@ray-js/builder-mp 1.6.0-beta.8 → 1.6.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/lib/babel/configs/babel.config.js +1 -1
- package/lib/babel/plugins/ray-hooks/index.js +18 -8
- package/lib/babel/plugins/ray-page-context/index.js +18 -8
- package/lib/babel/plugins/rjs-method.js +17 -7
- package/lib/build.js +1 -1
- package/lib/plugins/app-entry.js +17 -7
- package/lib/plugins/resolve-legacy.js +14 -1
- package/lib/ray-core.js +2 -2
- package/lib/utils.js +1 -2
- package/package.json +22 -22
@@ -1,5 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.default = babelConfig;
|
3
4
|
function babelConfig(api) {
|
4
5
|
api.cache(true);
|
5
6
|
return {
|
@@ -17,4 +18,3 @@ function babelConfig(api) {
|
|
17
18
|
],
|
18
19
|
};
|
19
20
|
}
|
20
|
-
exports.default = babelConfig;
|
@@ -18,14 +18,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
18
18
|
}) : function(o, v) {
|
19
19
|
o["default"] = v;
|
20
20
|
});
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
};
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
22
|
+
var ownKeys = function(o) {
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
24
|
+
var ar = [];
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
26
|
+
return ar;
|
27
|
+
};
|
28
|
+
return ownKeys(o);
|
29
|
+
};
|
30
|
+
return function (mod) {
|
31
|
+
if (mod && mod.__esModule) return mod;
|
32
|
+
var result = {};
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
34
|
+
__setModuleDefault(result, mod);
|
35
|
+
return result;
|
36
|
+
};
|
37
|
+
})();
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
39
|
+
exports.default = RayHooks;
|
29
40
|
const t = __importStar(require("@babel/types"));
|
30
41
|
function insertImport(program, imports, moduleName) {
|
31
42
|
const specifiers = imports.map((i) => t.importSpecifier(t.identifier(i), t.identifier(i)));
|
@@ -63,4 +74,3 @@ function RayHooks() {
|
|
63
74
|
},
|
64
75
|
};
|
65
76
|
}
|
66
|
-
exports.default = RayHooks;
|
@@ -15,17 +15,28 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
15
15
|
}) : function(o, v) {
|
16
16
|
o["default"] = v;
|
17
17
|
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
};
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
19
|
+
var ownKeys = function(o) {
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
21
|
+
var ar = [];
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
23
|
+
return ar;
|
24
|
+
};
|
25
|
+
return ownKeys(o);
|
26
|
+
};
|
27
|
+
return function (mod) {
|
28
|
+
if (mod && mod.__esModule) return mod;
|
29
|
+
var result = {};
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
31
|
+
__setModuleDefault(result, mod);
|
32
|
+
return result;
|
33
|
+
};
|
34
|
+
})();
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
27
37
|
};
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
39
|
+
exports.default = ContextAndHoc;
|
29
40
|
const change_case_1 = require("change-case");
|
30
41
|
const fs_1 = __importDefault(require("fs"));
|
31
42
|
const P = __importStar(require("path"));
|
@@ -284,4 +295,3 @@ function ContextAndHoc() {
|
|
284
295
|
},
|
285
296
|
};
|
286
297
|
}
|
287
|
-
exports.default = ContextAndHoc;
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
15
15
|
}) : function(o, v) {
|
16
16
|
o["default"] = v;
|
17
17
|
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
};
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
19
|
+
var ownKeys = function(o) {
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
21
|
+
var ar = [];
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
23
|
+
return ar;
|
24
|
+
};
|
25
|
+
return ownKeys(o);
|
26
|
+
};
|
27
|
+
return function (mod) {
|
28
|
+
if (mod && mod.__esModule) return mod;
|
29
|
+
var result = {};
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
31
|
+
__setModuleDefault(result, mod);
|
32
|
+
return result;
|
33
|
+
};
|
34
|
+
})();
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
27
37
|
};
|
package/lib/build.js
CHANGED
@@ -12,6 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
+
exports.default = build;
|
15
16
|
const colors_1 = __importDefault(require("colors"));
|
16
17
|
const shared_1 = require("@ray-js/shared");
|
17
18
|
const legacyExport_1 = require("@ray-core/cli/lib/legacyExport");
|
@@ -45,4 +46,3 @@ function build(options, context) {
|
|
45
46
|
return compiler;
|
46
47
|
});
|
47
48
|
}
|
48
|
-
exports.default = build;
|
package/lib/plugins/app-entry.js
CHANGED
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
15
15
|
}) : function(o, v) {
|
16
16
|
o["default"] = v;
|
17
17
|
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
};
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
19
|
+
var ownKeys = function(o) {
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
21
|
+
var ar = [];
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
23
|
+
return ar;
|
24
|
+
};
|
25
|
+
return ownKeys(o);
|
26
|
+
};
|
27
|
+
return function (mod) {
|
28
|
+
if (mod && mod.__esModule) return mod;
|
29
|
+
var result = {};
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
31
|
+
__setModuleDefault(result, mod);
|
32
|
+
return result;
|
33
|
+
};
|
34
|
+
})();
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
26
36
|
const babel = __importStar(require("@babel/core"));
|
27
37
|
// TODO 动态生成app.config.ts文件还是会造成二次编译,待优化
|
@@ -12,7 +12,7 @@ exports.default = {
|
|
12
12
|
const resolveConfig = builder_1.builder.api.config.resolveAlias;
|
13
13
|
// 兼容老项目中的老配置
|
14
14
|
if (resolveConfig) {
|
15
|
-
process.emitWarning(`config.resolveAlias has deprecated!, please use {
|
15
|
+
process.emitWarning(`config.resolveAlias has deprecated in webpack mode!, please use {
|
16
16
|
plugins: [
|
17
17
|
{
|
18
18
|
configWebpack({ config }) {
|
@@ -30,5 +30,18 @@ exports.default = {
|
|
30
30
|
}
|
31
31
|
});
|
32
32
|
}
|
33
|
+
const define = builder_1.builder.api.config.define;
|
34
|
+
if (define) {
|
35
|
+
process.emitWarning(`config.define has deprecated in webpack mode!, please use {
|
36
|
+
plugins: [
|
37
|
+
{
|
38
|
+
configWebpack({ config }) {
|
39
|
+
config.plugin('your-define').use(DefinePlugin, [define])
|
40
|
+
}
|
41
|
+
}
|
42
|
+
]
|
43
|
+
} plugin instead.`);
|
44
|
+
config.plugin('ray-define').use(require('webpack').DefinePlugin, [define]);
|
45
|
+
}
|
33
46
|
},
|
34
47
|
};
|
package/lib/ray-core.js
CHANGED
@@ -14,7 +14,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
15
15
|
};
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
exports.RayAPI =
|
17
|
+
exports.RayAPI = void 0;
|
18
|
+
exports.getRayCoreOptions = getRayCoreOptions;
|
18
19
|
const path_1 = __importDefault(require("path"));
|
19
20
|
const legacyExport_1 = require("@ray-core/cli/lib/legacyExport");
|
20
21
|
const API_1 = __importDefault(require("@ray-core/cli/lib/API"));
|
@@ -58,7 +59,6 @@ function getRayCoreOptions() {
|
|
58
59
|
blended });
|
59
60
|
return remaxBuildConfig;
|
60
61
|
}
|
61
|
-
exports.getRayCoreOptions = getRayCoreOptions;
|
62
62
|
class RayAPI extends API_1.default {
|
63
63
|
constructor(opts) {
|
64
64
|
super();
|
package/lib/utils.js
CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.getModuleOfPlatform =
|
6
|
+
exports.getModuleOfPlatform = getModuleOfPlatform;
|
7
7
|
const paths_1 = require("@ray-core/cli/lib/build/utils/paths");
|
8
8
|
const path_1 = __importDefault(require("path"));
|
9
9
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
@@ -33,4 +33,3 @@ function getModuleOfPlatform(file, opts) {
|
|
33
33
|
}
|
34
34
|
}
|
35
35
|
}
|
36
|
-
exports.getModuleOfPlatform = getModuleOfPlatform;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ray-js/builder-mp",
|
3
|
-
"version": "1.6.0
|
3
|
+
"version": "1.6.0",
|
4
4
|
"description": "Ray builder for mini program",
|
5
5
|
"keywords": [
|
6
6
|
"ray"
|
@@ -24,20 +24,20 @@
|
|
24
24
|
"watch": "tsc -p ./tsconfig.build.json --watch"
|
25
25
|
},
|
26
26
|
"dependencies": {
|
27
|
-
"@babel/plugin-transform-private-methods": "^7.
|
28
|
-
"@babel/plugin-transform-private-property-in-object": "^7.
|
29
|
-
"@babel/template": "^7.
|
30
|
-
"@babel/traverse": "^7.
|
31
|
-
"@babel/types": "^7.
|
32
|
-
"@ray-core/babel-preset-remax": "^0.4.
|
33
|
-
"@ray-core/build-store": "^0.4.
|
34
|
-
"@ray-core/cli": "^0.4.
|
35
|
-
"@ray-core/ray": "^0.4.
|
36
|
-
"@ray-js/adapter": "
|
27
|
+
"@babel/plugin-transform-private-methods": "^7.25.9",
|
28
|
+
"@babel/plugin-transform-private-property-in-object": "^7.25.9",
|
29
|
+
"@babel/template": "^7.25.9",
|
30
|
+
"@babel/traverse": "^7.26.4",
|
31
|
+
"@babel/types": "^7.26.3",
|
32
|
+
"@ray-core/babel-preset-remax": "^0.4.8",
|
33
|
+
"@ray-core/build-store": "^0.4.8",
|
34
|
+
"@ray-core/cli": "^0.4.8",
|
35
|
+
"@ray-core/ray": "^0.4.8",
|
36
|
+
"@ray-js/adapter": "1.6.0",
|
37
37
|
"@ray-js/rjs-for-wechat": "^0.0.3",
|
38
|
-
"@ray-js/shared": "
|
39
|
-
"@ray-js/types": "
|
40
|
-
"babel-loader": "^8.
|
38
|
+
"@ray-js/shared": "1.6.0",
|
39
|
+
"@ray-js/types": "1.6.0",
|
40
|
+
"babel-loader": "^8.4.1",
|
41
41
|
"babel-plugin-minify-dead-code-elimination": "^0.5.2",
|
42
42
|
"babel-plugin-transform-prune-unused-imports": "^1.0.1",
|
43
43
|
"change-case": "^4.1.2",
|
@@ -49,22 +49,22 @@
|
|
49
49
|
"pretty-bytes": "^5.6.0",
|
50
50
|
"react": "^17.0.2",
|
51
51
|
"slash": "^3.0.0",
|
52
|
-
"webpack": "^5.
|
52
|
+
"webpack": "^5.97.1",
|
53
53
|
"webpack-chain": "^6.5.1",
|
54
54
|
"webpack-virtual-modules": "^0.4.6"
|
55
55
|
},
|
56
56
|
"devDependencies": {
|
57
|
-
"@ray-core/types": "^0.4.
|
58
|
-
"@types/jest": "^29.5.
|
59
|
-
"@types/node": "^20.
|
57
|
+
"@ray-core/types": "^0.4.8",
|
58
|
+
"@types/jest": "^29.5.14",
|
59
|
+
"@types/node": "^20.17.6",
|
60
60
|
"babel-plugin-tester": "^10.1.0",
|
61
61
|
"jest": "^29.7.0",
|
62
|
-
"ts-jest": "^29.
|
63
|
-
"typescript": "^5.
|
62
|
+
"ts-jest": "^29.2.5",
|
63
|
+
"typescript": "^5.7.2"
|
64
64
|
},
|
65
65
|
"publishConfig": {
|
66
66
|
"access": "public",
|
67
|
-
"registry": "https://registry.npmjs.
|
67
|
+
"registry": "https://registry.npmjs.com"
|
68
68
|
},
|
69
|
-
"gitHead": "
|
69
|
+
"gitHead": "b5b10947abcec036f88b73320491fb4e0a4cbe52"
|
70
70
|
}
|