@ms-cloudpack/cli 0.77.2 → 0.77.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../src/commands/link/execute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAQ1D;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,aAAa,CAAC,WAAW,CA8D9C,CAAC"}
1
+ {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../src/commands/link/execute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAQ1D;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,aAAa,CAAC,WAAW,CAkE9C,CAAC"}
@@ -14,7 +14,12 @@ export const execute = async (params) => {
14
14
  console.debug('Linking packages...');
15
15
  console.debug('Include all:', !!includeAll);
16
16
  console.debug('Ignored packages:', ignoredPackages?.join(', ') || 'none');
17
- console.debug('Apply host resolutions:', !ignoreResolutions);
17
+ if (!ignoreResolutions || typeof ignoreResolutions === 'boolean') {
18
+ console.debug('Apply host resolutions:', !ignoreResolutions);
19
+ }
20
+ else {
21
+ console.debug('Ignoring resolutions:', ignoreResolutions.join(', '));
22
+ }
18
23
  console.debug('Resolve strategy:', resolveStrategy);
19
24
  console.debug('Remote:', remote);
20
25
  // If we are linking to a remote session, we need to use the link proxy.
@@ -1 +1 @@
1
- {"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../src/commands/link/execute.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAA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AAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAChF,MAAM,WAAW,GAAG,iBAAiB,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC,CAAC;IAC7F,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;AAClC,CAAC,CAAC","sourcesContent":["import type { CommandAction } from '../../types/CommandAction.js';\nimport type { LinkOptions } from './types/LinkOptions.js';\nimport { getSessionToLink } from './getSessionToLink.js';\nimport { createCloudpackClient } from '@ms-cloudpack/api-server';\nimport { formatLinkSummary } from './formatLinkSummary.js';\nimport { writeJson } from '@ms-cloudpack/json-utilities';\nimport path from 'path';\nimport { linkToRemoteSession } from './linkToRemoteSession.js';\n\n/**\n * Defines the \"link\" verb entry point.\n */\nexport const execute: CommandAction<LinkOptions> = async (params) => {\n // Use the current directory as the default package path.\n const { options, appPath, reporter } = params;\n const {\n remote,\n ignore: ignoredPackages,\n all: includeAll,\n ignoreResolutions,\n resolveStrategy,\n logResolveMap,\n cachePath,\n } = options;\n\n console.debug('Linking packages...');\n console.debug('Include all:', !!includeAll);\n console.debug('Ignored packages:', ignoredPackages?.join(', ') || 'none');\n console.debug('Apply host resolutions:', !ignoreResolutions);\n console.debug('Resolve strategy:', resolveStrategy);\n console.debug('Remote:', remote);\n\n // If we are linking to a remote session, we need to use the link proxy.\n if (remote) return linkToRemoteSession(params);\n\n // If we are linking to a session on the same machine, we can access the paths directly.\n const sessionResult = await getSessionToLink({ reporter, cachePath });\n if (!sessionResult.session) {\n return sessionResult;\n }\n const { session } = sessionResult;\n const client = await createCloudpackClient({ url: session.urls.apiServer, reporter });\n\n const includeMessage = includeAll ? ' including all internal paths' : '';\n const message = `Linking local paths for ${session.projectName} at \"${appPath}\"${includeMessage}`;\n const task = reporter.addTask(message);\n\n // Send request to api server to link paths.\n const { resolveMap, linkedPaths } = await client.linkPath.mutate({\n linkedPath: {\n path: appPath,\n ignoredPackages,\n includeAll,\n ignoreResolutions,\n resolveStrategy,\n },\n });\n await client.close();\n\n if (linkedPaths.find((p) => p.path === appPath) === undefined) {\n // Close down with an error.\n task.complete({ status: 'fail', message: `Failed to link paths.`, forceShow: true });\n return { hasErrors: true, message: 'Failed to link paths.' };\n }\n\n if (logResolveMap) {\n // Write the linked resolve map to disk.\n await writeJson(path.join(appPath, 'resolve-map-linked.json'), resolveMap);\n }\n\n // Close down successfully.\n task.complete({ status: 'complete', message: `Linked paths`, forceShow: true });\n const linkSummary = formatLinkSummary({ session, resolveMap, linkedPaths, resolveStrategy });\n return { message: linkSummary };\n};\n"]}
1
+ {"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../src/commands/link/execute.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAA+B,KAAK,EAAE,MAAM,EAAE,EAAE;IAClE,yDAAyD;IACzD,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;IAC9C,MAAM,EACJ,MAAM,EACN,MAAM,EAAE,eAAe,EACvB,GAAG,EAAE,UAAU,EACf,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,SAAS,GACV,GAAG,OAAO,CAAC;IAEZ,OAAO,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACrC,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC;IAC5C,OAAO,CAAC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AM,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;QAC/D,UAAU,EAAE;YACV,IAAI,EAAE,OAAO;YACb,eAAe;YACf,UAAU;YACV,iBAAiB;YACjB,eAAe;SAChB;KACF,CAAC,CAAC;IACH,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IAErB,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,KAAK,SAAS,EAAE,CAAC;QAC9D,4BAA4B;QAC5B,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACrF,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,uBAAuB,EAAE,CAAC;IAC/D,CAAC;IAED,IAAI,aAAa,EAAE,CAAC;QAClB,wCAAwC;QACxC,MAAM,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,yBAAyB,CAAC,EAAE,UAAU,CAAC,CAAC;IAC7E,CAAC;IAED,2BAA2B;IAC3B,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAChF,MAAM,WAAW,GAAG,iBAAiB,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC,CAAC;IAC7F,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;AAClC,CAAC,CAAC","sourcesContent":["import type { CommandAction } from '../../types/CommandAction.js';\nimport type { LinkOptions } from './types/LinkOptions.js';\nimport { getSessionToLink } from './getSessionToLink.js';\nimport { createCloudpackClient } from '@ms-cloudpack/api-server';\nimport { formatLinkSummary } from './formatLinkSummary.js';\nimport { writeJson } from '@ms-cloudpack/json-utilities';\nimport path from 'path';\nimport { linkToRemoteSession } from './linkToRemoteSession.js';\n\n/**\n * Defines the \"link\" verb entry point.\n */\nexport const execute: CommandAction<LinkOptions> = async (params) => {\n // Use the current directory as the default package path.\n const { options, appPath, reporter } = params;\n const {\n remote,\n ignore: ignoredPackages,\n all: includeAll,\n ignoreResolutions,\n resolveStrategy,\n logResolveMap,\n cachePath,\n } = options;\n\n console.debug('Linking packages...');\n console.debug('Include all:', !!includeAll);\n console.debug('Ignored packages:', ignoredPackages?.join(', ') || 'none');\n if (!ignoreResolutions || typeof ignoreResolutions === 'boolean') {\n console.debug('Apply host resolutions:', !ignoreResolutions);\n } else {\n console.debug('Ignoring resolutions:', ignoreResolutions.join(', '));\n }\n console.debug('Resolve strategy:', resolveStrategy);\n console.debug('Remote:', remote);\n\n // If we are linking to a remote session, we need to use the link proxy.\n if (remote) return linkToRemoteSession(params);\n\n // If we are linking to a session on the same machine, we can access the paths directly.\n const sessionResult = await getSessionToLink({ reporter, cachePath });\n if (!sessionResult.session) {\n return sessionResult;\n }\n const { session } = sessionResult;\n const client = await createCloudpackClient({ url: session.urls.apiServer, reporter });\n\n const includeMessage = includeAll ? ' including all internal paths' : '';\n const message = `Linking local paths for ${session.projectName} at \"${appPath}\"${includeMessage}`;\n const task = reporter.addTask(message);\n\n // Send request to api server to link paths.\n const { resolveMap, linkedPaths } = await client.linkPath.mutate({\n linkedPath: {\n path: appPath,\n ignoredPackages,\n includeAll,\n ignoreResolutions,\n resolveStrategy,\n },\n });\n await client.close();\n\n if (linkedPaths.find((p) => p.path === appPath) === undefined) {\n // Close down with an error.\n task.complete({ status: 'fail', message: `Failed to link paths.`, forceShow: true });\n return { hasErrors: true, message: 'Failed to link paths.' };\n }\n\n if (logResolveMap) {\n // Write the linked resolve map to disk.\n await writeJson(path.join(appPath, 'resolve-map-linked.json'), resolveMap);\n }\n\n // Close down successfully.\n task.complete({ status: 'complete', message: `Linked paths`, forceShow: true });\n const linkSummary = formatLinkSummary({ session, resolveMap, linkedPaths, resolveStrategy });\n return { message: linkSummary };\n};\n"]}
@@ -11,10 +11,10 @@ export const init = (program) => {
11
11
  '- URL: e.g., "http://example.com" or "https://example.com"\n' +
12
12
  '- hostname: e.g., "example.com" (attempts both wss:// and ws:// connections)\n' +
13
13
  '- no value: Uses "localhost" (attempts both wss:// and ws:// connections)\n'),
14
- ignore: new Option('--ignore [packages...]', 'Ignore these packages when linking. Can be used for packages in the current repo ' +
14
+ ignore: new Option('--ignore <packages...>', 'Ignore these packages when linking. Can be used for packages in the current repo ' +
15
15
  'that have issues being bundled.'),
16
16
  all: new Option('--all', "Link all internal packages discovered within the linked repo's graph."),
17
- ignoreResolutions: new Option('--ignore-resolutions', "Don't apply resolutions from the host repo's package.json to linked packages."),
17
+ ignoreResolutions: new Option('--ignore-resolutions [packages...]', "Don't apply resolutions from the host repo's package.json to linked packages."),
18
18
  resolveStrategy: new Option('--resolve-strategy <strategy>', 'Strategy to use when resolving linked packages.\n' +
19
19
  '- "dedupe": Attempt to dedupe packages from the resolve map by removing all but the ' +
20
20
  'highest version that satisfies semver requirements from all parent entries.\n' +
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/link/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGnC,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEjE,+BAA+B;AAC/B,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,OAAO,EAAE,EAAE;IACnD,OAAO,CAAC,aAAa,CAAc;QACjC,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,gGAAgG;QAC7G,OAAO,EAAE;YACP,MAAM,EAAE,IAAI,MAAM,CAChB,mBAAmB,EACnB,0FAA0F;gBACxF,8EAA8E;gBAC9E,8DAA8D;gBAC9D,gFAAgF;gBAChF,6EAA6E,CAChF;YACD,MAAM,EAAE,IAAI,MAAM,CAChB,wBAAwB,EACxB,mFAAmF;gBACjF,iCAAiC,CACpC;YACD,GAAG,EAAE,IAAI,MAAM,CAAC,OAAO,EAAE,uEAAuE,CAAC;YACjG,iBAAiB,EAAE,IAAI,MAAM,CAC3B,sBAAsB,EACtB,+EAA+E,CAChF;YACD,eAAe,EAAE,IAAI,MAAM,CACzB,+BAA+B,EAC/B,mDAAmD;gBACjD,sFAAsF;gBACtF,+EAA+E;gBAC/E,+EAA+E,CAClF;iBACE,OAAO,CAAC,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;iBAChC,OAAO,CAAC,QAAQ,CAAC;YACpB,KAAK,EAAE,aAAa,CAAC,KAAK,EAAE;YAC5B,aAAa,EAAE,aAAa,CAAC,aAAa,EAAE;SAC7C;QACD,WAAW,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC;KAC1C,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { Option } from 'commander';\nimport type { CommandInitFunction } from '../../types/CommandInitFunction.js';\nimport type { LinkOptions } from './types/LinkOptions.js';\nimport { reusedOptions } from '../../utilities/reusedOptions.js';\n\n/** Defines the \"link\" verb. */\nexport const init: CommandInitFunction = (program) => {\n program.addSubCommand<LinkOptions>({\n name: 'link',\n description: 'Links the package(s) found within the current folder to an existing \"cloudpack start\" session.',\n options: {\n remote: new Option(\n '--remote [remote]',\n 'Link to a remote session. Specify one of the following, listed in order of preference:\\n' +\n '- WebSocket URL: e.g., \"wss://example.com:9890\" or \"ws://example.com:9890\"\\n' +\n '- URL: e.g., \"http://example.com\" or \"https://example.com\"\\n' +\n '- hostname: e.g., \"example.com\" (attempts both wss:// and ws:// connections)\\n' +\n '- no value: Uses \"localhost\" (attempts both wss:// and ws:// connections)\\n',\n ),\n ignore: new Option(\n '--ignore [packages...]',\n 'Ignore these packages when linking. Can be used for packages in the current repo ' +\n 'that have issues being bundled.',\n ),\n all: new Option('--all', \"Link all internal packages discovered within the linked repo's graph.\"),\n ignoreResolutions: new Option(\n '--ignore-resolutions',\n \"Don't apply resolutions from the host repo's package.json to linked packages.\",\n ),\n resolveStrategy: new Option(\n '--resolve-strategy <strategy>',\n 'Strategy to use when resolving linked packages.\\n' +\n '- \"dedupe\": Attempt to dedupe packages from the resolve map by removing all but the ' +\n 'highest version that satisfies semver requirements from all parent entries.\\n' +\n `- \"duplicate\": Allow duplicates in the resolve map (don't bump dependencies).`,\n )\n .choices(['dedupe', 'duplicate'])\n .default('dedupe'),\n cache: reusedOptions.cache(),\n logResolveMap: reusedOptions.logResolveMap(),\n },\n getExecutor: () => import('./execute.js'),\n });\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/link/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGnC,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEjE,+BAA+B;AAC/B,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,OAAO,EAAE,EAAE;IACnD,OAAO,CAAC,aAAa,CAAc;QACjC,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,gGAAgG;QAC7G,OAAO,EAAE;YACP,MAAM,EAAE,IAAI,MAAM,CAChB,mBAAmB,EACnB,0FAA0F;gBACxF,8EAA8E;gBAC9E,8DAA8D;gBAC9D,gFAAgF;gBAChF,6EAA6E,CAChF;YACD,MAAM,EAAE,IAAI,MAAM,CAChB,wBAAwB,EACxB,mFAAmF;gBACjF,iCAAiC,CACpC;YACD,GAAG,EAAE,IAAI,MAAM,CAAC,OAAO,EAAE,uEAAuE,CAAC;YACjG,iBAAiB,EAAE,IAAI,MAAM,CAC3B,oCAAoC,EACpC,+EAA+E,CAChF;YACD,eAAe,EAAE,IAAI,MAAM,CACzB,+BAA+B,EAC/B,mDAAmD;gBACjD,sFAAsF;gBACtF,+EAA+E;gBAC/E,+EAA+E,CAClF;iBACE,OAAO,CAAC,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;iBAChC,OAAO,CAAC,QAAQ,CAAC;YACpB,KAAK,EAAE,aAAa,CAAC,KAAK,EAAE;YAC5B,aAAa,EAAE,aAAa,CAAC,aAAa,EAAE;SAC7C;QACD,WAAW,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC;KAC1C,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { Option } from 'commander';\nimport type { CommandInitFunction } from '../../types/CommandInitFunction.js';\nimport type { LinkOptions } from './types/LinkOptions.js';\nimport { reusedOptions } from '../../utilities/reusedOptions.js';\n\n/** Defines the \"link\" verb. */\nexport const init: CommandInitFunction = (program) => {\n program.addSubCommand<LinkOptions>({\n name: 'link',\n description: 'Links the package(s) found within the current folder to an existing \"cloudpack start\" session.',\n options: {\n remote: new Option(\n '--remote [remote]',\n 'Link to a remote session. Specify one of the following, listed in order of preference:\\n' +\n '- WebSocket URL: e.g., \"wss://example.com:9890\" or \"ws://example.com:9890\"\\n' +\n '- URL: e.g., \"http://example.com\" or \"https://example.com\"\\n' +\n '- hostname: e.g., \"example.com\" (attempts both wss:// and ws:// connections)\\n' +\n '- no value: Uses \"localhost\" (attempts both wss:// and ws:// connections)\\n',\n ),\n ignore: new Option(\n '--ignore <packages...>',\n 'Ignore these packages when linking. Can be used for packages in the current repo ' +\n 'that have issues being bundled.',\n ),\n all: new Option('--all', \"Link all internal packages discovered within the linked repo's graph.\"),\n ignoreResolutions: new Option(\n '--ignore-resolutions [packages...]',\n \"Don't apply resolutions from the host repo's package.json to linked packages.\",\n ),\n resolveStrategy: new Option(\n '--resolve-strategy <strategy>',\n 'Strategy to use when resolving linked packages.\\n' +\n '- \"dedupe\": Attempt to dedupe packages from the resolve map by removing all but the ' +\n 'highest version that satisfies semver requirements from all parent entries.\\n' +\n `- \"duplicate\": Allow duplicates in the resolve map (don't bump dependencies).`,\n )\n .choices(['dedupe', 'duplicate'])\n .default('dedupe'),\n cache: reusedOptions.cache(),\n logResolveMap: reusedOptions.logResolveMap(),\n },\n getExecutor: () => import('./execute.js'),\n });\n};\n"]}
@@ -12,7 +12,7 @@ export interface LinkOptions extends Pick<ReusedOptions, 'cache' | 'logResolveMa
12
12
  /** Link all internal packages discovered within the linked repo's graph. */
13
13
  all?: boolean;
14
14
  /** Don't apply resolutions from the host repo's package.json to linked packages. */
15
- ignoreResolutions?: boolean;
15
+ ignoreResolutions?: boolean | string[];
16
16
  /**
17
17
  * Strategy to use when resolving linked packages.
18
18
  * - `"dedupe"`: Attempt to dedupe packages from the resolve map by removing all but the
@@ -1 +1 @@
1
- {"version":3,"file":"LinkOptions.d.ts","sourceRoot":"","sources":["../../../../src/commands/link/types/LinkOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAErE,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,aAAa,EAAE,OAAO,GAAG,eAAe,CAAC;IACjF;;OAEG;IACH,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IAEzB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAElB,4EAA4E;IAC5E,GAAG,CAAC,EAAE,OAAO,CAAC;IAEd,oFAAoF;IACpF,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;;;;OAMG;IACH,eAAe,EAAE,QAAQ,GAAG,WAAW,CAAC;CACzC"}
1
+ {"version":3,"file":"LinkOptions.d.ts","sourceRoot":"","sources":["../../../../src/commands/link/types/LinkOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAErE,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,aAAa,EAAE,OAAO,GAAG,eAAe,CAAC;IACjF;;OAEG;IACH,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IAEzB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAElB,4EAA4E;IAC5E,GAAG,CAAC,EAAE,OAAO,CAAC;IAEd,oFAAoF;IACpF,iBAAiB,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAC;IAEvC;;;;;;OAMG;IACH,eAAe,EAAE,QAAQ,GAAG,WAAW,CAAC;CACzC"}
@@ -1 +1 @@
1
- {"version":3,"file":"LinkOptions.js","sourceRoot":"","sources":["../../../../src/commands/link/types/LinkOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReusedOptions } from '../../../types/ReusedOptions.js';\n\nexport interface LinkOptions extends Pick<ReusedOptions, 'cache' | 'logResolveMap'> {\n /**\n * Url to link to a remote session. See ../createRemoteApiUrls.ts for details.\n */\n remote: string | boolean;\n\n /**\n * Ignore these packages when linking.\n * This can be used for packages in the current repo that have issues being bundled.\n */\n ignore?: string[];\n\n /** Link all internal packages discovered within the linked repo's graph. */\n all?: boolean;\n\n /** Don't apply resolutions from the host repo's package.json to linked packages. */\n ignoreResolutions?: boolean;\n\n /**\n * Strategy to use when resolving linked packages.\n * - `\"dedupe\"`: Attempt to dedupe packages from the resolve map by removing all but the\n * highest version that satisfies semver requirements from all parent entries.\n * - `\"duplicate\"`: Allow duplicates in the resolve map (don't bump dependencies).\n * @default \"dedupe\"\n */\n resolveStrategy: 'dedupe' | 'duplicate';\n}\n"]}
1
+ {"version":3,"file":"LinkOptions.js","sourceRoot":"","sources":["../../../../src/commands/link/types/LinkOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReusedOptions } from '../../../types/ReusedOptions.js';\n\nexport interface LinkOptions extends Pick<ReusedOptions, 'cache' | 'logResolveMap'> {\n /**\n * Url to link to a remote session. See ../createRemoteApiUrls.ts for details.\n */\n remote: string | boolean;\n\n /**\n * Ignore these packages when linking.\n * This can be used for packages in the current repo that have issues being bundled.\n */\n ignore?: string[];\n\n /** Link all internal packages discovered within the linked repo's graph. */\n all?: boolean;\n\n /** Don't apply resolutions from the host repo's package.json to linked packages. */\n ignoreResolutions?: boolean | string[];\n\n /**\n * Strategy to use when resolving linked packages.\n * - `\"dedupe\"`: Attempt to dedupe packages from the resolve map by removing all but the\n * highest version that satisfies semver requirements from all parent entries.\n * - `\"duplicate\"`: Allow duplicates in the resolve map (don't bump dependencies).\n * @default \"dedupe\"\n */\n resolveStrategy: 'dedupe' | 'duplicate';\n}\n"]}
package/lib/main.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAOrD,iCAAiC;AACjC,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,aAAa,CAAC,EAAE,mBAAmB,CAAC;CACrC;AAED;;;GAGG;AACH,wBAAsB,IAAI,CAAC,OAAO,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA+C5E"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AASrD,iCAAiC;AACjC,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,aAAa,CAAC,EAAE,mBAAmB,CAAC;CACrC;AAED;;;GAGG;AACH,wBAAsB,IAAI,CAAC,OAAO,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
package/lib/main.js CHANGED
@@ -4,11 +4,20 @@ import path from 'path';
4
4
  import { fileURLToPath, pathToFileURL } from 'url';
5
5
  import { PerfMarkerCliEntry } from './performance/markers.js';
6
6
  import { CloudpackCommand } from './utilities/CloudpackCommand.js';
7
+ import { getNodeEngineRequirement } from './utilities/getNodeEngineRequirement.js';
8
+ import { satisfies } from 'semver';
7
9
  /**
8
10
  * Entry point for the cloudpack CLI.
9
11
  * Resolves all commands defined within the "./commands" folder.
10
12
  */
11
13
  export async function main(options = {}) {
14
+ // Check Node.js version compatibility before doing anything else
15
+ const requiredNodeVersion = getNodeEngineRequirement();
16
+ if (requiredNodeVersion && !satisfies(process.version, requiredNodeVersion)) {
17
+ console.error(`Cloudpack requires Node.js ${requiredNodeVersion}. Current version: ${process.version}.`);
18
+ // eslint-disable-next-line no-restricted-properties -- exit immediately
19
+ process.exit(1);
20
+ }
12
21
  const { argv = [...process.argv],
13
22
  // eslint-disable-next-line no-restricted-properties -- this is where the default is supplied
14
23
  cwd = process.cwd(), disableTelemetry, outputOptions, } = options;
package/lib/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAUnE;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,UAAgC,EAAE;IAC3D,MAAM,EACJ,IAAI,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IACxB,6FAA6F;IAC7F,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,EACnB,gBAAgB,EAChB,aAAa,GACd,GAAG,OAAO,CAAC;IAEZ,WAAW,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IAErC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QAC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globSourceFiles } from '@ms-cloudpack/path-utilities';\nimport type { OutputConfiguration } from 'commander';\nimport path from 'path';\nimport { fileURLToPath, pathToFileURL } from 'url';\nimport type { CommandInitModule } from './types/CommandInitFunction.js';\nimport { PerfMarkerCliEntry } from './performance/markers.js';\nimport { CloudpackCommand } from './utilities/CloudpackCommand.js';\n\n/** Override options for tests */\nexport interface MainOptions {\n cwd?: string;\n disableTelemetry?: boolean;\n argv?: string[];\n outputOptions?: OutputConfiguration;\n}\n\n/**\n * Entry point for the cloudpack CLI.\n * Resolves all commands defined within the \"./commands\" folder.\n */\nexport async function main(options: Partial<MainOptions> = {}): Promise<void> {\n const {\n argv = [...process.argv],\n // eslint-disable-next-line no-restricted-properties -- this is where the default is supplied\n cwd = process.cwd(),\n disableTelemetry,\n outputOptions,\n } = options;\n\n performance.mark(PerfMarkerCliEntry);\n\n if (argv[3] === '--') {\n // Remove the \"--\" argument in case it's added by lage\n argv.splice(3, 1);\n }\n\n const version = getDisplayVersion(import.meta.url);\n\n // Create the top-level command and apply common options\n // (avoids \"unknown option\" errors if they're specified without a verb)\n const program = new CloudpackCommand({\n name: 'cloudpack',\n description: 'A tool for managing fast inner and outer looping in web apps. Requires a sub-command.',\n usage: '<command> [options]',\n outputOptions,\n programOptions: { cwd, version, argv, disableTelemetry },\n // The top-level command should realistically only ever be used with --help or --version,\n // so hide most of the options.\n hideSharedOptions: true,\n });\n\n // Get all the available commands\n const commandsGlob = 'commands/*/index';\n const commands = await globSourceFiles(import.meta.url, commandsGlob);\n if (!commands.length) {\n const currentDir = path.dirname(fileURLToPath(import.meta.url));\n throw new Error(`No commands found matching \"${currentDir}/${commandsGlob}.*\".`);\n }\n\n for (const commandPath of commands) {\n const commandUrl = pathToFileURL(commandPath).toString();\n const commandModule = (await import(commandUrl)) as CommandInitModule;\n\n commandModule.init(program);\n }\n\n await program.run();\n}\n"]}
1
+ {"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,OAA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G,CAAC,CAAC;IAEnD,wDAAwD;IACxD,uEAAuE;IACvE,MAAM,OAAO,GAAG,IAAI,gBAAgB,CAAC;QACnC,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,uFAAuF;QACpG,KAAK,EAAE,qBAAqB;QAC5B,aAAa;QACb,cAAc,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE;QACxD,yFAAyF;QACzF,+BAA+B;QAC/B,iBAAiB,EAAE,IAAI;KACxB,CAAC,CAAC;IAEH,iCAAiC;IACjC,MAAM,YAAY,GAAG,kBAAkB,CAAC;IACxC,MAAM,QAAQ,GAAG,MAAM,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IACtE,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QACrB,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAChE,MAAM,IAAI,KAAK,CAAC,+BAA+B,UAAU,IAAI,YAAY,MAAM,CAAC,CAAC;IACnF,CAAC;IAED,KAAK,MAAM,WAAW,IAAI,QAAQ,EAAE,CAAC;QACnC,MAAM,UAAU,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE,CAAC;QACzD,MAAM,aAAa,GAAG,CAAC,MAAM,MAAM,CAAC,UAAU,CAAC,CAAsB,CAAC;QAEtE,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM,OAAO,CAAC,GAAG,EAAE,CAAC;AACtB,CAAC","sourcesContent":["import { getDisplayVersion } from '@ms-cloudpack/package-utilities';\nimport { globSourceFiles } from '@ms-cloudpack/path-utilities';\nimport type { OutputConfiguration } from 'commander';\nimport path from 'path';\nimport { fileURLToPath, pathToFileURL } from 'url';\nimport type { CommandInitModule } from './types/CommandInitFunction.js';\nimport { PerfMarkerCliEntry } from './performance/markers.js';\nimport { CloudpackCommand } from './utilities/CloudpackCommand.js';\nimport { getNodeEngineRequirement } from './utilities/getNodeEngineRequirement.js';\nimport { satisfies } from 'semver';\n\n/** Override options for tests */\nexport interface MainOptions {\n cwd?: string;\n disableTelemetry?: boolean;\n argv?: string[];\n outputOptions?: OutputConfiguration;\n}\n\n/**\n * Entry point for the cloudpack CLI.\n * Resolves all commands defined within the \"./commands\" folder.\n */\nexport async function main(options: Partial<MainOptions> = {}): Promise<void> {\n // Check Node.js version compatibility before doing anything else\n const requiredNodeVersion = getNodeEngineRequirement();\n if (requiredNodeVersion && !satisfies(process.version, requiredNodeVersion)) {\n console.error(`Cloudpack requires Node.js ${requiredNodeVersion}. Current version: ${process.version}.`);\n // eslint-disable-next-line no-restricted-properties -- exit immediately\n process.exit(1);\n }\n\n const {\n argv = [...process.argv],\n // eslint-disable-next-line no-restricted-properties -- this is where the default is supplied\n cwd = process.cwd(),\n disableTelemetry,\n outputOptions,\n } = options;\n\n performance.mark(PerfMarkerCliEntry);\n\n if (argv[3] === '--') {\n // Remove the \"--\" argument in case it's added by lage\n argv.splice(3, 1);\n }\n\n const version = getDisplayVersion(import.meta.url);\n\n // Create the top-level command and apply common options\n // (avoids \"unknown option\" errors if they're specified without a verb)\n const program = new CloudpackCommand({\n name: 'cloudpack',\n description: 'A tool for managing fast inner and outer looping in web apps. Requires a sub-command.',\n usage: '<command> [options]',\n outputOptions,\n programOptions: { cwd, version, argv, disableTelemetry },\n // The top-level command should realistically only ever be used with --help or --version,\n // so hide most of the options.\n hideSharedOptions: true,\n });\n\n // Get all the available commands\n const commandsGlob = 'commands/*/index';\n const commands = await globSourceFiles(import.meta.url, commandsGlob);\n if (!commands.length) {\n const currentDir = path.dirname(fileURLToPath(import.meta.url));\n throw new Error(`No commands found matching \"${currentDir}/${commandsGlob}.*\".`);\n }\n\n for (const commandPath of commands) {\n const commandUrl = pathToFileURL(commandPath).toString();\n const commandModule = (await import(commandUrl)) as CommandInitModule;\n\n commandModule.init(program);\n }\n\n await program.run();\n}\n"]}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Gets the Node.js engine requirement from the package.json.
3
+ * @returns The Node.js version requirement string, or null if not specified
4
+ */
5
+ export declare function getNodeEngineRequirement(): string | null;
6
+ //# sourceMappingURL=getNodeEngineRequirement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getNodeEngineRequirement.d.ts","sourceRoot":"","sources":["../../src/utilities/getNodeEngineRequirement.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,GAAG,IAAI,CAcxD"}
@@ -0,0 +1,21 @@
1
+ import { readJsonSync } from '@ms-cloudpack/json-utilities';
2
+ import { findPackageRoot } from '@ms-cloudpack/path-utilities';
3
+ import path, { dirname } from 'path';
4
+ import { fileURLToPath } from 'url';
5
+ /**
6
+ * Gets the Node.js engine requirement from the package.json.
7
+ * @returns The Node.js version requirement string, or null if not specified
8
+ */
9
+ export function getNodeEngineRequirement() {
10
+ // Find the CLI package root using the same logic as getVersionInternal
11
+ const currentDir = dirname(fileURLToPath(import.meta.url));
12
+ const packagePath = findPackageRoot(currentDir);
13
+ if (!packagePath) {
14
+ return null;
15
+ }
16
+ const packageJsonPath = path.join(packagePath, 'package.json');
17
+ // Read package.json using the existing utility
18
+ const packageJson = readJsonSync(packageJsonPath);
19
+ return packageJson.engines?.node || null;
20
+ }
21
+ //# sourceMappingURL=getNodeEngineRequirement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getNodeEngineRequirement.js","sourceRoot":"","sources":["../../src/utilities/getNodeEngineRequirement.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC;;;GAGG;AACH,MAAM,UAAU,wBAAwB;IACtC,uEAAuE;IACvE,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3D,MAAM,WAAW,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;IAEhD,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;IAC/D,+CAA+C;IAC/C,MAAM,WAAW,GAAG,YAAY,CAAC,eAAe,CAAgB,CAAC;IAEjE,OAAO,WAAW,CAAC,OAAO,EAAE,IAAI,IAAI,IAAI,CAAC;AAC3C,CAAC","sourcesContent":["import type { PackageJson } from '@ms-cloudpack/common-types';\nimport { readJsonSync } from '@ms-cloudpack/json-utilities';\nimport { findPackageRoot } from '@ms-cloudpack/path-utilities';\nimport path, { dirname } from 'path';\nimport { fileURLToPath } from 'url';\n\n/**\n * Gets the Node.js engine requirement from the package.json.\n * @returns The Node.js version requirement string, or null if not specified\n */\nexport function getNodeEngineRequirement(): string | null {\n // Find the CLI package root using the same logic as getVersionInternal\n const currentDir = dirname(fileURLToPath(import.meta.url));\n const packagePath = findPackageRoot(currentDir);\n\n if (!packagePath) {\n return null;\n }\n\n const packageJsonPath = path.join(packagePath, 'package.json');\n // Read package.json using the existing utility\n const packageJson = readJsonSync(packageJsonPath) as PackageJson;\n\n return packageJson.engines?.node || null;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/cli",
3
- "version": "0.77.2",
3
+ "version": "0.77.4",
4
4
  "description": "The Cloudpack command line interface - a tool for managing fast inner and outer looping in web apps.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -18,24 +18,24 @@
18
18
  "cloudpack": "./bin/cloudpack.js"
19
19
  },
20
20
  "dependencies": {
21
- "@ms-cloudpack/api-server": "^0.64.17",
22
- "@ms-cloudpack/app-server": "^0.20.9",
23
- "@ms-cloudpack/bundler": "^0.25.30",
24
- "@ms-cloudpack/bundler-capabilities": "^0.2.39",
25
- "@ms-cloudpack/common-types": "^0.27.4",
26
- "@ms-cloudpack/config": "^0.38.1",
27
- "@ms-cloudpack/create-express-app": "^1.10.48",
21
+ "@ms-cloudpack/api-server": "^0.64.19",
22
+ "@ms-cloudpack/app-server": "^0.20.11",
23
+ "@ms-cloudpack/bundler": "^0.25.32",
24
+ "@ms-cloudpack/bundler-capabilities": "^0.3.1",
25
+ "@ms-cloudpack/common-types": "^0.27.6",
26
+ "@ms-cloudpack/config": "^0.38.3",
27
+ "@ms-cloudpack/create-express-app": "^1.10.50",
28
28
  "@ms-cloudpack/environment": "^0.1.1",
29
- "@ms-cloudpack/json-utilities": "^0.1.10",
30
- "@ms-cloudpack/link-proxy": "^0.2.31",
31
- "@ms-cloudpack/overlay": "^0.19.27",
32
- "@ms-cloudpack/package-utilities": "^12.3.25",
29
+ "@ms-cloudpack/json-utilities": "^0.1.11",
30
+ "@ms-cloudpack/link-proxy": "^0.2.33",
31
+ "@ms-cloudpack/overlay": "^0.19.29",
32
+ "@ms-cloudpack/package-utilities": "^12.5.0",
33
33
  "@ms-cloudpack/path-string-parsing": "^1.2.7",
34
- "@ms-cloudpack/path-utilities": "^3.1.19",
35
- "@ms-cloudpack/remote-cache": "^0.11.36",
36
- "@ms-cloudpack/setup-utilities": "^0.5.40",
37
- "@ms-cloudpack/task-reporter": "^0.17.2",
38
- "@ms-cloudpack/telemetry": "^0.11.37",
34
+ "@ms-cloudpack/path-utilities": "^3.1.21",
35
+ "@ms-cloudpack/remote-cache": "^0.11.38",
36
+ "@ms-cloudpack/setup-utilities": "^0.5.42",
37
+ "@ms-cloudpack/task-reporter": "^0.17.3",
38
+ "@ms-cloudpack/telemetry": "^0.11.39",
39
39
  "@yarnpkg/lockfile": "^1.1.0",
40
40
  "commander": "^14.0.0",
41
41
  "cross-spawn": "^7.0.3",
@@ -48,7 +48,7 @@
48
48
  "workspace-tools": "^0.38.0"
49
49
  },
50
50
  "devDependencies": {
51
- "@ms-cloudpack/common-types": "^0.27.4",
51
+ "@ms-cloudpack/common-types": "^0.27.6",
52
52
  "@ms-cloudpack/common-types-browser": "^0.6.3",
53
53
  "@ms-cloudpack/eslint-plugin-internal": "^0.0.1",
54
54
  "@ms-cloudpack/scripts": "^0.0.1",
@@ -1169,6 +1169,20 @@
1169
1169
  }
1170
1170
  ]
1171
1171
  },
1172
+ "define": {
1173
+ "anyOf": [
1174
+ {
1175
+ "type": "object",
1176
+ "additionalProperties": {
1177
+ "type": "string"
1178
+ },
1179
+ "description": "Replace identifiers at build time. Values must be valid JS literals as strings (e.g. JSON.stringify('value'))."
1180
+ },
1181
+ {
1182
+ "type": "boolean"
1183
+ }
1184
+ ]
1185
+ },
1172
1186
  "density": {
1173
1187
  "type": "boolean"
1174
1188
  },
@@ -1170,6 +1170,20 @@
1170
1170
  }
1171
1171
  ]
1172
1172
  },
1173
+ "define": {
1174
+ "anyOf": [
1175
+ {
1176
+ "type": "object",
1177
+ "additionalProperties": {
1178
+ "type": "string"
1179
+ },
1180
+ "description": "Replace identifiers at build time. Values must be valid JS literals as strings (e.g. JSON.stringify('value'))."
1181
+ },
1182
+ {
1183
+ "type": "boolean"
1184
+ }
1185
+ ]
1186
+ },
1173
1187
  "density": {
1174
1188
  "type": "boolean"
1175
1189
  },