@charcoal-ui/tailwind-diff 3.2.0 → 3.3.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.
@@ -8,11 +8,11 @@ const fs_1 = __importDefault(require("fs"));
8
8
  const os_1 = __importDefault(require("os"));
9
9
  const path_1 = __importDefault(require("path"));
10
10
  function detectPackageManager(base) {
11
- const upperbounds = [os_1.default.homedir(), path_1.default.resolve('/')];
11
+ const upperBounds = [os_1.default.homedir(), path_1.default.resolve('/')];
12
12
  let dir = fs_1.default.statSync(base).isDirectory() ? base : path_1.default.dirname(base);
13
13
  while (!fs_1.default.existsSync(path_1.default.join(dir, 'package.json'))) {
14
14
  const parent = path_1.default.dirname(dir);
15
- if (upperbounds.includes(parent)) {
15
+ if (upperBounds.includes(parent)) {
16
16
  throw new Error('No node project found.');
17
17
  }
18
18
  dir = parent;
@@ -41,7 +41,7 @@ function detectPackageManager(base) {
41
41
  break;
42
42
  }
43
43
  dir = path_1.default.dirname(dir);
44
- } while (!upperbounds.includes(dir));
44
+ } while (!upperBounds.includes(dir));
45
45
  return {
46
46
  type,
47
47
  packageJSONPath,
@@ -2,8 +2,8 @@ import { PackageManagerInfo } from './packageManager';
2
2
  /**
3
3
  * 指定したバージョンのパッケージが存在する状態で処理を行う
4
4
  *
5
- * @param packageDescripters 欲しいパッケージの一覧
5
+ * @param packageDescriptors 欲しいパッケージの一覧
6
6
  * @param callback 実行したい処理
7
7
  */
8
- export declare function withPackages<T>(packageManagerInfo: PackageManagerInfo, packageDescripters: readonly string[], callback: () => T | Promise<T>): Promise<T>;
8
+ export declare function withPackages<T>(packageManagerInfo: PackageManagerInfo, packageDescriptors: readonly string[], callback: () => T | Promise<T>): Promise<T>;
9
9
  //# sourceMappingURL=withPackages.d.ts.map
@@ -12,11 +12,11 @@ const defer_1 = require("./defer");
12
12
  /**
13
13
  * 指定したバージョンのパッケージが存在する状態で処理を行う
14
14
  *
15
- * @param packageDescripters 欲しいパッケージの一覧
15
+ * @param packageDescriptors 欲しいパッケージの一覧
16
16
  * @param callback 実行したい処理
17
17
  */
18
- async function withPackages(packageManagerInfo, packageDescripters, callback) {
19
- if (packageDescripters.length === 0) {
18
+ async function withPackages(packageManagerInfo, packageDescriptors, callback) {
19
+ if (packageDescriptors.length === 0) {
20
20
  return callback();
21
21
  }
22
22
  const deferer = (0, defer_1.createDefer)();
@@ -45,15 +45,15 @@ async function withPackages(packageManagerInfo, packageDescripters, callback) {
45
45
  let cmd, recoverCmd;
46
46
  switch (packageManagerInfo.type) {
47
47
  case 'npm':
48
- cmd = `npm install ${packageDescripters.join(' ')}`;
48
+ cmd = `npm install ${packageDescriptors.join(' ')}`;
49
49
  recoverCmd = 'npm install';
50
50
  break;
51
51
  case 'yarn':
52
- cmd = `yarn add ${packageDescripters.join(' ')}`;
52
+ cmd = `yarn add ${packageDescriptors.join(' ')}`;
53
53
  recoverCmd = 'yarn install';
54
54
  break;
55
55
  case 'pnpm':
56
- cmd = `pnpm add ${packageDescripters.join(' ')}`;
56
+ cmd = `pnpm add ${packageDescriptors.join(' ')}`;
57
57
  recoverCmd = 'pnpm install';
58
58
  break;
59
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@charcoal-ui/tailwind-diff",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "bin": "bin/tailwind-diff.js",
5
5
  "scripts": {
6
6
  "build": "tsc",
@@ -25,5 +25,5 @@
25
25
  "url": "https://github.com/pixiv/charcoal.git",
26
26
  "directory": "packages/tailwind-diff"
27
27
  },
28
- "gitHead": "495dc492d64a159618461a074b2315547eeda99f"
28
+ "gitHead": "60cfc06dc31206cb629f762f263be3fe46a13808"
29
29
  }
@@ -11,12 +11,12 @@ export interface PackageManagerInfo {
11
11
  }
12
12
 
13
13
  export function detectPackageManager(base: string): PackageManagerInfo {
14
- const upperbounds = [os.homedir(), path.resolve('/')]
14
+ const upperBounds = [os.homedir(), path.resolve('/')]
15
15
  let dir = fs.statSync(base).isDirectory() ? base : path.dirname(base)
16
16
 
17
17
  while (!fs.existsSync(path.join(dir, 'package.json'))) {
18
18
  const parent = path.dirname(dir)
19
- if (upperbounds.includes(parent)) {
19
+ if (upperBounds.includes(parent)) {
20
20
  throw new Error('No node project found.')
21
21
  }
22
22
  dir = parent
@@ -50,7 +50,7 @@ export function detectPackageManager(base: string): PackageManagerInfo {
50
50
  }
51
51
 
52
52
  dir = path.dirname(dir)
53
- } while (!upperbounds.includes(dir))
53
+ } while (!upperBounds.includes(dir))
54
54
 
55
55
  return {
56
56
  type,
@@ -8,15 +8,15 @@ import { PackageManagerInfo } from './packageManager'
8
8
  /**
9
9
  * 指定したバージョンのパッケージが存在する状態で処理を行う
10
10
  *
11
- * @param packageDescripters 欲しいパッケージの一覧
11
+ * @param packageDescriptors 欲しいパッケージの一覧
12
12
  * @param callback 実行したい処理
13
13
  */
14
14
  export async function withPackages<T>(
15
15
  packageManagerInfo: PackageManagerInfo,
16
- packageDescripters: readonly string[],
16
+ packageDescriptors: readonly string[],
17
17
  callback: () => T | Promise<T>
18
18
  ): Promise<T> {
19
- if (packageDescripters.length === 0) {
19
+ if (packageDescriptors.length === 0) {
20
20
  return callback()
21
21
  }
22
22
 
@@ -56,15 +56,15 @@ export async function withPackages<T>(
56
56
  let cmd: string, recoverCmd: string
57
57
  switch (packageManagerInfo.type) {
58
58
  case 'npm':
59
- cmd = `npm install ${packageDescripters.join(' ')}`
59
+ cmd = `npm install ${packageDescriptors.join(' ')}`
60
60
  recoverCmd = 'npm install'
61
61
  break
62
62
  case 'yarn':
63
- cmd = `yarn add ${packageDescripters.join(' ')}`
63
+ cmd = `yarn add ${packageDescriptors.join(' ')}`
64
64
  recoverCmd = 'yarn install'
65
65
  break
66
66
  case 'pnpm':
67
- cmd = `pnpm add ${packageDescripters.join(' ')}`
67
+ cmd = `pnpm add ${packageDescriptors.join(' ')}`
68
68
  recoverCmd = 'pnpm install'
69
69
  break
70
70
  }