frosty 0.0.150 → 0.0.152
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -117,6 +117,16 @@ module.exports = {
|
|
|
117
117
|
basepath: '/', // (Optional) URL base path for this entry
|
|
118
118
|
}
|
|
119
119
|
},
|
|
120
|
+
workers: { // (Optional) Worker entry points
|
|
121
|
+
myClientWorker: {
|
|
122
|
+
entry: 'src/workers/myClientWorker.js', // Path to worker entry file
|
|
123
|
+
client: true, // true = browser worker (bundled into public/workers/)
|
|
124
|
+
},
|
|
125
|
+
myServerWorker: {
|
|
126
|
+
entry: 'src/workers/myServerWorker.js', // Path to worker entry file
|
|
127
|
+
client: false, // false = server worker (bundled into workers/)
|
|
128
|
+
}
|
|
129
|
+
},
|
|
120
130
|
moduleSuffixes: { // (Optional) Custom module resolution suffixes
|
|
121
131
|
client: ['.browser', '.web', ''],
|
|
122
132
|
server: ['.node', '.server', '.web', '']
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "frosty",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.152",
|
|
4
4
|
"main": "dist/index",
|
|
5
5
|
"module": "dist/index",
|
|
6
6
|
"types": "dist/index",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"lodash": ">=4.18.1",
|
|
41
41
|
"myers.js": "^0.0.22",
|
|
42
42
|
"nextick": "^0.0.2",
|
|
43
|
-
"postcss": "^8.5.
|
|
43
|
+
"postcss": "^8.5.10",
|
|
44
44
|
"postcss-js": "^5.0.0",
|
|
45
45
|
"postcss-nested": "^7.0.2"
|
|
46
46
|
},
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
import _ from 'lodash';
|
|
27
27
|
import fs from 'fs';
|
|
28
28
|
import path from 'path';
|
|
29
|
+
import process from 'process';
|
|
29
30
|
import cluster from 'cluster';
|
|
30
31
|
import { Server } from '@o2ter/server-js';
|
|
31
32
|
import { FrostyRoute } from './route';
|
|
@@ -33,6 +34,10 @@ import * as __SERVER__ from '__SERVER__';
|
|
|
33
34
|
import * as __APPLICATIONS__ from '__APPLICATIONS__';
|
|
34
35
|
import { PORT, NUM_WORKERS, INSTANCE_VAR } from './env';
|
|
35
36
|
|
|
37
|
+
process.on('unhandledRejection', (err) => {
|
|
38
|
+
console.error(`Error: ${err}`);
|
|
39
|
+
});
|
|
40
|
+
|
|
36
41
|
if (cluster.isPrimary && NUM_WORKERS > 1) {
|
|
37
42
|
console.info(`Primary ${process.pid} is running`);
|
|
38
43
|
|
|
@@ -214,6 +214,16 @@ export default async (env, argv) => {
|
|
|
214
214
|
server: config.moduleSuffixes?.server ?? ['.node', '.server', '.web', ''],
|
|
215
215
|
};
|
|
216
216
|
|
|
217
|
+
const clientWorkers = [];
|
|
218
|
+
const serverWorkers = [];
|
|
219
|
+
for (const [name, { entry, client }] of _.entries(config.workers || {})) {
|
|
220
|
+
if (client) {
|
|
221
|
+
clientWorkers.push({ name, entry });
|
|
222
|
+
} else {
|
|
223
|
+
serverWorkers.push({ name, entry });
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
217
227
|
return [
|
|
218
228
|
..._.map(inputs, ({ entry }, name) => ({
|
|
219
229
|
...webpackConfiguration,
|
|
@@ -250,6 +260,34 @@ export default async (env, argv) => {
|
|
|
250
260
|
]
|
|
251
261
|
}
|
|
252
262
|
})),
|
|
263
|
+
{
|
|
264
|
+
...webpackConfiguration,
|
|
265
|
+
optimization: webpackOptimization({ server: false }),
|
|
266
|
+
plugins: webpackPlugins,
|
|
267
|
+
entry: {
|
|
268
|
+
..._.fromPairs(clientWorkers.map(({ name, entry }) => ([`workers/${name}`, [
|
|
269
|
+
path.resolve(__dirname, 'node_modules/core-js/stable'),
|
|
270
|
+
path.resolve(process.cwd(), entry),
|
|
271
|
+
]]))),
|
|
272
|
+
},
|
|
273
|
+
output: {
|
|
274
|
+
path: path.join(OUTPUT_DIR, 'public'),
|
|
275
|
+
},
|
|
276
|
+
resolve: {
|
|
277
|
+
...webpackConfiguration.resolve,
|
|
278
|
+
extensions: [
|
|
279
|
+
...moduleSuffixes.client.flatMap(x => [`${x}.tsx`, `${x}.jsx`]),
|
|
280
|
+
...moduleSuffixes.client.flatMap(x => [`${x}.ts`, `${x}.mjs`, `${x}.js`]),
|
|
281
|
+
'...'
|
|
282
|
+
],
|
|
283
|
+
},
|
|
284
|
+
module: {
|
|
285
|
+
rules: [
|
|
286
|
+
babelLoaderConfiguration({ server: false }),
|
|
287
|
+
...config.options?.module?.rules ?? [],
|
|
288
|
+
]
|
|
289
|
+
}
|
|
290
|
+
},
|
|
253
291
|
{
|
|
254
292
|
...webpackConfiguration,
|
|
255
293
|
optimization: webpackOptimization({ server: true }),
|
|
@@ -269,6 +307,10 @@ export default async (env, argv) => {
|
|
|
269
307
|
path.resolve(__dirname, 'node_modules/core-js/stable'),
|
|
270
308
|
path.resolve(__dirname, 'src/server/index.js'),
|
|
271
309
|
],
|
|
310
|
+
..._.fromPairs(serverWorkers.map(({ name, entry }) => ([`workers/${name}`, [
|
|
311
|
+
path.resolve(__dirname, 'node_modules/core-js/stable'),
|
|
312
|
+
path.resolve(process.cwd(), entry),
|
|
313
|
+
]]))),
|
|
272
314
|
},
|
|
273
315
|
output: {
|
|
274
316
|
path: OUTPUT_DIR,
|
|
@@ -721,9 +721,9 @@
|
|
|
721
721
|
"@babel/helper-plugin-utils" "^7.28.6"
|
|
722
722
|
|
|
723
723
|
"@babel/plugin-transform-modules-systemjs@^7.29.0":
|
|
724
|
-
version "7.29.
|
|
725
|
-
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.29.
|
|
726
|
-
integrity sha512-
|
|
724
|
+
version "7.29.4"
|
|
725
|
+
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.29.4.tgz#f621105da99919c15cf4bde6fcc7346ef95e7b20"
|
|
726
|
+
integrity sha512-N7QmZ0xRZfjHOfZeQLJjwgX2zS9pdGHSVl/cjSGlo4dXMqvurfxXDMKY4RqEKzPozV78VMcd0lxyG13mlbKc4w==
|
|
727
727
|
dependencies:
|
|
728
728
|
"@babel/helper-module-transforms" "^7.28.6"
|
|
729
729
|
"@babel/helper-plugin-utils" "^7.28.6"
|
|
@@ -2485,9 +2485,9 @@ fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0:
|
|
|
2485
2485
|
integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==
|
|
2486
2486
|
|
|
2487
2487
|
fast-uri@^3.0.1:
|
|
2488
|
-
version "3.1.
|
|
2489
|
-
resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.1.
|
|
2490
|
-
integrity sha512-
|
|
2488
|
+
version "3.1.2"
|
|
2489
|
+
resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.1.2.tgz#8af3d4fc9d3e71b11572cc2673b514a7d1a8c8ec"
|
|
2490
|
+
integrity sha512-rVjf7ArG3LTk+FS6Yw81V1DLuZl1bRbNrev6Tmd/9RaroeeRRJhAt7jg/6YFxbvAQXUCavSoZhPPj6oOx+5KjQ==
|
|
2491
2491
|
|
|
2492
2492
|
fastest-levenshtein@^1.0.12:
|
|
2493
2493
|
version "1.0.16"
|
|
@@ -3318,9 +3318,9 @@ postcss-value-parser@^4.1.0, postcss-value-parser@^4.2.0:
|
|
|
3318
3318
|
integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==
|
|
3319
3319
|
|
|
3320
3320
|
postcss@^8.4.40:
|
|
3321
|
-
version "8.5.
|
|
3322
|
-
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.5.
|
|
3323
|
-
integrity sha512-
|
|
3321
|
+
version "8.5.14"
|
|
3322
|
+
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.5.14.tgz#a66c2d7808fadf69ebb5b84a03f8bafd76c4919c"
|
|
3323
|
+
integrity sha512-SoSL4+OSEtR99LHFZQiJLkT59C5B1amGO1NzTwj7TT1qCUgUO6hxOvzkOYxD+vMrXBM3XJIKzokoERdqQq/Zmg==
|
|
3324
3324
|
dependencies:
|
|
3325
3325
|
nanoid "^3.3.11"
|
|
3326
3326
|
picocolors "^1.1.1"
|