@modern-js/plugin-worker 0.0.0-next-1690395401656 → 0.0.0-next-1690449452554

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/CHANGELOG.md CHANGED
@@ -1,14 +1,12 @@
1
1
  # @modern-js/plugin-worker
2
2
 
3
- ## 0.0.0-next-1690395401656
3
+ ## 0.0.0-next-1690449452554
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - Updated dependencies [6eae1e7dc]
8
- - Updated dependencies [00b58a71c]
9
- - @modern-js/prod-server@0.0.0-next-1690395401656
10
- - @modern-js/utils@0.0.0-next-1690395401656
11
- - @modern-js/server-utils@0.0.0-next-1690395401656
7
+ - @modern-js/prod-server@0.0.0-next-1690449452554
8
+ - @modern-js/utils@0.0.0-next-1690449452554
9
+ - @modern-js/server-utils@0.0.0-next-1690449452554
12
10
 
13
11
  ## 2.27.0
14
12
 
package/dist/cjs/index.js CHANGED
@@ -22,52 +22,54 @@ const _path = /* @__PURE__ */ _interop_require_default._(require("path"));
22
22
  const _utils = require("@modern-js/utils");
23
23
  const _constants = require("./constants");
24
24
  const _code = require("./code");
25
- const workerPlugin = () => ({
26
- name: "@modern-js/plugin-worker",
27
- setup: (ctx) => {
28
- return {
29
- async config() {
30
- return {
31
- output: {
32
- disableNodePolyfill: false
33
- }
34
- };
35
- },
36
- validateSchema() {
37
- return [
38
- {
39
- target: "deploy.worker.ssr",
40
- schema: {
41
- type: [
42
- "boolean"
43
- ]
25
+ const workerPlugin = () => {
26
+ return {
27
+ name: "@modern-js/plugin-worker",
28
+ setup: (ctx) => {
29
+ return {
30
+ async config() {
31
+ return {
32
+ output: {
33
+ disableNodePolyfill: false
34
+ }
35
+ };
36
+ },
37
+ validateSchema() {
38
+ return [
39
+ {
40
+ target: "deploy.worker.ssr",
41
+ schema: {
42
+ type: [
43
+ "boolean"
44
+ ]
45
+ }
44
46
  }
47
+ ];
48
+ },
49
+ async afterDev() {
50
+ var _configContext_deploy_worker;
51
+ const { appDirectory, distDirectory } = ctx.useAppContext();
52
+ const configContext = ctx.useResolvedConfigContext();
53
+ if (!(0, _utils.isServiceWorker)(configContext)) {
54
+ return;
45
55
  }
46
- ];
47
- },
48
- async afterDev() {
49
- var _configContext_deploy_worker;
50
- const { appDirectory, distDirectory } = ctx.useAppContext();
51
- const configContext = ctx.useResolvedConfigContext();
52
- if (!(0, _utils.isServiceWorker)(configContext)) {
53
- return;
54
- }
55
- const enableWorkerInWeb = configContext.deploy.enableWorker || ((_configContext_deploy_worker = configContext.deploy.worker) === null || _configContext_deploy_worker === void 0 ? void 0 : _configContext_deploy_worker.web);
56
- writeWorkerServerFile(appDirectory, distDirectory, enableWorkerInWeb);
57
- },
58
- async afterBuild() {
59
- var _configContext_deploy_worker;
60
- const { appDirectory, distDirectory } = ctx.useAppContext();
61
- const configContext = ctx.useResolvedConfigContext();
62
- if (!(0, _utils.isServiceWorker)(configContext)) {
63
- return;
56
+ const enableWorkerInWeb = configContext.deploy.enableWorker || ((_configContext_deploy_worker = configContext.deploy.worker) === null || _configContext_deploy_worker === void 0 ? void 0 : _configContext_deploy_worker.web);
57
+ writeWorkerServerFile(appDirectory, distDirectory, enableWorkerInWeb);
58
+ },
59
+ async afterBuild() {
60
+ var _configContext_deploy_worker;
61
+ const { appDirectory, distDirectory } = ctx.useAppContext();
62
+ const configContext = ctx.useResolvedConfigContext();
63
+ if (!(0, _utils.isServiceWorker)(configContext)) {
64
+ return;
65
+ }
66
+ const enableWorkerInWeb = configContext.deploy.enableWorker || ((_configContext_deploy_worker = configContext.deploy.worker) === null || _configContext_deploy_worker === void 0 ? void 0 : _configContext_deploy_worker.web);
67
+ writeWorkerServerFile(appDirectory, distDirectory, enableWorkerInWeb);
64
68
  }
65
- const enableWorkerInWeb = configContext.deploy.enableWorker || ((_configContext_deploy_worker = configContext.deploy.worker) === null || _configContext_deploy_worker === void 0 ? void 0 : _configContext_deploy_worker.web);
66
- writeWorkerServerFile(appDirectory, distDirectory, enableWorkerInWeb);
67
- }
68
- };
69
- }
70
- });
69
+ };
70
+ }
71
+ };
72
+ };
71
73
  const writeWorkerServerFile = (appDirectory, distDirectory, enableWorkerInWeb) => {
72
74
  const workServerDir = _path.default.join(distDirectory, _constants.WORKER_SERVER);
73
75
  const serverHookDir = _path.default.join(appDirectory, _utils.SERVER_DIR, _constants.WEB_APP_NAME);
package/dist/esm/index.js CHANGED
@@ -2,52 +2,54 @@ import path from "path";
2
2
  import { fs, isServiceWorker, ROUTE_SPEC_FILE, SERVER_DIR } from "@modern-js/utils";
3
3
  import { MANIFEST_FILE, PKG_FILE, SERVER_HOOKS, WEB_APP_NAME, WORKER_SERVER, WORKER_SERVER_ENTRY, WRANGLER_FILE } from "./constants";
4
4
  import { worker } from "./code";
5
- export const workerPlugin = () => ({
6
- name: "@modern-js/plugin-worker",
7
- setup: (ctx) => {
8
- return {
9
- async config() {
10
- return {
11
- output: {
12
- disableNodePolyfill: false
13
- }
14
- };
15
- },
16
- validateSchema() {
17
- return [
18
- {
19
- target: "deploy.worker.ssr",
20
- schema: {
21
- type: [
22
- "boolean"
23
- ]
5
+ export const workerPlugin = () => {
6
+ return {
7
+ name: "@modern-js/plugin-worker",
8
+ setup: (ctx) => {
9
+ return {
10
+ async config() {
11
+ return {
12
+ output: {
13
+ disableNodePolyfill: false
14
+ }
15
+ };
16
+ },
17
+ validateSchema() {
18
+ return [
19
+ {
20
+ target: "deploy.worker.ssr",
21
+ schema: {
22
+ type: [
23
+ "boolean"
24
+ ]
25
+ }
24
26
  }
27
+ ];
28
+ },
29
+ async afterDev() {
30
+ var _configContext_deploy_worker;
31
+ const { appDirectory, distDirectory } = ctx.useAppContext();
32
+ const configContext = ctx.useResolvedConfigContext();
33
+ if (!isServiceWorker(configContext)) {
34
+ return;
25
35
  }
26
- ];
27
- },
28
- async afterDev() {
29
- var _configContext_deploy_worker;
30
- const { appDirectory, distDirectory } = ctx.useAppContext();
31
- const configContext = ctx.useResolvedConfigContext();
32
- if (!isServiceWorker(configContext)) {
33
- return;
34
- }
35
- const enableWorkerInWeb = configContext.deploy.enableWorker || ((_configContext_deploy_worker = configContext.deploy.worker) === null || _configContext_deploy_worker === void 0 ? void 0 : _configContext_deploy_worker.web);
36
- writeWorkerServerFile(appDirectory, distDirectory, enableWorkerInWeb);
37
- },
38
- async afterBuild() {
39
- var _configContext_deploy_worker;
40
- const { appDirectory, distDirectory } = ctx.useAppContext();
41
- const configContext = ctx.useResolvedConfigContext();
42
- if (!isServiceWorker(configContext)) {
43
- return;
36
+ const enableWorkerInWeb = configContext.deploy.enableWorker || ((_configContext_deploy_worker = configContext.deploy.worker) === null || _configContext_deploy_worker === void 0 ? void 0 : _configContext_deploy_worker.web);
37
+ writeWorkerServerFile(appDirectory, distDirectory, enableWorkerInWeb);
38
+ },
39
+ async afterBuild() {
40
+ var _configContext_deploy_worker;
41
+ const { appDirectory, distDirectory } = ctx.useAppContext();
42
+ const configContext = ctx.useResolvedConfigContext();
43
+ if (!isServiceWorker(configContext)) {
44
+ return;
45
+ }
46
+ const enableWorkerInWeb = configContext.deploy.enableWorker || ((_configContext_deploy_worker = configContext.deploy.worker) === null || _configContext_deploy_worker === void 0 ? void 0 : _configContext_deploy_worker.web);
47
+ writeWorkerServerFile(appDirectory, distDirectory, enableWorkerInWeb);
44
48
  }
45
- const enableWorkerInWeb = configContext.deploy.enableWorker || ((_configContext_deploy_worker = configContext.deploy.worker) === null || _configContext_deploy_worker === void 0 ? void 0 : _configContext_deploy_worker.web);
46
- writeWorkerServerFile(appDirectory, distDirectory, enableWorkerInWeb);
47
- }
48
- };
49
- }
50
- });
49
+ };
50
+ }
51
+ };
52
+ };
51
53
  const writeWorkerServerFile = (appDirectory, distDirectory, enableWorkerInWeb) => {
52
54
  const workServerDir = path.join(distDirectory, WORKER_SERVER);
53
55
  const serverHookDir = path.join(appDirectory, SERVER_DIR, WEB_APP_NAME);
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "0.0.0-next-1690395401656",
18
+ "version": "0.0.0-next-1690449452554",
19
19
  "types": "./dist/types/index.d.ts",
20
20
  "jsnext:source": "./src/index.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -43,20 +43,20 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@swc/helpers": "0.5.1",
46
- "@modern-js/server-utils": "0.0.0-next-1690395401656",
47
- "@modern-js/prod-server": "0.0.0-next-1690395401656",
48
- "@modern-js/utils": "0.0.0-next-1690395401656"
46
+ "@modern-js/server-utils": "0.0.0-next-1690449452554",
47
+ "@modern-js/utils": "0.0.0-next-1690449452554",
48
+ "@modern-js/prod-server": "0.0.0-next-1690449452554"
49
49
  },
50
50
  "devDependencies": {
51
51
  "typescript": "^5",
52
52
  "@types/jest": "^29",
53
53
  "@types/node": "^14",
54
54
  "jest": "^29",
55
- "@modern-js/core": "0.0.0-next-1690395401656",
56
- "@modern-js/app-tools": "0.0.0-next-1690395401656",
57
- "@scripts/build": "0.0.0-next-1690395401656",
58
- "@modern-js/types": "0.0.0-next-1690395401656",
59
- "@scripts/jest-config": "0.0.0-next-1690395401656"
55
+ "@modern-js/core": "0.0.0-next-1690449452554",
56
+ "@modern-js/types": "0.0.0-next-1690449452554",
57
+ "@modern-js/app-tools": "0.0.0-next-1690449452554",
58
+ "@scripts/build": "0.0.0-next-1690449452554",
59
+ "@scripts/jest-config": "0.0.0-next-1690449452554"
60
60
  },
61
61
  "sideEffects": [
62
62
  "*.css",