@bemoje/monorepo 1.2.1 → 1.2.2
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/lib/index.cjs +19 -5219
- package/lib/index.d.cts +2765 -26
- package/lib/index.d.ts +2765 -26
- package/lib/index.js +14 -5217
- package/package.json +178 -298
- package/lib/MonoRepo.cjs +0 -7370
- package/lib/MonoRepo.d.cts +0 -10
- package/lib/MonoRepo.d.ts +0 -10
- package/lib/MonoRepo.js +0 -7361
- package/lib/code/AbstractCode.cjs +0 -5568
- package/lib/code/AbstractCode.d.cts +0 -30
- package/lib/code/AbstractCode.d.ts +0 -30
- package/lib/code/AbstractCode.js +0 -5562
- package/lib/code/CodeBlock.cjs +0 -5614
- package/lib/code/CodeBlock.d.cts +0 -22
- package/lib/code/CodeBlock.d.ts +0 -22
- package/lib/code/CodeBlock.js +0 -5608
- package/lib/code/TsCode.cjs +0 -7370
- package/lib/code/TsCode.d.cts +0 -10
- package/lib/code/TsCode.d.ts +0 -10
- package/lib/code/TsCode.js +0 -7361
- package/lib/code/imports/ImportKeywords.cjs +0 -5652
- package/lib/code/imports/ImportKeywords.d.cts +0 -10
- package/lib/code/imports/ImportKeywords.d.ts +0 -10
- package/lib/code/imports/ImportKeywords.js +0 -5646
- package/lib/code/imports/ImportSpecifiers.cjs +0 -5708
- package/lib/code/imports/ImportSpecifiers.d.cts +0 -10
- package/lib/code/imports/ImportSpecifiers.d.ts +0 -10
- package/lib/code/imports/ImportSpecifiers.js +0 -5702
- package/lib/code/imports/ImportStatement.cjs +0 -7372
- package/lib/code/imports/ImportStatement.d.cts +0 -10
- package/lib/code/imports/ImportStatement.d.ts +0 -10
- package/lib/code/imports/ImportStatement.js +0 -7363
- package/lib/code/imports/ModuleSpecifier.cjs +0 -7372
- package/lib/code/imports/ModuleSpecifier.d.cts +0 -10
- package/lib/code/imports/ModuleSpecifier.d.ts +0 -10
- package/lib/code/imports/ModuleSpecifier.js +0 -7363
- package/lib/common/AbstractBase.cjs +0 -638
- package/lib/common/AbstractBase.d.cts +0 -3
- package/lib/common/AbstractBase.d.ts +0 -3
- package/lib/common/AbstractBase.js +0 -634
- package/lib/file/File.cjs +0 -5496
- package/lib/file/File.d.cts +0 -10
- package/lib/file/File.d.ts +0 -10
- package/lib/file/File.js +0 -5490
- package/lib/file/TestFile.cjs +0 -7368
- package/lib/file/TestFile.d.cts +0 -10
- package/lib/file/TestFile.d.ts +0 -10
- package/lib/file/TestFile.js +0 -7359
- package/lib/file/TsFile.cjs +0 -7368
- package/lib/file/TsFile.d.cts +0 -10
- package/lib/file/TsFile.d.ts +0 -10
- package/lib/file/TsFile.js +0 -7359
- package/lib/methods/findWorkspacePackageName.cjs +0 -86
- package/lib/methods/findWorkspacePackageName.d.cts +0 -6
- package/lib/methods/findWorkspacePackageName.d.ts +0 -6
- package/lib/methods/findWorkspacePackageName.js +0 -78
- package/lib/methods/getAllImports.cjs +0 -20
- package/lib/methods/getAllImports.d.cts +0 -17
- package/lib/methods/getAllImports.d.ts +0 -17
- package/lib/methods/getAllImports.js +0 -18
- package/lib/methods/getAllWorkspacePackageJsonPaths.cjs +0 -57
- package/lib/methods/getAllWorkspacePackageJsonPaths.d.cts +0 -6
- package/lib/methods/getAllWorkspacePackageJsonPaths.d.ts +0 -6
- package/lib/methods/getAllWorkspacePackageJsonPaths.js +0 -49
- package/lib/methods/getAllWorkspacePackageJsons.cjs +0 -66
- package/lib/methods/getAllWorkspacePackageJsons.d.cts +0 -6
- package/lib/methods/getAllWorkspacePackageJsons.d.ts +0 -6
- package/lib/methods/getAllWorkspacePackageJsons.js +0 -58
- package/lib/methods/getAllWorkspacePackageNames.cjs +0 -75
- package/lib/methods/getAllWorkspacePackageNames.d.cts +0 -6
- package/lib/methods/getAllWorkspacePackageNames.d.ts +0 -6
- package/lib/methods/getAllWorkspacePackageNames.js +0 -67
- package/lib/methods/getAllWorkspacePaths.cjs +0 -50
- package/lib/methods/getAllWorkspacePaths.d.cts +0 -6
- package/lib/methods/getAllWorkspacePaths.d.ts +0 -6
- package/lib/methods/getAllWorkspacePaths.js +0 -42
- package/lib/methods/getImportsRecursively.cjs +0 -7577
- package/lib/methods/getImportsRecursively.d.cts +0 -37
- package/lib/methods/getImportsRecursively.d.ts +0 -37
- package/lib/methods/getImportsRecursively.js +0 -7566
- package/lib/methods/getRepoPackageJson.cjs +0 -40
- package/lib/methods/getRepoPackageJson.d.cts +0 -6
- package/lib/methods/getRepoPackageJson.d.ts +0 -6
- package/lib/methods/getRepoPackageJson.js +0 -32
- package/lib/methods/getRepoPackageJsonPath.cjs +0 -34
- package/lib/methods/getRepoPackageJsonPath.d.cts +0 -6
- package/lib/methods/getRepoPackageJsonPath.d.ts +0 -6
- package/lib/methods/getRepoPackageJsonPath.js +0 -26
- package/lib/repo/Workspace.cjs +0 -7370
- package/lib/repo/Workspace.d.cts +0 -10
- package/lib/repo/Workspace.d.ts +0 -10
- package/lib/repo/Workspace.js +0 -7361
- package/lib/util/SemanticExtnamePrefix.cjs +0 -13
- package/lib/util/SemanticExtnamePrefix.d.cts +0 -14
- package/lib/util/SemanticExtnamePrefix.d.ts +0 -14
- package/lib/util/SemanticExtnamePrefix.js +0 -11
- package/lib/util/SemanticExtnamePrefixDescriptions.cjs +0 -13
- package/lib/util/SemanticExtnamePrefixDescriptions.d.cts +0 -15
- package/lib/util/SemanticExtnamePrefixDescriptions.d.ts +0 -15
- package/lib/util/SemanticExtnamePrefixDescriptions.js +0 -11
- package/lib/util/SemanticExtnamePrefixes.cjs +0 -18
- package/lib/util/SemanticExtnamePrefixes.d.cts +0 -97
- package/lib/util/SemanticExtnamePrefixes.d.ts +0 -97
- package/lib/util/SemanticExtnamePrefixes.js +0 -14
- package/lib/util/getRepoRootDirpath.cjs +0 -30
- package/lib/util/getRepoRootDirpath.d.cts +0 -6
- package/lib/util/getRepoRootDirpath.d.ts +0 -6
- package/lib/util/getRepoRootDirpath.js +0 -22
- package/lib/util/getWorkspaceDirpaths.cjs +0 -42
- package/lib/util/getWorkspaceDirpaths.d.cts +0 -6
- package/lib/util/getWorkspaceDirpaths.d.ts +0 -6
- package/lib/util/getWorkspaceDirpaths.js +0 -34
- package/lib/util/hasExtnamePrefix.cjs +0 -27
- package/lib/util/hasExtnamePrefix.d.cts +0 -38
- package/lib/util/hasExtnamePrefix.d.ts +0 -38
- package/lib/util/hasExtnamePrefix.js +0 -25
- package/lib/util/resolveModuleImportPath.cjs +0 -51
- package/lib/util/resolveModuleImportPath.d.cts +0 -8
- package/lib/util/resolveModuleImportPath.d.ts +0 -8
- package/lib/util/resolveModuleImportPath.js +0 -42
- package/lib/util/semverVersionBump.cjs +0 -30
- package/lib/util/semverVersionBump.d.cts +0 -22
- package/lib/util/semverVersionBump.d.ts +0 -22
- package/lib/util/semverVersionBump.js +0 -28
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var typescript = require('typescript');
|
|
4
|
-
var fs2 = require('fs-extra/esm');
|
|
5
|
-
var fs = require('fs-extra');
|
|
6
|
-
var onetime = require('onetime');
|
|
7
|
-
var path = require('upath');
|
|
8
|
-
|
|
9
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
-
|
|
11
|
-
var fs2__default = /*#__PURE__*/_interopDefault(fs2);
|
|
12
|
-
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
13
|
-
var onetime__default = /*#__PURE__*/_interopDefault(onetime);
|
|
14
|
-
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
15
|
-
|
|
16
|
-
var __defProp = Object.defineProperty;
|
|
17
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
18
|
-
var getRepoRootDirpath = onetime__default.default(/* @__PURE__ */ __name(function getRepoRootDirpath2() {
|
|
19
|
-
return (/* @__PURE__ */ __name(function recurse(dirpath = process.cwd()) {
|
|
20
|
-
dirpath = path__default.default.normalizeSafe(dirpath);
|
|
21
|
-
const pkgpath = path__default.default.joinSafe(dirpath, "package.json");
|
|
22
|
-
if (fs__default.default.existsSync(pkgpath) && fs__default.default.readJsonSync(pkgpath)?.workspaces) {
|
|
23
|
-
return dirpath;
|
|
24
|
-
}
|
|
25
|
-
const parent = path__default.default.dirname(dirpath);
|
|
26
|
-
if (parent !== dirpath) {
|
|
27
|
-
return recurse(parent);
|
|
28
|
-
}
|
|
29
|
-
throw new Error(`Could not find repo root from process.cwd(): ${process.cwd()}`);
|
|
30
|
-
}, "recurse"))();
|
|
31
|
-
}, "getRepoRootDirpath"));
|
|
32
|
-
function resolveModuleImportPath(filepath, importFrom) {
|
|
33
|
-
const rootdir = getRepoRootDirpath();
|
|
34
|
-
const result = typescript.resolveModuleName(importFrom, filepath, {
|
|
35
|
-
paths: fs2__default.default.readJsonSync(path__default.default.joinSafe(rootdir, "tsconfig.paths.json")).compilerOptions.paths,
|
|
36
|
-
allowJs: true,
|
|
37
|
-
allowArbitraryExtensions: true,
|
|
38
|
-
allowImportingTsExtensions: true,
|
|
39
|
-
allowSyntheticDefaultImports: true,
|
|
40
|
-
esModuleInterop: true,
|
|
41
|
-
strict: false
|
|
42
|
-
}, typescript.createCompilerHost({}, true));
|
|
43
|
-
const f = result.resolvedModule?.resolvedFileName;
|
|
44
|
-
if (f) {
|
|
45
|
-
result.resolvedModule.resolvedFileName = path__default.default.relative(rootdir, f);
|
|
46
|
-
}
|
|
47
|
-
return result.resolvedModule;
|
|
48
|
-
}
|
|
49
|
-
__name(resolveModuleImportPath, "resolveModuleImportPath");
|
|
50
|
-
|
|
51
|
-
exports.resolveModuleImportPath = resolveModuleImportPath;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as typescript from 'typescript';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Returns the resolved import path (relative from repo root)
|
|
5
|
-
*/
|
|
6
|
-
declare function resolveModuleImportPath(filepath: string, importFrom: string): typescript.ResolvedModuleFull | undefined;
|
|
7
|
-
|
|
8
|
-
export { resolveModuleImportPath };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as typescript from 'typescript';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Returns the resolved import path (relative from repo root)
|
|
5
|
-
*/
|
|
6
|
-
declare function resolveModuleImportPath(filepath: string, importFrom: string): typescript.ResolvedModuleFull | undefined;
|
|
7
|
-
|
|
8
|
-
export { resolveModuleImportPath };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { resolveModuleName, createCompilerHost } from 'typescript';
|
|
2
|
-
import fs2 from 'fs-extra/esm';
|
|
3
|
-
import fs from 'fs-extra';
|
|
4
|
-
import onetime from 'onetime';
|
|
5
|
-
import path from 'upath';
|
|
6
|
-
|
|
7
|
-
var __defProp = Object.defineProperty;
|
|
8
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
|
-
var getRepoRootDirpath = onetime(/* @__PURE__ */ __name(function getRepoRootDirpath2() {
|
|
10
|
-
return (/* @__PURE__ */ __name(function recurse(dirpath = process.cwd()) {
|
|
11
|
-
dirpath = path.normalizeSafe(dirpath);
|
|
12
|
-
const pkgpath = path.joinSafe(dirpath, "package.json");
|
|
13
|
-
if (fs.existsSync(pkgpath) && fs.readJsonSync(pkgpath)?.workspaces) {
|
|
14
|
-
return dirpath;
|
|
15
|
-
}
|
|
16
|
-
const parent = path.dirname(dirpath);
|
|
17
|
-
if (parent !== dirpath) {
|
|
18
|
-
return recurse(parent);
|
|
19
|
-
}
|
|
20
|
-
throw new Error(`Could not find repo root from process.cwd(): ${process.cwd()}`);
|
|
21
|
-
}, "recurse"))();
|
|
22
|
-
}, "getRepoRootDirpath"));
|
|
23
|
-
function resolveModuleImportPath(filepath, importFrom) {
|
|
24
|
-
const rootdir = getRepoRootDirpath();
|
|
25
|
-
const result = resolveModuleName(importFrom, filepath, {
|
|
26
|
-
paths: fs2.readJsonSync(path.joinSafe(rootdir, "tsconfig.paths.json")).compilerOptions.paths,
|
|
27
|
-
allowJs: true,
|
|
28
|
-
allowArbitraryExtensions: true,
|
|
29
|
-
allowImportingTsExtensions: true,
|
|
30
|
-
allowSyntheticDefaultImports: true,
|
|
31
|
-
esModuleInterop: true,
|
|
32
|
-
strict: false
|
|
33
|
-
}, createCompilerHost({}, true));
|
|
34
|
-
const f = result.resolvedModule?.resolvedFileName;
|
|
35
|
-
if (f) {
|
|
36
|
-
result.resolvedModule.resolvedFileName = path.relative(rootdir, f);
|
|
37
|
-
}
|
|
38
|
-
return result.resolvedModule;
|
|
39
|
-
}
|
|
40
|
-
__name(resolveModuleImportPath, "resolveModuleImportPath");
|
|
41
|
-
|
|
42
|
-
export { resolveModuleImportPath };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
-
|
|
6
|
-
// src/util/semverVersionBump.ts
|
|
7
|
-
function semverVersionBump(version, level) {
|
|
8
|
-
const arr = (typeof version === "string" ? version.split(".") : version).map(Number);
|
|
9
|
-
switch (level) {
|
|
10
|
-
case "major": {
|
|
11
|
-
arr[0] += 1;
|
|
12
|
-
arr[1] = 0;
|
|
13
|
-
arr[2] = 0;
|
|
14
|
-
break;
|
|
15
|
-
}
|
|
16
|
-
case "minor": {
|
|
17
|
-
arr[1] += 1;
|
|
18
|
-
arr[2] = 0;
|
|
19
|
-
break;
|
|
20
|
-
}
|
|
21
|
-
case "patch": {
|
|
22
|
-
arr[2] += 1;
|
|
23
|
-
break;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return arr.join(".");
|
|
27
|
-
}
|
|
28
|
-
__name(semverVersionBump, "semverVersionBump");
|
|
29
|
-
|
|
30
|
-
exports.semverVersionBump = semverVersionBump;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bumps the semantic versioning (SemVer) of a given version string or array based on the specified level.
|
|
3
|
-
* The function supports 'major', 'minor', and 'patch' levels.
|
|
4
|
-
*
|
|
5
|
-
* @remarks
|
|
6
|
-
* This function will mutate the original version if it's an array.
|
|
7
|
-
*
|
|
8
|
-
* @param version - The current version. It can be a string (e.g., '1.0.0') or an array of strings or numbers (e.g., ['1', '0', '0'] or [1, 0, 0]).
|
|
9
|
-
* @param level - The level of the version bump. It can be 'major', 'minor', or 'patch'.
|
|
10
|
-
*
|
|
11
|
-
* @returns The bumped version as a string.
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```ts
|
|
15
|
-
* semverVersionBump('1.0.0', 'major'); // '2.0.0'
|
|
16
|
-
* semverVersionBump([1, 0, 4], 'minor'); // '1.1.0'
|
|
17
|
-
* semverVersionBump(['1', '0', '0'], 'patch'); // '1.0.1'
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
declare function semverVersionBump(version: string | string[] | number[], level: 'major' | 'minor' | 'patch'): string;
|
|
21
|
-
|
|
22
|
-
export { semverVersionBump };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bumps the semantic versioning (SemVer) of a given version string or array based on the specified level.
|
|
3
|
-
* The function supports 'major', 'minor', and 'patch' levels.
|
|
4
|
-
*
|
|
5
|
-
* @remarks
|
|
6
|
-
* This function will mutate the original version if it's an array.
|
|
7
|
-
*
|
|
8
|
-
* @param version - The current version. It can be a string (e.g., '1.0.0') or an array of strings or numbers (e.g., ['1', '0', '0'] or [1, 0, 0]).
|
|
9
|
-
* @param level - The level of the version bump. It can be 'major', 'minor', or 'patch'.
|
|
10
|
-
*
|
|
11
|
-
* @returns The bumped version as a string.
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```ts
|
|
15
|
-
* semverVersionBump('1.0.0', 'major'); // '2.0.0'
|
|
16
|
-
* semverVersionBump([1, 0, 4], 'minor'); // '1.1.0'
|
|
17
|
-
* semverVersionBump(['1', '0', '0'], 'patch'); // '1.0.1'
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
declare function semverVersionBump(version: string | string[] | number[], level: 'major' | 'minor' | 'patch'): string;
|
|
21
|
-
|
|
22
|
-
export { semverVersionBump };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
|
-
// src/util/semverVersionBump.ts
|
|
5
|
-
function semverVersionBump(version, level) {
|
|
6
|
-
const arr = (typeof version === "string" ? version.split(".") : version).map(Number);
|
|
7
|
-
switch (level) {
|
|
8
|
-
case "major": {
|
|
9
|
-
arr[0] += 1;
|
|
10
|
-
arr[1] = 0;
|
|
11
|
-
arr[2] = 0;
|
|
12
|
-
break;
|
|
13
|
-
}
|
|
14
|
-
case "minor": {
|
|
15
|
-
arr[1] += 1;
|
|
16
|
-
arr[2] = 0;
|
|
17
|
-
break;
|
|
18
|
-
}
|
|
19
|
-
case "patch": {
|
|
20
|
-
arr[2] += 1;
|
|
21
|
-
break;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return arr.join(".");
|
|
25
|
-
}
|
|
26
|
-
__name(semverVersionBump, "semverVersionBump");
|
|
27
|
-
|
|
28
|
-
export { semverVersionBump };
|