@niche-works/dev 0.4.1 → 0.5.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/_virtual/_rolldown/runtime.cjs +29 -0
- package/addExports/addExports.cjs +61 -0
- package/addExports/addExports.cjs.map +1 -0
- package/addExports/addExports.d.cts +11 -0
- package/addExports/addExports.d.mts +12 -0
- package/addExports/addExports.mjs +59 -0
- package/addExports/addExports.mjs.map +1 -0
- package/addExports/index.cjs +3 -0
- package/addExports/index.d.cts +3 -0
- package/addExports/index.d.mts +3 -0
- package/addExports/index.mjs +3 -0
- package/addExports/types.cjs +0 -0
- package/{src/addExports/types.ts → addExports/types.d.cts} +33 -33
- package/addExports/types.d.mts +33 -0
- package/addExports/types.mjs +1 -0
- package/addJsExtensions/addJsExtensions.cjs +31 -0
- package/addJsExtensions/addJsExtensions.cjs.map +1 -0
- package/addJsExtensions/addJsExtensions.d.cts +8 -0
- package/addJsExtensions/addJsExtensions.d.mts +9 -0
- package/addJsExtensions/addJsExtensions.mjs +28 -0
- package/addJsExtensions/addJsExtensions.mjs.map +1 -0
- package/addJsExtensions/index.cjs +3 -0
- package/addJsExtensions/index.d.cts +2 -0
- package/addJsExtensions/index.d.mts +2 -0
- package/addJsExtensions/index.mjs +3 -0
- package/checkExistence/checkExistence.cjs +23 -0
- package/checkExistence/checkExistence.cjs.map +1 -0
- package/checkExistence/checkExistence.d.cts +9 -0
- package/checkExistence/checkExistence.d.mts +10 -0
- package/checkExistence/checkExistence.mjs +21 -0
- package/checkExistence/checkExistence.mjs.map +1 -0
- package/checkExistence/index.cjs +3 -0
- package/checkExistence/index.d.cts +2 -0
- package/checkExistence/index.d.mts +2 -0
- package/checkExistence/index.mjs +3 -0
- package/createExternalOptionFunction/createExternalOptionFunction.cjs +25 -0
- package/createExternalOptionFunction/createExternalOptionFunction.cjs.map +1 -0
- package/createExternalOptionFunction/createExternalOptionFunction.d.cts +10 -0
- package/createExternalOptionFunction/createExternalOptionFunction.d.mts +11 -0
- package/createExternalOptionFunction/createExternalOptionFunction.mjs +25 -0
- package/createExternalOptionFunction/createExternalOptionFunction.mjs.map +1 -0
- package/createExternalOptionFunction/index.cjs +3 -0
- package/createExternalOptionFunction/index.d.cts +2 -0
- package/createExternalOptionFunction/index.d.mts +2 -0
- package/createExternalOptionFunction/index.mjs +3 -0
- package/createExternalOptionFunction/types.cjs +0 -0
- package/{src/createExternalOptionFunction/types.ts → createExternalOptionFunction/types.d.cts} +31 -34
- package/createExternalOptionFunction/types.d.mts +31 -0
- package/createExternalOptionFunction/types.mjs +1 -0
- package/createSassClassNameFunction/createSassClassNameFunction.cjs +19 -0
- package/createSassClassNameFunction/createSassClassNameFunction.cjs.map +1 -0
- package/createSassClassNameFunction/createSassClassNameFunction.d.cts +11 -0
- package/createSassClassNameFunction/createSassClassNameFunction.d.mts +12 -0
- package/createSassClassNameFunction/createSassClassNameFunction.mjs +18 -0
- package/createSassClassNameFunction/createSassClassNameFunction.mjs.map +1 -0
- package/createSassClassNameFunction/index.cjs +3 -0
- package/createSassClassNameFunction/index.d.cts +2 -0
- package/createSassClassNameFunction/index.d.mts +2 -0
- package/createSassClassNameFunction/index.mjs +3 -0
- package/editJsonFile/editJsonFile.cjs +29 -0
- package/editJsonFile/editJsonFile.cjs.map +1 -0
- package/editJsonFile/editJsonFile.d.cts +9 -0
- package/editJsonFile/editJsonFile.d.mts +10 -0
- package/editJsonFile/editJsonFile.mjs +26 -0
- package/editJsonFile/editJsonFile.mjs.map +1 -0
- package/editJsonFile/index.cjs +3 -0
- package/editJsonFile/index.d.cts +2 -0
- package/editJsonFile/index.d.mts +2 -0
- package/editJsonFile/index.mjs +3 -0
- package/generatePublishPackageJson/generatePublishPackageJson.cjs +46 -0
- package/generatePublishPackageJson/generatePublishPackageJson.cjs.map +1 -0
- package/generatePublishPackageJson/generatePublishPackageJson.d.cts +6 -0
- package/generatePublishPackageJson/generatePublishPackageJson.d.mts +7 -0
- package/generatePublishPackageJson/generatePublishPackageJson.mjs +44 -0
- package/generatePublishPackageJson/generatePublishPackageJson.mjs.map +1 -0
- package/generatePublishPackageJson/index.cjs +3 -0
- package/generatePublishPackageJson/index.d.cts +3 -0
- package/generatePublishPackageJson/index.d.mts +3 -0
- package/generatePublishPackageJson/index.mjs +3 -0
- package/generatePublishPackageJson/types.cjs +0 -0
- package/{src/generatePublishPackageJson/types.ts → generatePublishPackageJson/types.d.cts} +60 -61
- package/generatePublishPackageJson/types.d.mts +60 -0
- package/generatePublishPackageJson/types.mjs +1 -0
- package/index.cjs +41 -0
- package/index.d.cts +14 -0
- package/index.d.mts +14 -0
- package/index.mjs +28 -0
- package/indexes/constants.cjs +123 -0
- package/indexes/constants.cjs.map +1 -0
- package/indexes/constants.d.cts +66 -0
- package/indexes/constants.d.mts +66 -0
- package/indexes/constants.mjs +106 -0
- package/indexes/constants.mjs.map +1 -0
- package/indexes/index.cjs +3 -0
- package/indexes/index.d.cts +3 -0
- package/indexes/index.d.mts +3 -0
- package/indexes/index.mjs +3 -0
- package/indexes/indexes.cjs +125 -0
- package/indexes/indexes.cjs.map +1 -0
- package/indexes/indexes.d.cts +11 -0
- package/indexes/indexes.d.mts +12 -0
- package/indexes/indexes.mjs +123 -0
- package/indexes/indexes.mjs.map +1 -0
- package/indexes/types.cjs +0 -0
- package/{src/indexes/types.ts → indexes/types.d.cts} +81 -87
- package/indexes/types.d.mts +81 -0
- package/indexes/types.mjs +1 -0
- package/installFromLocal/index.cjs +3 -0
- package/installFromLocal/index.d.cts +3 -0
- package/installFromLocal/index.d.mts +3 -0
- package/installFromLocal/index.mjs +3 -0
- package/installFromLocal/installFromLocal.cjs +46 -0
- package/installFromLocal/installFromLocal.cjs.map +1 -0
- package/installFromLocal/installFromLocal.d.cts +11 -0
- package/installFromLocal/installFromLocal.d.mts +12 -0
- package/installFromLocal/installFromLocal.mjs +43 -0
- package/installFromLocal/installFromLocal.mjs.map +1 -0
- package/installFromLocal/types.cjs +0 -0
- package/{src/installFromLocal/types.ts → installFromLocal/types.d.cts} +21 -19
- package/installFromLocal/types.d.mts +21 -0
- package/installFromLocal/types.mjs +1 -0
- package/isMatchingPath/index.cjs +3 -0
- package/isMatchingPath/index.d.cts +3 -0
- package/isMatchingPath/index.d.mts +3 -0
- package/isMatchingPath/index.mjs +3 -0
- package/isMatchingPath/isMatchingPath.cjs +52 -0
- package/isMatchingPath/isMatchingPath.cjs.map +1 -0
- package/isMatchingPath/isMatchingPath.d.cts +13 -0
- package/isMatchingPath/isMatchingPath.d.mts +14 -0
- package/isMatchingPath/isMatchingPath.mjs +50 -0
- package/isMatchingPath/isMatchingPath.mjs.map +1 -0
- package/isMatchingPath/types.cjs +0 -0
- package/isMatchingPath/types.d.cts +72 -0
- package/isMatchingPath/types.d.mts +72 -0
- package/isMatchingPath/types.mjs +1 -0
- package/isTargetPath/index.cjs +3 -0
- package/isTargetPath/index.d.cts +3 -0
- package/isTargetPath/index.d.mts +3 -0
- package/isTargetPath/index.mjs +3 -0
- package/isTargetPath/isTargetPath.cjs +21 -0
- package/isTargetPath/isTargetPath.cjs.map +1 -0
- package/isTargetPath/isTargetPath.d.cts +7 -0
- package/isTargetPath/isTargetPath.d.mts +8 -0
- package/isTargetPath/isTargetPath.mjs +19 -0
- package/isTargetPath/isTargetPath.mjs.map +1 -0
- package/isTargetPath/types.cjs +0 -0
- package/{src/isTargetPath/types.ts → isTargetPath/types.d.cts} +33 -38
- package/isTargetPath/types.d.mts +33 -0
- package/isTargetPath/types.mjs +1 -0
- package/moveFilesToSubdir/index.cjs +3 -0
- package/moveFilesToSubdir/index.d.cts +3 -0
- package/moveFilesToSubdir/index.d.mts +3 -0
- package/moveFilesToSubdir/index.mjs +3 -0
- package/moveFilesToSubdir/moveFilesToSubdir.cjs +32 -0
- package/moveFilesToSubdir/moveFilesToSubdir.cjs.map +1 -0
- package/moveFilesToSubdir/moveFilesToSubdir.d.cts +10 -0
- package/moveFilesToSubdir/moveFilesToSubdir.d.mts +11 -0
- package/moveFilesToSubdir/moveFilesToSubdir.mjs +29 -0
- package/moveFilesToSubdir/moveFilesToSubdir.mjs.map +1 -0
- package/moveFilesToSubdir/types.cjs +0 -0
- package/{src/moveFilesToSubdir/types.ts → moveFilesToSubdir/types.d.cts} +18 -15
- package/moveFilesToSubdir/types.d.mts +18 -0
- package/moveFilesToSubdir/types.mjs +1 -0
- package/package.json +21 -29
- package/removeFiles/index.cjs +3 -0
- package/removeFiles/index.d.cts +2 -0
- package/removeFiles/index.d.mts +2 -0
- package/removeFiles/index.mjs +3 -0
- package/removeFiles/removeFiles.cjs +15 -0
- package/removeFiles/removeFiles.cjs.map +1 -0
- package/removeFiles/removeFiles.d.cts +6 -0
- package/removeFiles/removeFiles.d.mts +7 -0
- package/removeFiles/removeFiles.mjs +12 -0
- package/removeFiles/removeFiles.mjs.map +1 -0
- package/removeFiles/types.cjs +0 -0
- package/removeFiles/types.d.cts +9 -0
- package/removeFiles/types.d.mts +9 -0
- package/removeFiles/types.mjs +1 -0
- package/ver/index.cjs +3 -0
- package/ver/index.d.cts +3 -0
- package/ver/index.d.mts +3 -0
- package/ver/index.mjs +3 -0
- package/ver/types.cjs +0 -0
- package/{src/ver/types.ts → ver/types.d.cts} +16 -13
- package/ver/types.d.mts +16 -0
- package/ver/types.mjs +1 -0
- package/ver/ver.cjs +34 -0
- package/ver/ver.cjs.map +1 -0
- package/ver/ver.d.cts +11 -0
- package/ver/ver.d.mts +12 -0
- package/ver/ver.mjs +31 -0
- package/ver/ver.mjs.map +1 -0
- package/src/addExports/addExports.ts +0 -94
- package/src/addExports/index.ts +0 -2
- package/src/addJsExtensions/addJsExtensions.ts +0 -30
- package/src/addJsExtensions/index.ts +0 -1
- package/src/checkExistence/checkExistence.ts +0 -16
- package/src/checkExistence/index.ts +0 -1
- package/src/createExternalOptionFunction/createExternalOptionFunction.ts +0 -43
- package/src/createExternalOptionFunction/index.ts +0 -1
- package/src/editJsonFile/editJsonFile.ts +0 -30
- package/src/editJsonFile/index.ts +0 -1
- package/src/generatePublishPackageJson/generatePublishPackageJson.ts +0 -55
- package/src/generatePublishPackageJson/index.ts +0 -2
- package/src/index.ts +0 -11
- package/src/indexes/constants.ts +0 -135
- package/src/indexes/index.ts +0 -2
- package/src/indexes/indexes.ts +0 -194
- package/src/installFromLocal/index.ts +0 -2
- package/src/installFromLocal/installFromLocal.ts +0 -63
- package/src/isMatchingPath/index.ts +0 -2
- package/src/isMatchingPath/isMatchingPath.ts +0 -94
- package/src/isMatchingPath/types.ts +0 -95
- package/src/isTargetPath/index.ts +0 -2
- package/src/isTargetPath/isTargetPath.ts +0 -30
- package/src/moveFilesToSubdir/index.ts +0 -2
- package/src/moveFilesToSubdir/moveFilesToSubdir.ts +0 -40
- package/src/removeFiles/index.ts +0 -1
- package/src/removeFiles/removeFiles.ts +0 -11
- package/src/removeFiles/types.ts +0 -5
- package/src/ver/index.ts +0 -2
- package/src/ver/ver.ts +0 -38
- package/tsconfig.json +0 -46
- package/tsdown.config.ts +0 -41
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ConditionFnOptions, IsMatchingPathCondition } from "../isMatchingPath/types.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/isTargetPath/types.d.ts
|
|
4
|
+
type IsTargetPathOptions<O extends ConditionFnOptions = ConditionFnOptions> = {
|
|
5
|
+
/**
|
|
6
|
+
* 対象の種別
|
|
7
|
+
* @default 'file'
|
|
8
|
+
*/
|
|
9
|
+
itemType?: 'file' | 'dir' | 'both';
|
|
10
|
+
/**
|
|
11
|
+
* 対象とする条件
|
|
12
|
+
* 未指定の場合は`defaultInclude`が適用される
|
|
13
|
+
*/
|
|
14
|
+
include?: IsMatchingPathCondition<O>[];
|
|
15
|
+
/**
|
|
16
|
+
* 対象から除外する条件
|
|
17
|
+
* 未指定の場合は`defaultExclude`が適用される
|
|
18
|
+
*/
|
|
19
|
+
exclude?: IsMatchingPathCondition<O>[];
|
|
20
|
+
/**
|
|
21
|
+
* 対象とする条件のデフォルト
|
|
22
|
+
* 未指定の場合は条件なし
|
|
23
|
+
*/
|
|
24
|
+
defaultInclude?: IsMatchingPathCondition<O>[];
|
|
25
|
+
/**
|
|
26
|
+
* 対象から除外する条件のデフォルト
|
|
27
|
+
* 未指定の場合は除外なし
|
|
28
|
+
*/
|
|
29
|
+
defaultExclude?: IsMatchingPathCondition<O>[];
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { IsTargetPathOptions };
|
|
33
|
+
//# sourceMappingURL=types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
const require_isTargetPath_isTargetPath = require('../isTargetPath/isTargetPath.cjs');
|
|
3
|
+
require('../isTargetPath/index.cjs');
|
|
4
|
+
let fs_extra = require("fs-extra");
|
|
5
|
+
fs_extra = require_runtime.__toESM(fs_extra, 1);
|
|
6
|
+
let path = require("path");
|
|
7
|
+
path = require_runtime.__toESM(path, 1);
|
|
8
|
+
|
|
9
|
+
//#region src/moveFilesToSubdir/moveFilesToSubdir.ts
|
|
10
|
+
/**
|
|
11
|
+
* 対象のディレクトリ直下のファイルを、拡張子を除いた同名のサブディレクトリ直下に移動する
|
|
12
|
+
* @param dirPath 対象のディレクトリのパス
|
|
13
|
+
*/
|
|
14
|
+
async function moveFilesToSubdir(dirPath, options = {}) {
|
|
15
|
+
const { process, index, ...rest } = options;
|
|
16
|
+
const items = await fs_extra.default.readdir(dirPath);
|
|
17
|
+
for (const item of items) {
|
|
18
|
+
const itemPath = path.default.join(dirPath, item);
|
|
19
|
+
if (require_isTargetPath_isTargetPath(itemPath, rest)) {
|
|
20
|
+
const { name, ext } = path.default.parse(item);
|
|
21
|
+
const subdirPath = path.default.join(dirPath, name);
|
|
22
|
+
fs_extra.default.ensureDirSync(subdirPath);
|
|
23
|
+
fs_extra.default.moveSync(itemPath, path.default.join(subdirPath, item));
|
|
24
|
+
if (index) fs_extra.default.writeFileSync(path.default.join(subdirPath, `index${ext}`), `export { default } from './${name}';`, { encoding: "utf8" });
|
|
25
|
+
if (process) process(subdirPath, item);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
module.exports = moveFilesToSubdir;
|
|
32
|
+
//# sourceMappingURL=moveFilesToSubdir.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moveFilesToSubdir.cjs","names":["fs","isTargetPath"],"sources":["../../src/moveFilesToSubdir/moveFilesToSubdir.ts"],"sourcesContent":["import fs from 'fs-extra';\r\nimport path from 'path';\r\nimport isTargetPath from '../isTargetPath';\r\nimport type { MoveFilesToSubdirOptions } from './types';\r\n\r\n/**\r\n * 対象のディレクトリ直下のファイルを、拡張子を除いた同名のサブディレクトリ直下に移動する\r\n * @param dirPath 対象のディレクトリのパス\r\n */\r\nexport default async function moveFilesToSubdir(\r\n dirPath: string,\r\n options: MoveFilesToSubdirOptions = {},\r\n) {\r\n const { process, index, ...rest } = options;\r\n const items = await fs.readdir(dirPath);\r\n for (const item of items) {\r\n const itemPath = path.join(dirPath, item);\r\n if (isTargetPath(itemPath, rest)) {\r\n const { name, ext } = path.parse(item);\r\n // 移動先のディレクトリパスを生成\r\n const subdirPath = path.join(dirPath, name);\r\n // 移動先のディレクトリが存在しなければ作成\r\n fs.ensureDirSync(subdirPath);\r\n // 移動\r\n fs.moveSync(itemPath, path.join(subdirPath, item));\r\n if (index) {\r\n fs.writeFileSync(\r\n path.join(subdirPath, `index${ext}`),\r\n `export { default } from './${name}';`,\r\n {\r\n encoding: 'utf8',\r\n },\r\n );\r\n }\r\n if (process) {\r\n process(subdirPath, item);\r\n }\r\n }\r\n }\r\n}\r\n"],"mappings":";;;;;;;;;;;;;AASA,eAA8B,kBAC5B,SACA,UAAoC,EAAE,EACtC;CACA,MAAM,EAAE,SAAS,OAAO,GAAG,SAAS;CACpC,MAAM,QAAQ,MAAMA,iBAAG,QAAQ,QAAQ;AACvC,MAAK,MAAM,QAAQ,OAAO;EACxB,MAAM,WAAW,aAAK,KAAK,SAAS,KAAK;AACzC,MAAIC,kCAAa,UAAU,KAAK,EAAE;GAChC,MAAM,EAAE,MAAM,QAAQ,aAAK,MAAM,KAAK;GAEtC,MAAM,aAAa,aAAK,KAAK,SAAS,KAAK;AAE3C,oBAAG,cAAc,WAAW;AAE5B,oBAAG,SAAS,UAAU,aAAK,KAAK,YAAY,KAAK,CAAC;AAClD,OAAI,MACF,kBAAG,cACD,aAAK,KAAK,YAAY,QAAQ,MAAM,EACpC,8BAA8B,KAAK,KACnC,EACE,UAAU,QACX,CACF;AAEH,OAAI,QACF,SAAQ,YAAY,KAAK"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MoveFilesToSubdirOptions } from "./types.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/moveFilesToSubdir/moveFilesToSubdir.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* 対象のディレクトリ直下のファイルを、拡張子を除いた同名のサブディレクトリ直下に移動する
|
|
6
|
+
* @param dirPath 対象のディレクトリのパス
|
|
7
|
+
*/
|
|
8
|
+
declare function moveFilesToSubdir(dirPath: string, options?: MoveFilesToSubdirOptions): Promise<void>;
|
|
9
|
+
export = moveFilesToSubdir;
|
|
10
|
+
//# sourceMappingURL=moveFilesToSubdir.d.cts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MoveFilesToSubdirOptions } from "./types.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/moveFilesToSubdir/moveFilesToSubdir.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* 対象のディレクトリ直下のファイルを、拡張子を除いた同名のサブディレクトリ直下に移動する
|
|
6
|
+
* @param dirPath 対象のディレクトリのパス
|
|
7
|
+
*/
|
|
8
|
+
declare function moveFilesToSubdir(dirPath: string, options?: MoveFilesToSubdirOptions): Promise<void>;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { moveFilesToSubdir as default };
|
|
11
|
+
//# sourceMappingURL=moveFilesToSubdir.d.mts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import isTargetPath from "../isTargetPath/isTargetPath.mjs";
|
|
2
|
+
import "../isTargetPath/index.mjs";
|
|
3
|
+
import fs from "fs-extra";
|
|
4
|
+
import path from "path";
|
|
5
|
+
|
|
6
|
+
//#region src/moveFilesToSubdir/moveFilesToSubdir.ts
|
|
7
|
+
/**
|
|
8
|
+
* 対象のディレクトリ直下のファイルを、拡張子を除いた同名のサブディレクトリ直下に移動する
|
|
9
|
+
* @param dirPath 対象のディレクトリのパス
|
|
10
|
+
*/
|
|
11
|
+
async function moveFilesToSubdir(dirPath, options = {}) {
|
|
12
|
+
const { process, index, ...rest } = options;
|
|
13
|
+
const items = await fs.readdir(dirPath);
|
|
14
|
+
for (const item of items) {
|
|
15
|
+
const itemPath = path.join(dirPath, item);
|
|
16
|
+
if (isTargetPath(itemPath, rest)) {
|
|
17
|
+
const { name, ext } = path.parse(item);
|
|
18
|
+
const subdirPath = path.join(dirPath, name);
|
|
19
|
+
fs.ensureDirSync(subdirPath);
|
|
20
|
+
fs.moveSync(itemPath, path.join(subdirPath, item));
|
|
21
|
+
if (index) fs.writeFileSync(path.join(subdirPath, `index${ext}`), `export { default } from './${name}';`, { encoding: "utf8" });
|
|
22
|
+
if (process) process(subdirPath, item);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
export { moveFilesToSubdir as default };
|
|
29
|
+
//# sourceMappingURL=moveFilesToSubdir.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moveFilesToSubdir.mjs","names":[],"sources":["../../src/moveFilesToSubdir/moveFilesToSubdir.ts"],"sourcesContent":["import fs from 'fs-extra';\r\nimport path from 'path';\r\nimport isTargetPath from '../isTargetPath';\r\nimport type { MoveFilesToSubdirOptions } from './types';\r\n\r\n/**\r\n * 対象のディレクトリ直下のファイルを、拡張子を除いた同名のサブディレクトリ直下に移動する\r\n * @param dirPath 対象のディレクトリのパス\r\n */\r\nexport default async function moveFilesToSubdir(\r\n dirPath: string,\r\n options: MoveFilesToSubdirOptions = {},\r\n) {\r\n const { process, index, ...rest } = options;\r\n const items = await fs.readdir(dirPath);\r\n for (const item of items) {\r\n const itemPath = path.join(dirPath, item);\r\n if (isTargetPath(itemPath, rest)) {\r\n const { name, ext } = path.parse(item);\r\n // 移動先のディレクトリパスを生成\r\n const subdirPath = path.join(dirPath, name);\r\n // 移動先のディレクトリが存在しなければ作成\r\n fs.ensureDirSync(subdirPath);\r\n // 移動\r\n fs.moveSync(itemPath, path.join(subdirPath, item));\r\n if (index) {\r\n fs.writeFileSync(\r\n path.join(subdirPath, `index${ext}`),\r\n `export { default } from './${name}';`,\r\n {\r\n encoding: 'utf8',\r\n },\r\n );\r\n }\r\n if (process) {\r\n process(subdirPath, item);\r\n }\r\n }\r\n }\r\n}\r\n"],"mappings":";;;;;;;;;;AASA,eAA8B,kBAC5B,SACA,UAAoC,EAAE,EACtC;CACA,MAAM,EAAE,SAAS,OAAO,GAAG,SAAS;CACpC,MAAM,QAAQ,MAAM,GAAG,QAAQ,QAAQ;AACvC,MAAK,MAAM,QAAQ,OAAO;EACxB,MAAM,WAAW,KAAK,KAAK,SAAS,KAAK;AACzC,MAAI,aAAa,UAAU,KAAK,EAAE;GAChC,MAAM,EAAE,MAAM,QAAQ,KAAK,MAAM,KAAK;GAEtC,MAAM,aAAa,KAAK,KAAK,SAAS,KAAK;AAE3C,MAAG,cAAc,WAAW;AAE5B,MAAG,SAAS,UAAU,KAAK,KAAK,YAAY,KAAK,CAAC;AAClD,OAAI,MACF,IAAG,cACD,KAAK,KAAK,YAAY,QAAQ,MAAM,EACpC,8BAA8B,KAAK,KACnC,EACE,UAAU,QACX,CACF;AAEH,OAAI,QACF,SAAQ,YAAY,KAAK"}
|
|
File without changes
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*
|
|
7
|
-
* @param
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* indexファイルの作成
|
|
13
|
-
*/
|
|
14
|
-
index?: boolean;
|
|
15
|
-
};
|
|
1
|
+
import { IsTargetPathOptions } from "../isTargetPath/types.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/moveFilesToSubdir/types.d.ts
|
|
4
|
+
type MoveFilesToSubdirOptions = Omit<IsTargetPathOptions, 'itemType'> & {
|
|
5
|
+
/**
|
|
6
|
+
* ファイル毎の後処理
|
|
7
|
+
* @param subdirPath サブディレクトリのパス
|
|
8
|
+
* @param fileName ファイル名
|
|
9
|
+
*/
|
|
10
|
+
process?: (subdirPath: string, fileName: string) => void;
|
|
11
|
+
/**
|
|
12
|
+
* indexファイルの作成
|
|
13
|
+
*/
|
|
14
|
+
index?: boolean;
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { MoveFilesToSubdirOptions };
|
|
18
|
+
//# sourceMappingURL=types.d.cts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IsTargetPathOptions } from "../isTargetPath/types.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/moveFilesToSubdir/types.d.ts
|
|
4
|
+
type MoveFilesToSubdirOptions = Omit<IsTargetPathOptions, 'itemType'> & {
|
|
5
|
+
/**
|
|
6
|
+
* ファイル毎の後処理
|
|
7
|
+
* @param subdirPath サブディレクトリのパス
|
|
8
|
+
* @param fileName ファイル名
|
|
9
|
+
*/
|
|
10
|
+
process?: (subdirPath: string, fileName: string) => void;
|
|
11
|
+
/**
|
|
12
|
+
* indexファイルの作成
|
|
13
|
+
*/
|
|
14
|
+
index?: boolean;
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { MoveFilesToSubdirOptions };
|
|
18
|
+
//# sourceMappingURL=types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@niche-works/dev",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"utils"
|
|
6
6
|
],
|
|
@@ -12,36 +12,28 @@
|
|
|
12
12
|
"author": "Mitsuhiro Seino",
|
|
13
13
|
"type": "module",
|
|
14
14
|
"exports": {
|
|
15
|
-
".":
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
".": {
|
|
16
|
+
"import": "./index.mjs",
|
|
17
|
+
"require": "./index.cjs"
|
|
18
|
+
},
|
|
19
|
+
"./*": {
|
|
20
|
+
"import": "./*/index.mjs",
|
|
21
|
+
"require": "./*/index.cjs"
|
|
22
|
+
},
|
|
23
|
+
"./constants": {
|
|
24
|
+
"import": "./constants.mjs",
|
|
25
|
+
"require": "./constants.cjs"
|
|
26
|
+
},
|
|
27
|
+
"./*/constants": {
|
|
28
|
+
"import": "./*/constants.mjs",
|
|
29
|
+
"require": "./*/constants.cjs"
|
|
30
|
+
}
|
|
18
31
|
},
|
|
19
|
-
"main": "./src/index.ts",
|
|
20
|
-
"module": "./src/index.ts",
|
|
21
32
|
"dependencies": {
|
|
33
|
+
"fast-glob": "^3.3.3",
|
|
22
34
|
"fs-extra": "^11.3.4",
|
|
23
35
|
"remeda": "^2.33.6",
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
"devDependencies": {
|
|
27
|
-
"@types/fs-extra": "^11.0.4",
|
|
28
|
-
"@types/node": "^25.5.0",
|
|
29
|
-
"fast-glob": "^3.3.3",
|
|
30
|
-
"prettier": "^3.8.1",
|
|
31
|
-
"prettier-plugin-organize-imports": "^4.3.0",
|
|
32
|
-
"prettier-plugin-packagejson": "^3.0.2",
|
|
33
|
-
"tsdown": "^0.21.9",
|
|
34
|
-
"tsx": "^4.21.0",
|
|
35
|
-
"type-fest": "^5.5.0",
|
|
36
|
-
"typescript": "^6.0.2"
|
|
37
|
-
},
|
|
38
|
-
"scripts": {
|
|
39
|
-
"build": "tsdown",
|
|
40
|
-
"check": "tsc --noEmit",
|
|
41
|
-
"dev": "tsdown --watch",
|
|
42
|
-
"format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json}\"",
|
|
43
|
-
"indexes": "tsx scripts/indexes.ts",
|
|
44
|
-
"lint": "tsdown --dry-run",
|
|
45
|
-
"tidy": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json}\" --config ./prettier.tidy.config.js"
|
|
36
|
+
"sass": "^1.99.0",
|
|
37
|
+
"type-fest": "^5.5.0"
|
|
46
38
|
}
|
|
47
|
-
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
let fs_extra = require("fs-extra");
|
|
3
|
+
fs_extra = require_runtime.__toESM(fs_extra, 1);
|
|
4
|
+
let fast_glob = require("fast-glob");
|
|
5
|
+
fast_glob = require_runtime.__toESM(fast_glob, 1);
|
|
6
|
+
|
|
7
|
+
//#region src/removeFiles/removeFiles.ts
|
|
8
|
+
async function removeFiles(source, options = {}) {
|
|
9
|
+
const files = await (0, fast_glob.default)(source, options);
|
|
10
|
+
await Promise.all(files.map((file) => fs_extra.default.remove(file)));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
module.exports = removeFiles;
|
|
15
|
+
//# sourceMappingURL=removeFiles.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"removeFiles.cjs","names":["fs"],"sources":["../../src/removeFiles/removeFiles.ts"],"sourcesContent":["import fg from 'fast-glob';\r\nimport type { Options, Pattern } from 'fast-glob/out/index';\r\nimport fs from 'fs-extra';\r\n\r\nexport default async function removeFiles(\r\n source: Pattern | Pattern[],\r\n options: Options = {},\r\n) {\r\n const files = await fg(source, options);\r\n await Promise.all(files.map((file) => fs.remove(file)));\r\n}\r\n"],"mappings":";;;;;;;AAIA,eAA8B,YAC5B,QACA,UAAmB,EAAE,EACrB;CACA,MAAM,QAAQ,6BAAS,QAAQ,QAAQ;AACvC,OAAM,QAAQ,IAAI,MAAM,KAAK,SAASA,iBAAG,OAAO,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Options, Pattern } from "fast-glob/out/index";
|
|
2
|
+
|
|
3
|
+
//#region src/removeFiles/removeFiles.d.ts
|
|
4
|
+
declare function removeFiles(source: Pattern | Pattern[], options?: Options): Promise<void>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { removeFiles as default };
|
|
7
|
+
//# sourceMappingURL=removeFiles.d.mts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import fs from "fs-extra";
|
|
2
|
+
import fg from "fast-glob";
|
|
3
|
+
|
|
4
|
+
//#region src/removeFiles/removeFiles.ts
|
|
5
|
+
async function removeFiles(source, options = {}) {
|
|
6
|
+
const files = await fg(source, options);
|
|
7
|
+
await Promise.all(files.map((file) => fs.remove(file)));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { removeFiles as default };
|
|
12
|
+
//# sourceMappingURL=removeFiles.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"removeFiles.mjs","names":[],"sources":["../../src/removeFiles/removeFiles.ts"],"sourcesContent":["import fg from 'fast-glob';\r\nimport type { Options, Pattern } from 'fast-glob/out/index';\r\nimport fs from 'fs-extra';\r\n\r\nexport default async function removeFiles(\r\n source: Pattern | Pattern[],\r\n options: Options = {},\r\n) {\r\n const files = await fg(source, options);\r\n await Promise.all(files.map((file) => fs.remove(file)));\r\n}\r\n"],"mappings":";;;;AAIA,eAA8B,YAC5B,QACA,UAAmB,EAAE,EACrB;CACA,MAAM,QAAQ,MAAM,GAAG,QAAQ,QAAQ;AACvC,OAAM,QAAQ,IAAI,MAAM,KAAK,SAAS,GAAG,OAAO,KAAK,CAAC,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/ver/index.cjs
ADDED
package/ver/index.d.cts
ADDED
package/ver/index.d.mts
ADDED
package/ver/index.mjs
ADDED
package/ver/types.cjs
ADDED
|
File without changes
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* パッケージが置かれたディレクトリのパス
|
|
10
|
-
* @default `./packages`
|
|
11
|
-
*/
|
|
12
|
-
packagesPath?: string;
|
|
13
|
-
};
|
|
1
|
+
//#region src/ver/types.d.ts
|
|
2
|
+
type VerOptions = {
|
|
3
|
+
/**
|
|
4
|
+
* ワークスペースのパッケージjsonのパス
|
|
5
|
+
* @default `./package.json`
|
|
6
|
+
*/
|
|
7
|
+
workspacePackageJsonPath?: string;
|
|
8
|
+
/**
|
|
9
|
+
* パッケージが置かれたディレクトリのパス
|
|
10
|
+
* @default `./packages`
|
|
11
|
+
*/
|
|
12
|
+
packagesPath?: string;
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { VerOptions };
|
|
16
|
+
//# sourceMappingURL=types.d.cts.map
|
package/ver/types.d.mts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/ver/types.d.ts
|
|
2
|
+
type VerOptions = {
|
|
3
|
+
/**
|
|
4
|
+
* ワークスペースのパッケージjsonのパス
|
|
5
|
+
* @default `./package.json`
|
|
6
|
+
*/
|
|
7
|
+
workspacePackageJsonPath?: string;
|
|
8
|
+
/**
|
|
9
|
+
* パッケージが置かれたディレクトリのパス
|
|
10
|
+
* @default `./packages`
|
|
11
|
+
*/
|
|
12
|
+
packagesPath?: string;
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { VerOptions };
|
|
16
|
+
//# sourceMappingURL=types.d.mts.map
|
package/ver/types.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/ver/ver.cjs
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
let fs_extra = require("fs-extra");
|
|
3
|
+
fs_extra = require_runtime.__toESM(fs_extra, 1);
|
|
4
|
+
let path = require("path");
|
|
5
|
+
path = require_runtime.__toESM(path, 1);
|
|
6
|
+
|
|
7
|
+
//#region src/ver/ver.ts
|
|
8
|
+
/**
|
|
9
|
+
* ワークスペースのパッケージにバージョンを反映する
|
|
10
|
+
* @param version バージョン
|
|
11
|
+
* @param options オプション
|
|
12
|
+
*/
|
|
13
|
+
async function ver(version, options = {}) {
|
|
14
|
+
const { workspacePackageJsonPath = "package.json", packagesPath = "packages" } = options;
|
|
15
|
+
if (fs_extra.default.existsSync(workspacePackageJsonPath)) _updatePkgJson(version, workspacePackageJsonPath);
|
|
16
|
+
const pkgs = fs_extra.default.readdirSync(packagesPath);
|
|
17
|
+
for (const pkg of pkgs) {
|
|
18
|
+
const packagePath = path.default.join(packagesPath, pkg);
|
|
19
|
+
const packageJsonPath = path.default.join(packagePath, "package.json");
|
|
20
|
+
if (fs_extra.default.existsSync(packageJsonPath)) _updatePkgJson(version, packageJsonPath);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function _updatePkgJson(version, packageJsonPath) {
|
|
24
|
+
const packageJson = fs_extra.default.readJsonSync(packageJsonPath, { encoding: "utf8" });
|
|
25
|
+
packageJson.version = version;
|
|
26
|
+
fs_extra.default.writeJsonSync(packageJsonPath, packageJson, {
|
|
27
|
+
encoding: "utf8",
|
|
28
|
+
spaces: 2
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
module.exports = ver;
|
|
34
|
+
//# sourceMappingURL=ver.cjs.map
|
package/ver/ver.cjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ver.cjs","names":["fs"],"sources":["../../src/ver/ver.ts"],"sourcesContent":["import fs from 'fs-extra';\r\nimport path from 'path';\r\nimport type { VerOptions } from './types';\r\n\r\n/**\r\n * ワークスペースのパッケージにバージョンを反映する\r\n * @param version バージョン\r\n * @param options オプション\r\n */\r\nexport default async function ver(version: string, options: VerOptions = {}) {\r\n const {\r\n workspacePackageJsonPath = 'package.json',\r\n packagesPath = 'packages',\r\n } = options;\r\n\r\n if (fs.existsSync(workspacePackageJsonPath)) {\r\n // ワークスペースのpackage.jsonを更新\r\n _updatePkgJson(version, workspacePackageJsonPath);\r\n }\r\n const pkgs = fs.readdirSync(packagesPath);\r\n for (const pkg of pkgs) {\r\n const packagePath = path.join(packagesPath, pkg);\r\n const packageJsonPath = path.join(packagePath, 'package.json');\r\n if (fs.existsSync(packageJsonPath)) {\r\n // 各パッケージのpackage.jsonを更新\r\n _updatePkgJson(version, packageJsonPath);\r\n }\r\n }\r\n}\r\n\r\nfunction _updatePkgJson(version: string, packageJsonPath: string) {\r\n const packageJson = fs.readJsonSync(packageJsonPath, { encoding: 'utf8' });\r\n packageJson.version = version;\r\n fs.writeJsonSync(packageJsonPath, packageJson, {\r\n encoding: 'utf8',\r\n spaces: 2,\r\n });\r\n}\r\n"],"mappings":";;;;;;;;;;;;AASA,eAA8B,IAAI,SAAiB,UAAsB,EAAE,EAAE;CAC3E,MAAM,EACJ,2BAA2B,gBAC3B,eAAe,eACb;AAEJ,KAAIA,iBAAG,WAAW,yBAAyB,CAEzC,gBAAe,SAAS,yBAAyB;CAEnD,MAAM,OAAOA,iBAAG,YAAY,aAAa;AACzC,MAAK,MAAM,OAAO,MAAM;EACtB,MAAM,cAAc,aAAK,KAAK,cAAc,IAAI;EAChD,MAAM,kBAAkB,aAAK,KAAK,aAAa,eAAe;AAC9D,MAAIA,iBAAG,WAAW,gBAAgB,CAEhC,gBAAe,SAAS,gBAAgB;;;AAK9C,SAAS,eAAe,SAAiB,iBAAyB;CAChE,MAAM,cAAcA,iBAAG,aAAa,iBAAiB,EAAE,UAAU,QAAQ,CAAC;AAC1E,aAAY,UAAU;AACtB,kBAAG,cAAc,iBAAiB,aAAa;EAC7C,UAAU;EACV,QAAQ;EACT,CAAC"}
|
package/ver/ver.d.cts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { VerOptions } from "./types.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/ver/ver.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* ワークスペースのパッケージにバージョンを反映する
|
|
6
|
+
* @param version バージョン
|
|
7
|
+
* @param options オプション
|
|
8
|
+
*/
|
|
9
|
+
declare function ver(version: string, options?: VerOptions): Promise<void>;
|
|
10
|
+
export = ver;
|
|
11
|
+
//# sourceMappingURL=ver.d.cts.map
|
package/ver/ver.d.mts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { VerOptions } from "./types.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/ver/ver.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* ワークスペースのパッケージにバージョンを反映する
|
|
6
|
+
* @param version バージョン
|
|
7
|
+
* @param options オプション
|
|
8
|
+
*/
|
|
9
|
+
declare function ver(version: string, options?: VerOptions): Promise<void>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { ver as default };
|
|
12
|
+
//# sourceMappingURL=ver.d.mts.map
|
package/ver/ver.mjs
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import fs from "fs-extra";
|
|
2
|
+
import path from "path";
|
|
3
|
+
|
|
4
|
+
//#region src/ver/ver.ts
|
|
5
|
+
/**
|
|
6
|
+
* ワークスペースのパッケージにバージョンを反映する
|
|
7
|
+
* @param version バージョン
|
|
8
|
+
* @param options オプション
|
|
9
|
+
*/
|
|
10
|
+
async function ver(version, options = {}) {
|
|
11
|
+
const { workspacePackageJsonPath = "package.json", packagesPath = "packages" } = options;
|
|
12
|
+
if (fs.existsSync(workspacePackageJsonPath)) _updatePkgJson(version, workspacePackageJsonPath);
|
|
13
|
+
const pkgs = fs.readdirSync(packagesPath);
|
|
14
|
+
for (const pkg of pkgs) {
|
|
15
|
+
const packagePath = path.join(packagesPath, pkg);
|
|
16
|
+
const packageJsonPath = path.join(packagePath, "package.json");
|
|
17
|
+
if (fs.existsSync(packageJsonPath)) _updatePkgJson(version, packageJsonPath);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function _updatePkgJson(version, packageJsonPath) {
|
|
21
|
+
const packageJson = fs.readJsonSync(packageJsonPath, { encoding: "utf8" });
|
|
22
|
+
packageJson.version = version;
|
|
23
|
+
fs.writeJsonSync(packageJsonPath, packageJson, {
|
|
24
|
+
encoding: "utf8",
|
|
25
|
+
spaces: 2
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
export { ver as default };
|
|
31
|
+
//# sourceMappingURL=ver.mjs.map
|
package/ver/ver.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ver.mjs","names":[],"sources":["../../src/ver/ver.ts"],"sourcesContent":["import fs from 'fs-extra';\r\nimport path from 'path';\r\nimport type { VerOptions } from './types';\r\n\r\n/**\r\n * ワークスペースのパッケージにバージョンを反映する\r\n * @param version バージョン\r\n * @param options オプション\r\n */\r\nexport default async function ver(version: string, options: VerOptions = {}) {\r\n const {\r\n workspacePackageJsonPath = 'package.json',\r\n packagesPath = 'packages',\r\n } = options;\r\n\r\n if (fs.existsSync(workspacePackageJsonPath)) {\r\n // ワークスペースのpackage.jsonを更新\r\n _updatePkgJson(version, workspacePackageJsonPath);\r\n }\r\n const pkgs = fs.readdirSync(packagesPath);\r\n for (const pkg of pkgs) {\r\n const packagePath = path.join(packagesPath, pkg);\r\n const packageJsonPath = path.join(packagePath, 'package.json');\r\n if (fs.existsSync(packageJsonPath)) {\r\n // 各パッケージのpackage.jsonを更新\r\n _updatePkgJson(version, packageJsonPath);\r\n }\r\n }\r\n}\r\n\r\nfunction _updatePkgJson(version: string, packageJsonPath: string) {\r\n const packageJson = fs.readJsonSync(packageJsonPath, { encoding: 'utf8' });\r\n packageJson.version = version;\r\n fs.writeJsonSync(packageJsonPath, packageJson, {\r\n encoding: 'utf8',\r\n spaces: 2,\r\n });\r\n}\r\n"],"mappings":";;;;;;;;;AASA,eAA8B,IAAI,SAAiB,UAAsB,EAAE,EAAE;CAC3E,MAAM,EACJ,2BAA2B,gBAC3B,eAAe,eACb;AAEJ,KAAI,GAAG,WAAW,yBAAyB,CAEzC,gBAAe,SAAS,yBAAyB;CAEnD,MAAM,OAAO,GAAG,YAAY,aAAa;AACzC,MAAK,MAAM,OAAO,MAAM;EACtB,MAAM,cAAc,KAAK,KAAK,cAAc,IAAI;EAChD,MAAM,kBAAkB,KAAK,KAAK,aAAa,eAAe;AAC9D,MAAI,GAAG,WAAW,gBAAgB,CAEhC,gBAAe,SAAS,gBAAgB;;;AAK9C,SAAS,eAAe,SAAiB,iBAAyB;CAChE,MAAM,cAAc,GAAG,aAAa,iBAAiB,EAAE,UAAU,QAAQ,CAAC;AAC1E,aAAY,UAAU;AACtB,IAAG,cAAc,iBAAiB,aAAa;EAC7C,UAAU;EACV,QAAQ;EACT,CAAC"}
|