@dsh-workbench/shared 1.1.11 → 1.1.12

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.
@@ -57,6 +57,7 @@ export interface SupplyProbeReleaseOptions {
57
57
  readonly package: string;
58
58
  readonly registry?: string | undefined;
59
59
  readonly force?: boolean;
60
+ readonly check?: boolean;
60
61
  }
61
62
  export interface EnvSupplyPort {
62
63
  resolvePluginSource(source: SupplySource | undefined, env: Readonly<Record<string, string | undefined>>, options?: PluginSourceOptions): ResolvedPluginSource;
@@ -28,6 +28,7 @@ interface ProbeReleaseOptions {
28
28
  readonly package: string;
29
29
  readonly registry?: string | undefined;
30
30
  readonly force?: boolean;
31
+ readonly check?: boolean;
31
32
  readonly cacheDir?: string | undefined;
32
33
  readonly prefix?: string | undefined;
33
34
  }
@@ -68,7 +68,7 @@ async function missingPartsOf(latestCache, existsCache, options) {
68
68
  return checked.filter((entry) => !entry.present).map((entry) => entry.part);
69
69
  }
70
70
  async function probeOf(latestCache, options) {
71
- const { shell, package: pkg, registry, force = false, cacheDir, prefix } = options;
71
+ const { shell, package: pkg, registry, force = false, check = true, cacheDir, prefix } = options;
72
72
  if (pkg === "")
73
73
  return undefined;
74
74
  const ledger = await runShell(shell, `npm ls --prefix ${quoteShellArg(prefix ?? '')} ${quoteShellArg(pkg)} --json --depth=0${cacheFlag(cacheDir)}`, { timeoutMs: VERSION_CHECK_TIMEOUT_MS }).catch(() => undefined);
@@ -78,7 +78,7 @@ async function probeOf(latestCache, options) {
78
78
  const source = registry === undefined || registry.trim() === ""
79
79
  ? undefined
80
80
  : registry.trim();
81
- const latest = source === undefined
81
+ const latest = source === undefined || !check
82
82
  ? undefined
83
83
  : await latestVersionOf(latestCache, { shell, name: pkg, registry: source, force, cacheDir });
84
84
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsh-workbench/shared",
3
- "version": "1.1.11",
3
+ "version": "1.1.12",
4
4
  "description": "工作台与模块共享的纯代码与契约类型:类型、纯逻辑、哑组件、平台解析。宿主侧的东西从 /host 进(不影响浏览器产物)。",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -76,6 +76,7 @@ export interface SupplyProbeReleaseOptions {
76
76
  readonly package: string;
77
77
  readonly registry?: string | undefined;
78
78
  readonly force?: boolean;
79
+ readonly check?: boolean;
79
80
  }
80
81
 
81
82
  export interface EnvSupplyPort {
@@ -82,6 +82,7 @@ interface ProbeReleaseOptions {
82
82
  readonly package: string;
83
83
  readonly registry?: string | undefined;
84
84
  readonly force?: boolean;
85
+ readonly check?: boolean;
85
86
  readonly cacheDir?: string | undefined;
86
87
  readonly prefix?: string | undefined;
87
88
  }
@@ -169,10 +170,11 @@ async function probeOf(
169
170
  package: string;
170
171
  registry?: string | undefined;
171
172
  force?: boolean;
173
+ check?: boolean;
172
174
  cacheDir?: string | undefined;
173
175
  prefix?: string | undefined;
174
176
  }): Promise<PluginRelease | undefined> {
175
- const { shell, package: pkg, registry, force = false, cacheDir, prefix } = options;
177
+ const { shell, package: pkg, registry, force = false, check = true, cacheDir, prefix } = options;
176
178
  if (pkg === "") return undefined;
177
179
 
178
180
  const ledger = await runShell(
@@ -189,7 +191,7 @@ async function probeOf(
189
191
  ? undefined
190
192
  : registry.trim();
191
193
  const latest =
192
- source === undefined
194
+ source === undefined || !check
193
195
  ? undefined
194
196
  : await latestVersionOf(latestCache, { shell, name: pkg, registry: source, force, cacheDir });
195
197