swico 2.4.0-beta.1 → 2.4.0-beta.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swico",
3
- "version": "2.4.0-beta.1",
3
+ "version": "2.4.0-beta.2",
4
4
  "description": "Simple, efficient, and practical front-end framework",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -143,6 +143,18 @@ const initCliIndexFile = (templateType, env) => __awaiter(void 0, void 0, void 0
143
143
  .replaceAll('\\', '/');
144
144
  replaceFileText = replaceFileText.replaceAll('require("./project-path/.swico-react/react-hooks");', `require("${formatHooksPath}");`);
145
145
  }
146
+ if (templateType === 'react') {
147
+ const formatHooksPath = path_1.default
148
+ .resolve(projectPath, './.swico/react-hooks')
149
+ .replaceAll('\\', '/');
150
+ replaceFileText = replaceFileText.replaceAll('require("./project-path/.swico-react/react-hooks");', `require("${formatHooksPath}");`);
151
+ }
152
+ if (templateType === 'react') {
153
+ const formatLinkComponentPath = path_1.default
154
+ .resolve(projectPath, './.swico/Link')
155
+ .replaceAll('\\', '/');
156
+ replaceFileText = replaceFileText.replaceAll('require("./project-path/.swico-react/Link");', `require("${formatLinkComponentPath}");`);
157
+ }
146
158
  const formatHistoryPath = path_1.default
147
159
  .resolve(projectPath, `./.swico/.${env}/history`)
148
160
  .replaceAll('\\', '/');
@@ -240,7 +252,13 @@ const initTemplateConfig = (routerConfig, templateType, env) => {
240
252
  (templateType === 'vue'
241
253
  ? !['Container.js', 'vue-hooks.js'].includes(fileName)
242
254
  : !['react-hooks.js'].includes(fileName)));
243
- yield (0, tools_1.copyDirFiles)(path_1.default.resolve(__dirname, `../project-path/.swico-${templateType}`), path_1.default.resolve(projectPath, './.swico'), (fileName) => ['react-hooks.js', 'vue-hooks.js', 'loading.js', 'Container.vue'].includes(fileName));
255
+ yield (0, tools_1.copyDirFiles)(path_1.default.resolve(__dirname, `../project-path/.swico-${templateType}`), path_1.default.resolve(projectPath, './.swico'), (fileName) => [
256
+ 'react-hooks.js',
257
+ 'vue-hooks.js',
258
+ 'Link.js',
259
+ 'loading.js',
260
+ 'Container.vue'
261
+ ].includes(fileName));
244
262
  yield formatRouterConfig(routerConfig, templateType, env);
245
263
  let replaceIndexText = yield fs_extra_1.default.readFile(path_1.default.resolve(projectPath, `./.swico${envPath}index.js`), 'utf8');
246
264
  const hooksFilePath = path_1.default.resolve(projectPath, `./.swico/${templateType}-hooks.js`);