@gct-paas/build 0.1.5-dev.9 → 0.1.6-dev.2

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 (57) hide show
  1. package/dist/constants/index.cjs +12 -3
  2. package/dist/constants/index.d.ts +0 -4
  3. package/dist/eslint/eslint-config/eslint-config.cjs +1 -0
  4. package/dist/index.cjs +11 -11
  5. package/dist/index.d.ts +1 -1
  6. package/dist/vite/index.cjs +6 -0
  7. package/dist/vite/index.d.ts +1 -1
  8. package/dist/vite/vite-config/vite-base-config.cjs +2 -24
  9. package/dist/vite/vite-config/vite-config.cjs +18 -18
  10. package/dist/vite/vite-config/vite-config.d.ts +1 -0
  11. package/dist/vite/vite-config/vite-dev-config.cjs +1 -2
  12. package/dist/vite/vite-config/vite-pkg-dev-config.cjs +4 -6
  13. package/dist/vite/vite-config/vite-project-config.cjs +7 -44
  14. package/dist/vite/vite-config/vite-project-config.d.ts +1 -2
  15. package/es/constants/index.d.ts +0 -4
  16. package/es/constants/index.mjs +26 -7
  17. package/es/eslint/eslint-config/eslint-config.mjs +1 -0
  18. package/es/index.d.ts +1 -1
  19. package/es/index.mjs +1 -1
  20. package/es/vite/index.d.ts +1 -1
  21. package/es/vite/index.mjs +1 -1
  22. package/es/vite/vite-config/vite-base-config.mjs +0 -22
  23. package/es/vite/vite-config/vite-config.d.ts +1 -0
  24. package/es/vite/vite-config/vite-config.mjs +22 -18
  25. package/es/vite/vite-config/vite-dev-config.mjs +1 -2
  26. package/es/vite/vite-config/vite-pkg-dev-config.mjs +2 -5
  27. package/es/vite/vite-config/vite-project-config.d.ts +1 -2
  28. package/es/vite/vite-config/vite-project-config.mjs +8 -63
  29. package/package.json +18 -33
  30. package/dist/rollup/index.cjs +0 -35
  31. package/dist/rollup/index.d.ts +0 -3
  32. package/dist/rollup/rollup-config/build-config.cjs +0 -60
  33. package/dist/rollup/rollup-config/build-config.d.ts +0 -9
  34. package/dist/rollup/rollup-config/dev-config.cjs +0 -107
  35. package/dist/rollup/rollup-config/dev-config.d.ts +0 -9
  36. package/dist/rollup/rollup-plugins/copy-file.cjs +0 -24
  37. package/dist/rollup/rollup-plugins/copy-file.d.ts +0 -37
  38. package/dist/rollup/rollup-plugins/ignore-compiler-file.cjs +0 -23
  39. package/dist/rollup/rollup-plugins/ignore-compiler-file.d.ts +0 -8
  40. package/dist/rollup/rollup-plugins/index.cjs +0 -19
  41. package/dist/rollup/rollup-plugins/index.d.ts +0 -2
  42. package/dist/vite/gct-opts.interface.cjs +0 -1
  43. package/dist/vite/gct-opts.interface.d.ts +0 -18
  44. package/es/rollup/index.d.ts +0 -3
  45. package/es/rollup/index.mjs +0 -3
  46. package/es/rollup/rollup-config/build-config.d.ts +0 -9
  47. package/es/rollup/rollup-config/build-config.mjs +0 -67
  48. package/es/rollup/rollup-config/dev-config.d.ts +0 -9
  49. package/es/rollup/rollup-config/dev-config.mjs +0 -124
  50. package/es/rollup/rollup-plugins/copy-file.d.ts +0 -37
  51. package/es/rollup/rollup-plugins/copy-file.mjs +0 -18
  52. package/es/rollup/rollup-plugins/ignore-compiler-file.d.ts +0 -8
  53. package/es/rollup/rollup-plugins/ignore-compiler-file.mjs +0 -17
  54. package/es/rollup/rollup-plugins/index.d.ts +0 -2
  55. package/es/rollup/rollup-plugins/index.mjs +0 -2
  56. package/es/vite/gct-opts.interface.d.ts +0 -18
  57. package/es/vite/gct-opts.interface.mjs +0 -0
@@ -1,9 +0,0 @@
1
- import { RollupOptions } from 'rollup';
2
- /**
3
- * 开发包基础编译配置
4
- *
5
- * @export
6
- * @param {RollupOptions} [opts={}]
7
- * @returns {*} {RollupOptions}
8
- */
9
- export declare function defineRollupConfig(opts?: RollupOptions): RollupOptions;
@@ -1,124 +0,0 @@
1
- import { defineConfig } from "rollup";
2
- import path from "path";
3
- import { nodeResolve } from "@rollup/plugin-node-resolve";
4
- import commonjs from "@rollup/plugin-commonjs";
5
- import json from "@rollup/plugin-json";
6
- import esbuild from "rollup-plugin-esbuild";
7
- import dts from "vite-plugin-dts";
8
- import vue from "@vitejs/plugin-vue";
9
- import vueJsx from "@vitejs/plugin-vue-jsx";
10
- import * as rf from "rimraf";
11
- import cpy from "cpy";
12
- import fs from "fs-extra";
13
- import os from "os";
14
- import { copyFile, ignoreCompilerFile } from "../rollup-plugins/index.mjs";
15
- import { DEFAULT_EXTERNAL, PROD_MODE } from "../../constants/index.mjs";
16
- import { IS_NODE_MODULE, mergeConfig, winToUnixPath } from "../../util/index.mjs";
17
- export function defineRollupConfig(opts = {}) {
18
- process.on("SIGINT", () => {
19
- process.exit();
20
- });
21
- const cwd = process.cwd();
22
- const isProd = process.env.NODE_ENV === PROD_MODE;
23
- const rootDir = path.resolve(cwd, "src");
24
- const outDir = path.resolve(cwd, "es");
25
- const assetsDir = path.resolve(cwd, "public");
26
- const externalCompileFileReg = /\.(scss|css|less|d\.ts)+$/;
27
- rf.sync(outDir);
28
- if (isProd) {
29
- const isWin = os.platform() === "win32";
30
- if (isWin) {
31
- if (fs.pathExistsSync(assetsDir)) {
32
- cpy(winToUnixPath(assetsDir), winToUnixPath(outDir));
33
- }
34
- cpy(
35
- winToUnixPath(path.resolve(cwd, "src/**/*.{scss,css,less,d.ts}")),
36
- winToUnixPath(outDir)
37
- );
38
- } else {
39
- if (fs.pathExistsSync(assetsDir)) {
40
- cpy(assetsDir, outDir);
41
- }
42
- cpy(path.resolve(cwd, "src/**/*.{scss,css,less,d.ts}"), outDir);
43
- }
44
- } else {
45
- copyFile([
46
- {
47
- from: assetsDir,
48
- to: outDir
49
- },
50
- {
51
- from: rootDir,
52
- to: outDir,
53
- opts: {
54
- ignored: (file, stats) => {
55
- if (stats && stats.isFile()) {
56
- return !externalCompileFileReg.test(file);
57
- }
58
- return false;
59
- }
60
- }
61
- }
62
- ]);
63
- }
64
- const output = [
65
- {
66
- dir: outDir,
67
- esModule: true,
68
- format: "es",
69
- sourcemap: false,
70
- preserveModules: true,
71
- preserveModulesRoot: rootDir,
72
- exports: "named",
73
- entryFileNames: "[name].mjs"
74
- }
75
- ];
76
- return mergeConfig(
77
- defineConfig({
78
- input: "src/index.ts",
79
- treeshake: false,
80
- external: (id) => {
81
- if (IS_NODE_MODULE.test(id)) {
82
- return true;
83
- }
84
- if (DEFAULT_EXTERNAL.includes(id)) {
85
- return true;
86
- }
87
- return false;
88
- },
89
- output,
90
- plugins: [
91
- ignoreCompilerFile(externalCompileFileReg),
92
- json(),
93
- vue({
94
- isProduction: isProd
95
- }),
96
- vueJsx({}),
97
- nodeResolve({
98
- extensions: [".cjs", ".mjs", ".js", ".ts"]
99
- }),
100
- commonjs(),
101
- esbuild({
102
- logLevel: "verbose",
103
- sourceMap: false,
104
- target: ["esnext"],
105
- loaders: {
106
- ".vue": "ts"
107
- }
108
- }),
109
- dts({
110
- outDir: [outDir],
111
- // 排除测试目录,以及测试文件
112
- exclude: [
113
- "**/test/**",
114
- "**/*.test.ts",
115
- "**/*.test.tsx",
116
- "**/*.spec.ts",
117
- "**/*.spec.tsx"
118
- ]
119
- })
120
- ]
121
- }),
122
- opts
123
- );
124
- }
@@ -1,37 +0,0 @@
1
- import * as chokidar from 'chokidar';
2
- /**
3
- * 文件拷贝插件配置参数
4
- *
5
- * @export
6
- * @interface CopyFilePluginOptions
7
- */
8
- export interface CopyFilePluginOptions {
9
- /**
10
- * 源文件
11
- *
12
- * @type {string}
13
- * @memberof CopyFilePluginOptions
14
- */
15
- from: string;
16
- /**
17
- * 目标文件
18
- *
19
- * @type {string}
20
- * @memberof CopyFilePluginOptions
21
- */
22
- to: string;
23
- /**
24
- * chokidar watch 配置
25
- *
26
- * @type {chokidar.ChokidarOptions}
27
- */
28
- opts?: chokidar.ChokidarOptions;
29
- }
30
- /**
31
- * 文件拷贝插件,在开发模式下会监控文件变更,并自动拷贝文件
32
- *
33
- * @export
34
- * @param {CopyFilePluginOptions[]} opts
35
- * @return {*} {Plugin}
36
- */
37
- export declare function copyFile(opts: CopyFilePluginOptions[]): void;
@@ -1,18 +0,0 @@
1
- import { CopyWatch } from "../../util/index.mjs";
2
- export function copyFile(opts) {
3
- if (opts.length === 0) {
4
- return;
5
- }
6
- const arr = [];
7
- opts.forEach((opt) => {
8
- arr.push(new CopyWatch(opt.from, opt.to, opt.opts));
9
- });
10
- process.on("exit", () => {
11
- if (!opts.length) {
12
- return;
13
- }
14
- arr.forEach((item) => {
15
- item.unwatch();
16
- });
17
- });
18
- }
@@ -1,8 +0,0 @@
1
- import { Plugin } from 'rollup';
2
- /**
3
- * 忽略编译的文件类型
4
- *
5
- * @export
6
- * @returns {*} {Plugin}
7
- */
8
- export declare function ignoreCompilerFile(extReg: RegExp): Plugin;
@@ -1,17 +0,0 @@
1
- export function ignoreCompilerFile(extReg) {
2
- return {
3
- name: "gct:ignore-compiler-file",
4
- resolveId(source) {
5
- if (extReg.test(source)) {
6
- return {
7
- id: source,
8
- external: true
9
- };
10
- }
11
- return null;
12
- },
13
- load() {
14
- return null;
15
- }
16
- };
17
- }
@@ -1,2 +0,0 @@
1
- export { copyFile } from './copy-file';
2
- export { ignoreCompilerFile } from './ignore-compiler-file';
@@ -1,2 +0,0 @@
1
- export { copyFile } from "./copy-file.mjs";
2
- export { ignoreCompilerFile } from "./ignore-compiler-file.mjs";
@@ -1,18 +0,0 @@
1
- /**
2
- * 项目自定义配置接口
3
- *
4
- * @author chitanda
5
- * @date 2025-08-24 11:08:43
6
- * @export
7
- * @interface GctOpts
8
- */
9
- export interface GctOpts {
10
- /**
11
- * HTTP 代理配置,根据分支前缀匹配
12
- *
13
- * @author chitanda
14
- * @date 2025-08-24 11:08:56
15
- * @type {Record<string, string>}
16
- */
17
- httpProxyConfig: Record<string, string>;
18
- }
File without changes