esa-cli 0.0.2-beta.12 → 0.0.2-beta.13
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/commands/commit/index.js +20 -119
- package/dist/commands/commit/prodBuild.js +2 -3
- package/dist/commands/common/routineUtils.js +276 -0
- package/dist/commands/config.js +1 -1
- package/dist/commands/deploy/helper.js +31 -36
- package/dist/commands/deploy/index.js +78 -165
- package/dist/commands/deployments/delete.js +31 -6
- package/dist/commands/deployments/index.js +3 -3
- package/dist/commands/deployments/list.js +18 -27
- package/dist/commands/dev/build.js +3 -3
- package/dist/commands/dev/doProcess.js +5 -5
- package/dist/commands/dev/ew2/devPack.js +17 -8
- package/dist/commands/dev/ew2/mock/kv.js +2 -2
- package/dist/commands/dev/ew2/server.js +13 -10
- package/dist/commands/dev/index.js +12 -12
- package/dist/commands/dev/mockWorker/devPack.js +16 -7
- package/dist/commands/dev/mockWorker/server.js +7 -6
- package/dist/commands/domain/add.js +3 -3
- package/dist/commands/domain/delete.js +3 -3
- package/dist/commands/domain/index.js +3 -3
- package/dist/commands/domain/list.js +7 -7
- package/dist/commands/init/helper.js +59 -9
- package/dist/commands/init/index.js +416 -76
- package/dist/commands/init/template.jsonc +34 -0
- package/dist/commands/lang.js +2 -2
- package/dist/commands/login/index.js +9 -5
- package/dist/commands/logout.js +6 -6
- package/dist/commands/route/add.js +134 -43
- package/dist/commands/route/delete.js +6 -6
- package/dist/commands/route/index.js +3 -3
- package/dist/commands/route/list.js +4 -4
- package/dist/commands/routine/delete.js +2 -2
- package/dist/commands/routine/index.js +3 -3
- package/dist/commands/routine/list.js +5 -16
- package/dist/commands/site/index.js +2 -2
- package/dist/commands/site/list.js +6 -7
- package/dist/commands/utils.js +55 -19
- package/dist/components/descriptionInput.js +1 -1
- package/dist/components/mutiSelectTable.js +1 -1
- package/dist/components/selectInput.js +2 -3
- package/dist/components/selectItem.js +1 -1
- package/dist/docs/Commands_en.md +12 -16
- package/dist/docs/Commands_zh_CN.md +12 -16
- package/dist/docs/eslint-config-en.md +1 -0
- package/dist/docs/eslint-config.md +73 -0
- package/dist/docs/init-command-quick-test.md +208 -0
- package/dist/docs/init-command-test-guide.md +598 -0
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/locales.json +161 -9
- package/dist/index.js +11 -11
- package/dist/libs/apiService.js +177 -14
- package/dist/libs/git/index.js +8 -4
- package/dist/libs/logger.js +63 -7
- package/dist/libs/service.js +2 -2
- package/dist/libs/templates/index.js +1 -1
- package/dist/utils/checkAssetsExist.js +80 -0
- package/dist/utils/checkDevPort.js +3 -17
- package/dist/utils/checkEntryFileExist.js +10 -0
- package/dist/utils/checkIsRoutineCreated.js +17 -16
- package/dist/utils/checkVersion.js +1 -1
- package/dist/utils/compress.js +80 -0
- package/dist/utils/download.js +5 -5
- package/dist/utils/fileMd5.js +1 -1
- package/dist/utils/fileUtils/index.js +71 -22
- package/dist/utils/installDeno.js +3 -3
- package/dist/utils/installEw2.js +7 -7
- package/dist/utils/openInBrowser.js +1 -1
- package/package.json +9 -3
- package/dist/docs/Dev_en.md +0 -0
- package/dist/docs/Dev_zh_CN.md +0 -0
|
@@ -10,21 +10,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { exec } from 'child_process';
|
|
11
11
|
import { isIP } from 'net';
|
|
12
12
|
import chokidar from 'chokidar';
|
|
13
|
-
import doProcess from './doProcess.js';
|
|
14
|
-
import { getProjectConfig, generateConfigFile, getDevConf } from '../../utils/fileUtils/index.js';
|
|
15
|
-
import { getRoot } from '../../utils/fileUtils/base.js';
|
|
16
13
|
import SelectItems from '../../components/selectInput.js';
|
|
17
|
-
import logger from '../../libs/logger.js';
|
|
18
|
-
import MockServer from './mockWorker/server.js';
|
|
19
|
-
import mockPack from './mockWorker/devPack.js';
|
|
20
|
-
import Ew2Server from './ew2/server.js';
|
|
21
|
-
import ew2Pack from './ew2/devPack.js';
|
|
22
|
-
import { preCheckDeno } from '../../utils/installDeno.js';
|
|
23
|
-
import { preCheckEw2 } from '../../utils/installEw2.js';
|
|
24
|
-
import debounce from '../../utils/debounce.js';
|
|
25
14
|
import t from '../../i18n/index.js';
|
|
15
|
+
import logger from '../../libs/logger.js';
|
|
26
16
|
import checkAndInputPort from '../../utils/checkDevPort.js';
|
|
27
17
|
import { checkOS, Platforms } from '../../utils/checkOS.js';
|
|
18
|
+
import debounce from '../../utils/debounce.js';
|
|
19
|
+
import { getRoot } from '../../utils/fileUtils/base.js';
|
|
20
|
+
import { getProjectConfig, generateConfigFile, getDevConf } from '../../utils/fileUtils/index.js';
|
|
21
|
+
import { preCheckDeno } from '../../utils/installDeno.js';
|
|
22
|
+
import { preCheckEw2 } from '../../utils/installEw2.js';
|
|
23
|
+
import doProcess from './doProcess.js';
|
|
24
|
+
import ew2Pack from './ew2/devPack.js';
|
|
25
|
+
import Ew2Server from './ew2/server.js';
|
|
26
|
+
import mockPack from './mockWorker/devPack.js';
|
|
27
|
+
import MockServer from './mockWorker/server.js';
|
|
28
28
|
let yargsIns;
|
|
29
29
|
const OS = checkOS();
|
|
30
30
|
const EW2OS = [Platforms.AppleArm, Platforms.AppleIntel, Platforms.LinuxX86];
|
|
@@ -221,7 +221,7 @@ const dev = {
|
|
|
221
221
|
const { waitUntilExit } = devElement;
|
|
222
222
|
yield waitUntilExit();
|
|
223
223
|
function onWorkerClosed() {
|
|
224
|
-
exit
|
|
224
|
+
exit === null || exit === void 0 ? void 0 : exit();
|
|
225
225
|
}
|
|
226
226
|
watcher.close();
|
|
227
227
|
})
|
|
@@ -7,14 +7,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import path from 'path';
|
|
11
10
|
import fs from 'fs';
|
|
12
|
-
import
|
|
13
|
-
import devBuild from '../build.js';
|
|
11
|
+
import path from 'path';
|
|
14
12
|
import t from '../../../i18n/index.js';
|
|
15
|
-
import
|
|
16
|
-
import { getRoot, getDirName } from '../../../utils/fileUtils/base.js';
|
|
13
|
+
import logger from '../../../libs/logger.js';
|
|
17
14
|
import { checkPort } from '../../../utils/checkDevPort.js';
|
|
15
|
+
import { getRoot, getDirName } from '../../../utils/fileUtils/base.js';
|
|
16
|
+
import { getDevConf } from '../../../utils/fileUtils/index.js';
|
|
17
|
+
import devBuild from '../build.js';
|
|
18
18
|
const generateEntry = (id, projectEntry, userRoot) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
19
|
const __dirname = getDirName(import.meta.url);
|
|
20
20
|
const devDir = path.resolve(userRoot, '.dev');
|
|
@@ -78,10 +78,19 @@ const prepare = (configPath, entry, port, localUpstream, userRoot) => __awaiter(
|
|
|
78
78
|
const devPack = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
79
79
|
logger.ora.start('Processing...\n');
|
|
80
80
|
const userRoot = getRoot();
|
|
81
|
-
|
|
81
|
+
// Try to find config file in order of preference: .jsonc, .toml
|
|
82
|
+
const configFormats = ['esa.jsonc', 'esa.toml'];
|
|
83
|
+
let configPath = null;
|
|
84
|
+
for (const format of configFormats) {
|
|
85
|
+
const testPath = path.resolve(userRoot, format);
|
|
86
|
+
if (fs.existsSync(testPath)) {
|
|
87
|
+
configPath = testPath;
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
82
91
|
let port, minify, localUpstream, entry;
|
|
83
92
|
let projectEntry = path.resolve(userRoot, 'src/index.js');
|
|
84
|
-
if (
|
|
93
|
+
if (configPath) {
|
|
85
94
|
port = getDevConf('port', 'dev', 18080);
|
|
86
95
|
minify = getDevConf('minify', 'dev', false);
|
|
87
96
|
localUpstream = getDevConf('localUpstream', 'dev', '');
|
|
@@ -7,12 +7,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import spawn from 'cross-spawn';
|
|
11
|
-
import logger from '../../../libs/logger.js';
|
|
12
10
|
import path from 'path';
|
|
11
|
+
import spawn from 'cross-spawn';
|
|
13
12
|
import t from '../../../i18n/index.js';
|
|
14
|
-
import
|
|
13
|
+
import logger from '../../../libs/logger.js';
|
|
15
14
|
import { getRoot } from '../../../utils/fileUtils/base.js';
|
|
15
|
+
import { getDevConf } from '../../../utils/fileUtils/index.js';
|
|
16
16
|
class MockWorkerServer {
|
|
17
17
|
constructor(props) {
|
|
18
18
|
this.instance = null;
|
|
@@ -63,10 +63,11 @@ class MockWorkerServer {
|
|
|
63
63
|
logger.subError(chunk.toString().trim());
|
|
64
64
|
}
|
|
65
65
|
errorHandler(err) {
|
|
66
|
+
var _a;
|
|
66
67
|
logger.error(err.message ? err.message : err);
|
|
67
|
-
this.instance
|
|
68
|
+
(_a = this.instance) === null || _a === void 0 ? void 0 : _a.kill();
|
|
68
69
|
}
|
|
69
|
-
closeHandler(
|
|
70
|
+
closeHandler() {
|
|
70
71
|
if (this.restarting) {
|
|
71
72
|
this.restarting = false;
|
|
72
73
|
return;
|
|
@@ -86,7 +87,7 @@ class MockWorkerServer {
|
|
|
86
87
|
resolve(false);
|
|
87
88
|
return;
|
|
88
89
|
}
|
|
89
|
-
const onExit = (
|
|
90
|
+
const onExit = () => {
|
|
90
91
|
this.instance = null;
|
|
91
92
|
resolve(true);
|
|
92
93
|
};
|
|
@@ -7,14 +7,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { bindRoutineWithDomain, checkDirectory, checkIsLoginSuccess, validDomain, validName } from '../utils.js';
|
|
11
|
-
import { getProjectConfig } from '../../utils/fileUtils/index.js';
|
|
12
10
|
import t from '../../i18n/index.js';
|
|
13
11
|
import logger from '../../libs/logger.js';
|
|
14
12
|
import { validRoutine } from '../../utils/checkIsRoutineCreated.js';
|
|
13
|
+
import { getProjectConfig } from '../../utils/fileUtils/index.js';
|
|
14
|
+
import { bindRoutineWithDomain, checkDirectory, checkIsLoginSuccess, validDomain, validName } from '../utils.js';
|
|
15
15
|
const addDomain = {
|
|
16
16
|
command: 'add <domain>',
|
|
17
|
-
describe:
|
|
17
|
+
describe: `📥 ${t('domain_add_describe').d('Bind a domain to a routine')}`,
|
|
18
18
|
builder: (yargs) => {
|
|
19
19
|
return yargs
|
|
20
20
|
.positional('domain', {
|
|
@@ -7,12 +7,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { getProjectConfig } from '../../utils/fileUtils/index.js';
|
|
11
|
-
import { checkDirectory, checkIsLoginSuccess } from '../utils.js';
|
|
12
|
-
import { ApiService } from '../../libs/apiService.js';
|
|
13
10
|
import t from '../../i18n/index.js';
|
|
11
|
+
import { ApiService } from '../../libs/apiService.js';
|
|
14
12
|
import logger from '../../libs/logger.js';
|
|
15
13
|
import { validRoutine } from '../../utils/checkIsRoutineCreated.js';
|
|
14
|
+
import { getProjectConfig } from '../../utils/fileUtils/index.js';
|
|
15
|
+
import { checkDirectory, checkIsLoginSuccess } from '../utils.js';
|
|
16
16
|
const deleteDomain = {
|
|
17
17
|
command: 'delete <domain>',
|
|
18
18
|
describe: `🗑 ${t('domain_delete_describe').d('Delete a related domain')}`,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import t from '../../i18n/index.js';
|
|
1
2
|
import addDomain from './add.js';
|
|
2
|
-
import listDomain from './list.js';
|
|
3
3
|
import deleteDomain from './delete.js';
|
|
4
|
-
import
|
|
4
|
+
import listDomain from './list.js';
|
|
5
5
|
let yargsIns;
|
|
6
6
|
const domainCommand = {
|
|
7
7
|
command: 'domain [script]',
|
|
8
|
-
describe:
|
|
8
|
+
describe: `🚀 ${t('domain_describe').d('Manage the domain names bound to your routine')}`,
|
|
9
9
|
builder: (yargs) => {
|
|
10
10
|
yargsIns = yargs;
|
|
11
11
|
return yargs
|
|
@@ -7,21 +7,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { checkDirectory, checkIsLoginSuccess } from '../utils.js';
|
|
11
|
-
import logger from '../../libs/logger.js';
|
|
12
|
-
import { getProjectConfig } from '../../utils/fileUtils/index.js';
|
|
13
|
-
import { ApiService } from '../../libs/apiService.js';
|
|
14
10
|
import t from '../../i18n/index.js';
|
|
11
|
+
import { ApiService } from '../../libs/apiService.js';
|
|
12
|
+
import logger from '../../libs/logger.js';
|
|
15
13
|
import { validRoutine } from '../../utils/checkIsRoutineCreated.js';
|
|
14
|
+
import { getProjectConfig } from '../../utils/fileUtils/index.js';
|
|
15
|
+
import { checkDirectory, checkIsLoginSuccess } from '../utils.js';
|
|
16
16
|
const listDomain = {
|
|
17
17
|
command: 'list',
|
|
18
18
|
describe: `🔍 ${t('domain_list_describe').d('List all related domains')}`,
|
|
19
|
-
handler: (
|
|
20
|
-
handleListDomains(
|
|
19
|
+
handler: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
+
handleListDomains();
|
|
21
21
|
})
|
|
22
22
|
};
|
|
23
23
|
export default listDomain;
|
|
24
|
-
export function handleListDomains(
|
|
24
|
+
export function handleListDomains() {
|
|
25
25
|
return __awaiter(this, void 0, void 0, function* () {
|
|
26
26
|
var _a, _b;
|
|
27
27
|
if (!checkDirectory()) {
|
|
@@ -7,16 +7,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import fs from 'fs-extra';
|
|
11
|
-
import path from 'path';
|
|
12
|
-
import Template from '../../libs/templates/index.js';
|
|
13
|
-
import { getProjectConfig } from '../../utils/fileUtils/index.js';
|
|
14
|
-
import logger from '../../libs/logger.js';
|
|
15
10
|
import { execSync } from 'child_process';
|
|
16
|
-
import
|
|
11
|
+
import path from 'path';
|
|
17
12
|
import chalk from 'chalk';
|
|
13
|
+
import fs from 'fs-extra';
|
|
18
14
|
import inquirer from 'inquirer';
|
|
15
|
+
import t from '../../i18n/index.js';
|
|
16
|
+
import logger from '../../libs/logger.js';
|
|
17
|
+
import Template from '../../libs/templates/index.js';
|
|
19
18
|
import { getDirName } from '../../utils/fileUtils/base.js';
|
|
19
|
+
import { getProjectConfig } from '../../utils/fileUtils/index.js';
|
|
20
20
|
export const getTemplateInstances = (templateHubPath) => {
|
|
21
21
|
return fs
|
|
22
22
|
.readdirSync(templateHubPath)
|
|
@@ -66,11 +66,34 @@ export const preInstallDependencies = (targetPath) => __awaiter(void 0, void 0,
|
|
|
66
66
|
else {
|
|
67
67
|
logger.log(t('no_build_script').d('No build script found in package.json, skipping build step.'));
|
|
68
68
|
}
|
|
69
|
+
// After build, try to infer assets directory if not explicitly known
|
|
70
|
+
try {
|
|
71
|
+
const candidates = ['dist', 'build', 'out'];
|
|
72
|
+
for (const dir of candidates) {
|
|
73
|
+
const abs = path.join(targetPath, dir);
|
|
74
|
+
if (fs.existsSync(abs) && fs.statSync(abs).isDirectory()) {
|
|
75
|
+
// Update config file if present and assets not set
|
|
76
|
+
const projectConfig = getProjectConfig(targetPath);
|
|
77
|
+
if (projectConfig) {
|
|
78
|
+
const { updateProjectConfigFile } = yield import('../../utils/fileUtils/index.js');
|
|
79
|
+
if (!projectConfig.assets || !projectConfig.assets.directory) {
|
|
80
|
+
yield updateProjectConfigFile({ assets: { directory: dir } }, targetPath);
|
|
81
|
+
logger.success(`Detected build output "${dir}" and updated assets.directory`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
catch (_a) { }
|
|
69
89
|
}
|
|
70
90
|
});
|
|
71
91
|
export function checkAndUpdatePackage(packageName) {
|
|
72
92
|
return __awaiter(this, void 0, void 0, function* () {
|
|
73
93
|
try {
|
|
94
|
+
const spinner = logger.ora;
|
|
95
|
+
spinner.text = t('checking_template_update').d('Checking esa-template updates...');
|
|
96
|
+
spinner.start();
|
|
74
97
|
// 获取当前安装的版本
|
|
75
98
|
const __dirname = getDirName(import.meta.url);
|
|
76
99
|
const packageJsonPath = path.join(__dirname, '../../../');
|
|
@@ -81,6 +104,7 @@ export function checkAndUpdatePackage(packageName) {
|
|
|
81
104
|
}).toString();
|
|
82
105
|
}
|
|
83
106
|
catch (e) {
|
|
107
|
+
spinner.text = t('template_updating').d('Updating templates to latest...');
|
|
84
108
|
execSync(`rm -rf node_modules/${packageName}`, {
|
|
85
109
|
cwd: packageJsonPath
|
|
86
110
|
});
|
|
@@ -88,6 +112,8 @@ export function checkAndUpdatePackage(packageName) {
|
|
|
88
112
|
cwd: packageJsonPath,
|
|
89
113
|
stdio: 'inherit'
|
|
90
114
|
});
|
|
115
|
+
spinner.stop();
|
|
116
|
+
logger.log(`├ ${t('template_updated_to_latest').d('Templates updated to latest.')}`);
|
|
91
117
|
return;
|
|
92
118
|
}
|
|
93
119
|
const match = versionInfo.match(new RegExp(`(${packageName})@([0-9.]+)`));
|
|
@@ -99,6 +125,7 @@ export function checkAndUpdatePackage(packageName) {
|
|
|
99
125
|
.toString()
|
|
100
126
|
.trim();
|
|
101
127
|
if (currentVersion !== latestVersion) {
|
|
128
|
+
spinner.stop();
|
|
102
129
|
logger.log(t('display_current_esa_template_version').d(`Current esa-template version:`) +
|
|
103
130
|
chalk.green(currentVersion) +
|
|
104
131
|
' ' +
|
|
@@ -110,6 +137,7 @@ export function checkAndUpdatePackage(packageName) {
|
|
|
110
137
|
message: t('is_update_to_latest_version').d('Do you want to update templates to latest version?')
|
|
111
138
|
});
|
|
112
139
|
if (isUpdate) {
|
|
140
|
+
spinner.start(t('template_updating').d('Updating templates to latest...'));
|
|
113
141
|
execSync(`rm -rf node_modules/${packageName}`, {
|
|
114
142
|
cwd: packageJsonPath
|
|
115
143
|
});
|
|
@@ -120,18 +148,40 @@ export function checkAndUpdatePackage(packageName) {
|
|
|
120
148
|
cwd: packageJsonPath,
|
|
121
149
|
stdio: 'inherit'
|
|
122
150
|
});
|
|
123
|
-
|
|
151
|
+
spinner.stop();
|
|
152
|
+
logger.log(`├ ${t('updated_esa_template_to_latest_version', { packageName }).d(`${packageName} updated successfully`)}`);
|
|
124
153
|
}
|
|
125
154
|
}
|
|
126
155
|
else {
|
|
127
|
-
|
|
156
|
+
spinner.stop();
|
|
157
|
+
logger.log(` ${t('checking_esa_template_finished').d(`Checking esa-template finished.`)}`);
|
|
158
|
+
t('esa_template_is_latest_version', { packageName }).d(`${packageName} is latest.`);
|
|
159
|
+
logger.divider();
|
|
128
160
|
}
|
|
129
161
|
}
|
|
130
162
|
catch (error) {
|
|
131
163
|
console.log(error);
|
|
132
164
|
if (error instanceof Error) {
|
|
133
|
-
logger.
|
|
165
|
+
logger.ora.fail(t('check_and_update_package_error').d('Error: An error occurred while checking and updating the package, skipping template update'));
|
|
134
166
|
}
|
|
135
167
|
}
|
|
136
168
|
});
|
|
137
169
|
}
|
|
170
|
+
export const getFrameworkConfig = (framework) => {
|
|
171
|
+
// 从init目录读取template.jsonc
|
|
172
|
+
const templatePath = path.join(getDirName(import.meta.url), 'template.jsonc');
|
|
173
|
+
const jsonc = fs.readFileSync(templatePath, 'utf-8');
|
|
174
|
+
const json = JSON.parse(jsonc);
|
|
175
|
+
return json[framework];
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* 获取框架全部配置
|
|
179
|
+
* @returns 框架全部配置
|
|
180
|
+
*/
|
|
181
|
+
export const getAllFrameworkConfig = () => {
|
|
182
|
+
// 从init目录读取template.jsonc
|
|
183
|
+
const templatePath = path.join(getDirName(import.meta.url), 'template.jsonc');
|
|
184
|
+
const jsonc = fs.readFileSync(templatePath, 'utf-8');
|
|
185
|
+
const json = JSON.parse(jsonc);
|
|
186
|
+
return json;
|
|
187
|
+
};
|