swico 2.8.0-beta.2 → 2.8.0-beta.4

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,9 +1,23 @@
1
1
  {
2
2
  "name": "swico",
3
- "version": "2.8.0-beta.2",
3
+ "version": "2.8.0-beta.4",
4
4
  "description": "Simple, efficient, and practical front-end framework",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "default": "./src/index.js",
10
+ "types": "./src/index.d.ts"
11
+ },
12
+ "./react": {
13
+ "default": "./src/index.react.js",
14
+ "types": "./src/index.react.d.ts"
15
+ },
16
+ "./vue": {
17
+ "default": "./src/index.vue.js",
18
+ "types": "./src/index.vue.d.ts"
19
+ }
20
+ },
7
21
  "keywords": [
8
22
  "typescript",
9
23
  "javascript",
@@ -25,7 +25,7 @@ const chalk_1 = __importDefault(require("chalk"));
25
25
  const dev_server_1 = require("@rspack/dev-server");
26
26
  const fs_extra_1 = __importDefault(require("fs-extra"));
27
27
  const core_1 = require("@rspack/core");
28
- let currentPort, currentRouterBase = '/';
28
+ let currentPort, currentTemplateType, currentRouterBase = '/';
29
29
  const handleWatch = (projectPath, devServer, env) => {
30
30
  const envPath = env === 'dev' ? '/.dev/' : '/.prod/';
31
31
  const configFilesWatcher = chokidar_1.default
package/src/index.d.ts CHANGED
@@ -1,13 +1,11 @@
1
1
  import { GlobalData, GlobalSwicoConfigType } from './main-config';
2
2
  import { UseLocationType, UseNavType } from './typings/global-type';
3
- import { Outlet as ReactOutlet, Link as ReactLink } from './index.react';
4
- import { Outlet as VueOutlet, Link as VueLink } from './index.vue';
5
3
  import { App } from 'vue';
6
4
  import { Router } from 'vue-router';
7
5
  export type CustomConfigType = GlobalData['customConfig'];
8
6
  export type { GlobalSwicoConfigType };
9
7
  export { history } from './mock-history';
10
- declare let Outlet: typeof ReactOutlet | typeof VueOutlet, Link: typeof ReactLink | typeof VueLink, useLocation: UseLocationType, useNav: UseNavType;
8
+ declare let Outlet: any, Link: any, useLocation: UseLocationType, useNav: UseNavType;
11
9
  export { Outlet, Link, useLocation, useNav };
12
10
  export interface DefineSwicoConfigType {
13
11
  (env: 'base', config: CustomConfigType['base']): CustomConfigType['base'];
@@ -16,6 +14,6 @@ export interface DefineSwicoConfigType {
16
14
  }
17
15
  export declare const defineConfig: DefineSwicoConfigType;
18
16
  export interface DefineGlobalConfigType {
19
- onInit?: ((app: App, router: Router) => void) | (() => void);
17
+ onInit?: (app?: App, router?: Router) => void;
20
18
  }
21
19
  export declare const defineGlobal: (config: DefineGlobalConfigType) => DefineGlobalConfigType;
package/src/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.defineGlobal = exports.defineConfig = exports.useNav = exports.useLocation = exports.Link = exports.Outlet = exports.history = void 0;
4
- console.log('orrrr', process.env.SWICO_ENV);
5
4
  var mock_history_1 = require("./mock-history");
6
5
  Object.defineProperty(exports, "history", { enumerable: true, get: function () { return mock_history_1.history; } });
7
6
  let Outlet, Link, useLocation, useNav;
@@ -219,10 +219,10 @@ const handleLoadingFile = (projectPath, replaceIndexText) => __awaiter(void 0, v
219
219
  let newReplaceIndexText = replaceIndexText;
220
220
  try {
221
221
  yield fs_extra_1.default.access(path_1.default.resolve(projectPath, './src/loading/index.tsx'), fs_extra_1.default.constants.F_OK);
222
- newReplaceIndexText = newReplaceIndexText.replace('const Loading = () => null;', 'const Loading = __importDefault(require("../../src/loading"));');
222
+ newReplaceIndexText = newReplaceIndexText.replace('const Loading = () => null;', 'const Loading = __importDefault(require("../../src/loading")).default;');
223
223
  }
224
224
  catch (e) {
225
- newReplaceIndexText = newReplaceIndexText.replace('__importDefault(require("../../src/loading"));', '() => null;');
225
+ newReplaceIndexText = newReplaceIndexText.replace('__importDefault(require("../../src/loading")).default;', '() => null;');
226
226
  }
227
227
  return newReplaceIndexText;
228
228
  });