@gct-paas/cli 0.0.1-dev.7.1 → 0.0.1-dev.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.
Files changed (83) hide show
  1. package/dist/bin.cjs +5 -0
  2. package/dist/commands/index.cjs +21 -0
  3. package/dist/index.cjs +47 -0
  4. package/dist/interface/i-command/i-command.cjs +1 -0
  5. package/dist/interface/index.cjs +16 -0
  6. package/dist/utils/index.cjs +18 -0
  7. package/dist/utils/local-binaries/local-binaries.cjs +19 -0
  8. package/es/bin.d.ts +2 -0
  9. package/es/commands/index.d.ts +5 -0
  10. package/{dist → es}/commands/index.mjs +0 -6
  11. package/es/index.d.ts +2 -0
  12. package/{dist → es}/index.mjs +1 -1
  13. package/es/interface/i-command/i-command.d.ts +22 -0
  14. package/es/interface/index.d.ts +1 -0
  15. package/es/types/index.d.ts +1 -0
  16. package/es/utils/index.d.ts +1 -0
  17. package/es/utils/local-binaries/local-binaries.d.ts +3 -0
  18. package/package.json +20 -54
  19. package/dist/commands/create-template/create-template.d.ts +0 -6
  20. package/dist/commands/create-template/create-template.mjs +0 -29
  21. package/dist/commands/update-template/update-template.d.ts +0 -6
  22. package/dist/commands/update-template/update-template.mjs +0 -17
  23. package/dist/commands/zip/zip.d.ts +0 -21
  24. package/dist/commands/zip/zip.mjs +0 -9
  25. package/dist/core/commitlint/commitlint-config/commitlint-config.d.ts +0 -9
  26. package/dist/core/commitlint/commitlint-config/commitlint-config.mjs +0 -28
  27. package/dist/core/commitlint/index.d.ts +0 -1
  28. package/dist/core/commitlint/index.mjs +0 -1
  29. package/dist/core/constants/index.d.ts +0 -12
  30. package/dist/core/constants/index.mjs +0 -24
  31. package/dist/core/eslint/eslint-config/eslint-config.d.ts +0 -9
  32. package/dist/core/eslint/eslint-config/eslint-config.mjs +0 -109
  33. package/dist/core/eslint/index.d.ts +0 -1
  34. package/dist/core/eslint/index.mjs +0 -1
  35. package/dist/core/index.d.ts +0 -8
  36. package/dist/core/index.mjs +0 -8
  37. package/dist/core/prettier/index.d.ts +0 -1
  38. package/dist/core/prettier/index.mjs +0 -1
  39. package/dist/core/prettier/prettier-config/prettier-config.d.ts +0 -22
  40. package/dist/core/prettier/prettier-config/prettier-config.mjs +0 -26
  41. package/dist/core/rollup/index.d.ts +0 -2
  42. package/dist/core/rollup/index.mjs +0 -2
  43. package/dist/core/rollup/rollup-config/dev-config.d.ts +0 -9
  44. package/dist/core/rollup/rollup-config/dev-config.mjs +0 -101
  45. package/dist/core/rollup/rollup-plugins/copy-file.d.ts +0 -37
  46. package/dist/core/rollup/rollup-plugins/copy-file.mjs +0 -18
  47. package/dist/core/rollup/rollup-plugins/ignore-compiler-file.d.ts +0 -8
  48. package/dist/core/rollup/rollup-plugins/ignore-compiler-file.mjs +0 -17
  49. package/dist/core/rollup/rollup-plugins/index.d.ts +0 -2
  50. package/dist/core/rollup/rollup-plugins/index.mjs +0 -2
  51. package/dist/core/stylelint/index.d.ts +0 -1
  52. package/dist/core/stylelint/index.mjs +0 -1
  53. package/dist/core/stylelint/stylelint-config/stylelint-config.d.ts +0 -9
  54. package/dist/core/stylelint/stylelint-config/stylelint-config.mjs +0 -21
  55. package/dist/core/template/actions/create-template.d.ts +0 -16
  56. package/dist/core/template/actions/create-template.mjs +0 -43
  57. package/dist/core/template/actions/update-template.d.ts +0 -18
  58. package/dist/core/template/actions/update-template.mjs +0 -61
  59. package/dist/core/template/actions/zip.d.ts +0 -9
  60. package/dist/core/template/actions/zip.mjs +0 -13
  61. package/dist/core/template/constant/index.d.ts +0 -1
  62. package/dist/core/template/constant/index.mjs +0 -1
  63. package/dist/core/template/index.d.ts +0 -3
  64. package/dist/core/template/index.mjs +0 -3
  65. package/dist/core/util/index.d.ts +0 -17
  66. package/dist/core/util/index.mjs +0 -7
  67. package/dist/core/util/watcher/watcher.d.ts +0 -48
  68. package/dist/core/util/watcher/watcher.mjs +0 -97
  69. package/dist/core/vite/index.d.ts +0 -4
  70. package/dist/core/vite/index.mjs +0 -8
  71. package/dist/core/vite/vite-config/vite-base-config.d.ts +0 -9
  72. package/dist/core/vite/vite-config/vite-base-config.mjs +0 -53
  73. package/dist/core/vite/vite-config/vite-config.d.ts +0 -9
  74. package/dist/core/vite/vite-config/vite-config.mjs +0 -31
  75. package/dist/core/vite/vite-config/vite-dev-config.d.ts +0 -9
  76. package/dist/core/vite/vite-config/vite-dev-config.mjs +0 -19
  77. package/dist/core/vite/vite-config/vite-plugin-config.d.ts +0 -25
  78. package/dist/core/vite/vite-config/vite-plugin-config.mjs +0 -97
  79. /package/{dist → es}/bin.mjs +0 -0
  80. /package/{dist → es}/interface/i-command/i-command.mjs +0 -0
  81. /package/{dist → es}/interface/index.mjs +0 -0
  82. /package/{dist → es}/utils/index.mjs +0 -0
  83. /package/{dist → es}/utils/local-binaries/local-binaries.mjs +0 -0
package/dist/bin.cjs ADDED
@@ -0,0 +1,5 @@
1
+ // #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ var _index = require("./index.cjs");
5
+ (0, _index.bootstrap)();
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.CommandLoader = void 0;
7
+ var _consola = require("consola");
8
+ class CommandLoader {
9
+ static load(program) {
10
+ this.handleInvalidCommand(program);
11
+ }
12
+ static handleInvalidCommand(program) {
13
+ program.on("command:*", () => {
14
+ _consola.consola.error(`\u672A\u652F\u6301\u7684\u547D\u4EE4: `, program.args.join(" "));
15
+ _consola.consola.log(`\u8BF7\u4F7F\u7528 --help \u67E5\u770B\u5DF2\u652F\u6301\u7684\u547D\u4EE4.
16
+ `);
17
+ process.exit(1);
18
+ });
19
+ }
20
+ }
21
+ exports.CommandLoader = CommandLoader;
package/dist/index.cjs ADDED
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _exportNames = {
7
+ bootstrap: true
8
+ };
9
+ exports.bootstrap = bootstrap;
10
+ var _commander = require("commander");
11
+ var _commands = require("./commands/index.cjs");
12
+ var _utils = require("./utils/index.cjs");
13
+ var _package = _interopRequireDefault(require("../package.json"));
14
+ var _core = require("./core");
15
+ Object.keys(_core).forEach(function (key) {
16
+ if (key === "default" || key === "__esModule") return;
17
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
18
+ if (key in exports && exports[key] === _core[key]) return;
19
+ Object.defineProperty(exports, key, {
20
+ enumerable: true,
21
+ get: function () {
22
+ return _core[key];
23
+ }
24
+ });
25
+ });
26
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
27
+ async function bootstrap() {
28
+ process.on("SIGINT", () => {
29
+ process.exit();
30
+ });
31
+ _commander.program.version(_package.default.version, "-v, --version", "\u67E5\u770B\u5F53\u524D\u7248\u672C").usage("<command> [options]").helpOption("-h, --help", "\u83B7\u53D6\u5E2E\u52A9\u4FE1\u606F").configureOutput({
32
+ // Visibly override write routines as example!
33
+ writeErr: str => process.stdout.write(`[ERR] ${str}`),
34
+ // Highlight errors in color.
35
+ outputError: (str, write) => write(`\x1B[31m${str}\x1B[0m`)
36
+ });
37
+ if ((0, _utils.localBinExists)()) {
38
+ const localCommandLoader = (0, _utils.loadLocalBinCommandLoader)();
39
+ localCommandLoader.load(_commander.program);
40
+ } else {
41
+ _commands.CommandLoader.load(_commander.program);
42
+ }
43
+ _commander.program.parse(process.argv);
44
+ if (!process.argv.slice(2).length) {
45
+ _commander.program.outputHelp();
46
+ }
47
+ }
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _iCommand = require("./i-command/i-command.cjs");
7
+ Object.keys(_iCommand).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _iCommand[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _iCommand[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "loadLocalBinCommandLoader", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _localBinaries.loadLocalBinCommandLoader;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "localBinExists", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _localBinaries.localBinExists;
16
+ }
17
+ });
18
+ var _localBinaries = require("./local-binaries/local-binaries.cjs");
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.loadLocalBinCommandLoader = loadLocalBinCommandLoader;
7
+ exports.localBinExists = localBinExists;
8
+ var _path = require("path");
9
+ var _fsExtra = _interopRequireDefault(require("fs-extra"));
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ const localBinPathSegments = [process.cwd(), "node_modules", "@nestjs", "cli"];
12
+ function localBinExists() {
13
+ return _fsExtra.default.existsSync((0, _path.join)(...localBinPathSegments));
14
+ }
15
+ function loadLocalBinCommandLoader() {
16
+ const path = _path.posix.join(...localBinPathSegments, "commands");
17
+ const commandsFile = require(path);
18
+ return commandsFile.CommandLoader;
19
+ }
package/es/bin.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,5 @@
1
+ import { Command } from 'commander';
2
+ export declare class CommandLoader {
3
+ static load(program: Command): void;
4
+ private static handleInvalidCommand;
5
+ }
@@ -1,12 +1,6 @@
1
1
  import { consola } from "consola";
2
- import { CreateTemplateCommand } from "./create-template/create-template.mjs";
3
- import { UpdateTemplateCommand } from "./update-template/update-template.mjs";
4
- import { ZipCommand } from "./zip/zip.mjs";
5
2
  export class CommandLoader {
6
3
  static load(program) {
7
- new CreateTemplateCommand().load(program);
8
- new UpdateTemplateCommand().load(program);
9
- new ZipCommand().load(program);
10
4
  this.handleInvalidCommand(program);
11
5
  }
12
6
  static handleInvalidCommand(program) {
package/es/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export declare function bootstrap(): Promise<void>;
2
+ export * from './core';
@@ -23,4 +23,4 @@ export async function bootstrap() {
23
23
  program.outputHelp();
24
24
  }
25
25
  }
26
- export * from "./core/index.mjs";
26
+ export * from "./core";
@@ -0,0 +1,22 @@
1
+ import { Command } from 'commander';
2
+ /**
3
+ * 命令项
4
+ *
5
+ * @export
6
+ * @interface ICommand
7
+ */
8
+ export interface ICommand {
9
+ /**
10
+ * 加载命令
11
+ *
12
+ * @param {Command} program
13
+ */
14
+ load(program: Command): void;
15
+ /**
16
+ * 执行行为
17
+ *
18
+ * @param {...unknown[]} args
19
+ * @return {*} {(void | Promise<void>)}
20
+ */
21
+ action(...args: unknown[]): void | Promise<void>;
22
+ }
@@ -0,0 +1 @@
1
+ export * from './i-command/i-command';
@@ -0,0 +1 @@
1
+ declare module 'eslint-plugin-import';
@@ -0,0 +1 @@
1
+ export { localBinExists, loadLocalBinCommandLoader, } from './local-binaries/local-binaries';
@@ -0,0 +1,3 @@
1
+ import { CommandLoader } from '../../commands/index';
2
+ export declare function localBinExists(): boolean;
3
+ export declare function loadLocalBinCommandLoader(): typeof CommandLoader;
package/package.json CHANGED
@@ -1,15 +1,24 @@
1
1
  {
2
2
  "name": "@gct-paas/cli",
3
- "version": "0.0.1-dev.7.1",
3
+ "version": "0.0.1-dev.8",
4
4
  "type": "module",
5
5
  "description": "paas 平台核心包",
6
6
  "bin": {
7
- "gct-paas": "dist/bin.mjs"
7
+ "gct-paas": "es/bin.mjs"
8
+ },
9
+ "main": "dist/index.cjs",
10
+ "module": "es/index.mjs",
11
+ "types": "es/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "types": "./es/index.d.ts",
15
+ "import": "./es/index.mjs",
16
+ "require": "./dist/index.cjs"
17
+ }
8
18
  },
9
- "main": "dist/index.mjs",
10
- "types": "dist/index.d.ts",
11
19
  "files": [
12
20
  "dist",
21
+ "es",
13
22
  "CHANGELOG.md",
14
23
  "README.md"
15
24
  ],
@@ -33,65 +42,22 @@
33
42
  "publish:npm": "npm run build && npm publish --access public --registry=https://registry.npmjs.org/"
34
43
  },
35
44
  "dependencies": {
36
- "@babel/core": "^7.26.0",
37
- "@babel/preset-env": "^7.26.0",
38
- "@commitlint/cli": "^19.6.1",
39
- "@commitlint/config-conventional": "^19.6.0",
40
- "@eslint/js": "^9.17.0",
41
- "@gct-paas/scss": "*",
42
45
  "@inquirer/prompts": "^7.3.1",
43
- "@rollup/plugin-babel": "^6.0.4",
44
- "@rollup/plugin-commonjs": "^28.0.2",
45
- "@rollup/plugin-eslint": "^9.0.5",
46
- "@rollup/plugin-json": "^6.1.0",
47
- "@rollup/plugin-node-resolve": "^16.0.0",
48
- "@rollup/plugin-typescript": "^12.1.2",
49
- "@vitejs/plugin-vue": "^5.2.1",
50
- "@vitejs/plugin-vue-jsx": "^4.1.1",
51
- "@vue/compiler-sfc": "^3.5.13",
52
- "archiver": "^7.0.1",
53
- "chokidar": "^4.0.3",
54
- "commander": "^13.0.0",
55
- "consola": "^3.3.3",
56
- "copy-file": "^11.0.0",
46
+ "commander": "^13.1.0",
47
+ "consola": "^3.4.0",
57
48
  "core-js": "^3.40.0",
58
- "cpy": "^11.1.0",
59
- "crypto": "^1.0.1",
60
- "esbuild": "^0.24.2",
61
- "eslint": "^9.17.0",
62
- "eslint-config-prettier": "^9.1.0",
63
- "eslint-plugin-import": "^2.31.0",
64
- "eslint-plugin-prettier": "^5.2.1",
65
- "eslint-plugin-unused-imports": "^4.1.4",
66
- "eslint-plugin-vue": "^9.32.0",
67
49
  "fast-glob": "^3.3.3",
68
- "fs-extra": "^11.2.0",
69
- "globals": "^15.14.0",
50
+ "fs-extra": "^11.3.0",
70
51
  "lodash-es": "^4.17.21",
71
52
  "ora": "^8.2.0",
72
53
  "picocolors": "^1.1.1",
73
- "prettier": "^3.4.2",
74
- "rimraf": "^6.0.1",
75
- "rollup": "^4.30.0",
76
- "rollup-plugin-esbuild": "^6.1.1",
77
- "simple-git": "^3.27.0",
78
- "stylelint": "^16.12.0",
79
- "stylelint-config-standard": "^36.0.1",
80
- "stylelint-config-standard-scss": "^14.0.0",
81
- "typescript-eslint": "^8.19.0",
82
- "vite": "^6.0.7",
83
- "vite-plugin-dts": "^4.4.0",
84
- "vue-tsc": "^2.2.0"
54
+ "rimraf": "^6.0.1"
85
55
  },
86
56
  "devDependencies": {
87
- "@commitlint/types": "^19.5.0",
88
- "@types/archiver": "^6.0.3",
89
- "@types/babel__core": "^7.20.5",
90
- "@types/babel__preset-env": "^7.9.7",
91
57
  "@types/fs-extra": "^11.0.4",
92
58
  "@types/lodash-es": "^4.17.12",
93
- "@types/node": "^22.10.5",
94
- "typescript": "^5.7.2",
95
- "unbuild": "^3.2.0"
59
+ "@types/node": "^22.13.1",
60
+ "typescript": "^5.7.3",
61
+ "unbuild": "^3.3.1"
96
62
  }
97
63
  }
@@ -1,6 +0,0 @@
1
- import { Command } from 'commander';
2
- import { ICommand } from '../../interface';
3
- export declare class CreateTemplateCommand implements ICommand {
4
- load(program: Command): void;
5
- action(): Promise<void>;
6
- }
@@ -1,29 +0,0 @@
1
- import fse from "fs-extra";
2
- import ora from "ora";
3
- import { confirm, input } from "@inquirer/prompts";
4
- import { CreateTemplateAction } from "../../core/index.mjs";
5
- export class CreateTemplateCommand {
6
- load(program) {
7
- program.command("create-template").description("\u57FA\u4E8E\u6A21\u677F\u521B\u5EFA paas \u5E73\u53F0\u63D2\u4EF6").action(this.action.bind(this));
8
- }
9
- async action() {
10
- const cwd = process.cwd();
11
- const child = fse.readdirSync(cwd);
12
- if (child.length > 0) {
13
- const bol = await confirm({
14
- message: "\u5F53\u524D\u76EE\u5F55\u4E0D\u4E3A\u7A7A\uFF0C\u7EE7\u7EED\u5C06\u53EF\u80FD\u8986\u76D6\u5DF2\u6709\u6587\u4EF6\uFF0C\u662F\u5426\u7EE7\u7EED\u521B\u5EFA\uFF1F",
15
- default: false
16
- });
17
- if (bol === false) {
18
- process.exit();
19
- }
20
- }
21
- const name = await input({
22
- message: "\u8BF7\u8F93\u5165\u63D2\u4EF6\u540D\u79F0",
23
- default: "gct-plugin"
24
- });
25
- const spinner = ora("\u521D\u59CB\u5316\u63D2\u4EF6").start();
26
- await new CreateTemplateAction().run(process.cwd(), name);
27
- spinner.succeed("\u521D\u59CB\u5316\u5B8C\u6210");
28
- }
29
- }
@@ -1,6 +0,0 @@
1
- import { Command } from 'commander';
2
- import { ICommand } from '../../interface';
3
- export declare class UpdateTemplateCommand implements ICommand {
4
- load(program: Command): void;
5
- action(): Promise<void>;
6
- }
@@ -1,17 +0,0 @@
1
- import ora from "ora";
2
- import { confirm } from "@inquirer/prompts";
3
- import { UpdateTemplateAction } from "../../core/index.mjs";
4
- export class UpdateTemplateCommand {
5
- load(program) {
6
- program.command("update-template").description("paas \u5E73\u53F0\u63D2\u4EF6\u589E\u91CF\u66F4\u65B0").action(this.action.bind(this));
7
- }
8
- async action() {
9
- const overwrite = await confirm({
10
- message: "\u66F4\u65B0\u65F6\u9009\u62E9\u4E0D\u8986\u76D6\uFF0C\u53EF\u4FDD\u7559\u5DF2\u4FEE\u6539\u7684\u6587\u4EF6\u800C\u4E0D\u88AB\u65B0\u7248\u672C\u66FF\u6362\u3002\u662F\u5426\u8986\u76D6\u66F4\u65B0\uFF1F",
11
- default: false
12
- });
13
- const spinner = ora("\u589E\u91CF\u66F4\u65B0\u63D2\u4EF6").start();
14
- await new UpdateTemplateAction().run(process.cwd(), overwrite);
15
- spinner.succeed("\u66F4\u65B0\u5B8C\u6210");
16
- }
17
- }
@@ -1,21 +0,0 @@
1
- import { Command } from 'commander';
2
- import { ICommand } from '../../interface';
3
- interface ZipCommandParams {
4
- /**
5
- * 待压缩目录
6
- *
7
- * @type {string}
8
- */
9
- folder: string;
10
- /**
11
- * 输出文件名
12
- *
13
- * @type {string}
14
- */
15
- output: string;
16
- }
17
- export declare class ZipCommand implements ICommand {
18
- load(program: Command): void;
19
- action(args: ZipCommandParams): Promise<void>;
20
- }
21
- export {};
@@ -1,9 +0,0 @@
1
- import { ZipAction } from "../../core/index.mjs";
2
- export class ZipCommand {
3
- load(program) {
4
- program.command("zip").description("zip \u538B\u7F29\u76EE\u5F55").option("--folder <folder-path>", "\u5F85\u538B\u7F29\u76EE\u5F55").option("--output <output-file>", "\u8F93\u51FA\u6587\u4EF6\u540D").action(this.action.bind(this));
5
- }
6
- async action(args) {
7
- new ZipAction().run(process.cwd(), args.folder, args.output);
8
- }
9
- }
@@ -1,9 +0,0 @@
1
- import type { UserConfig } from '@commitlint/types';
2
- /**
3
- * 基于基础配置,定义 commitlint 配置
4
- *
5
- * @export
6
- * @param {UserConfig} [config={}]
7
- * @returns {*} {UserConfig}
8
- */
9
- export declare function defineCommitlintConfig(config?: UserConfig): UserConfig;
@@ -1,28 +0,0 @@
1
- import { merge } from "lodash-es";
2
- export function defineCommitlintConfig(config = {}) {
3
- return merge(
4
- {
5
- extends: ["@commitlint/config-conventional"],
6
- rules: {
7
- "type-enum": [
8
- 2,
9
- "always",
10
- [
11
- "feat",
12
- "fix",
13
- "docs",
14
- "style",
15
- "refactor",
16
- "test",
17
- "perf",
18
- "revert",
19
- "build",
20
- "chore",
21
- "release"
22
- ]
23
- ]
24
- }
25
- },
26
- config
27
- );
28
- }
@@ -1 +0,0 @@
1
- export { defineCommitlintConfig } from './commitlint-config/commitlint-config';
@@ -1 +0,0 @@
1
- export { defineCommitlintConfig } from "./commitlint-config/commitlint-config.mjs";
@@ -1,12 +0,0 @@
1
- /**
2
- * 开发模式标识,匹配环境变量中的 NODE_ENV
3
- */
4
- export declare const DEV_MODE = "development";
5
- /**
6
- * 生产编译模式标识,匹配环境变量中的 NODE_ENV
7
- */
8
- export declare const PROD_MODE = "production";
9
- /**
10
- * 默认需要忽略编译的外部依赖
11
- */
12
- export declare const DEFAULT_EXTERNAL: string[];
@@ -1,24 +0,0 @@
1
- export const DEV_MODE = "development";
2
- export const PROD_MODE = "production";
3
- export const DEFAULT_EXTERNAL = [
4
- "vue",
5
- "vue-router",
6
- "vue-i18n",
7
- "axios",
8
- "dayjs",
9
- "lodash-es",
10
- "qs",
11
- "pinia",
12
- "vuedraggable",
13
- "sortablejs",
14
- "vue-grid-layout",
15
- "vant",
16
- "ant-design-vue",
17
- "@gct-paas/core",
18
- "@gct-paas/design",
19
- "@gct-paas/design-mobile",
20
- "@gct-paas/design-web",
21
- "@gct-paas/mobile",
22
- "@gct-paas/web",
23
- "systemjs"
24
- ];
@@ -1,9 +0,0 @@
1
- import { ConfigArray, InfiniteDepthConfigWithExtends } from 'typescript-eslint';
2
- /**
3
- * 基于基础规则,定义 eslint 配置
4
- *
5
- * @export
6
- * @param {...InfiniteDepthConfigWithExtends[]} configs
7
- * @returns {*} {ConfigArray}
8
- */
9
- export declare function defineEslintConfig(...configs: InfiniteDepthConfigWithExtends[]): ConfigArray;
@@ -1,109 +0,0 @@
1
- import eslint from "@eslint/js";
2
- import tsEslint from "typescript-eslint";
3
- import eslintPluginVue from "eslint-plugin-vue";
4
- import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
5
- import unusedImports from "eslint-plugin-unused-imports";
6
- import eslintPluginImport from "eslint-plugin-import";
7
- import globals from "globals";
8
- export function defineEslintConfig(...configs) {
9
- return tsEslint.config(
10
- /** js推荐配置 */
11
- eslint.configs.recommended,
12
- /** ts推荐配置 */
13
- tsEslint.configs.strict,
14
- tsEslint.configs.stylistic,
15
- /** vue推荐配置 */
16
- eslintPluginVue.configs["flat/recommended"],
17
- eslintPluginPrettierRecommended,
18
- eslintPluginImport.flatConfigs.recommended,
19
- eslintPluginImport.flatConfigs.warnings,
20
- eslintPluginImport.flatConfigs.errors,
21
- eslintPluginImport.flatConfigs.typescript,
22
- {
23
- ignores: [
24
- "**/node_modules",
25
- "lerna.json",
26
- "package.json",
27
- "tsconfig.json",
28
- "pnpm-lock.yaml",
29
- "pnpm-workspace.yaml",
30
- "eslint.config.mjs",
31
- "**/dist",
32
- "**/out",
33
- "**/es",
34
- "**/lib"
35
- ],
36
- files: ["**/*.ts", "**.*.tsx", "**/*.vue"],
37
- plugins: {
38
- "unused-imports": unusedImports
39
- },
40
- languageOptions: {
41
- globals: {
42
- ...globals.browser
43
- },
44
- parserOptions: {
45
- ecmaFeatures: {
46
- // 全局严格模式
47
- impliedStrict: true,
48
- // 启用 jsx
49
- jsx: true
50
- }
51
- }
52
- },
53
- rules: {
54
- // 基础配置覆盖
55
- "no-console": "off",
56
- "no-debugger": "off",
57
- "no-undef": "off",
58
- "no-plusplus": [
59
- "error",
60
- {
61
- allowForLoopAfterthoughts: true
62
- }
63
- ],
64
- "no-underscore-dangle": "off",
65
- "no-restricted-syntax": "off",
66
- "no-continue": "off",
67
- "no-unused-vars": "off",
68
- "no-extraneous-class": "off",
69
- "no-param-reassign": "off",
70
- "no-useless-constructor": "off",
71
- "no-empty-function": "off",
72
- // unused-imports 配置覆盖
73
- "unused-imports/no-unused-imports": "error",
74
- "consistent-return": "off",
75
- "func-names": "off",
76
- // import 配置覆盖
77
- "import/no-unresolved": "off",
78
- "import/extensions": "off",
79
- "import/prefer-default-export": "off",
80
- // vue 配置覆盖
81
- "vue/no-setup-props-destructure": "off",
82
- "vue/require-default-prop": "off",
83
- // typescript 配置覆盖
84
- "@typescript-eslint/no-unused-vars": [
85
- "error",
86
- {
87
- argsIgnorePattern: "^_"
88
- }
89
- ],
90
- "@typescript-eslint/no-inferrable-types": "off",
91
- "@typescript-eslint/no-explicit-any": ["error"],
92
- "@typescript-eslint/explicit-module-boundary-types": "off",
93
- "@typescript-eslint/no-non-null-assertion": "off",
94
- "@typescript-eslint/no-extraneous-class": "off",
95
- // 其他配置覆盖
96
- "class-methods-use-this": "off",
97
- "prefer-destructuring": "off"
98
- }
99
- },
100
- {
101
- name: "ts-vue-override",
102
- files: ["**/*.vue"],
103
- rules: {
104
- "@typescript-eslint/no-unused-vars": "off"
105
- }
106
- },
107
- ...configs
108
- );
109
- }
@@ -1 +0,0 @@
1
- export { defineEslintConfig } from './eslint-config/eslint-config';
@@ -1 +0,0 @@
1
- export { defineEslintConfig } from "./eslint-config/eslint-config.mjs";
@@ -1,8 +0,0 @@
1
- export * from './commitlint';
2
- export * from './eslint';
3
- export * from './prettier';
4
- export * from './rollup';
5
- export * from './stylelint';
6
- export * from './template';
7
- export * from './util';
8
- export * from './vite';
@@ -1,8 +0,0 @@
1
- export * from "./commitlint/index.mjs";
2
- export * from "./eslint/index.mjs";
3
- export * from "./prettier/index.mjs";
4
- export * from "./rollup/index.mjs";
5
- export * from "./stylelint/index.mjs";
6
- export * from "./template/index.mjs";
7
- export * from "./util/index.mjs";
8
- export * from "./vite/index.mjs";
@@ -1 +0,0 @@
1
- export { definePrettierConfig } from './prettier-config/prettier-config';
@@ -1 +0,0 @@
1
- export { definePrettierConfig } from "./prettier-config/prettier-config.mjs";