@jsenv/monorepo 0.0.6 → 0.0.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/monorepo",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "Helpers to manage packages in a monorepo",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -34,10 +34,10 @@
34
34
  "test": "node ./scripts/test.mjs"
35
35
  },
36
36
  "dependencies": {
37
- "@jsenv/urls": "2.5.1",
38
- "@jsenv/filesystem": "4.9.8",
39
- "@jsenv/package-publish": "1.10.6",
40
- "@jsenv/log": "3.5.2",
37
+ "@jsenv/urls": "2.5.2",
38
+ "@jsenv/filesystem": "4.10.2",
39
+ "@jsenv/package-publish": "1.10.7",
40
+ "@jsenv/humanize": "1.2.8",
41
41
  "semver": "7.6.3"
42
42
  }
43
43
  }
@@ -1,4 +1,4 @@
1
- import { createTaskLog } from "@jsenv/log";
1
+ import { createTaskLog } from "@jsenv/humanize";
2
2
  import { fetchLatestInRegistry } from "@jsenv/package-publish/src/internal/fetchLatestInRegistry.js";
3
3
 
4
4
  export const fetchWorkspaceLatests = async (workspacePackages) => {
@@ -1,5 +1,4 @@
1
- import { createLogger, UNICODE } from "@jsenv/log";
2
-
1
+ import { createLogger, UNICODE } from "@jsenv/humanize";
3
2
  import { publish } from "@jsenv/package-publish/src/internal/publish.js";
4
3
  import { collectWorkspacePackages } from "./internal/collect_workspace_packages.js";
5
4
  import { fetchWorkspaceLatests } from "./internal/fetch_workspace_latests.js";
@@ -1,5 +1,4 @@
1
- import { UNICODE } from "@jsenv/log";
2
-
1
+ import { UNICODE } from "@jsenv/humanize";
3
2
  import { collectWorkspacePackages } from "./internal/collect_workspace_packages.js";
4
3
  import {
5
4
  buildDependencyGraph,
@@ -9,11 +9,9 @@
9
9
  * Be sure to check ../readme.md#upgrade-dependencies
10
10
  */
11
11
 
12
- import { UNICODE, createTaskLog } from "@jsenv/log";
12
+ import { UNICODE, createTaskLog } from "@jsenv/humanize";
13
13
  import { fetchLatestInRegistry } from "@jsenv/package-publish/src/internal/fetchLatestInRegistry.js";
14
-
15
14
  import { collectWorkspacePackages } from "./internal/collect_workspace_packages.js";
16
-
17
15
  import {
18
16
  compareTwoPackageVersions,
19
17
  VERSION_COMPARE_RESULTS,
@@ -21,6 +19,7 @@ import {
21
19
 
22
20
  export const upgradeExternalVersions = async ({ directoryUrl }) => {
23
21
  const internalPackages = await collectWorkspacePackages({ directoryUrl });
22
+ const internalPackageNames = Object.keys(internalPackages);
24
23
  let externalPackages = {};
25
24
  collect_external_packages: {
26
25
  const addExternalPackage = ({
@@ -58,7 +57,7 @@ export const upgradeExternalVersions = async ({ directoryUrl }) => {
58
57
  version,
59
58
  });
60
59
  };
61
- for (const internalPackageName of Object.keys(internalPackages)) {
60
+ for (const internalPackageName of internalPackageNames) {
62
61
  const internalPackage = internalPackages[internalPackageName];
63
62
  const internalPackageObject = internalPackage.packageObject;
64
63
  const { dependencies = {}, devDependencies = {} } = internalPackageObject;
@@ -100,10 +99,14 @@ export const upgradeExternalVersions = async ({ directoryUrl }) => {
100
99
  packageName: externalPackageName,
101
100
  });
102
101
  if (latestPackageInRegistry === null) {
103
- throw new Error(`${externalPackageName} not found on NPM registry`);
102
+ latestVersions[externalPackageName] = null;
103
+ console.warn(
104
+ `${UNICODE.WARN} "${externalPackageName}" not published on NPM`,
105
+ );
106
+ } else {
107
+ const registryLatestVersion = latestPackageInRegistry.version;
108
+ latestVersions[externalPackageName] = registryLatestVersion;
104
109
  }
105
- const registryLatestVersion = latestPackageInRegistry.version;
106
- latestVersions[externalPackageName] = registryLatestVersion;
107
110
  done++;
108
111
  fetchTask.setRightText(`${done}/${total}`);
109
112
  }),
@@ -127,6 +130,9 @@ export const upgradeExternalVersions = async ({ directoryUrl }) => {
127
130
  ];
128
131
  const versionDeclared = internalPackageDeps[externalPackageName];
129
132
  const registryLatestVersion = latestVersions[externalPackageName];
133
+ if (registryLatestVersion === null) {
134
+ continue;
135
+ }
130
136
  const comparisonResult = compareTwoPackageVersions(
131
137
  versionDeclared,
132
138
  registryLatestVersion,