@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,60 @@
|
|
|
1
|
+
import { JsonReadOptions, JsonWriteOptions } from "fs-extra";
|
|
2
|
+
import { PackageJson } from "type-fest";
|
|
3
|
+
|
|
4
|
+
//#region src/generatePublishPackageJson/types.d.ts
|
|
5
|
+
type GeneratePublishPackageJsonOptions = {
|
|
6
|
+
/**
|
|
7
|
+
* package.jsonのパス
|
|
8
|
+
* @default './package.json'
|
|
9
|
+
*/
|
|
10
|
+
packageJsonPath?: string;
|
|
11
|
+
/**
|
|
12
|
+
* 出力先package.jsonファイルのパス
|
|
13
|
+
* @default './dist/package.json'
|
|
14
|
+
*/
|
|
15
|
+
outputPackageJsonPath?: string;
|
|
16
|
+
/**
|
|
17
|
+
* exportsに設定する値
|
|
18
|
+
* @default
|
|
19
|
+
* {
|
|
20
|
+
* '.': {
|
|
21
|
+
* import: './index.js',
|
|
22
|
+
* reqire: './index.cjs',
|
|
23
|
+
* type: './index.d.ts',
|
|
24
|
+
* },
|
|
25
|
+
* './*': {
|
|
26
|
+
* import: './*\/index.js',
|
|
27
|
+
* reqire: './*\/index.cjs',
|
|
28
|
+
* type: './*\/index.d.ts',
|
|
29
|
+
* },
|
|
30
|
+
* './constants': {
|
|
31
|
+
* import: './constants.js',
|
|
32
|
+
* reqire: './constants.cjs',
|
|
33
|
+
* type: './constants.d.ts',
|
|
34
|
+
* },
|
|
35
|
+
* './*\/constants': {
|
|
36
|
+
* import: './*\/constants.js',
|
|
37
|
+
* reqire: './*\/constants.cjs',
|
|
38
|
+
* type: './*\/constants.d.ts',
|
|
39
|
+
* },
|
|
40
|
+
* }
|
|
41
|
+
*/
|
|
42
|
+
exports?: PackageJson['exports'];
|
|
43
|
+
/**
|
|
44
|
+
* 任意の編集を行う関数
|
|
45
|
+
* @param packageJson 既定の変換を行った後のpackage.jsonの内容
|
|
46
|
+
* @returns 任意の編集を行った後のpackage.jsonの内容
|
|
47
|
+
*/
|
|
48
|
+
transform?(packageJson: PackageJson): PackageJson;
|
|
49
|
+
/**
|
|
50
|
+
* package.json読み込み時のオプション
|
|
51
|
+
*/
|
|
52
|
+
jsonReadOptions?: JsonReadOptions;
|
|
53
|
+
/**
|
|
54
|
+
* package.json書き込み時のオプション
|
|
55
|
+
*/
|
|
56
|
+
jsonWriteOptions?: JsonWriteOptions;
|
|
57
|
+
};
|
|
58
|
+
//#endregion
|
|
59
|
+
export { GeneratePublishPackageJsonOptions };
|
|
60
|
+
//# sourceMappingURL=types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/index.cjs
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_isMatchingPath_isMatchingPath = require('./isMatchingPath/isMatchingPath.cjs');
|
|
3
|
+
require('./isMatchingPath/index.cjs');
|
|
4
|
+
const require_addExports_addExports = require('./addExports/addExports.cjs');
|
|
5
|
+
require('./addExports/index.cjs');
|
|
6
|
+
const require_addJsExtensions_addJsExtensions = require('./addJsExtensions/addJsExtensions.cjs');
|
|
7
|
+
require('./addJsExtensions/index.cjs');
|
|
8
|
+
const require_checkExistence_checkExistence = require('./checkExistence/checkExistence.cjs');
|
|
9
|
+
require('./checkExistence/index.cjs');
|
|
10
|
+
const require_createExternalOptionFunction_createExternalOptionFunction = require('./createExternalOptionFunction/createExternalOptionFunction.cjs');
|
|
11
|
+
require('./createExternalOptionFunction/index.cjs');
|
|
12
|
+
const require_createSassClassNameFunction_createSassClassNameFunction = require('./createSassClassNameFunction/createSassClassNameFunction.cjs');
|
|
13
|
+
require('./createSassClassNameFunction/index.cjs');
|
|
14
|
+
const require_editJsonFile_editJsonFile = require('./editJsonFile/editJsonFile.cjs');
|
|
15
|
+
require('./editJsonFile/index.cjs');
|
|
16
|
+
const require_generatePublishPackageJson_generatePublishPackageJson = require('./generatePublishPackageJson/generatePublishPackageJson.cjs');
|
|
17
|
+
require('./generatePublishPackageJson/index.cjs');
|
|
18
|
+
const require_indexes_indexes = require('./indexes/indexes.cjs');
|
|
19
|
+
require('./indexes/index.cjs');
|
|
20
|
+
const require_installFromLocal_installFromLocal = require('./installFromLocal/installFromLocal.cjs');
|
|
21
|
+
require('./installFromLocal/index.cjs');
|
|
22
|
+
const require_moveFilesToSubdir_moveFilesToSubdir = require('./moveFilesToSubdir/moveFilesToSubdir.cjs');
|
|
23
|
+
require('./moveFilesToSubdir/index.cjs');
|
|
24
|
+
const require_removeFiles_removeFiles = require('./removeFiles/removeFiles.cjs');
|
|
25
|
+
require('./removeFiles/index.cjs');
|
|
26
|
+
const require_ver_ver = require('./ver/ver.cjs');
|
|
27
|
+
require('./ver/index.cjs');
|
|
28
|
+
|
|
29
|
+
exports.addExports = require_addExports_addExports;
|
|
30
|
+
exports.addJsExtensions = require_addJsExtensions_addJsExtensions;
|
|
31
|
+
exports.checkExistence = require_checkExistence_checkExistence;
|
|
32
|
+
exports.createExternalOptionFunction = require_createExternalOptionFunction_createExternalOptionFunction;
|
|
33
|
+
exports.createSassClassNameFunction = require_createSassClassNameFunction_createSassClassNameFunction;
|
|
34
|
+
exports.editJsonFile = require_editJsonFile_editJsonFile;
|
|
35
|
+
exports.generatePublishPackageJson = require_generatePublishPackageJson_generatePublishPackageJson;
|
|
36
|
+
exports.indexes = require_indexes_indexes;
|
|
37
|
+
exports.installFromLocal = require_installFromLocal_installFromLocal;
|
|
38
|
+
exports.isMatchingPath = require_isMatchingPath_isMatchingPath;
|
|
39
|
+
exports.moveFilesToSubdir = require_moveFilesToSubdir_moveFilesToSubdir;
|
|
40
|
+
exports.removeFiles = require_removeFiles_removeFiles;
|
|
41
|
+
exports.ver = require_ver_ver;
|
package/index.d.cts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import isMatchingPath from "./isMatchingPath/isMatchingPath.cjs";
|
|
2
|
+
import addExports from "./addExports/addExports.cjs";
|
|
3
|
+
import addJsExtensions from "./addJsExtensions/addJsExtensions.cjs";
|
|
4
|
+
import checkExistence from "./checkExistence/checkExistence.cjs";
|
|
5
|
+
import createExternalOptionFunction from "./createExternalOptionFunction/createExternalOptionFunction.cjs";
|
|
6
|
+
import createSassClassNameFunction from "./createSassClassNameFunction/createSassClassNameFunction.cjs";
|
|
7
|
+
import editJsonFile from "./editJsonFile/editJsonFile.cjs";
|
|
8
|
+
import generatePublishPackageJson from "./generatePublishPackageJson/generatePublishPackageJson.cjs";
|
|
9
|
+
import indexes from "./indexes/indexes.cjs";
|
|
10
|
+
import installFromLocal from "./installFromLocal/installFromLocal.cjs";
|
|
11
|
+
import moveFilesToSubdir from "./moveFilesToSubdir/moveFilesToSubdir.cjs";
|
|
12
|
+
import removeFiles from "./removeFiles/removeFiles.cjs";
|
|
13
|
+
import ver from "./ver/ver.cjs";
|
|
14
|
+
export { addExports, addJsExtensions, checkExistence, createExternalOptionFunction, createSassClassNameFunction, editJsonFile, generatePublishPackageJson, indexes, installFromLocal, isMatchingPath, moveFilesToSubdir, removeFiles, ver };
|
package/index.d.mts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import isMatchingPath from "./isMatchingPath/isMatchingPath.mjs";
|
|
2
|
+
import addExports from "./addExports/addExports.mjs";
|
|
3
|
+
import addJsExtensions from "./addJsExtensions/addJsExtensions.mjs";
|
|
4
|
+
import checkExistence from "./checkExistence/checkExistence.mjs";
|
|
5
|
+
import createExternalOptionFunction from "./createExternalOptionFunction/createExternalOptionFunction.mjs";
|
|
6
|
+
import createSassClassNameFunction from "./createSassClassNameFunction/createSassClassNameFunction.mjs";
|
|
7
|
+
import editJsonFile from "./editJsonFile/editJsonFile.mjs";
|
|
8
|
+
import generatePublishPackageJson from "./generatePublishPackageJson/generatePublishPackageJson.mjs";
|
|
9
|
+
import indexes from "./indexes/indexes.mjs";
|
|
10
|
+
import installFromLocal from "./installFromLocal/installFromLocal.mjs";
|
|
11
|
+
import moveFilesToSubdir from "./moveFilesToSubdir/moveFilesToSubdir.mjs";
|
|
12
|
+
import removeFiles from "./removeFiles/removeFiles.mjs";
|
|
13
|
+
import ver from "./ver/ver.mjs";
|
|
14
|
+
export { addExports, addJsExtensions, checkExistence, createExternalOptionFunction, createSassClassNameFunction, editJsonFile, generatePublishPackageJson, indexes, installFromLocal, isMatchingPath, moveFilesToSubdir, removeFiles, ver };
|
package/index.mjs
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import isMatchingPath from "./isMatchingPath/isMatchingPath.mjs";
|
|
2
|
+
import "./isMatchingPath/index.mjs";
|
|
3
|
+
import addExports from "./addExports/addExports.mjs";
|
|
4
|
+
import "./addExports/index.mjs";
|
|
5
|
+
import addJsExtensions from "./addJsExtensions/addJsExtensions.mjs";
|
|
6
|
+
import "./addJsExtensions/index.mjs";
|
|
7
|
+
import checkExistence from "./checkExistence/checkExistence.mjs";
|
|
8
|
+
import "./checkExistence/index.mjs";
|
|
9
|
+
import createExternalOptionFunction from "./createExternalOptionFunction/createExternalOptionFunction.mjs";
|
|
10
|
+
import "./createExternalOptionFunction/index.mjs";
|
|
11
|
+
import createSassClassNameFunction from "./createSassClassNameFunction/createSassClassNameFunction.mjs";
|
|
12
|
+
import "./createSassClassNameFunction/index.mjs";
|
|
13
|
+
import editJsonFile from "./editJsonFile/editJsonFile.mjs";
|
|
14
|
+
import "./editJsonFile/index.mjs";
|
|
15
|
+
import generatePublishPackageJson from "./generatePublishPackageJson/generatePublishPackageJson.mjs";
|
|
16
|
+
import "./generatePublishPackageJson/index.mjs";
|
|
17
|
+
import indexes from "./indexes/indexes.mjs";
|
|
18
|
+
import "./indexes/index.mjs";
|
|
19
|
+
import installFromLocal from "./installFromLocal/installFromLocal.mjs";
|
|
20
|
+
import "./installFromLocal/index.mjs";
|
|
21
|
+
import moveFilesToSubdir from "./moveFilesToSubdir/moveFilesToSubdir.mjs";
|
|
22
|
+
import "./moveFilesToSubdir/index.mjs";
|
|
23
|
+
import removeFiles from "./removeFiles/removeFiles.mjs";
|
|
24
|
+
import "./removeFiles/index.mjs";
|
|
25
|
+
import ver from "./ver/ver.mjs";
|
|
26
|
+
import "./ver/index.mjs";
|
|
27
|
+
|
|
28
|
+
export { addExports, addJsExtensions, checkExistence, createExternalOptionFunction, createSassClassNameFunction, editJsonFile, generatePublishPackageJson, indexes, installFromLocal, isMatchingPath, moveFilesToSubdir, removeFiles, ver };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
let fs_extra = require("fs-extra");
|
|
4
|
+
fs_extra = require_runtime.__toESM(fs_extra, 1);
|
|
5
|
+
|
|
6
|
+
//#region src/indexes/constants.ts
|
|
7
|
+
/**
|
|
8
|
+
* types.ts
|
|
9
|
+
*/
|
|
10
|
+
const TYPES = {
|
|
11
|
+
valueType: "base",
|
|
12
|
+
entryType: "file",
|
|
13
|
+
conditions: /^types.ts$/i
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* constants.ts
|
|
17
|
+
*/
|
|
18
|
+
const CONSTANTS = {
|
|
19
|
+
valueType: "base",
|
|
20
|
+
entryType: "file",
|
|
21
|
+
conditions: /^constants.(ts|tsx)$/i
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* TypeScriptとJavaScript
|
|
25
|
+
*/
|
|
26
|
+
const TS_JS = {
|
|
27
|
+
valueType: "base",
|
|
28
|
+
entryType: "file",
|
|
29
|
+
conditions: /.+\.(ts|tsx|js|jsx)$/i
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* 配下にindexファイルのあるディレクトリ
|
|
33
|
+
*/
|
|
34
|
+
const HAS_INDEX_DIR = {
|
|
35
|
+
entryType: "dir",
|
|
36
|
+
conditions: (values, { indexRegex }) => {
|
|
37
|
+
const items = fs_extra.default.readdirSync(values.path);
|
|
38
|
+
for (const item of items) if (indexRegex.test(item)) return true;
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* テストディレクトリ配下
|
|
44
|
+
*/
|
|
45
|
+
const TEST_DIR = {
|
|
46
|
+
valueType: "path",
|
|
47
|
+
conditions: /.+\/__test__\/.+/i
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* ファイル名またはディレクトリ名が`_`で始まる
|
|
51
|
+
*/
|
|
52
|
+
const TEST_FILE = {
|
|
53
|
+
valueType: "base",
|
|
54
|
+
conditions: /.*\.test\.(ts|tsx|js|jsx)$/i
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* ファイル名またはディレクトリ名が`_`で始まる
|
|
58
|
+
*/
|
|
59
|
+
const PRIVATE = {
|
|
60
|
+
valueType: "base",
|
|
61
|
+
conditions: /^_/
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* 拡張子を除いたファイル名が親ディレクトリ名と同じ
|
|
65
|
+
*/
|
|
66
|
+
const MAIN_FILE = {
|
|
67
|
+
entryType: "file",
|
|
68
|
+
conditions: (values) => {
|
|
69
|
+
return values.name === values.dirbase;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* ツール類の入ったディレクトリ
|
|
74
|
+
*/
|
|
75
|
+
const TOOLS_DIR = {
|
|
76
|
+
entryType: "dir",
|
|
77
|
+
conditions: (values, { children }) => {
|
|
78
|
+
const { base } = values;
|
|
79
|
+
return base[0] === base[0].toLowerCase() && children?.every((child) => child.split(".")[0] !== base);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* includeのデフォルト値
|
|
84
|
+
*/
|
|
85
|
+
const DEFAULT_INCLUDE = [TS_JS, HAS_INDEX_DIR];
|
|
86
|
+
/**
|
|
87
|
+
* excludeのデフォルト値
|
|
88
|
+
*/
|
|
89
|
+
const DEFAULT_EXCLUDE = [TEST_DIR, PRIVATE];
|
|
90
|
+
/**
|
|
91
|
+
* exportTypeAllのデフォルト値
|
|
92
|
+
*/
|
|
93
|
+
const DEFAULT_EXPORT_TYPE_ALL = [TYPES];
|
|
94
|
+
/**
|
|
95
|
+
* exportAllのデフォルト値
|
|
96
|
+
*/
|
|
97
|
+
const DEFAULT_EXPORT_ALL = [CONSTANTS];
|
|
98
|
+
/**
|
|
99
|
+
* exportDefaultのデフォルト値
|
|
100
|
+
*/
|
|
101
|
+
const DEFAULT_EXPORT_DEFAULT = [MAIN_FILE];
|
|
102
|
+
/**
|
|
103
|
+
* exportAllAsのデフォルト値
|
|
104
|
+
*/
|
|
105
|
+
const DEFAULT_EXPORT_ALL_AS = [TOOLS_DIR];
|
|
106
|
+
|
|
107
|
+
//#endregion
|
|
108
|
+
exports.CONSTANTS = CONSTANTS;
|
|
109
|
+
exports.DEFAULT_EXCLUDE = DEFAULT_EXCLUDE;
|
|
110
|
+
exports.DEFAULT_EXPORT_ALL = DEFAULT_EXPORT_ALL;
|
|
111
|
+
exports.DEFAULT_EXPORT_ALL_AS = DEFAULT_EXPORT_ALL_AS;
|
|
112
|
+
exports.DEFAULT_EXPORT_DEFAULT = DEFAULT_EXPORT_DEFAULT;
|
|
113
|
+
exports.DEFAULT_EXPORT_TYPE_ALL = DEFAULT_EXPORT_TYPE_ALL;
|
|
114
|
+
exports.DEFAULT_INCLUDE = DEFAULT_INCLUDE;
|
|
115
|
+
exports.HAS_INDEX_DIR = HAS_INDEX_DIR;
|
|
116
|
+
exports.MAIN_FILE = MAIN_FILE;
|
|
117
|
+
exports.PRIVATE = PRIVATE;
|
|
118
|
+
exports.TEST_DIR = TEST_DIR;
|
|
119
|
+
exports.TEST_FILE = TEST_FILE;
|
|
120
|
+
exports.TOOLS_DIR = TOOLS_DIR;
|
|
121
|
+
exports.TS_JS = TS_JS;
|
|
122
|
+
exports.TYPES = TYPES;
|
|
123
|
+
//# sourceMappingURL=constants.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.cjs","names":["fs"],"sources":["../../src/indexes/constants.ts"],"sourcesContent":["import fs from 'fs-extra';\r\nimport type { IsMatchingPathCondition } from '../isMatchingPath';\r\n\r\n/**\r\n * types.ts\r\n */\r\nexport const TYPES: IsMatchingPathCondition = {\r\n valueType: 'base',\r\n entryType: 'file',\r\n conditions: /^types.ts$/i,\r\n};\r\n\r\n/**\r\n * constants.ts\r\n */\r\nexport const CONSTANTS: IsMatchingPathCondition = {\r\n valueType: 'base',\r\n entryType: 'file',\r\n conditions: /^constants.(ts|tsx)$/i,\r\n};\r\n\r\n/**\r\n * TypeScriptとJavaScript\r\n */\r\nexport const TS_JS: IsMatchingPathCondition = {\r\n valueType: 'base',\r\n entryType: 'file',\r\n conditions: /.+\\.(ts|tsx|js|jsx)$/i,\r\n};\r\n\r\n/**\r\n * 配下にindexファイルのあるディレクトリ\r\n */\r\nexport const HAS_INDEX_DIR: IsMatchingPathCondition = {\r\n entryType: 'dir',\r\n conditions: (values, { indexRegex }) => {\r\n const items = fs.readdirSync(values.path);\r\n for (const item of items) {\r\n if (indexRegex.test(item)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n },\r\n};\r\n\r\n/**\r\n * テストディレクトリ配下\r\n */\r\nexport const TEST_DIR: IsMatchingPathCondition = {\r\n valueType: 'path',\r\n conditions: /.+\\/__test__\\/.+/i,\r\n};\r\n\r\n/**\r\n * ファイル名またはディレクトリ名が`_`で始まる\r\n */\r\nexport const TEST_FILE: IsMatchingPathCondition = {\r\n valueType: 'base',\r\n conditions: /.*\\.test\\.(ts|tsx|js|jsx)$/i,\r\n};\r\n\r\n/**\r\n * ファイル名またはディレクトリ名が`_`で始まる\r\n */\r\nexport const PRIVATE: IsMatchingPathCondition = {\r\n valueType: 'base',\r\n conditions: /^_/,\r\n};\r\n\r\n/**\r\n * 拡張子を除いたファイル名が親ディレクトリ名と同じ\r\n */\r\nexport const MAIN_FILE: IsMatchingPathCondition = {\r\n entryType: 'file',\r\n conditions: (values) => {\r\n return values.name === values.dirbase;\r\n },\r\n};\r\n\r\n/**\r\n * ツール類の入ったディレクトリ\r\n */\r\nexport const TOOLS_DIR: IsMatchingPathCondition = {\r\n entryType: 'dir',\r\n conditions: (values, { children }) => {\r\n const { base } = values;\r\n return (\r\n // 先頭が小文字\r\n base[0] === base[0].toLowerCase() &&\r\n // 子要素にディレクトリと同じ名称のファイルが無い\r\n children?.every((child: string) => child.split('.')[0] !== base)\r\n );\r\n },\r\n};\r\n\r\n/**\r\n * includeのデフォルト値\r\n */\r\nexport const DEFAULT_INCLUDE = [\r\n // TypeScript,JavaScriptのファイルを対象\r\n TS_JS,\r\n // 配下にindex.tsを持つディレクトリを対象\r\n HAS_INDEX_DIR,\r\n];\r\n\r\n/**\r\n * excludeのデフォルト値\r\n */\r\nexport const DEFAULT_EXCLUDE = [\r\n // __test__フォルダ配下の全てを除外\r\n TEST_DIR,\r\n // ディレクトリ名、ファイル名が_で始まるものを除外\r\n PRIVATE,\r\n];\r\n\r\n/**\r\n * exportTypeAllのデフォルト値\r\n */\r\nexport const DEFAULT_EXPORT_TYPE_ALL = [TYPES];\r\n\r\n/**\r\n * exportAllのデフォルト値\r\n */\r\nexport const DEFAULT_EXPORT_ALL = [CONSTANTS];\r\n\r\n/**\r\n * exportDefaultのデフォルト値\r\n */\r\nexport const DEFAULT_EXPORT_DEFAULT = [MAIN_FILE];\r\n\r\n/**\r\n * exportAllAsのデフォルト値\r\n */\r\nexport const DEFAULT_EXPORT_ALL_AS = [TOOLS_DIR];\r\n"],"mappings":";;;;;;;;;AAMA,MAAa,QAAiC;CAC5C,WAAW;CACX,WAAW;CACX,YAAY;CACb;;;;AAKD,MAAa,YAAqC;CAChD,WAAW;CACX,WAAW;CACX,YAAY;CACb;;;;AAKD,MAAa,QAAiC;CAC5C,WAAW;CACX,WAAW;CACX,YAAY;CACb;;;;AAKD,MAAa,gBAAyC;CACpD,WAAW;CACX,aAAa,QAAQ,EAAE,iBAAiB;EACtC,MAAM,QAAQA,iBAAG,YAAY,OAAO,KAAK;AACzC,OAAK,MAAM,QAAQ,MACjB,KAAI,WAAW,KAAK,KAAK,CACvB,QAAO;AAGX,SAAO;;CAEV;;;;AAKD,MAAa,WAAoC;CAC/C,WAAW;CACX,YAAY;CACb;;;;AAKD,MAAa,YAAqC;CAChD,WAAW;CACX,YAAY;CACb;;;;AAKD,MAAa,UAAmC;CAC9C,WAAW;CACX,YAAY;CACb;;;;AAKD,MAAa,YAAqC;CAChD,WAAW;CACX,aAAa,WAAW;AACtB,SAAO,OAAO,SAAS,OAAO;;CAEjC;;;;AAKD,MAAa,YAAqC;CAChD,WAAW;CACX,aAAa,QAAQ,EAAE,eAAe;EACpC,MAAM,EAAE,SAAS;AACjB,SAEE,KAAK,OAAO,KAAK,GAAG,aAAa,IAEjC,UAAU,OAAO,UAAkB,MAAM,MAAM,IAAI,CAAC,OAAO,KAAK;;CAGrE;;;;AAKD,MAAa,kBAAkB,CAE7B,OAEA,cACD;;;;AAKD,MAAa,kBAAkB,CAE7B,UAEA,QACD;;;;AAKD,MAAa,0BAA0B,CAAC,MAAM;;;;AAK9C,MAAa,qBAAqB,CAAC,UAAU;;;;AAK7C,MAAa,yBAAyB,CAAC,UAAU;;;;AAKjD,MAAa,wBAAwB,CAAC,UAAU"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { ConditionConfig, ConditionFnOptions, IsMatchingPathCondition } from "../isMatchingPath/types.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/indexes/constants.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* types.ts
|
|
6
|
+
*/
|
|
7
|
+
declare const TYPES: IsMatchingPathCondition;
|
|
8
|
+
/**
|
|
9
|
+
* constants.ts
|
|
10
|
+
*/
|
|
11
|
+
declare const CONSTANTS: IsMatchingPathCondition;
|
|
12
|
+
/**
|
|
13
|
+
* TypeScriptとJavaScript
|
|
14
|
+
*/
|
|
15
|
+
declare const TS_JS: IsMatchingPathCondition;
|
|
16
|
+
/**
|
|
17
|
+
* 配下にindexファイルのあるディレクトリ
|
|
18
|
+
*/
|
|
19
|
+
declare const HAS_INDEX_DIR: IsMatchingPathCondition;
|
|
20
|
+
/**
|
|
21
|
+
* テストディレクトリ配下
|
|
22
|
+
*/
|
|
23
|
+
declare const TEST_DIR: IsMatchingPathCondition;
|
|
24
|
+
/**
|
|
25
|
+
* ファイル名またはディレクトリ名が`_`で始まる
|
|
26
|
+
*/
|
|
27
|
+
declare const TEST_FILE: IsMatchingPathCondition;
|
|
28
|
+
/**
|
|
29
|
+
* ファイル名またはディレクトリ名が`_`で始まる
|
|
30
|
+
*/
|
|
31
|
+
declare const PRIVATE: IsMatchingPathCondition;
|
|
32
|
+
/**
|
|
33
|
+
* 拡張子を除いたファイル名が親ディレクトリ名と同じ
|
|
34
|
+
*/
|
|
35
|
+
declare const MAIN_FILE: IsMatchingPathCondition;
|
|
36
|
+
/**
|
|
37
|
+
* ツール類の入ったディレクトリ
|
|
38
|
+
*/
|
|
39
|
+
declare const TOOLS_DIR: IsMatchingPathCondition;
|
|
40
|
+
/**
|
|
41
|
+
* includeのデフォルト値
|
|
42
|
+
*/
|
|
43
|
+
declare const DEFAULT_INCLUDE: ConditionConfig<ConditionFnOptions>[];
|
|
44
|
+
/**
|
|
45
|
+
* excludeのデフォルト値
|
|
46
|
+
*/
|
|
47
|
+
declare const DEFAULT_EXCLUDE: ConditionConfig<ConditionFnOptions>[];
|
|
48
|
+
/**
|
|
49
|
+
* exportTypeAllのデフォルト値
|
|
50
|
+
*/
|
|
51
|
+
declare const DEFAULT_EXPORT_TYPE_ALL: ConditionConfig<ConditionFnOptions>[];
|
|
52
|
+
/**
|
|
53
|
+
* exportAllのデフォルト値
|
|
54
|
+
*/
|
|
55
|
+
declare const DEFAULT_EXPORT_ALL: ConditionConfig<ConditionFnOptions>[];
|
|
56
|
+
/**
|
|
57
|
+
* exportDefaultのデフォルト値
|
|
58
|
+
*/
|
|
59
|
+
declare const DEFAULT_EXPORT_DEFAULT: ConditionConfig<ConditionFnOptions>[];
|
|
60
|
+
/**
|
|
61
|
+
* exportAllAsのデフォルト値
|
|
62
|
+
*/
|
|
63
|
+
declare const DEFAULT_EXPORT_ALL_AS: ConditionConfig<ConditionFnOptions>[];
|
|
64
|
+
//#endregion
|
|
65
|
+
export { CONSTANTS, DEFAULT_EXCLUDE, DEFAULT_EXPORT_ALL, DEFAULT_EXPORT_ALL_AS, DEFAULT_EXPORT_DEFAULT, DEFAULT_EXPORT_TYPE_ALL, DEFAULT_INCLUDE, HAS_INDEX_DIR, MAIN_FILE, PRIVATE, TEST_DIR, TEST_FILE, TOOLS_DIR, TS_JS, TYPES };
|
|
66
|
+
//# sourceMappingURL=constants.d.cts.map
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { ConditionConfig, ConditionFnOptions, IsMatchingPathCondition } from "../isMatchingPath/types.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/indexes/constants.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* types.ts
|
|
6
|
+
*/
|
|
7
|
+
declare const TYPES: IsMatchingPathCondition;
|
|
8
|
+
/**
|
|
9
|
+
* constants.ts
|
|
10
|
+
*/
|
|
11
|
+
declare const CONSTANTS: IsMatchingPathCondition;
|
|
12
|
+
/**
|
|
13
|
+
* TypeScriptとJavaScript
|
|
14
|
+
*/
|
|
15
|
+
declare const TS_JS: IsMatchingPathCondition;
|
|
16
|
+
/**
|
|
17
|
+
* 配下にindexファイルのあるディレクトリ
|
|
18
|
+
*/
|
|
19
|
+
declare const HAS_INDEX_DIR: IsMatchingPathCondition;
|
|
20
|
+
/**
|
|
21
|
+
* テストディレクトリ配下
|
|
22
|
+
*/
|
|
23
|
+
declare const TEST_DIR: IsMatchingPathCondition;
|
|
24
|
+
/**
|
|
25
|
+
* ファイル名またはディレクトリ名が`_`で始まる
|
|
26
|
+
*/
|
|
27
|
+
declare const TEST_FILE: IsMatchingPathCondition;
|
|
28
|
+
/**
|
|
29
|
+
* ファイル名またはディレクトリ名が`_`で始まる
|
|
30
|
+
*/
|
|
31
|
+
declare const PRIVATE: IsMatchingPathCondition;
|
|
32
|
+
/**
|
|
33
|
+
* 拡張子を除いたファイル名が親ディレクトリ名と同じ
|
|
34
|
+
*/
|
|
35
|
+
declare const MAIN_FILE: IsMatchingPathCondition;
|
|
36
|
+
/**
|
|
37
|
+
* ツール類の入ったディレクトリ
|
|
38
|
+
*/
|
|
39
|
+
declare const TOOLS_DIR: IsMatchingPathCondition;
|
|
40
|
+
/**
|
|
41
|
+
* includeのデフォルト値
|
|
42
|
+
*/
|
|
43
|
+
declare const DEFAULT_INCLUDE: ConditionConfig<ConditionFnOptions>[];
|
|
44
|
+
/**
|
|
45
|
+
* excludeのデフォルト値
|
|
46
|
+
*/
|
|
47
|
+
declare const DEFAULT_EXCLUDE: ConditionConfig<ConditionFnOptions>[];
|
|
48
|
+
/**
|
|
49
|
+
* exportTypeAllのデフォルト値
|
|
50
|
+
*/
|
|
51
|
+
declare const DEFAULT_EXPORT_TYPE_ALL: ConditionConfig<ConditionFnOptions>[];
|
|
52
|
+
/**
|
|
53
|
+
* exportAllのデフォルト値
|
|
54
|
+
*/
|
|
55
|
+
declare const DEFAULT_EXPORT_ALL: ConditionConfig<ConditionFnOptions>[];
|
|
56
|
+
/**
|
|
57
|
+
* exportDefaultのデフォルト値
|
|
58
|
+
*/
|
|
59
|
+
declare const DEFAULT_EXPORT_DEFAULT: ConditionConfig<ConditionFnOptions>[];
|
|
60
|
+
/**
|
|
61
|
+
* exportAllAsのデフォルト値
|
|
62
|
+
*/
|
|
63
|
+
declare const DEFAULT_EXPORT_ALL_AS: ConditionConfig<ConditionFnOptions>[];
|
|
64
|
+
//#endregion
|
|
65
|
+
export { CONSTANTS, DEFAULT_EXCLUDE, DEFAULT_EXPORT_ALL, DEFAULT_EXPORT_ALL_AS, DEFAULT_EXPORT_DEFAULT, DEFAULT_EXPORT_TYPE_ALL, DEFAULT_INCLUDE, HAS_INDEX_DIR, MAIN_FILE, PRIVATE, TEST_DIR, TEST_FILE, TOOLS_DIR, TS_JS, TYPES };
|
|
66
|
+
//# sourceMappingURL=constants.d.mts.map
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import fs from "fs-extra";
|
|
2
|
+
|
|
3
|
+
//#region src/indexes/constants.ts
|
|
4
|
+
/**
|
|
5
|
+
* types.ts
|
|
6
|
+
*/
|
|
7
|
+
const TYPES = {
|
|
8
|
+
valueType: "base",
|
|
9
|
+
entryType: "file",
|
|
10
|
+
conditions: /^types.ts$/i
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* constants.ts
|
|
14
|
+
*/
|
|
15
|
+
const CONSTANTS = {
|
|
16
|
+
valueType: "base",
|
|
17
|
+
entryType: "file",
|
|
18
|
+
conditions: /^constants.(ts|tsx)$/i
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* TypeScriptとJavaScript
|
|
22
|
+
*/
|
|
23
|
+
const TS_JS = {
|
|
24
|
+
valueType: "base",
|
|
25
|
+
entryType: "file",
|
|
26
|
+
conditions: /.+\.(ts|tsx|js|jsx)$/i
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* 配下にindexファイルのあるディレクトリ
|
|
30
|
+
*/
|
|
31
|
+
const HAS_INDEX_DIR = {
|
|
32
|
+
entryType: "dir",
|
|
33
|
+
conditions: (values, { indexRegex }) => {
|
|
34
|
+
const items = fs.readdirSync(values.path);
|
|
35
|
+
for (const item of items) if (indexRegex.test(item)) return true;
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* テストディレクトリ配下
|
|
41
|
+
*/
|
|
42
|
+
const TEST_DIR = {
|
|
43
|
+
valueType: "path",
|
|
44
|
+
conditions: /.+\/__test__\/.+/i
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* ファイル名またはディレクトリ名が`_`で始まる
|
|
48
|
+
*/
|
|
49
|
+
const TEST_FILE = {
|
|
50
|
+
valueType: "base",
|
|
51
|
+
conditions: /.*\.test\.(ts|tsx|js|jsx)$/i
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* ファイル名またはディレクトリ名が`_`で始まる
|
|
55
|
+
*/
|
|
56
|
+
const PRIVATE = {
|
|
57
|
+
valueType: "base",
|
|
58
|
+
conditions: /^_/
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* 拡張子を除いたファイル名が親ディレクトリ名と同じ
|
|
62
|
+
*/
|
|
63
|
+
const MAIN_FILE = {
|
|
64
|
+
entryType: "file",
|
|
65
|
+
conditions: (values) => {
|
|
66
|
+
return values.name === values.dirbase;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* ツール類の入ったディレクトリ
|
|
71
|
+
*/
|
|
72
|
+
const TOOLS_DIR = {
|
|
73
|
+
entryType: "dir",
|
|
74
|
+
conditions: (values, { children }) => {
|
|
75
|
+
const { base } = values;
|
|
76
|
+
return base[0] === base[0].toLowerCase() && children?.every((child) => child.split(".")[0] !== base);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* includeのデフォルト値
|
|
81
|
+
*/
|
|
82
|
+
const DEFAULT_INCLUDE = [TS_JS, HAS_INDEX_DIR];
|
|
83
|
+
/**
|
|
84
|
+
* excludeのデフォルト値
|
|
85
|
+
*/
|
|
86
|
+
const DEFAULT_EXCLUDE = [TEST_DIR, PRIVATE];
|
|
87
|
+
/**
|
|
88
|
+
* exportTypeAllのデフォルト値
|
|
89
|
+
*/
|
|
90
|
+
const DEFAULT_EXPORT_TYPE_ALL = [TYPES];
|
|
91
|
+
/**
|
|
92
|
+
* exportAllのデフォルト値
|
|
93
|
+
*/
|
|
94
|
+
const DEFAULT_EXPORT_ALL = [CONSTANTS];
|
|
95
|
+
/**
|
|
96
|
+
* exportDefaultのデフォルト値
|
|
97
|
+
*/
|
|
98
|
+
const DEFAULT_EXPORT_DEFAULT = [MAIN_FILE];
|
|
99
|
+
/**
|
|
100
|
+
* exportAllAsのデフォルト値
|
|
101
|
+
*/
|
|
102
|
+
const DEFAULT_EXPORT_ALL_AS = [TOOLS_DIR];
|
|
103
|
+
|
|
104
|
+
//#endregion
|
|
105
|
+
export { CONSTANTS, DEFAULT_EXCLUDE, DEFAULT_EXPORT_ALL, DEFAULT_EXPORT_ALL_AS, DEFAULT_EXPORT_DEFAULT, DEFAULT_EXPORT_TYPE_ALL, DEFAULT_INCLUDE, HAS_INDEX_DIR, MAIN_FILE, PRIVATE, TEST_DIR, TEST_FILE, TOOLS_DIR, TS_JS, TYPES };
|
|
106
|
+
//# sourceMappingURL=constants.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.mjs","names":[],"sources":["../../src/indexes/constants.ts"],"sourcesContent":["import fs from 'fs-extra';\r\nimport type { IsMatchingPathCondition } from '../isMatchingPath';\r\n\r\n/**\r\n * types.ts\r\n */\r\nexport const TYPES: IsMatchingPathCondition = {\r\n valueType: 'base',\r\n entryType: 'file',\r\n conditions: /^types.ts$/i,\r\n};\r\n\r\n/**\r\n * constants.ts\r\n */\r\nexport const CONSTANTS: IsMatchingPathCondition = {\r\n valueType: 'base',\r\n entryType: 'file',\r\n conditions: /^constants.(ts|tsx)$/i,\r\n};\r\n\r\n/**\r\n * TypeScriptとJavaScript\r\n */\r\nexport const TS_JS: IsMatchingPathCondition = {\r\n valueType: 'base',\r\n entryType: 'file',\r\n conditions: /.+\\.(ts|tsx|js|jsx)$/i,\r\n};\r\n\r\n/**\r\n * 配下にindexファイルのあるディレクトリ\r\n */\r\nexport const HAS_INDEX_DIR: IsMatchingPathCondition = {\r\n entryType: 'dir',\r\n conditions: (values, { indexRegex }) => {\r\n const items = fs.readdirSync(values.path);\r\n for (const item of items) {\r\n if (indexRegex.test(item)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n },\r\n};\r\n\r\n/**\r\n * テストディレクトリ配下\r\n */\r\nexport const TEST_DIR: IsMatchingPathCondition = {\r\n valueType: 'path',\r\n conditions: /.+\\/__test__\\/.+/i,\r\n};\r\n\r\n/**\r\n * ファイル名またはディレクトリ名が`_`で始まる\r\n */\r\nexport const TEST_FILE: IsMatchingPathCondition = {\r\n valueType: 'base',\r\n conditions: /.*\\.test\\.(ts|tsx|js|jsx)$/i,\r\n};\r\n\r\n/**\r\n * ファイル名またはディレクトリ名が`_`で始まる\r\n */\r\nexport const PRIVATE: IsMatchingPathCondition = {\r\n valueType: 'base',\r\n conditions: /^_/,\r\n};\r\n\r\n/**\r\n * 拡張子を除いたファイル名が親ディレクトリ名と同じ\r\n */\r\nexport const MAIN_FILE: IsMatchingPathCondition = {\r\n entryType: 'file',\r\n conditions: (values) => {\r\n return values.name === values.dirbase;\r\n },\r\n};\r\n\r\n/**\r\n * ツール類の入ったディレクトリ\r\n */\r\nexport const TOOLS_DIR: IsMatchingPathCondition = {\r\n entryType: 'dir',\r\n conditions: (values, { children }) => {\r\n const { base } = values;\r\n return (\r\n // 先頭が小文字\r\n base[0] === base[0].toLowerCase() &&\r\n // 子要素にディレクトリと同じ名称のファイルが無い\r\n children?.every((child: string) => child.split('.')[0] !== base)\r\n );\r\n },\r\n};\r\n\r\n/**\r\n * includeのデフォルト値\r\n */\r\nexport const DEFAULT_INCLUDE = [\r\n // TypeScript,JavaScriptのファイルを対象\r\n TS_JS,\r\n // 配下にindex.tsを持つディレクトリを対象\r\n HAS_INDEX_DIR,\r\n];\r\n\r\n/**\r\n * excludeのデフォルト値\r\n */\r\nexport const DEFAULT_EXCLUDE = [\r\n // __test__フォルダ配下の全てを除外\r\n TEST_DIR,\r\n // ディレクトリ名、ファイル名が_で始まるものを除外\r\n PRIVATE,\r\n];\r\n\r\n/**\r\n * exportTypeAllのデフォルト値\r\n */\r\nexport const DEFAULT_EXPORT_TYPE_ALL = [TYPES];\r\n\r\n/**\r\n * exportAllのデフォルト値\r\n */\r\nexport const DEFAULT_EXPORT_ALL = [CONSTANTS];\r\n\r\n/**\r\n * exportDefaultのデフォルト値\r\n */\r\nexport const DEFAULT_EXPORT_DEFAULT = [MAIN_FILE];\r\n\r\n/**\r\n * exportAllAsのデフォルト値\r\n */\r\nexport const DEFAULT_EXPORT_ALL_AS = [TOOLS_DIR];\r\n"],"mappings":";;;;;;AAMA,MAAa,QAAiC;CAC5C,WAAW;CACX,WAAW;CACX,YAAY;CACb;;;;AAKD,MAAa,YAAqC;CAChD,WAAW;CACX,WAAW;CACX,YAAY;CACb;;;;AAKD,MAAa,QAAiC;CAC5C,WAAW;CACX,WAAW;CACX,YAAY;CACb;;;;AAKD,MAAa,gBAAyC;CACpD,WAAW;CACX,aAAa,QAAQ,EAAE,iBAAiB;EACtC,MAAM,QAAQ,GAAG,YAAY,OAAO,KAAK;AACzC,OAAK,MAAM,QAAQ,MACjB,KAAI,WAAW,KAAK,KAAK,CACvB,QAAO;AAGX,SAAO;;CAEV;;;;AAKD,MAAa,WAAoC;CAC/C,WAAW;CACX,YAAY;CACb;;;;AAKD,MAAa,YAAqC;CAChD,WAAW;CACX,YAAY;CACb;;;;AAKD,MAAa,UAAmC;CAC9C,WAAW;CACX,YAAY;CACb;;;;AAKD,MAAa,YAAqC;CAChD,WAAW;CACX,aAAa,WAAW;AACtB,SAAO,OAAO,SAAS,OAAO;;CAEjC;;;;AAKD,MAAa,YAAqC;CAChD,WAAW;CACX,aAAa,QAAQ,EAAE,eAAe;EACpC,MAAM,EAAE,SAAS;AACjB,SAEE,KAAK,OAAO,KAAK,GAAG,aAAa,IAEjC,UAAU,OAAO,UAAkB,MAAM,MAAM,IAAI,CAAC,OAAO,KAAK;;CAGrE;;;;AAKD,MAAa,kBAAkB,CAE7B,OAEA,cACD;;;;AAKD,MAAa,kBAAkB,CAE7B,UAEA,QACD;;;;AAKD,MAAa,0BAA0B,CAAC,MAAM;;;;AAK9C,MAAa,qBAAqB,CAAC,UAAU;;;;AAK7C,MAAa,yBAAyB,CAAC,UAAU;;;;AAKjD,MAAa,wBAAwB,CAAC,UAAU"}
|