@modern-js/plugin-garfish 1.4.3 → 1.4.4-beta.1

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.
@@ -13,7 +13,8 @@ export const externals = {
13
13
  react: 'react'
14
14
  };
15
15
  export default (({
16
- runtimePluginName: _runtimePluginName = '@modern-js/runtime/plugins'
16
+ runtimePluginName: _runtimePluginName = '@modern-js/runtime/plugins',
17
+ mfPackagePath: _mfPackagePath = path.resolve(__dirname, '../../../../')
17
18
  } = {}) => ({
18
19
  name: '@modern-js/plugin-garfish',
19
20
  setup: ({
@@ -129,11 +130,10 @@ export default (({
129
130
  },
130
131
 
131
132
  addRuntimeExports() {
132
- const mfPackage = path.resolve(__dirname, '../../../../');
133
- const addExportStatement = `export { default as garfish, default as masterApp } from '${mfPackage}'`;
133
+ const addExportStatement = `export { default as garfish, default as masterApp } from '${_mfPackagePath}'`;
134
134
  logger('exportStatement', addExportStatement);
135
135
  pluginsExportsUtils.addExport(addExportStatement);
136
- runtimeExportsUtils.addExport(`export * from '${mfPackage}'`);
136
+ runtimeExportsUtils.addExport(`export * from '${_mfPackagePath}'`);
137
137
  },
138
138
 
139
139
  modifyEntryImports({
@@ -72,7 +72,7 @@ export function getRuntimeConfig(config) {
72
72
  return config === null || config === void 0 ? void 0 : (_config$runtime2 = config.runtime) === null || _config$runtime2 === void 0 ? void 0 : _config$runtime2.features;
73
73
  }
74
74
 
75
- return config === null || config === void 0 ? void 0 : config.runtime;
75
+ return (config === null || config === void 0 ? void 0 : config.runtime) || {};
76
76
  } // support legacy config
77
77
 
78
78
  export function setRuntimeConfig(config, key, value) {
@@ -28,7 +28,8 @@ const externals = {
28
28
  exports.externals = externals;
29
29
 
30
30
  var _default = ({
31
- runtimePluginName: _runtimePluginName = '@modern-js/runtime/plugins'
31
+ runtimePluginName: _runtimePluginName = '@modern-js/runtime/plugins',
32
+ mfPackagePath: _mfPackagePath = _path.default.resolve(__dirname, '../../../../')
32
33
  } = {}) => ({
33
34
  name: '@modern-js/plugin-garfish',
34
35
  setup: ({
@@ -144,12 +145,10 @@ var _default = ({
144
145
  },
145
146
 
146
147
  addRuntimeExports() {
147
- const mfPackage = _path.default.resolve(__dirname, '../../../../');
148
-
149
- const addExportStatement = `export { default as garfish, default as masterApp } from '${mfPackage}'`;
148
+ const addExportStatement = `export { default as garfish, default as masterApp } from '${_mfPackagePath}'`;
150
149
  (0, _util.logger)('exportStatement', addExportStatement);
151
150
  pluginsExportsUtils.addExport(addExportStatement);
152
- runtimeExportsUtils.addExport(`export * from '${mfPackage}'`);
151
+ runtimeExportsUtils.addExport(`export * from '${_mfPackagePath}'`);
153
152
  },
154
153
 
155
154
  modifyEntryImports({
@@ -87,7 +87,7 @@ function getRuntimeConfig(config) {
87
87
  return config === null || config === void 0 ? void 0 : (_config$runtime2 = config.runtime) === null || _config$runtime2 === void 0 ? void 0 : _config$runtime2.features;
88
88
  }
89
89
 
90
- return config === null || config === void 0 ? void 0 : config.runtime;
90
+ return (config === null || config === void 0 ? void 0 : config.runtime) || {};
91
91
  } // support legacy config
92
92
 
93
93
 
@@ -23,7 +23,9 @@ export var externals = {
23
23
  export default (function () {
24
24
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
25
25
  _ref$runtimePluginNam = _ref.runtimePluginName,
26
- runtimePluginName = _ref$runtimePluginNam === void 0 ? '@modern-js/runtime/plugins' : _ref$runtimePluginNam;
26
+ runtimePluginName = _ref$runtimePluginNam === void 0 ? '@modern-js/runtime/plugins' : _ref$runtimePluginNam,
27
+ _ref$mfPackagePath = _ref.mfPackagePath,
28
+ mfPackagePath = _ref$mfPackagePath === void 0 ? path.resolve(__dirname, '../../../../') : _ref$mfPackagePath;
27
29
 
28
30
  return {
29
31
  name: '@modern-js/plugin-garfish',
@@ -153,11 +155,10 @@ export default (function () {
153
155
  };
154
156
  },
155
157
  addRuntimeExports: function addRuntimeExports() {
156
- var mfPackage = path.resolve(__dirname, '../../../../');
157
- var addExportStatement = "export { default as garfish, default as masterApp } from '".concat(mfPackage, "'");
158
+ var addExportStatement = "export { default as garfish, default as masterApp } from '".concat(mfPackagePath, "'");
158
159
  logger('exportStatement', addExportStatement);
159
160
  pluginsExportsUtils.addExport(addExportStatement);
160
- runtimeExportsUtils.addExport("export * from '".concat(mfPackage, "'"));
161
+ runtimeExportsUtils.addExport("export * from '".concat(mfPackagePath, "'"));
161
162
  },
162
163
  modifyEntryImports: function modifyEntryImports(_ref5) {
163
164
  var entrypoint = _ref5.entrypoint,
@@ -15,7 +15,7 @@ export function getRuntimeConfig(config) {
15
15
  return config === null || config === void 0 ? void 0 : (_config$runtime2 = config.runtime) === null || _config$runtime2 === void 0 ? void 0 : _config$runtime2.features;
16
16
  }
17
17
 
18
- return config === null || config === void 0 ? void 0 : config.runtime;
18
+ return (config === null || config === void 0 ? void 0 : config.runtime) || {};
19
19
  } // support legacy config
20
20
 
21
21
  export function setRuntimeConfig(config, key, value) {
@@ -6,9 +6,11 @@ export declare const externals: {
6
6
  export declare type LifeCycle = CliHookCallbacks;
7
7
 
8
8
  declare const _default: ({
9
- runtimePluginName
9
+ runtimePluginName,
10
+ mfPackagePath
10
11
  }?: {
11
12
  runtimePluginName?: string | undefined;
13
+ mfPackagePath?: string | undefined;
12
14
  }) => CliPlugin;
13
15
 
14
16
  export default _default;
package/package.json CHANGED
@@ -11,9 +11,9 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.4.3",
14
+ "version": "1.4.4-beta.1",
15
15
  "jsnext:source": "./src/index.ts",
16
- "types": "./dist/types/runtime/index.d.ts",
16
+ "types": "./src/index.ts",
17
17
  "typesVersions": {
18
18
  "*": {
19
19
  ".": [
@@ -44,9 +44,17 @@
44
44
  "default": "./dist/js/node/cli/index.js"
45
45
  }
46
46
  },
47
+ "scripts": {
48
+ "prepare": "pnpm build",
49
+ "prepublishOnly": "pnpm build --platform",
50
+ "new": "modern new",
51
+ "build": "modern build",
52
+ "build:watch": "rm -rf ./dist && modern build --watch",
53
+ "test": "jest --passWithNoTests"
54
+ },
47
55
  "dependencies": {
48
56
  "@babel/runtime": "^7",
49
- "@modern-js/utils": "^1.3.5",
57
+ "@modern-js/utils": "workspace:^1.3.5",
50
58
  "@types/debug": "^4.1.7",
51
59
  "@types/react-loadable": "^5.5.6",
52
60
  "debug": "^4.3.2",
@@ -55,12 +63,12 @@
55
63
  "react-loadable": "^5.5.0"
56
64
  },
57
65
  "devDependencies": {
58
- "@modern-js/core": "^1.5.0",
59
- "@modern-js/plugin-router": "^1.2.5",
60
- "@modern-js/runtime-core": "^1.2.4",
61
- "@modern-js/types": "^1.3.5",
62
- "@scripts/build": "0.0.0",
63
- "@scripts/jest-config": "0.0.0",
66
+ "@modern-js/core": "workspace:^1.5.0",
67
+ "@modern-js/plugin-router": "workspace:^1.2.5",
68
+ "@modern-js/runtime-core": "workspace:^1.2.4",
69
+ "@modern-js/types": "workspace:^1.3.5",
70
+ "@scripts/build": "workspace:*",
71
+ "@scripts/jest-config": "workspace:*",
64
72
  "@testing-library/jest-dom": "^5.16.1",
65
73
  "@testing-library/react": "^12.0.0",
66
74
  "@testing-library/react-hooks": "^7.0.1",
@@ -79,20 +87,14 @@
79
87
  "webpack-chain": "^6.5.1"
80
88
  },
81
89
  "peerDependencies": {
82
- "@modern-js/plugin-router": "^1.2.5",
83
- "@modern-js/runtime-core": "^1.2.4"
90
+ "@modern-js/plugin-router": "workspace:^1.2.5",
91
+ "@modern-js/runtime-core": "workspace:^1.2.4"
84
92
  },
85
93
  "sideEffects": false,
86
94
  "modernConfig": {},
87
95
  "publishConfig": {
88
96
  "registry": "https://registry.npmjs.org/",
89
- "access": "public"
90
- },
91
- "scripts": {
92
- "new": "modern new",
93
- "build": "modern build",
94
- "build:watch": "rm -rf ./dist && modern build --watch",
95
- "test": "jest --passWithNoTests"
96
- },
97
- "readme": "\n<p align=\"center\">\n <a href=\"https://modernjs.dev\" target=\"blank\"><img src=\"https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png\" width=\"300\" alt=\"Modern.js Logo\" /></a>\n</p>\n<p align=\"center\">\n现代 Web 工程体系\n <br/>\n <a href=\"https://modernjs.dev\" target=\"blank\">\n modernjs.dev\n </a>\n</p>\n<p align=\"center\">\n The meta-framework suite designed from scratch for frontend-focused modern web development\n</p>\n\n# Introduction\n\n> The doc site ([modernjs.dev](https://modernjs.dev)) and articles are only available in Chinese for now, we are planning to add English versions soon.\n\n- [Modern.js: Hello, World!](https://zhuanlan.zhihu.com/p/426707646)\n\n## Getting Started\n\n- [Quick Start](https://modernjs.dev/docs/start)\n- [Guides](https://modernjs.dev/docs/guides)\n- [API References](https://modernjs.dev/docs/apis)\n\n## Contributing\n\n- [Contributing Guide](https://github.com/modern-js-dev/modern.js/blob/main/CONTRIBUTING.md)\n"
98
- }
97
+ "access": "public",
98
+ "types": "./dist/types/runtime/index.d.ts"
99
+ }
100
+ }