@bemoje/monorepo 1.2.0 → 1.2.1

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.
Files changed (63) hide show
  1. package/lib/MonoRepo.cjs +7288 -60
  2. package/lib/MonoRepo.js +7267 -40
  3. package/lib/code/AbstractCode.cjs +5507 -16
  4. package/lib/code/AbstractCode.js +5500 -12
  5. package/lib/code/CodeBlock.cjs +5582 -19
  6. package/lib/code/CodeBlock.js +5574 -14
  7. package/lib/code/TsCode.cjs +7307 -27
  8. package/lib/code/TsCode.js +7295 -21
  9. package/lib/code/imports/ImportKeywords.cjs +5620 -10
  10. package/lib/code/imports/ImportKeywords.js +5614 -7
  11. package/lib/code/imports/ImportSpecifiers.cjs +5620 -10
  12. package/lib/code/imports/ImportSpecifiers.js +5614 -7
  13. package/lib/code/imports/ImportStatement.cjs +7321 -38
  14. package/lib/code/imports/ImportStatement.js +7301 -24
  15. package/lib/code/imports/ModuleSpecifier.cjs +7311 -16
  16. package/lib/code/imports/ModuleSpecifier.js +7299 -10
  17. package/lib/common/AbstractBase.cjs +570 -9
  18. package/lib/common/AbstractBase.js +565 -5
  19. package/lib/file/File.cjs +5424 -46
  20. package/lib/file/File.js +5419 -20
  21. package/lib/file/TestFile.cjs +7344 -18
  22. package/lib/file/TestFile.js +7334 -14
  23. package/lib/file/TsFile.cjs +7342 -20
  24. package/lib/file/TsFile.js +7331 -15
  25. package/lib/index.cjs +7695 -212
  26. package/lib/index.js +7672 -30
  27. package/lib/methods/findWorkspacePackageName.cjs +71 -2
  28. package/lib/methods/findWorkspacePackageName.js +66 -2
  29. package/lib/methods/getAllImports.cjs +2 -0
  30. package/lib/methods/getAllImports.js +3 -1
  31. package/lib/methods/getAllWorkspacePackageJsonPaths.cjs +42 -5
  32. package/lib/methods/getAllWorkspacePackageJsonPaths.js +40 -4
  33. package/lib/methods/getAllWorkspacePackageJsons.cjs +48 -2
  34. package/lib/methods/getAllWorkspacePackageJsons.js +47 -2
  35. package/lib/methods/getAllWorkspacePackageNames.cjs +62 -2
  36. package/lib/methods/getAllWorkspacePackageNames.js +57 -2
  37. package/lib/methods/getAllWorkspacePaths.cjs +32 -5
  38. package/lib/methods/getAllWorkspacePaths.js +30 -4
  39. package/lib/methods/getImportsRecursively.cjs +7422 -21
  40. package/lib/methods/getImportsRecursively.js +7412 -14
  41. package/lib/methods/getRepoPackageJson.cjs +25 -2
  42. package/lib/methods/getRepoPackageJson.js +24 -2
  43. package/lib/methods/getRepoPackageJsonPath.cjs +21 -4
  44. package/lib/methods/getRepoPackageJsonPath.js +20 -4
  45. package/lib/repo/Workspace.cjs +7059 -72
  46. package/lib/repo/Workspace.js +7034 -49
  47. package/lib/util/SemanticExtnamePrefix.cjs +2 -1
  48. package/lib/util/SemanticExtnamePrefix.js +2 -3
  49. package/lib/util/SemanticExtnamePrefixDescriptions.cjs +2 -1
  50. package/lib/util/SemanticExtnamePrefixDescriptions.js +2 -3
  51. package/lib/util/SemanticExtnamePrefixes.cjs +11 -2
  52. package/lib/util/SemanticExtnamePrefixes.js +10 -2
  53. package/lib/util/getRepoRootDirpath.cjs +1 -1
  54. package/lib/util/getRepoRootDirpath.js +3 -2
  55. package/lib/util/getWorkspaceDirpaths.cjs +18 -3
  56. package/lib/util/getWorkspaceDirpaths.js +18 -3
  57. package/lib/util/hasExtnamePrefix.cjs +15 -6
  58. package/lib/util/hasExtnamePrefix.js +17 -3
  59. package/lib/util/resolveModuleImportPath.cjs +24 -7
  60. package/lib/util/resolveModuleImportPath.js +22 -6
  61. package/lib/util/semverVersionBump.cjs +2 -0
  62. package/lib/util/semverVersionBump.js +3 -1
  63. package/package.json +2 -1
@@ -1,16 +1,39 @@
1
1
  'use strict';
2
2
 
3
3
  var fs = require('fs-extra');
4
- var getRepoPackageJsonPath = require('./getRepoPackageJsonPath');
4
+ var onetime = require('onetime');
5
+ var path = require('upath');
5
6
 
6
7
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
7
8
 
8
9
  var fs__default = /*#__PURE__*/_interopDefault(fs);
10
+ var onetime__default = /*#__PURE__*/_interopDefault(onetime);
11
+ var path__default = /*#__PURE__*/_interopDefault(path);
9
12
 
10
13
  var __defProp = Object.defineProperty;
11
14
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
15
+ var getRepoRootDirpath = onetime__default.default(/* @__PURE__ */ __name(function getRepoRootDirpath2() {
16
+ return (/* @__PURE__ */ __name(function recurse(dirpath = process.cwd()) {
17
+ dirpath = path__default.default.normalizeSafe(dirpath);
18
+ const pkgpath = path__default.default.joinSafe(dirpath, "package.json");
19
+ if (fs__default.default.existsSync(pkgpath) && fs__default.default.readJsonSync(pkgpath)?.workspaces) {
20
+ return dirpath;
21
+ }
22
+ const parent = path__default.default.dirname(dirpath);
23
+ if (parent !== dirpath) {
24
+ return recurse(parent);
25
+ }
26
+ throw new Error(`Could not find repo root from process.cwd(): ${process.cwd()}`);
27
+ }, "recurse"))();
28
+ }, "getRepoRootDirpath"));
29
+ function getRepoPackageJsonPath() {
30
+ return path__default.default.joinSafe(getRepoRootDirpath(), "package.json");
31
+ }
32
+ __name(getRepoPackageJsonPath, "getRepoPackageJsonPath");
33
+
34
+ // src/methods/getRepoPackageJson.ts
12
35
  async function getRepoPackageJson() {
13
- return await fs__default.default.readJson(getRepoPackageJsonPath.getRepoPackageJsonPath());
36
+ return await fs__default.default.readJson(getRepoPackageJsonPath());
14
37
  }
15
38
  __name(getRepoPackageJson, "getRepoPackageJson");
16
39
 
@@ -1,7 +1,29 @@
1
- import { __name } from '../chunk-SHUYVCID.js';
2
1
  import fs from 'fs-extra';
3
- import { getRepoPackageJsonPath } from './getRepoPackageJsonPath';
2
+ import onetime from 'onetime';
3
+ import path from 'upath';
4
4
 
5
+ var __defProp = Object.defineProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var getRepoRootDirpath = onetime(/* @__PURE__ */ __name(function getRepoRootDirpath2() {
8
+ return (/* @__PURE__ */ __name(function recurse(dirpath = process.cwd()) {
9
+ dirpath = path.normalizeSafe(dirpath);
10
+ const pkgpath = path.joinSafe(dirpath, "package.json");
11
+ if (fs.existsSync(pkgpath) && fs.readJsonSync(pkgpath)?.workspaces) {
12
+ return dirpath;
13
+ }
14
+ const parent = path.dirname(dirpath);
15
+ if (parent !== dirpath) {
16
+ return recurse(parent);
17
+ }
18
+ throw new Error(`Could not find repo root from process.cwd(): ${process.cwd()}`);
19
+ }, "recurse"))();
20
+ }, "getRepoRootDirpath"));
21
+ function getRepoPackageJsonPath() {
22
+ return path.joinSafe(getRepoRootDirpath(), "package.json");
23
+ }
24
+ __name(getRepoPackageJsonPath, "getRepoPackageJsonPath");
25
+
26
+ // src/methods/getRepoPackageJson.ts
5
27
  async function getRepoPackageJson() {
6
28
  return await fs.readJson(getRepoPackageJsonPath());
7
29
  }
@@ -1,16 +1,33 @@
1
1
  'use strict';
2
2
 
3
- var getRepoRootDirpath = require('../util/getRepoRootDirpath');
4
- var upath = require('upath');
3
+ var fs = require('fs-extra');
4
+ var onetime = require('onetime');
5
+ var path = require('upath');
5
6
 
6
7
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
7
8
 
8
- var upath__default = /*#__PURE__*/_interopDefault(upath);
9
+ var fs__default = /*#__PURE__*/_interopDefault(fs);
10
+ var onetime__default = /*#__PURE__*/_interopDefault(onetime);
11
+ var path__default = /*#__PURE__*/_interopDefault(path);
9
12
 
10
13
  var __defProp = Object.defineProperty;
11
14
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
15
+ var getRepoRootDirpath = onetime__default.default(/* @__PURE__ */ __name(function getRepoRootDirpath2() {
16
+ return (/* @__PURE__ */ __name(function recurse(dirpath = process.cwd()) {
17
+ dirpath = path__default.default.normalizeSafe(dirpath);
18
+ const pkgpath = path__default.default.joinSafe(dirpath, "package.json");
19
+ if (fs__default.default.existsSync(pkgpath) && fs__default.default.readJsonSync(pkgpath)?.workspaces) {
20
+ return dirpath;
21
+ }
22
+ const parent = path__default.default.dirname(dirpath);
23
+ if (parent !== dirpath) {
24
+ return recurse(parent);
25
+ }
26
+ throw new Error(`Could not find repo root from process.cwd(): ${process.cwd()}`);
27
+ }, "recurse"))();
28
+ }, "getRepoRootDirpath"));
12
29
  function getRepoPackageJsonPath() {
13
- return upath__default.default.joinSafe(getRepoRootDirpath.getRepoRootDirpath(), "package.json");
30
+ return path__default.default.joinSafe(getRepoRootDirpath(), "package.json");
14
31
  }
15
32
  __name(getRepoPackageJsonPath, "getRepoPackageJsonPath");
16
33
 
@@ -1,9 +1,25 @@
1
- import { __name } from '../chunk-SHUYVCID.js';
2
- import { getRepoRootDirpath } from '../util/getRepoRootDirpath';
3
- import upath from 'upath';
1
+ import fs from 'fs-extra';
2
+ import onetime from 'onetime';
3
+ import path from 'upath';
4
4
 
5
+ var __defProp = Object.defineProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var getRepoRootDirpath = onetime(/* @__PURE__ */ __name(function getRepoRootDirpath2() {
8
+ return (/* @__PURE__ */ __name(function recurse(dirpath = process.cwd()) {
9
+ dirpath = path.normalizeSafe(dirpath);
10
+ const pkgpath = path.joinSafe(dirpath, "package.json");
11
+ if (fs.existsSync(pkgpath) && fs.readJsonSync(pkgpath)?.workspaces) {
12
+ return dirpath;
13
+ }
14
+ const parent = path.dirname(dirpath);
15
+ if (parent !== dirpath) {
16
+ return recurse(parent);
17
+ }
18
+ throw new Error(`Could not find repo root from process.cwd(): ${process.cwd()}`);
19
+ }, "recurse"))();
20
+ }, "getRepoRootDirpath"));
5
21
  function getRepoPackageJsonPath() {
6
- return upath.joinSafe(getRepoRootDirpath(), "package.json");
22
+ return path.joinSafe(getRepoRootDirpath(), "package.json");
7
23
  }
8
24
  __name(getRepoPackageJsonPath, "getRepoPackageJsonPath");
9
25