virmator 6.7.0 → 7.0.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/configs/configs/vite.config.ts +2 -5
- package/configs/npmignore.txt +1 -1
- package/configs/{index.html → src/index.html} +1 -1
- package/configs/src/ui/elements/vir-app.element.ts +10 -0
- package/dist/api/command/define-command-inputs.d.ts +9 -1
- package/dist/api/command/define-command-inputs.js +6 -0
- package/dist/api/run-command/check-npm-deps.js +12 -21
- package/dist/commands/code-in-markdown.command.d.ts +22 -6
- package/dist/commands/code-in-markdown.command.js +4 -1
- package/dist/commands/compile.command.d.ts +22 -6
- package/dist/commands/compile.command.js +4 -1
- package/dist/commands/extra-configs/all-extra-configs.js +8 -4
- package/dist/commands/format.command.d.ts +127 -6
- package/dist/commands/format.command.js +9 -8
- package/dist/commands/frontend.command.d.ts +97 -6
- package/dist/commands/frontend.command.js +17 -9
- package/dist/commands/init.command.d.ts +125 -5
- package/dist/commands/spellcheck.command.d.ts +22 -6
- package/dist/commands/spellcheck.command.js +4 -1
- package/dist/commands/test-web.command.d.ts +127 -6
- package/dist/commands/test-web.command.js +9 -8
- package/dist/commands/test.command.d.ts +142 -6
- package/dist/commands/test.command.js +10 -9
- package/dist/commands/upgrade-deps.command.d.ts +37 -6
- package/dist/commands/upgrade-deps.command.js +3 -2
- package/dist/compiled-base-configs/base-vite.d.ts +14 -4
- package/dist/compiled-base-configs/base-vite.js +73 -10
- package/dist/index.d.ts +705 -45
- package/package.json +6 -5
- /package/configs/{public → www-static}/index.css +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { NpmDepTypeEnum } from '../api/command/define-command-inputs';
|
|
1
2
|
export declare const testCommandDefinition: {
|
|
2
3
|
commandName: "test";
|
|
3
4
|
subCommandDescriptions: {
|
|
@@ -13,10 +14,37 @@ export declare const testCommandDefinition: {
|
|
|
13
14
|
readonly copyToPathRelativeToRepoDir: string;
|
|
14
15
|
};
|
|
15
16
|
};
|
|
16
|
-
npmDeps: readonly [
|
|
17
|
+
npmDeps: readonly [{
|
|
18
|
+
readonly name: "@electrovir/nyc";
|
|
19
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
20
|
+
}, {
|
|
21
|
+
readonly name: "@istanbuljs/nyc-config-typescript";
|
|
22
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
23
|
+
}, {
|
|
24
|
+
readonly name: "@types/chai";
|
|
25
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
26
|
+
}, {
|
|
27
|
+
readonly name: "@types/mocha";
|
|
28
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
29
|
+
}, {
|
|
30
|
+
readonly name: "chai";
|
|
31
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
32
|
+
}, {
|
|
33
|
+
readonly name: "istanbul-smart-text-reporter";
|
|
34
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
35
|
+
}, {
|
|
36
|
+
readonly name: "mocha-spec-reporter-with-file-names";
|
|
37
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
38
|
+
}, {
|
|
39
|
+
readonly name: "mocha";
|
|
40
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
41
|
+
}, {
|
|
42
|
+
readonly name: "ts-node";
|
|
43
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
44
|
+
}];
|
|
17
45
|
} & {
|
|
18
46
|
allAvailableSubCommands: readonly "coverage"[];
|
|
19
|
-
subCommands: import("
|
|
47
|
+
subCommands: import("../api/command/define-command-inputs").SubCommandsMap<{
|
|
20
48
|
commandName: "test";
|
|
21
49
|
subCommandDescriptions: {
|
|
22
50
|
readonly coverage: "run tests with code coverage calculations. This will often result in incorrect stack traces on errors, so this is only recommended after having first gotten all tests to pass without coverage calculations.";
|
|
@@ -31,7 +59,34 @@ export declare const testCommandDefinition: {
|
|
|
31
59
|
readonly copyToPathRelativeToRepoDir: string;
|
|
32
60
|
};
|
|
33
61
|
};
|
|
34
|
-
npmDeps: readonly [
|
|
62
|
+
npmDeps: readonly [{
|
|
63
|
+
readonly name: "@electrovir/nyc";
|
|
64
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
65
|
+
}, {
|
|
66
|
+
readonly name: "@istanbuljs/nyc-config-typescript";
|
|
67
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
68
|
+
}, {
|
|
69
|
+
readonly name: "@types/chai";
|
|
70
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
71
|
+
}, {
|
|
72
|
+
readonly name: "@types/mocha";
|
|
73
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
74
|
+
}, {
|
|
75
|
+
readonly name: "chai";
|
|
76
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
77
|
+
}, {
|
|
78
|
+
readonly name: "istanbul-smart-text-reporter";
|
|
79
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
80
|
+
}, {
|
|
81
|
+
readonly name: "mocha-spec-reporter-with-file-names";
|
|
82
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
83
|
+
}, {
|
|
84
|
+
readonly name: "mocha";
|
|
85
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
86
|
+
}, {
|
|
87
|
+
readonly name: "ts-node";
|
|
88
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
89
|
+
}];
|
|
35
90
|
}>;
|
|
36
91
|
} & {
|
|
37
92
|
executor: import("..").CommandExecutor<{
|
|
@@ -49,7 +104,34 @@ export declare const testCommandDefinition: {
|
|
|
49
104
|
readonly copyToPathRelativeToRepoDir: string;
|
|
50
105
|
};
|
|
51
106
|
};
|
|
52
|
-
npmDeps: readonly [
|
|
107
|
+
npmDeps: readonly [{
|
|
108
|
+
readonly name: "@electrovir/nyc";
|
|
109
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
110
|
+
}, {
|
|
111
|
+
readonly name: "@istanbuljs/nyc-config-typescript";
|
|
112
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
113
|
+
}, {
|
|
114
|
+
readonly name: "@types/chai";
|
|
115
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
116
|
+
}, {
|
|
117
|
+
readonly name: "@types/mocha";
|
|
118
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
119
|
+
}, {
|
|
120
|
+
readonly name: "chai";
|
|
121
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
122
|
+
}, {
|
|
123
|
+
readonly name: "istanbul-smart-text-reporter";
|
|
124
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
125
|
+
}, {
|
|
126
|
+
readonly name: "mocha-spec-reporter-with-file-names";
|
|
127
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
128
|
+
}, {
|
|
129
|
+
readonly name: "mocha";
|
|
130
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
131
|
+
}, {
|
|
132
|
+
readonly name: "ts-node";
|
|
133
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
134
|
+
}];
|
|
53
135
|
}>;
|
|
54
136
|
createDescription: import("..").CreateDescriptionsCallback<{
|
|
55
137
|
commandName: "test";
|
|
@@ -66,7 +148,34 @@ export declare const testCommandDefinition: {
|
|
|
66
148
|
readonly copyToPathRelativeToRepoDir: string;
|
|
67
149
|
};
|
|
68
150
|
};
|
|
69
|
-
npmDeps: readonly [
|
|
151
|
+
npmDeps: readonly [{
|
|
152
|
+
readonly name: "@electrovir/nyc";
|
|
153
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
154
|
+
}, {
|
|
155
|
+
readonly name: "@istanbuljs/nyc-config-typescript";
|
|
156
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
157
|
+
}, {
|
|
158
|
+
readonly name: "@types/chai";
|
|
159
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
160
|
+
}, {
|
|
161
|
+
readonly name: "@types/mocha";
|
|
162
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
163
|
+
}, {
|
|
164
|
+
readonly name: "chai";
|
|
165
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
166
|
+
}, {
|
|
167
|
+
readonly name: "istanbul-smart-text-reporter";
|
|
168
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
169
|
+
}, {
|
|
170
|
+
readonly name: "mocha-spec-reporter-with-file-names";
|
|
171
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
172
|
+
}, {
|
|
173
|
+
readonly name: "mocha";
|
|
174
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
175
|
+
}, {
|
|
176
|
+
readonly name: "ts-node";
|
|
177
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
178
|
+
}];
|
|
70
179
|
}>;
|
|
71
180
|
extend: import("../api/command/define-command").ExtendCallback<{
|
|
72
181
|
commandName: "test";
|
|
@@ -83,6 +192,33 @@ export declare const testCommandDefinition: {
|
|
|
83
192
|
readonly copyToPathRelativeToRepoDir: string;
|
|
84
193
|
};
|
|
85
194
|
};
|
|
86
|
-
npmDeps: readonly [
|
|
195
|
+
npmDeps: readonly [{
|
|
196
|
+
readonly name: "@electrovir/nyc";
|
|
197
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
198
|
+
}, {
|
|
199
|
+
readonly name: "@istanbuljs/nyc-config-typescript";
|
|
200
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
201
|
+
}, {
|
|
202
|
+
readonly name: "@types/chai";
|
|
203
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
204
|
+
}, {
|
|
205
|
+
readonly name: "@types/mocha";
|
|
206
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
207
|
+
}, {
|
|
208
|
+
readonly name: "chai";
|
|
209
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
210
|
+
}, {
|
|
211
|
+
readonly name: "istanbul-smart-text-reporter";
|
|
212
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
213
|
+
}, {
|
|
214
|
+
readonly name: "mocha-spec-reporter-with-file-names";
|
|
215
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
216
|
+
}, {
|
|
217
|
+
readonly name: "mocha";
|
|
218
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
219
|
+
}, {
|
|
220
|
+
readonly name: "ts-node";
|
|
221
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
222
|
+
}];
|
|
87
223
|
}>;
|
|
88
224
|
};
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.testCommandDefinition = void 0;
|
|
4
4
|
const path_1 = require("path");
|
|
5
5
|
const define_command_1 = require("../api/command/define-command");
|
|
6
|
+
const define_command_inputs_1 = require("../api/command/define-command-inputs");
|
|
6
7
|
const package_paths_1 = require("../file-paths/package-paths");
|
|
7
8
|
exports.testCommandDefinition = (0, define_command_1.defineCommand)({
|
|
8
9
|
commandName: 'test',
|
|
@@ -20,15 +21,15 @@ exports.testCommandDefinition = (0, define_command_1.defineCommand)({
|
|
|
20
21
|
},
|
|
21
22
|
},
|
|
22
23
|
npmDeps: [
|
|
23
|
-
'@electrovir/nyc',
|
|
24
|
-
'@istanbuljs/nyc-config-typescript',
|
|
25
|
-
'@types/chai',
|
|
26
|
-
'@types/mocha',
|
|
27
|
-
'chai',
|
|
28
|
-
'istanbul-smart-text-reporter',
|
|
29
|
-
'mocha-spec-reporter-with-file-names',
|
|
30
|
-
'mocha',
|
|
31
|
-
'ts-node',
|
|
24
|
+
{ name: '@electrovir/nyc', type: define_command_inputs_1.NpmDepTypeEnum.Dev },
|
|
25
|
+
{ name: '@istanbuljs/nyc-config-typescript', type: define_command_inputs_1.NpmDepTypeEnum.Dev },
|
|
26
|
+
{ name: '@types/chai', type: define_command_inputs_1.NpmDepTypeEnum.Dev },
|
|
27
|
+
{ name: '@types/mocha', type: define_command_inputs_1.NpmDepTypeEnum.Dev },
|
|
28
|
+
{ name: 'chai', type: define_command_inputs_1.NpmDepTypeEnum.Dev },
|
|
29
|
+
{ name: 'istanbul-smart-text-reporter', type: define_command_inputs_1.NpmDepTypeEnum.Dev },
|
|
30
|
+
{ name: 'mocha-spec-reporter-with-file-names', type: define_command_inputs_1.NpmDepTypeEnum.Dev },
|
|
31
|
+
{ name: 'mocha', type: define_command_inputs_1.NpmDepTypeEnum.Dev },
|
|
32
|
+
{ name: 'ts-node', type: define_command_inputs_1.NpmDepTypeEnum.Dev },
|
|
32
33
|
],
|
|
33
34
|
}, ({ commandName, packageBinName }) => {
|
|
34
35
|
return {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { NpmDepTypeEnum } from '../api/command/define-command-inputs';
|
|
1
2
|
export declare const upgradeDepsCommandDefinition: {
|
|
2
3
|
commandName: "upgrade-deps";
|
|
3
4
|
subCommandDescriptions: {};
|
|
@@ -7,10 +8,16 @@ export declare const upgradeDepsCommandDefinition: {
|
|
|
7
8
|
readonly copyToPathRelativeToRepoDir: string;
|
|
8
9
|
};
|
|
9
10
|
};
|
|
10
|
-
npmDeps: readonly [
|
|
11
|
+
npmDeps: readonly [{
|
|
12
|
+
readonly name: "esbuild";
|
|
13
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
14
|
+
}, {
|
|
15
|
+
readonly name: "npm-check-updates";
|
|
16
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
17
|
+
}];
|
|
11
18
|
} & {
|
|
12
19
|
allAvailableSubCommands: readonly never[];
|
|
13
|
-
subCommands: import("
|
|
20
|
+
subCommands: import("../api/command/define-command-inputs").SubCommandsMap<{
|
|
14
21
|
commandName: "upgrade-deps";
|
|
15
22
|
subCommandDescriptions: {};
|
|
16
23
|
configFiles: {
|
|
@@ -19,7 +26,13 @@ export declare const upgradeDepsCommandDefinition: {
|
|
|
19
26
|
readonly copyToPathRelativeToRepoDir: string;
|
|
20
27
|
};
|
|
21
28
|
};
|
|
22
|
-
npmDeps: readonly [
|
|
29
|
+
npmDeps: readonly [{
|
|
30
|
+
readonly name: "esbuild";
|
|
31
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
32
|
+
}, {
|
|
33
|
+
readonly name: "npm-check-updates";
|
|
34
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
35
|
+
}];
|
|
23
36
|
}>;
|
|
24
37
|
} & {
|
|
25
38
|
executor: import("..").CommandExecutor<{
|
|
@@ -31,7 +44,13 @@ export declare const upgradeDepsCommandDefinition: {
|
|
|
31
44
|
readonly copyToPathRelativeToRepoDir: string;
|
|
32
45
|
};
|
|
33
46
|
};
|
|
34
|
-
npmDeps: readonly [
|
|
47
|
+
npmDeps: readonly [{
|
|
48
|
+
readonly name: "esbuild";
|
|
49
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
50
|
+
}, {
|
|
51
|
+
readonly name: "npm-check-updates";
|
|
52
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
53
|
+
}];
|
|
35
54
|
}>;
|
|
36
55
|
createDescription: import("..").CreateDescriptionsCallback<{
|
|
37
56
|
commandName: "upgrade-deps";
|
|
@@ -42,7 +61,13 @@ export declare const upgradeDepsCommandDefinition: {
|
|
|
42
61
|
readonly copyToPathRelativeToRepoDir: string;
|
|
43
62
|
};
|
|
44
63
|
};
|
|
45
|
-
npmDeps: readonly [
|
|
64
|
+
npmDeps: readonly [{
|
|
65
|
+
readonly name: "esbuild";
|
|
66
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
67
|
+
}, {
|
|
68
|
+
readonly name: "npm-check-updates";
|
|
69
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
70
|
+
}];
|
|
46
71
|
}>;
|
|
47
72
|
extend: import("../api/command/define-command").ExtendCallback<{
|
|
48
73
|
commandName: "upgrade-deps";
|
|
@@ -53,6 +78,12 @@ export declare const upgradeDepsCommandDefinition: {
|
|
|
53
78
|
readonly copyToPathRelativeToRepoDir: string;
|
|
54
79
|
};
|
|
55
80
|
};
|
|
56
|
-
npmDeps: readonly [
|
|
81
|
+
npmDeps: readonly [{
|
|
82
|
+
readonly name: "esbuild";
|
|
83
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
84
|
+
}, {
|
|
85
|
+
readonly name: "npm-check-updates";
|
|
86
|
+
readonly type: NpmDepTypeEnum.Dev;
|
|
87
|
+
}];
|
|
57
88
|
}>;
|
|
58
89
|
};
|
|
@@ -29,6 +29,7 @@ const node_js_1 = require("@augment-vir/node-js");
|
|
|
29
29
|
const promises_1 = require("fs/promises");
|
|
30
30
|
const path_1 = require("path");
|
|
31
31
|
const define_command_1 = require("../api/command/define-command");
|
|
32
|
+
const define_command_inputs_1 = require("../api/command/define-command-inputs");
|
|
32
33
|
const package_paths_1 = require("./../file-paths/package-paths");
|
|
33
34
|
exports.upgradeDepsCommandDefinition = (0, define_command_1.defineCommand)({
|
|
34
35
|
commandName: 'upgrade-deps',
|
|
@@ -40,8 +41,8 @@ exports.upgradeDepsCommandDefinition = (0, define_command_1.defineCommand)({
|
|
|
40
41
|
},
|
|
41
42
|
},
|
|
42
43
|
npmDeps: [
|
|
43
|
-
'esbuild',
|
|
44
|
-
'npm-check-updates',
|
|
44
|
+
{ name: 'esbuild', type: define_command_inputs_1.NpmDepTypeEnum.Dev },
|
|
45
|
+
{ name: 'npm-check-updates', type: define_command_inputs_1.NpmDepTypeEnum.Dev },
|
|
45
46
|
],
|
|
46
47
|
}, ({ commandName, packageBinName }) => {
|
|
47
48
|
return {
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { MaybePromise } from '@augment-vir/common';
|
|
2
|
+
import { UserConfig, UserConfigExport } from 'vite';
|
|
3
|
+
export declare const basePlugins: readonly [import("vite").PluginOption, import("vite").Plugin];
|
|
4
|
+
export declare const currentDir: string;
|
|
5
|
+
export declare const srcDir: string;
|
|
6
|
+
export declare const staticDir: string;
|
|
7
|
+
export declare const outDir: string;
|
|
8
|
+
export declare function findGitRepoRoot(dir?: string): string;
|
|
9
|
+
export type BaseConfigOptions = {
|
|
10
|
+
/** If your prod deploy is going to be GitHub pages, set this to true. */
|
|
11
|
+
forGitHubPages: boolean;
|
|
5
12
|
};
|
|
13
|
+
export declare function createBaseConfig({ forGitHubPages }: BaseConfigOptions): UserConfig;
|
|
14
|
+
export declare function combineConfigs(baseConfigOptions: BaseConfigOptions, overrideConfigInput: MaybePromise<UserConfig>): Promise<UserConfig>;
|
|
15
|
+
export declare function defineConfig(baseConfigOptions: BaseConfigOptions, configOverride: UserConfigExport): UserConfigExport;
|
|
@@ -3,14 +3,77 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.defineConfig = exports.combineConfigs = exports.createBaseConfig = exports.findGitRepoRoot = exports.outDir = exports.staticDir = exports.srcDir = exports.currentDir = exports.basePlugins = void 0;
|
|
7
|
+
const node_js_1 = require("@augment-vir/node-js");
|
|
8
|
+
const fs_1 = require("fs");
|
|
9
|
+
const path_1 = require("path");
|
|
10
|
+
const vite_always_reload_plugin_1 = require("virmator/dist/compiled-base-configs/vite-always-reload-plugin");
|
|
7
11
|
const vite_tsconfig_paths_1 = __importDefault(require("vite-tsconfig-paths"));
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
exports.basePlugins = [
|
|
13
|
+
(0, vite_always_reload_plugin_1.alwaysReloadPlugin)(),
|
|
14
|
+
(0, vite_tsconfig_paths_1.default)(),
|
|
15
|
+
];
|
|
16
|
+
exports.currentDir = process.cwd();
|
|
17
|
+
exports.srcDir = (0, path_1.join)(exports.currentDir, 'src');
|
|
18
|
+
exports.staticDir = (0, path_1.join)(exports.currentDir, 'www-static');
|
|
19
|
+
exports.outDir = (0, path_1.join)(exports.currentDir, 'dist');
|
|
20
|
+
function findGitRepoRoot(dir = exports.currentDir) {
|
|
21
|
+
if ((0, fs_1.existsSync)((0, path_1.join)(dir, '.git'))) {
|
|
22
|
+
return dir;
|
|
23
|
+
}
|
|
24
|
+
const nextDir = (0, path_1.dirname)(dir);
|
|
25
|
+
if (nextDir === dir) {
|
|
26
|
+
// failed to find an ancestor dir with a .git folder
|
|
27
|
+
return '';
|
|
28
|
+
}
|
|
29
|
+
return findGitRepoRoot(nextDir);
|
|
30
|
+
}
|
|
31
|
+
exports.findGitRepoRoot = findGitRepoRoot;
|
|
32
|
+
function createBaseConfig({ forGitHubPages }) {
|
|
33
|
+
const githubPagesConfig = forGitHubPages
|
|
34
|
+
? {
|
|
35
|
+
base: process.env.CI
|
|
36
|
+
? /** So GitHub Pages will work. */ (0, path_1.basename)(findGitRepoRoot())
|
|
37
|
+
: '',
|
|
38
|
+
}
|
|
39
|
+
: {};
|
|
40
|
+
return {
|
|
41
|
+
clearScreen: false,
|
|
42
|
+
...githubPagesConfig,
|
|
43
|
+
publicDir: exports.staticDir,
|
|
44
|
+
root: exports.srcDir,
|
|
45
|
+
plugins: [
|
|
46
|
+
...exports.basePlugins,
|
|
47
|
+
],
|
|
48
|
+
build: {
|
|
49
|
+
outDir: exports.outDir,
|
|
50
|
+
emptyOutDir: true,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
exports.createBaseConfig = createBaseConfig;
|
|
55
|
+
async function combineConfigs(baseConfigOptions, overrideConfigInput) {
|
|
56
|
+
const baseConfig = createBaseConfig(baseConfigOptions);
|
|
57
|
+
const overrideConfig = await overrideConfigInput;
|
|
58
|
+
const fullConfig = {
|
|
59
|
+
...baseConfig,
|
|
60
|
+
...overrideConfig,
|
|
61
|
+
};
|
|
62
|
+
node_js_1.log.faint(`public dir: ${node_js_1.logColors.info}${(0, path_1.relative)(process.cwd(), fullConfig.publicDir || '')}${node_js_1.logColors.reset}`);
|
|
63
|
+
node_js_1.log.faint(`root dir: ${node_js_1.logColors.info}${(0, path_1.relative)(process.cwd(), fullConfig.root || '')}${node_js_1.logColors.reset}`);
|
|
64
|
+
node_js_1.log.faint(`out dir: ${node_js_1.logColors.info}${(0, path_1.relative)(process.cwd(), fullConfig.build?.outDir || '')}${node_js_1.logColors.reset}`);
|
|
65
|
+
node_js_1.log.faint(`base path: ${node_js_1.logColors.info}${(0, path_1.relative)(process.cwd(), fullConfig.base || '')}${node_js_1.logColors.reset}`);
|
|
66
|
+
return fullConfig;
|
|
67
|
+
}
|
|
68
|
+
exports.combineConfigs = combineConfigs;
|
|
69
|
+
function defineConfig(baseConfigOptions, configOverride) {
|
|
70
|
+
if (typeof configOverride === 'function') {
|
|
71
|
+
return (envConfig) => {
|
|
72
|
+
return combineConfigs(baseConfigOptions, configOverride(envConfig));
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
return combineConfigs(baseConfigOptions, configOverride);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.defineConfig = defineConfig;
|