swico 3.2.0-beta.3 → 3.2.1-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.
- package/package.json +3 -4
- package/src/command/build.js +1 -1
- package/src/command/start.js +1 -1
- package/src/main-config/index.js +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "swico",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.1-beta.1",
|
|
4
4
|
"description": "Simple, efficient, and practical front-end framework",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
"compile": "tsc && ts-node ./src/task.ts",
|
|
36
36
|
"publish:offical": "npm run compile && cd ./dist && npm publish",
|
|
37
37
|
"publish:beta": "npm run compile && cd ./dist && npm publish --tag=beta",
|
|
38
|
-
"publish:alpha": "npm run compile && cd ./dist && npm publish --tag=alpha",
|
|
39
38
|
"lint:fix": "eslint --fix src/**/*.{js,jsx,ts,tsx} "
|
|
40
39
|
},
|
|
41
40
|
"repository": {
|
|
@@ -63,7 +62,8 @@
|
|
|
63
62
|
"qs": "6.13.0",
|
|
64
63
|
"react-router": "7.15.0",
|
|
65
64
|
"ts-node": "10.9.1",
|
|
66
|
-
"vue-router": "4.5.0"
|
|
65
|
+
"vue-router": "4.5.0",
|
|
66
|
+
"typescript": "5.8.3"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@eslint/js": "9.39.4",
|
|
@@ -76,7 +76,6 @@
|
|
|
76
76
|
"prettier": "3.5.3",
|
|
77
77
|
"react": "~19.2.6",
|
|
78
78
|
"react-dom": "~19.2.6",
|
|
79
|
-
"typescript": "5.8.3",
|
|
80
79
|
"typescript-eslint": "8.59.2",
|
|
81
80
|
"vue": "~3.5.34"
|
|
82
81
|
},
|
package/src/command/build.js
CHANGED
|
@@ -47,7 +47,7 @@ function default_1() {
|
|
|
47
47
|
const entryFilePath = path_1.default.resolve(projectPath, './.swico/index.js');
|
|
48
48
|
let replaceEntryText = yield fs_extra_1.default.readFile(entryFilePath, 'utf8');
|
|
49
49
|
replaceEntryText = replaceEntryText.replaceAll('.swico/.prod/history.js', '.swico/.dev/history.js');
|
|
50
|
-
yield fs_extra_1.default.
|
|
50
|
+
yield fs_extra_1.default.outputFile(entryFilePath, replaceEntryText);
|
|
51
51
|
}));
|
|
52
52
|
utils_1.toast.info('Building...');
|
|
53
53
|
now = Date.now();
|
package/src/command/start.js
CHANGED
|
@@ -27,7 +27,7 @@ const core_1 = require("@rsbuild/core");
|
|
|
27
27
|
const { SWICO_DEV_RESTART } = process.env;
|
|
28
28
|
const updateIndexFileText = (envPath, newFileText) => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
29
|
const projectPath = process.cwd();
|
|
30
|
-
yield fs_extra_1.default.
|
|
30
|
+
yield fs_extra_1.default.outputFile(path_1.default.resolve(projectPath, `./.swico${envPath}index.js`), newFileText);
|
|
31
31
|
});
|
|
32
32
|
exports.updateIndexFileText = updateIndexFileText;
|
|
33
33
|
const handleWatch = (projectPath, devServer, env) => {
|
package/src/main-config/index.js
CHANGED
|
@@ -183,7 +183,7 @@ const handleAndCopyRouterFile = ({ routes = [], type = 'browser', base = '/' },
|
|
|
183
183
|
return `exports.routerType = '${type}';`;
|
|
184
184
|
});
|
|
185
185
|
}
|
|
186
|
-
yield fs_extra_1.default.
|
|
186
|
+
yield fs_extra_1.default.outputFile(targetRouterFilePath, routerFileText);
|
|
187
187
|
resolve(null);
|
|
188
188
|
}));
|
|
189
189
|
};
|
|
@@ -251,13 +251,13 @@ const initTemplateConfig = (routerConfig, templateType, env) => {
|
|
|
251
251
|
.resolve(projectPath, `./.swico/.${env}/history.js`)
|
|
252
252
|
.replaceAll('\\', '/');
|
|
253
253
|
replaceEntryText = replaceEntryText.replaceAll('require("./mock-history");', `require("${formatHistoryPath}");`);
|
|
254
|
-
yield fs_extra_1.default.
|
|
254
|
+
yield fs_extra_1.default.outputFile(targetEntryFilePath, replaceEntryText);
|
|
255
255
|
yield handleAndCopyRouterFile(routerConfig, templateType, env);
|
|
256
256
|
const oriHooksFilePath = path_1.default.resolve(__dirname, `../template-root/.swico-${templateType}/hooks.js`);
|
|
257
257
|
const targetHooksFilePath = path_1.default.resolve(projectPath, './.swico/hooks.js');
|
|
258
258
|
let replaceHooksText = yield fs_extra_1.default.readFile(oriHooksFilePath, 'utf8');
|
|
259
259
|
replaceHooksText = replaceHooksText.replaceAll('$env', `.${env}`);
|
|
260
|
-
yield fs_extra_1.default.
|
|
260
|
+
yield fs_extra_1.default.outputFile(targetHooksFilePath, replaceHooksText);
|
|
261
261
|
const oriHistoryFilePath = path_1.default.resolve(__dirname, `../template-root/.swico-${templateType}/$env/history.js`);
|
|
262
262
|
const targetHistoryFilePath = path_1.default.resolve(projectPath, `./.swico${envPath}history.js`);
|
|
263
263
|
yield fs_extra_1.default.copyFile(oriHistoryFilePath, targetHistoryFilePath);
|
|
@@ -268,7 +268,7 @@ const initTemplateConfig = (routerConfig, templateType, env) => {
|
|
|
268
268
|
if (templateType === 'react') {
|
|
269
269
|
replaceIndexText = yield (0, exports.handleLoadingFile)(projectPath, replaceIndexText);
|
|
270
270
|
}
|
|
271
|
-
yield fs_extra_1.default.
|
|
271
|
+
yield fs_extra_1.default.outputFile(targetIndexFilePath, replaceIndexText);
|
|
272
272
|
resolve(null);
|
|
273
273
|
}));
|
|
274
274
|
};
|