esa-cli 0.0.1-beta.7 → 0.0.1-beta.9

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.
@@ -11,7 +11,7 @@ import esbuild from 'esbuild';
11
11
  import { lessLoader } from 'esbuild-plugin-less';
12
12
  import path from 'path';
13
13
  import fs from 'fs';
14
- import { getRoot } from '../../utils/fileUtils/index.js';
14
+ import { getRoot } from '../../utils/fileUtils/base.js';
15
15
  import { NODE_EXTERNALS } from '../common/constant.js';
16
16
  const userRoot = getRoot();
17
17
  const entry = path.resolve(userRoot, 'src/index.js');
@@ -1,7 +1,7 @@
1
1
  import esbuild from 'esbuild';
2
2
  import { lessLoader } from 'esbuild-plugin-less';
3
3
  import path from 'path';
4
- import { getRoot } from '../../../utils/fileUtils/index.js';
4
+ import { getRoot } from '../../../utils/fileUtils/base.js';
5
5
  import { NODE_EXTERNALS } from '../../common/constant.js';
6
6
  export default function (options) {
7
7
  const userRoot = getRoot();
@@ -12,7 +12,8 @@ import fs from 'fs';
12
12
  import logger from '../../libs/logger.js';
13
13
  import devBuild from './config/devBuild.js';
14
14
  import t from '../../i18n/index.js';
15
- import { getDevConf, getRoot, getDirName } from '../../utils/fileUtils/index.js';
15
+ import { getDevConf } from '../../utils/fileUtils/index.js';
16
+ import { getRoot, getDirName } from '../../utils/fileUtils/base.js';
16
17
  import { checkPort } from '../../utils/checkDevPort.js';
17
18
  const generateEntry = (id, projectEntry, userRoot) => __awaiter(void 0, void 0, void 0, function* () {
18
19
  const __dirname = getDirName(import.meta.url);
@@ -10,7 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import { exec } from 'child_process';
11
11
  import chokidar from 'chokidar';
12
12
  import doProcess from './doProcess.js';
13
- import { getProjectConfig, getRoot, generateConfigFile, getDevConf } from '../../utils/fileUtils/index.js';
13
+ import { getProjectConfig, generateConfigFile, getDevConf } from '../../utils/fileUtils/index.js';
14
+ import { getRoot } from '../../utils/fileUtils/base.js';
14
15
  import SelectItems from '../../components/selectInput.js';
15
16
  import logger from '../../libs/logger.js';
16
17
  import devPack from './devPack.js';
@@ -11,7 +11,8 @@ import spawn from 'cross-spawn';
11
11
  import logger from '../../libs/logger.js';
12
12
  import path from 'path';
13
13
  import t from '../../i18n/index.js';
14
- import { getDevConf, getRoot } from '../../utils/fileUtils/index.js';
14
+ import { getDevConf } from '../../utils/fileUtils/index.js';
15
+ import { getRoot } from '../../utils/fileUtils/base.js';
15
16
  class WorkerServer {
16
17
  constructor(props) {
17
18
  this.instance = null;
@@ -7,20 +7,20 @@ 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 SelectItems from '../../components/selectInput.js';
11
10
  import fs from 'fs-extra';
11
+ import path from 'path';
12
12
  import Template from '../../libs/templates/index.js';
13
13
  import { installGit } from '../../libs/git/index.js';
14
14
  import { descriptionInput } from '../../components/descriptionInput.js';
15
- import { generateConfigFile, getDirName, getProjectConfig, getTemplatesConfig, templateHubPath, updateProjectConfigFile } from '../../utils/fileUtils/index.js';
15
+ import { generateConfigFile, getProjectConfig, getTemplatesConfig, templateHubPath, updateProjectConfigFile } from '../../utils/fileUtils/index.js';
16
16
  import t from '../../i18n/index.js';
17
17
  import logger from '../../libs/logger.js';
18
+ import SelectItems from '../../components/selectInput.js';
18
19
  import { quickDeploy } from '../deploy/index.js';
19
20
  import chalk from 'chalk';
20
21
  import { ApiService } from '../../libs/apiService.js';
21
22
  import { exit } from 'process';
22
23
  import { checkRoutineExist } from '../../utils/checkIsRoutineCreated.js';
23
- import path from 'path';
24
24
  import { execSync } from 'child_process';
25
25
  const secondSetOfItems = [
26
26
  { label: 'Yes', value: 'yesInstall' },
@@ -44,11 +44,10 @@ export default init;
44
44
  export function handleInit(argv) {
45
45
  return __awaiter(this, void 0, void 0, function* () {
46
46
  const { config } = argv;
47
- // 更新npm包
48
- const __dirname = getDirName(import.meta.url);
49
- const projectPath = path.join(__dirname, '../../..');
50
- execSync('npm install', { stdio: 'ignore', cwd: projectPath });
51
- console.log(projectPath);
47
+ // // 更新npm包
48
+ // const __dirname = getDirName(import.meta.url);
49
+ // const projectPath = path.join(__dirname, '../../..');
50
+ // execSync('npm install', { stdio: 'ignore', cwd: projectPath });
52
51
  if (config !== undefined) {
53
52
  yield generateConfigFile(String(config));
54
53
  return;
@@ -10,7 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import fs from 'fs';
11
11
  import { execSync } from 'child_process';
12
12
  import { isInstalledGit } from '../libs/git/index.js';
13
- import { getCliConfig, projectConfigPath, getRoot } from '../utils/fileUtils/index.js';
13
+ import { getCliConfig, projectConfigPath } from '../utils/fileUtils/index.js';
14
+ import { getRoot } from '../utils/fileUtils/base.js';
14
15
  import chalk from 'chalk';
15
16
  import t from '../i18n/index.js';
16
17
  import { ApiService } from '../libs/apiService.js';
@@ -1,6 +1,9 @@
1
- import localesJson from './locales.json' assert { type: 'json' };
1
+ import { resolve } from 'path';
2
2
  import { getCliConfig } from '../utils/fileUtils/index.js';
3
3
  import logger from '../libs/logger.js';
4
+ import { readJson } from '../utils/readJson.js';
5
+ import { getDirName } from '../utils/fileUtils/base.js';
6
+ const localesJson = readJson(resolve(getDirName(import.meta.url), './locales.json'));
4
7
  const t = (key, variables) => {
5
8
  var _a;
6
9
  const locales = localesJson;