swico 0.9.0-beta10 → 0.9.0-beta12

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": "0.9.0-beta10",
3
+ "version": "0.9.0-beta12",
4
4
  "description": "Simple, efficient, and practical front-end framework",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -34,30 +34,18 @@
34
34
  "react-dom": "~18.2.0",
35
35
  "react-router-dom": "6.22.3",
36
36
  "vue": "~3.4.14",
37
- "vue-router": "^4.2.5",
38
- "history": "5.3.0"
37
+ "vue-router": "^4.2.5"
39
38
  },
40
39
  "devDependencies": {
41
- "@types/react": "18.2.79",
42
- "@types/react-dom": "18.2.25",
43
- "@vue/compiler-sfc": "3.4.14",
44
- "eslint-plugin-react": "7.33.2",
45
- "eslint-plugin-react-hooks": "4.3.0",
46
- "eslint-plugin-vue": "9.19.2",
47
- "vue-loader": "17.4.2",
48
- "vue-style-loader": "4.1.3",
49
- "webpack": "5.88.2",
50
- "webpack-bundle-analyzer": "4.9.1",
51
- "webpack-cli": "5.1.4",
52
- "webpack-dev-server": "4.15.2",
53
- "webpack-merge": "5.9.0",
54
- "webpackbar": "6.0.1",
55
40
  "@babel/types": "7.23.9",
56
41
  "@commitlint/cli": "18.5.0",
57
42
  "@commitlint/config-conventional": "18.5.0",
58
43
  "@swc/core": "1.4.6",
44
+ "@types/react": "18.2.79",
45
+ "@types/react-dom": "18.2.25",
59
46
  "@typescript-eslint/eslint-plugin": "6.19.0",
60
47
  "@typescript-eslint/parser": "6.19.0",
48
+ "@vue/compiler-sfc": "3.4.14",
61
49
  "autoprefixer": "10.3.7",
62
50
  "chalk": "4.1.2",
63
51
  "chokidar": "3.6.0",
@@ -68,6 +56,9 @@
68
56
  "css-loader": "6.3.0",
69
57
  "esbuild-loader": "4.0.3",
70
58
  "eslint": "8.48.0",
59
+ "eslint-plugin-react": "7.33.2",
60
+ "eslint-plugin-react-hooks": "4.3.0",
61
+ "eslint-plugin-vue": "9.19.2",
71
62
  "eslint-webpack-plugin": "4.0.0",
72
63
  "fork-ts-checker-webpack-plugin": "9.0.2",
73
64
  "html-loader": "5.0.0",
@@ -85,6 +76,14 @@
85
76
  "style-loader": "3.3.0",
86
77
  "swc-loader": "0.2.6",
87
78
  "ts-node": "10.9.1",
88
- "typescript": "5.3.3"
79
+ "typescript": "5.3.3",
80
+ "vue-loader": "17.4.2",
81
+ "vue-style-loader": "4.1.3",
82
+ "webpack": "5.88.2",
83
+ "webpack-bundle-analyzer": "4.9.1",
84
+ "webpack-cli": "5.1.4",
85
+ "webpack-dev-server": "4.15.2",
86
+ "webpack-merge": "5.9.0",
87
+ "webpackbar": "6.0.1"
89
88
  }
90
89
  }
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getRouter = exports.history = exports.pathNameList = exports.formatAncPath = exports.interpolatePath = exports.compareURLPatterns = void 0;
7
7
  var index_1 = require("./index");
8
8
  var qs_1 = __importDefault(require("qs"));
9
- var history_1 = require("history");
10
9
  var routes_1 = __importDefault(require("./routes"));
11
10
  var config_1 = require("./config");
12
11
  var layout_1 = __importDefault(require("../../layout"));
@@ -88,8 +87,9 @@ var getPathNameList = function (routes) {
88
87
  return list;
89
88
  };
90
89
  exports.pathNameList = getPathNameList(routes_1.default);
91
- var getLocation = function (originalHistory, state) {
92
- var _a = originalHistory.location, pathname = _a.pathname, hash = _a.hash, search = _a.search;
90
+ var getLocation = function (historyLocation) {
91
+ console.log('historyLocation', historyLocation);
92
+ var pathname = historyLocation.pathname, hash = historyLocation.hash, search = historyLocation.search, state = historyLocation.state;
93
93
  var routerBaseLength = formatRouterBase.length;
94
94
  var path = pathname.slice(routerBaseLength);
95
95
  var matchPathNameItem = exports.pathNameList.find(function (item) { return item.path === path || (0, exports.compareURLPatterns)(path, item.path); });
@@ -128,7 +128,6 @@ var getFormatHistoryOption = function (to, pathList, type) {
128
128
  return obj;
129
129
  };
130
130
  var getRouter = function (routerType) {
131
- var _a;
132
131
  var routeList = [
133
132
  {
134
133
  element: react_1.default.createElement(layout_1.default, null),
@@ -137,7 +136,6 @@ var getRouter = function (routerType) {
137
136
  }
138
137
  ];
139
138
  var router = (routerType === 'hash' ? react_router_dom_1.createHashRouter : react_router_dom_1.createBrowserRouter)(routeList);
140
- var oriHistory = (_a = (routerType === 'hash' ? history_1.createHashHistory : history_1.createBrowserHistory)) === null || _a === void 0 ? void 0 : _a();
141
139
  exports.history = {
142
140
  go: function (delta) {
143
141
  router.navigate(delta);
@@ -175,7 +173,9 @@ var getRouter = function (routerType) {
175
173
  }
176
174
  },
177
175
  get location() {
178
- return getLocation(oriHistory, router.state);
176
+ console.log('router.state', router.state);
177
+ console.log('router.state.location', router.state.location);
178
+ return getLocation(router.state.location);
179
179
  }
180
180
  };
181
181
  return router;