@modern-js/plugin-garfish 2.56.2 → 2.56.3-alpha.0
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/dist/cjs/cli/index.js +1 -4
- package/dist/cjs/cli/template.js +1 -1
- package/dist/cjs/runtime/index.js +0 -6
- package/dist/cjs/runtime/tools.js +31 -0
- package/dist/esm/cli/index.js +1 -2
- package/dist/esm/cli/template.js +1 -1
- package/dist/esm/runtime/index.js +0 -4
- package/dist/esm/runtime/tools.js +6 -0
- package/dist/esm-node/cli/index.js +1 -4
- package/dist/esm-node/cli/template.js +1 -1
- package/dist/esm-node/runtime/index.js +0 -4
- package/dist/esm-node/runtime/tools.js +6 -0
- package/dist/types/runtime/index.d.ts +0 -2
- package/dist/types/runtime/tools.d.ts +2 -0
- package/package.json +15 -8
package/dist/cjs/cli/index.js
CHANGED
|
@@ -122,10 +122,7 @@ const garfishPlugin = () => ({
|
|
|
122
122
|
},
|
|
123
123
|
source: {
|
|
124
124
|
alias: {
|
|
125
|
-
[`@${metaName}/runtime/garfish`]: `@${metaName}/plugin-garfish/runtime
|
|
126
|
-
"@meta/runtime/browser": "@modern-js/runtime/browser",
|
|
127
|
-
"@meta/runtime/react": "@modern-js/runtime/react",
|
|
128
|
-
"@meta/runtime": "@modern-js/runtime"
|
|
125
|
+
[`@${metaName}/runtime/garfish`]: `@${metaName}/plugin-garfish/runtime`
|
|
129
126
|
}
|
|
130
127
|
},
|
|
131
128
|
tools: {
|
package/dist/cjs/cli/template.js
CHANGED
|
@@ -25,7 +25,7 @@ var import_utils = require("@modern-js/utils");
|
|
|
25
25
|
const genRenderCode = ({ srcDirectory, internalSrcAlias, metaName, entry, customEntry, customBootstrap, mountId }) => customEntry ? `import '${entry.replace(srcDirectory, internalSrcAlias)}'
|
|
26
26
|
export * from '${entry.replace(srcDirectory, internalSrcAlias)}'` : `import { createRoot } from '@${metaName}/runtime/react';
|
|
27
27
|
import { render } from '@${metaName}/runtime/browser';
|
|
28
|
-
import { isRenderGarfish, createProvider } from '@${metaName}/plugin-garfish/
|
|
28
|
+
import { isRenderGarfish, createProvider } from '@${metaName}/plugin-garfish/tools';
|
|
29
29
|
${customBootstrap ? `import customBootstrap from '${(0, import_utils.formatImportPath)(customBootstrap.replace(srcDirectory, internalSrcAlias))}';` : "let customBootstrap;"}
|
|
30
30
|
if (!isRenderGarfish()) {
|
|
31
31
|
const ModernRoot = createRoot();
|
|
@@ -29,11 +29,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
var runtime_exports = {};
|
|
30
30
|
__export(runtime_exports, {
|
|
31
31
|
Garfish: () => import_garfish.default,
|
|
32
|
-
createProvider: () => import_provider.createProvider,
|
|
33
32
|
default: () => import_plugin.default,
|
|
34
33
|
garfish: () => import_garfish.default,
|
|
35
34
|
garfishPlugin: () => import_plugin.garfishPlugin,
|
|
36
|
-
isRenderGarfish: () => import_utils.isRenderGarfish,
|
|
37
35
|
useModuleApp: () => import_useModuleApps.useModuleApp,
|
|
38
36
|
useModuleApps: () => import_useModuleApps.useModuleApps
|
|
39
37
|
});
|
|
@@ -41,15 +39,11 @@ module.exports = __toCommonJS(runtime_exports);
|
|
|
41
39
|
var import_plugin = __toESM(require("./plugin"));
|
|
42
40
|
var import_useModuleApps = require("./useModuleApps");
|
|
43
41
|
var import_garfish = __toESM(require("garfish"));
|
|
44
|
-
var import_utils = require("./utils");
|
|
45
|
-
var import_provider = require("./provider");
|
|
46
42
|
// Annotate the CommonJS export names for ESM import in node:
|
|
47
43
|
0 && (module.exports = {
|
|
48
44
|
Garfish,
|
|
49
|
-
createProvider,
|
|
50
45
|
garfish,
|
|
51
46
|
garfishPlugin,
|
|
52
|
-
isRenderGarfish,
|
|
53
47
|
useModuleApp,
|
|
54
48
|
useModuleApps
|
|
55
49
|
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var tools_exports = {};
|
|
20
|
+
__export(tools_exports, {
|
|
21
|
+
createProvider: () => import_provider.createProvider,
|
|
22
|
+
isRenderGarfish: () => import_utils.isRenderGarfish
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(tools_exports);
|
|
25
|
+
var import_utils = require("./utils");
|
|
26
|
+
var import_provider = require("./provider");
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
createProvider,
|
|
30
|
+
isRenderGarfish
|
|
31
|
+
});
|
package/dist/esm/cli/index.js
CHANGED
|
@@ -102,13 +102,12 @@ var garfishPlugin = function() {
|
|
|
102
102
|
disableCssExtract = true;
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
var _obj;
|
|
106
105
|
return {
|
|
107
106
|
output: {
|
|
108
107
|
disableCssExtract
|
|
109
108
|
},
|
|
110
109
|
source: {
|
|
111
|
-
alias: (
|
|
110
|
+
alias: _define_property({}, "@".concat(metaName, "/runtime/garfish"), "@".concat(metaName, "/plugin-garfish/runtime"))
|
|
112
111
|
},
|
|
113
112
|
tools: {
|
|
114
113
|
devServer: {
|
package/dist/esm/cli/template.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { formatImportPath } from "@modern-js/utils";
|
|
2
2
|
var genRenderCode = function(param) {
|
|
3
3
|
var srcDirectory = param.srcDirectory, internalSrcAlias = param.internalSrcAlias, metaName = param.metaName, entry = param.entry, customEntry = param.customEntry, customBootstrap = param.customBootstrap, mountId = param.mountId;
|
|
4
|
-
return customEntry ? "import '".concat(entry.replace(srcDirectory, internalSrcAlias), "'\nexport * from '").concat(entry.replace(srcDirectory, internalSrcAlias), "'") : "import { createRoot } from '@".concat(metaName, "/runtime/react';\nimport { render } from '@").concat(metaName, "/runtime/browser';\nimport { isRenderGarfish, createProvider } from '@").concat(metaName, "/plugin-garfish/
|
|
4
|
+
return customEntry ? "import '".concat(entry.replace(srcDirectory, internalSrcAlias), "'\nexport * from '").concat(entry.replace(srcDirectory, internalSrcAlias), "'") : "import { createRoot } from '@".concat(metaName, "/runtime/react';\nimport { render } from '@").concat(metaName, "/runtime/browser';\nimport { isRenderGarfish, createProvider } from '@").concat(metaName, "/plugin-garfish/tools';\n").concat(customBootstrap ? "import customBootstrap from '".concat(formatImportPath(customBootstrap.replace(srcDirectory, internalSrcAlias)), "';") : "let customBootstrap;", "\nif (!isRenderGarfish()) {\n const ModernRoot = createRoot();\n ").concat(customBootstrap ? "customBootstrap(ModernRoot, () => render(<ModernRoot />, '".concat(mountId || "root", "'));") : "render(<ModernRoot />, '".concat(mountId || "root", "');"), ";\n}\n\nexport const provider = createProvider('").concat(mountId || "root", "', { customBootstrap });\n");
|
|
5
5
|
};
|
|
6
6
|
var index = function(param) {
|
|
7
7
|
var srcDirectory = param.srcDirectory, internalSrcAlias = param.internalSrcAlias, metaName = param.metaName, entry = param.entry, entryName = param.entryName, customEntry = param.customEntry, customBootstrap = param.customBootstrap, mountId = param.mountId, _param_appendCode = param.appendCode, appendCode = _param_appendCode === void 0 ? [] : _param_appendCode;
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import { default as default2, garfishPlugin } from "./plugin";
|
|
2
2
|
import { useModuleApps, useModuleApp } from "./useModuleApps";
|
|
3
3
|
import { default as default3, default as default4 } from "garfish";
|
|
4
|
-
import { isRenderGarfish } from "./utils";
|
|
5
|
-
import { createProvider } from "./provider";
|
|
6
4
|
export {
|
|
7
5
|
default3 as Garfish,
|
|
8
|
-
createProvider,
|
|
9
6
|
default2 as default,
|
|
10
7
|
default4 as garfish,
|
|
11
8
|
garfishPlugin,
|
|
12
|
-
isRenderGarfish,
|
|
13
9
|
useModuleApp,
|
|
14
10
|
useModuleApps
|
|
15
11
|
};
|
|
@@ -96,10 +96,7 @@ const garfishPlugin = () => ({
|
|
|
96
96
|
},
|
|
97
97
|
source: {
|
|
98
98
|
alias: {
|
|
99
|
-
[`@${metaName}/runtime/garfish`]: `@${metaName}/plugin-garfish/runtime
|
|
100
|
-
"@meta/runtime/browser": "@modern-js/runtime/browser",
|
|
101
|
-
"@meta/runtime/react": "@modern-js/runtime/react",
|
|
102
|
-
"@meta/runtime": "@modern-js/runtime"
|
|
99
|
+
[`@${metaName}/runtime/garfish`]: `@${metaName}/plugin-garfish/runtime`
|
|
103
100
|
}
|
|
104
101
|
},
|
|
105
102
|
tools: {
|
|
@@ -2,7 +2,7 @@ import { formatImportPath } from "@modern-js/utils";
|
|
|
2
2
|
const genRenderCode = ({ srcDirectory, internalSrcAlias, metaName, entry, customEntry, customBootstrap, mountId }) => customEntry ? `import '${entry.replace(srcDirectory, internalSrcAlias)}'
|
|
3
3
|
export * from '${entry.replace(srcDirectory, internalSrcAlias)}'` : `import { createRoot } from '@${metaName}/runtime/react';
|
|
4
4
|
import { render } from '@${metaName}/runtime/browser';
|
|
5
|
-
import { isRenderGarfish, createProvider } from '@${metaName}/plugin-garfish/
|
|
5
|
+
import { isRenderGarfish, createProvider } from '@${metaName}/plugin-garfish/tools';
|
|
6
6
|
${customBootstrap ? `import customBootstrap from '${formatImportPath(customBootstrap.replace(srcDirectory, internalSrcAlias))}';` : "let customBootstrap;"}
|
|
7
7
|
if (!isRenderGarfish()) {
|
|
8
8
|
const ModernRoot = createRoot();
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import { default as default2, garfishPlugin } from "./plugin";
|
|
2
2
|
import { useModuleApps, useModuleApp } from "./useModuleApps";
|
|
3
3
|
import { default as default3, default as default4 } from "garfish";
|
|
4
|
-
import { isRenderGarfish } from "./utils";
|
|
5
|
-
import { createProvider } from "./provider";
|
|
6
4
|
export {
|
|
7
5
|
default3 as Garfish,
|
|
8
|
-
createProvider,
|
|
9
6
|
default2 as default,
|
|
10
7
|
default4 as garfish,
|
|
11
8
|
garfishPlugin,
|
|
12
|
-
isRenderGarfish,
|
|
13
9
|
useModuleApp,
|
|
14
10
|
useModuleApps
|
|
15
11
|
};
|
|
@@ -2,5 +2,3 @@ export { default, garfishPlugin } from './plugin';
|
|
|
2
2
|
export { useModuleApps, useModuleApp } from './useModuleApps';
|
|
3
3
|
export type { Manifest, ModuleInfo, Config } from './useModuleApps';
|
|
4
4
|
export { default as Garfish, default as garfish } from 'garfish';
|
|
5
|
-
export { isRenderGarfish } from './utils';
|
|
6
|
-
export { createProvider } from './provider';
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.56.
|
|
18
|
+
"version": "2.56.3-alpha.0",
|
|
19
19
|
"jsnext:source": "./src/cli/index.ts",
|
|
20
20
|
"types": "./dist/types/cli/index.d.ts",
|
|
21
21
|
"typesVersions": {
|
|
@@ -29,6 +29,9 @@
|
|
|
29
29
|
"runtime": [
|
|
30
30
|
"./dist/types/runtime/index.d.ts"
|
|
31
31
|
],
|
|
32
|
+
"tools": [
|
|
33
|
+
"./dist/types/runtime/tools.d.ts"
|
|
34
|
+
],
|
|
32
35
|
"types": [
|
|
33
36
|
"./type.d.ts"
|
|
34
37
|
]
|
|
@@ -52,6 +55,11 @@
|
|
|
52
55
|
"types": "./dist/types/runtime/index.d.ts",
|
|
53
56
|
"jsnext:source": "./src/runtime/index.ts",
|
|
54
57
|
"default": "./dist/esm/runtime/index.js"
|
|
58
|
+
},
|
|
59
|
+
"./tools": {
|
|
60
|
+
"types": "./dist/types/runtime/tools.d.ts",
|
|
61
|
+
"jsnext:source": "./src/runtime/tools.ts",
|
|
62
|
+
"default": "./dist/esm/runtime/tools.js"
|
|
55
63
|
}
|
|
56
64
|
},
|
|
57
65
|
"dependencies": {
|
|
@@ -61,8 +69,8 @@
|
|
|
61
69
|
"garfish": "^1.8.1",
|
|
62
70
|
"react-loadable": "^5.5.0",
|
|
63
71
|
"@swc/helpers": "0.5.3",
|
|
64
|
-
"@modern-js/
|
|
65
|
-
"@modern-js/
|
|
72
|
+
"@modern-js/plugin": "2.56.2",
|
|
73
|
+
"@modern-js/utils": "2.56.2"
|
|
66
74
|
},
|
|
67
75
|
"peerDependencies": {
|
|
68
76
|
"@modern-js/runtime": "^2.56.2",
|
|
@@ -84,19 +92,18 @@
|
|
|
84
92
|
"react-dom": "^18",
|
|
85
93
|
"react-router-dom": "6.22.0",
|
|
86
94
|
"typescript": "^5",
|
|
95
|
+
"@modern-js/types": "2.56.2",
|
|
87
96
|
"@modern-js/app-tools": "2.56.2",
|
|
88
|
-
"@modern-js/plugin-router-v5": "2.56.2",
|
|
89
97
|
"@modern-js/core": "2.56.2",
|
|
90
|
-
"@modern-js/
|
|
91
|
-
"@modern-js/
|
|
98
|
+
"@modern-js/plugin-router-v5": "2.56.3-alpha.0",
|
|
99
|
+
"@modern-js/runtime": "2.56.3-alpha.0",
|
|
92
100
|
"@scripts/build": "2.56.2",
|
|
93
101
|
"@scripts/jest-config": "2.56.2"
|
|
94
102
|
},
|
|
95
103
|
"sideEffects": false,
|
|
96
104
|
"publishConfig": {
|
|
97
105
|
"registry": "https://registry.npmjs.org/",
|
|
98
|
-
"access": "public"
|
|
99
|
-
"provenance": true
|
|
106
|
+
"access": "public"
|
|
100
107
|
},
|
|
101
108
|
"scripts": {
|
|
102
109
|
"new": "modern-lib new",
|