swico 2.8.0-beta.6 → 2.8.0-beta.8

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.8.0-beta.6",
3
+ "version": "2.8.0-beta.8",
4
4
  "description": "Simple, efficient, and practical front-end framework",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -160,11 +160,11 @@ const initCliEntryFile = (projectPath, templateType, env) => __awaiter(void 0, v
160
160
  const formatHooksPath = path_1.default
161
161
  .resolve(projectPath, './.swico/hooks')
162
162
  .replaceAll('\\', '/');
163
- replaceEntryText = replaceEntryText.replaceAll(`require("./template-root/.swico-${templateType}/hooks");`, `require("${formatHooksPath}");`);
163
+ replaceEntryText = replaceEntryText.replaceAll(`require("../src/template-root/.swico-${templateType}/hooks");`, `require("${formatHooksPath}");`);
164
164
  const formatHistoryPath = path_1.default
165
165
  .resolve(projectPath, `./.swico/.${env}/history`)
166
166
  .replaceAll('\\', '/');
167
- replaceEntryText = replaceEntryText.replaceAll('require("./mock-history");', `require("${formatHistoryPath}");`);
167
+ replaceEntryText = replaceEntryText.replaceAll('require("../src/mock-history");', `require("${formatHistoryPath}");`);
168
168
  yield fs_extra_1.default.writeFile(entryFilePath, replaceEntryText);
169
169
  });
170
170
  const formatRouterConfig = ({ routes = [], type = 'browser', base = '/' }, templateType, env) => {
@@ -253,7 +253,7 @@ const initTemplateConfig = (routerConfig, templateType, env) => {
253
253
  yield (0, utils_1.copyDirFiles)(path_1.default.resolve(__dirname, `../template-root/.swico-${templateType}/$env`), copyTargetPath, (fileName) => !fileName.endsWith('.d.ts') && !['hooks.js'].includes(fileName));
254
254
  yield (0, utils_1.copyDirFiles)(path_1.default.resolve(__dirname, `../template-root/.swico-${templateType}`), path_1.default.resolve(projectPath, './.swico'), (fileName) => ['hooks.js'].includes(fileName));
255
255
  const entryFilePath = path_1.default.resolve(projectPath, './.swico/index.js');
256
- yield fs_extra_1.default.copyFile(path_1.default.resolve(__dirname, `../index.${templateType}.js`), entryFilePath);
256
+ yield fs_extra_1.default.copyFile(path_1.default.resolve(__dirname, `../../${templateType}/index.js`), entryFilePath);
257
257
  yield formatRouterConfig(routerConfig, templateType, env);
258
258
  const hooksFilePath = path_1.default.resolve(projectPath, './.swico/hooks.js');
259
259
  let replaceHooksText = yield fs_extra_1.default.readFile(hooksFilePath, 'utf8');
@@ -91,6 +91,7 @@ export default function ({ projectPath, entryPath, env, customConfig }: GlobalDa
91
91
  '@': string;
92
92
  'react-router': string;
93
93
  swico: string;
94
+ 'swico/react': string;
94
95
  qs: string;
95
96
  };
96
97
  };
@@ -146,7 +146,7 @@ function default_1(_a) {
146
146
  },
147
147
  resolve: {
148
148
  extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
149
- alias: Object.assign({ '@': path_1.default.join(projectPath, '/src'), 'react-router': path_1.default.dirname(require.resolve('react-router')), swico: path_1.default.join(projectPath, '/.swico/index'), qs: path_1.default.dirname(require.resolve('qs')) }, getCustomAliasConfig())
149
+ alias: Object.assign({ '@': path_1.default.join(projectPath, '/src'), 'react-router': path_1.default.dirname(require.resolve('react-router')), swico: path_1.default.join(projectPath, '/.swico/index'), 'swico/react': path_1.default.resolve(path_1.default.dirname(require.resolve('qs')), './react'), qs: path_1.default.dirname(require.resolve('qs')) }, getCustomAliasConfig())
150
150
  },
151
151
  externals: customConfig.base.externals,
152
152
  plugins: [
@@ -126,6 +126,7 @@ export default function ({ projectPath, entryPath, env, customConfig }: GlobalDa
126
126
  vue: string;
127
127
  'vue-router': string;
128
128
  swico: string;
129
+ 'swico/vue': string;
129
130
  qs: string;
130
131
  };
131
132
  };
@@ -254,7 +254,7 @@ function default_1(_a) {
254
254
  },
255
255
  resolve: {
256
256
  extensions: ['.ts', '.js', '.vue', '.json'],
257
- alias: Object.assign({ '@': path_1.default.join(projectPath, '/src'), vue: 'vue/dist/vue.esm-bundler.js', 'vue-router': path_1.default.dirname(require.resolve('vue-router')), swico: path_1.default.join(projectPath, '/.swico/index'), qs: path_1.default.dirname(require.resolve('qs')) }, getCustomAliasConfig())
257
+ alias: Object.assign({ '@': path_1.default.join(projectPath, '/src'), vue: 'vue/dist/vue.esm-bundler.js', 'vue-router': path_1.default.dirname(require.resolve('vue-router')), swico: path_1.default.join(projectPath, '/.swico/index'), 'swico/vue': path_1.default.resolve(path_1.default.dirname(require.resolve('qs')), './vue'), qs: path_1.default.dirname(require.resolve('qs')) }, getCustomAliasConfig())
258
258
  },
259
259
  externals: customBaseConfig === null || customBaseConfig === void 0 ? void 0 : customBaseConfig.externals,
260
260
  plugins: [