swico 2.0.0-beta.18 → 2.0.0-beta.19

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.0.0-beta.18",
3
+ "version": "2.0.0-beta.19",
4
4
  "description": "Simple, efficient, and practical front-end framework",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -21,7 +21,8 @@
21
21
  "scripts": {
22
22
  "compile": "tsc && ts-node ./src/task.ts",
23
23
  "publish:offical": "npm run compile && cd ./dist && npm publish",
24
- "publish:beta": "npm run compile && cd ./dist && npm publish --tag=beta"
24
+ "publish:beta": "npm run compile && cd ./dist && npm publish --tag=beta",
25
+ "lint:fix": "eslint --fix src/**/*.{js,jsx,ts,tsx} "
25
26
  },
26
27
  "repository": {
27
28
  "type": "git",
@@ -73,7 +74,8 @@
73
74
  "react": "~19.1.0",
74
75
  "react-dom": "~19.1.0",
75
76
  "typescript": "5.8.3",
76
- "vue": "~3.5.13"
77
+ "vue": "~3.5.13",
78
+ "prettier": "3.5.3"
77
79
  },
78
80
  "engines": {
79
81
  "node": ">=20.0.0"
@@ -29,7 +29,7 @@ let currentPort, currentRouterBase = '/';
29
29
  const handleWatch = (projectPath, devServer, env) => {
30
30
  const envPath = env === 'dev' ? '/.dev/' : '/.prod/';
31
31
  const configFilesWatcher = chokidar_1.default
32
- .watch([path_1.default.join(projectPath, '/config/*.ts'), path_1.default.join(projectPath, '/.eslintrc')], {
32
+ .watch([path_1.default.join(projectPath, '/config/*.ts'), path_1.default.join(projectPath, '/.eslint.config.mjs')], {
33
33
  interval: 500,
34
34
  binaryInterval: 500,
35
35
  ignoreInitial: true,
@@ -54,17 +54,37 @@ export default function ({ projectPath, entryPath, env, customConfig }: GlobalDa
54
54
  oneOf: ({
55
55
  test: RegExp;
56
56
  type: string;
57
- loader: string;
58
- options?: undefined;
57
+ use: (string | {
58
+ loader: string;
59
+ options: {
60
+ postcssOptions: {
61
+ plugins: string[][];
62
+ };
63
+ };
64
+ })[];
65
+ loader?: undefined;
59
66
  generator?: undefined;
60
67
  } | {
61
68
  test: RegExp;
62
69
  type: string;
63
70
  loader: string;
64
- options: {
65
- api: string;
66
- implementation: string;
67
- };
71
+ use: ({
72
+ loader: string;
73
+ options: {
74
+ postcssOptions: {
75
+ plugins: string[][];
76
+ };
77
+ api?: undefined;
78
+ implementation?: undefined;
79
+ };
80
+ } | {
81
+ loader: string;
82
+ options: {
83
+ api: string;
84
+ implementation: string;
85
+ postcssOptions?: undefined;
86
+ };
87
+ })[];
68
88
  generator?: undefined;
69
89
  } | {
70
90
  test: RegExp;
@@ -72,19 +92,19 @@ export default function ({ projectPath, entryPath, env, customConfig }: GlobalDa
72
92
  generator: {
73
93
  filename: string;
74
94
  };
95
+ use?: undefined;
75
96
  loader?: undefined;
76
- options?: undefined;
77
97
  } | {
78
98
  test: RegExp;
79
99
  type: string;
100
+ use?: undefined;
80
101
  loader?: undefined;
81
- options?: undefined;
82
102
  generator?: undefined;
83
103
  } | {
84
104
  test: RegExp;
85
105
  loader: string;
86
106
  type?: undefined;
87
- options?: undefined;
107
+ use?: undefined;
88
108
  generator?: undefined;
89
109
  })[];
90
110
  test?: undefined;
@@ -100,16 +100,39 @@ function default_1(_a) {
100
100
  {
101
101
  test: /\.less$/,
102
102
  type: 'css',
103
- loader: lessLoader
103
+ use: [
104
+ {
105
+ loader: postcssLoader,
106
+ options: {
107
+ postcssOptions: {
108
+ plugins: [['autoprefixer']]
109
+ }
110
+ }
111
+ },
112
+ lessLoader
113
+ ]
104
114
  },
105
115
  {
106
116
  test: /\.scss$/,
107
117
  type: 'css',
108
118
  loader: sassLoader,
109
- options: {
110
- api: 'modern-compiler',
111
- implementation: require.resolve('sass-embedded')
112
- }
119
+ use: [
120
+ {
121
+ loader: postcssLoader,
122
+ options: {
123
+ postcssOptions: {
124
+ plugins: [['autoprefixer']]
125
+ }
126
+ }
127
+ },
128
+ {
129
+ loader: sassLoader,
130
+ options: {
131
+ api: 'modern-compiler',
132
+ implementation: require.resolve('sass-embedded')
133
+ }
134
+ }
135
+ ]
113
136
  },
114
137
  {
115
138
  test: /\.(jpg|png|gif|webp|bmp|jpeg|svg)$/,
@@ -18,6 +18,5 @@ export interface DefineSwicoConfigType {
18
18
  (env: 'prod', config: CustomConfigType['prod']): any;
19
19
  }
20
20
  export declare const defineConfig: DefineSwicoConfigType;
21
- export interface DefineGlobalConfigType {
22
- }
21
+ export type DefineGlobalConfigType = object;
23
22
  export declare const defineGlobal: (config: DefineGlobalConfigType) => DefineGlobalConfigType;
@@ -31,7 +31,7 @@ exports.compareURLPatterns = compareURLPatterns;
31
31
  const interpolatePath = (pathTemplate, params) => {
32
32
  const pathParts = pathTemplate.split('/');
33
33
  const interpolatedParts = pathParts.map((part) => {
34
- const paramMatch = part.match(/^\:(.+)$/);
34
+ const paramMatch = part.match(/^:(.+)$/);
35
35
  if (paramMatch) {
36
36
  const paramName = paramMatch[1];
37
37
  if (params[paramName]) {