@blocklet/component-studio-cli 0.4.139 → 0.4.141

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.
@@ -1,7 +1,7 @@
1
1
  import chalk from 'chalk';
2
2
  import { Command } from 'commander';
3
3
  import inquirer from 'inquirer';
4
- import { camelCase, upperFirst } from 'lodash';
4
+ import { camelCase, upperFirst } from 'lodash-es';
5
5
  import { existsSync, mkdirSync, readdirSync } from 'node:fs';
6
6
  import { join, relative } from 'node:path';
7
7
  import ora from 'ora';
@@ -16,7 +16,7 @@ export function createAddCommand() {
16
16
  .option('-t, --template <template>', 'Specify template to use')
17
17
  .action(async (name, options) => {
18
18
  const projectPath = getProjectPath();
19
- const addTemplateDir = join(__dirname, '../../templates/add');
19
+ const addTemplateDir = join(import.meta.dirname, '../../templates/add');
20
20
  // 检查add模板目录是否存在
21
21
  if (!existsSync(addTemplateDir)) {
22
22
  console.log(chalk.red('Add templates directory not found. Please check your installation.'));
@@ -12,7 +12,7 @@ export function createInitCommand() {
12
12
  .argument('[path]', 'Path to create the project directory', '.')
13
13
  .action(async (_path, options) => {
14
14
  let path = _path;
15
- const initTemplateDir = join(__dirname, '../../templates/init');
15
+ const initTemplateDir = join(import.meta.dirname, '../../templates/init');
16
16
  if (path === '.') {
17
17
  const answers = await inquirer.prompt([
18
18
  {
@@ -12,7 +12,7 @@ const workspaceVersion = '0.1.0';
12
12
  const METADATA_FILE_NAME = '@metadata.json';
13
13
  // 获取CLI内置的workspace模板路径
14
14
  export function getWorkspaceTemplatePath() {
15
- return join(__dirname, '../../templates/workspace');
15
+ return join(import.meta.dirname, '../../templates/workspace');
16
16
  }
17
17
  // 获取用户电脑的workspace路径
18
18
  export function getWorkspacePath() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/component-studio-cli",
3
- "version": "0.4.139",
3
+ "version": "0.4.141",
4
4
  "description": "CLI for Component Studio",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -41,7 +41,7 @@
41
41
  "pretty-error": "^4.0.0",
42
42
  "tar": "^7.4.3",
43
43
  "node-fetch": "^2.7.0",
44
- "lodash": "^4.17.21"
44
+ "lodash-es": "^4.17.21"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/glob": "^8.1.0",