@seayoo-web/scripts 1.2.11 → 1.3.0
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/dist/index.js +43 -7
- package/package.json +1 -1
- package/types/index.d.ts +1 -0
- package/types/src/eslint.d.ts +3 -7
- package/types/src/vite.app.d.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -9,8 +9,7 @@ import { existsSync, readFileSync } from "fs";
|
|
|
9
9
|
import "colors";
|
|
10
10
|
import { g as getNowTime, a as getCommitInfo, c as createPageDeployTag } from "./git-BbsLu9cn.js";
|
|
11
11
|
import skipFormatting from "@vue/eslint-config-prettier/skip-formatting";
|
|
12
|
-
import { vueTsConfigs } from "@vue/eslint-config-typescript";
|
|
13
|
-
import { defineConfigWithVueTs } from "@vue/eslint-config-typescript";
|
|
12
|
+
import { vueTsConfigs, defineConfigWithVueTs } from "@vue/eslint-config-typescript";
|
|
14
13
|
import { flatConfigs } from "eslint-plugin-import";
|
|
15
14
|
import pluginVue from "eslint-plugin-vue";
|
|
16
15
|
function defineLibBuildConfig(option) {
|
|
@@ -152,7 +151,7 @@ function definePageBuildConfig(option) {
|
|
|
152
151
|
"regenerator-runtime/runtime.js",
|
|
153
152
|
"core-js/es/array/flat",
|
|
154
153
|
"core-js/es/global-this",
|
|
155
|
-
"core-js/es/promise
|
|
154
|
+
"core-js/es/promise",
|
|
156
155
|
"core-js/es/symbol"
|
|
157
156
|
]
|
|
158
157
|
}),
|
|
@@ -207,7 +206,42 @@ function definePageBuildConfig(option) {
|
|
|
207
206
|
};
|
|
208
207
|
});
|
|
209
208
|
}
|
|
209
|
+
function defineAppBuildConfig(option) {
|
|
210
|
+
return defineConfig(async function() {
|
|
211
|
+
const { plugins = [], build = {}, resolve = {}, ...optionReset } = option || {};
|
|
212
|
+
const { alias, ...resolveReset } = resolve || {};
|
|
213
|
+
return {
|
|
214
|
+
base: "./",
|
|
215
|
+
build: {
|
|
216
|
+
emptyOutDir: true,
|
|
217
|
+
outDir: join(process.cwd(), "./dist"),
|
|
218
|
+
assetsDir: "assets",
|
|
219
|
+
reportCompressedSize: false,
|
|
220
|
+
sourcemap: false,
|
|
221
|
+
...build
|
|
222
|
+
},
|
|
223
|
+
plugins: [vue(), ...plugins],
|
|
224
|
+
resolve: {
|
|
225
|
+
alias: {
|
|
226
|
+
"@": join(process.cwd(), "./src"),
|
|
227
|
+
...alias
|
|
228
|
+
},
|
|
229
|
+
extensions: [".mts", ".mjs", ".ts", ".js"],
|
|
230
|
+
...resolveReset
|
|
231
|
+
},
|
|
232
|
+
...optionReset
|
|
233
|
+
};
|
|
234
|
+
});
|
|
235
|
+
}
|
|
210
236
|
const vueEslintConfig = [
|
|
237
|
+
{
|
|
238
|
+
name: "app/files-to-lint",
|
|
239
|
+
files: ["**/*.{ts,mts,tsx,vue,mjs}"]
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
name: "app/files-to-ignore",
|
|
243
|
+
ignores: ["*.mjs", "**/dist/**", "**/bin/**", "**/types/**", "**/dist-ssr/**", "**/coverage/**"]
|
|
244
|
+
},
|
|
211
245
|
pluginVue.configs["flat/essential"],
|
|
212
246
|
vueTsConfigs.recommended,
|
|
213
247
|
skipFormatting,
|
|
@@ -248,6 +282,9 @@ const importEslintConfig = [
|
|
|
248
282
|
}
|
|
249
283
|
}
|
|
250
284
|
];
|
|
285
|
+
function defineEslintConfig(...options) {
|
|
286
|
+
return defineConfigWithVueTs(vueEslintConfig, importEslintConfig, options);
|
|
287
|
+
}
|
|
251
288
|
const stylelintConfig = {
|
|
252
289
|
extends: ["stylelint-config-standard", "stylelint-config-recess-order"],
|
|
253
290
|
overrides: [
|
|
@@ -267,13 +304,12 @@ const stylelintConfig = {
|
|
|
267
304
|
};
|
|
268
305
|
export {
|
|
269
306
|
EnvPrefix,
|
|
270
|
-
|
|
307
|
+
defineAppBuildConfig,
|
|
308
|
+
defineEslintConfig,
|
|
271
309
|
defineLibBuildConfig,
|
|
272
310
|
definePageBuildConfig,
|
|
273
311
|
getBuildEnv,
|
|
274
312
|
htmlInjectPlugin,
|
|
275
|
-
importEslintConfig,
|
|
276
313
|
stylelintConfig,
|
|
277
|
-
transformEnvs
|
|
278
|
-
vueEslintConfig
|
|
314
|
+
transformEnvs
|
|
279
315
|
};
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
package/types/src/eslint.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { type TSESLint } from "@typescript-eslint/utils";
|
|
2
|
-
export
|
|
2
|
+
export type ESLintFlatConfig = TSESLint.FlatConfig.Config;
|
|
3
3
|
/**
|
|
4
|
-
* vue eslint
|
|
4
|
+
* 导出默认的 eslint 配置,包括 vue 基本 eslint 和 import order lint
|
|
5
5
|
*/
|
|
6
|
-
export declare
|
|
7
|
-
/**
|
|
8
|
-
* import 规则,含排序配置
|
|
9
|
-
*/
|
|
10
|
-
export declare const importEslintConfig: TSESLint.FlatConfig.Config[];
|
|
6
|
+
export declare function defineEslintConfig(...options: ESLintFlatConfig[]): ESLintFlatConfig[];
|
package/types/src/vite.app.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ import { type UserConfig } from "vite";
|
|
|
2
2
|
/**
|
|
3
3
|
* 导出一个动态的配置工厂函数
|
|
4
4
|
*/
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function defineAppBuildConfig(option?: UserConfig): import("vite").UserConfigFnPromise;
|