@ms-cloudpack/cli 0.39.9 → 0.39.11

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":"findImports.d.ts","sourceRoot":"","sources":["../../../src/commands/init/findImports.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,wBAAsB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CA2D3F"}
1
+ {"version":3,"file":"findImports.d.ts","sourceRoot":"","sources":["../../../src/commands/init/findImports.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,wBAAsB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAoE3F"}
@@ -2,7 +2,10 @@ import { parse } from 'es-module-lexer';
2
2
  import fsPromises from 'fs/promises';
3
3
  import path from 'path';
4
4
  import { parseImportString } from '@ms-cloudpack/path-string-parsing';
5
+ import { sourceExtensions } from '@ms-cloudpack/path-utilities';
5
6
  import { builtinModules } from 'module';
7
+ /** Treat files with no extension as JS for purposes below */
8
+ const allSourceExtensions = [...sourceExtensions, ''];
6
9
  /**
7
10
  * Returns a dictionary where key is the package name and value is a set of required paths.
8
11
  * Eg. `{ '@fluentui/react': new Set([ '.', './lib/Button' ]) }`
@@ -13,11 +16,21 @@ export async function findImports(filePaths) {
13
16
  const pathsToParse = [...filePaths];
14
17
  while (pathsToParse.length) {
15
18
  const filePath = pathsToParse.shift();
16
- if (!filePath) {
19
+ // Ignore any non-JS/TS files such as SVGs
20
+ if (!filePath || !allSourceExtensions.includes(path.extname(filePath))) {
17
21
  continue;
18
22
  }
19
23
  const source = await fsPromises.readFile(filePath, 'utf-8');
20
- const [rawImports] = parse(source);
24
+ let rawImports;
25
+ try {
26
+ [rawImports] = parse(source);
27
+ }
28
+ catch (err) {
29
+ // This could happen if the source file isn't valid JS
30
+ // (unlikely after adding the check above to only attempt parsing JS/TS files)
31
+ console.warn(`Failed to parse ${filePath}:`, err);
32
+ continue;
33
+ }
21
34
  const imports = Array.from(new Set(rawImports))
22
35
  .map((i) => {
23
36
  // The es-module-lexer returns entries where the "n" property equals the import source.
@@ -1 +1 @@
1
- {"version":3,"file":"findImports.js","sourceRoot":"","sources":["../../../src/commands/init/findImports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAA2B,MAAM,mCAAmC,CAAC;AAC/F,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAExC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,SAAmB;IACnD,MAAM,eAAe,GAAgC,EAAE,CAAC;IACxD,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC;IACxC,MAAM,YAAY,GAAa,CAAC,GAAG,SAAS,CAAC,CAAC;IAE9C,OAAO,YAAY,CAAC,MAAM,EAAE;QAC1B,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,EAAE,CAAC;QACtC,IAAI,CAAC,QAAQ,EAAE;YACb,SAAS;SACV;QAED,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC5D,MAAM,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;QACnC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;aAC5C,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YACT,uFAAuF;YACvF,sEAAsE;YACtE,EAAE;YACF,y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ACzB,CAAC","sourcesContent":["import { parse } from 'es-module-lexer';\nimport fsPromises from 'fs/promises';\nimport path from 'path';\nimport { parseImportString, type ImportStringResult } from '@ms-cloudpack/path-string-parsing';\nimport { builtinModules } from 'module';\n\n/**\n * Returns a dictionary where key is the package name and value is a set of required paths.\n * Eg. `{ '@fluentui/react': new Set([ '.', './lib/Button' ]) }`\n */\nexport async function findImports(filePaths: string[]): Promise<Record<string, Set<string>>> {\n const requiredExports: Record<string, Set<string>> = {};\n const visitedPaths = new Set(filePaths);\n const pathsToParse: string[] = [...filePaths];\n\n while (pathsToParse.length) {\n const filePath = pathsToParse.shift();\n if (!filePath) {\n continue;\n }\n\n const source = await fsPromises.readFile(filePath, 'utf-8');\n const [rawImports] = parse(source);\n const imports = Array.from(new Set(rawImports))\n .map((i) => {\n // The es-module-lexer returns entries where the \"n\" property equals the import source.\n // This includes the package name and path. For example, in this case:\n //\n // import { Button } from '@fluentui/react/lib/Button';\n //\n // The \"n\" property would be \"@fluentui/react/lib/Button\".\n // The \"s\" and \"e\" properties represent the start/end character positions of\n // the import source. The \"ss\" and \"se\" properties represent the start/end\n // character positions of the import specifier starting with \"import\". This\n // may be useful for determining if the import is sync or async.\n //\n // Currently when the import source is a backtick string, the \"n\" property\n // is undefined. This is a bug in es-module-lexer. We may need to handle this\n // at the javascript layer and expand it into multiple potential imports.\n if (!i.n) {\n console.debug(\n `Found an import that didn't parse correctly:\\nFilename:\\n${filePath}\\n\\nImport:\\n${source.slice(\n i.s,\n i.e,\n )}`,\n );\n return undefined;\n }\n\n return parseImportString(i.n);\n })\n .filter(Boolean) as ImportStringResult[];\n\n for (const { packageName, importPath } of imports) {\n if (packageName?.startsWith('.')) {\n const localPath = path.resolve(path.dirname(filePath), packageName, importPath || '');\n\n if (!visitedPaths.has(localPath)) {\n visitedPaths.add(localPath);\n pathsToParse.push(localPath);\n }\n } else if (packageName && !packageName.startsWith('node:') && !builtinModules.includes(packageName)) {\n requiredExports[packageName] ||= new Set();\n requiredExports[packageName].add(importPath || '.');\n }\n }\n }\n\n return requiredExports;\n}\n"]}
1
+ {"version":3,"file":"findImports.js","sourceRoot":"","sources":["../../../src/commands/init/findImports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAA2B,MAAM,mCAAmC,CAAC;AAC/F,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAExC,6DAA6D;AAC7D,MAAM,mBAAmB,GAAG,CAAC,GAAG,gBAAgB,EAAE,EAAE,CAAC,CAAC;AAEtD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,SAAmB;IACnD,MAAM,eAAe,GAAgC,EAAE,CAAC;IACxD,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC;IACxC,MAAM,YAAY,GAAa,CAAC,GAAG,SAAS,CAAC,CAAC;IAE9C,OAAO,YAAY,CAAC,MAAM,EAAE;QAC1B,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,EAAE,CAAC;QACtC,0CAA0C;QAC1C,IAAI,CAAC,QAAQ,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE;YACtE,SAAS;SACV;QAED,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC5D,IAAI,UAAuC,CAAC;QAC5C,IAAI;YACF,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;SAC9B;QAAC,OAAO,GAAG,EAAE;YACZ,sDAAsD;YACtD,8EAA8E;YAC9E,OAAO,CAAC,IAAI,CAAC,mBAA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AQ,CAAC,WAAW,CAAC,EAAE;gBACnG,eAAe,CAAC,WAAW,MAA3B,eAAe,CAAC,WAAW,IAAM,IAAI,GAAG,EAAE,EAAC;gBAC3C,eAAe,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC;aACrD;SACF;KACF;IAED,OAAO,eAAe,CAAC;AACzB,CAAC","sourcesContent":["import { parse } from 'es-module-lexer';\nimport fsPromises from 'fs/promises';\nimport path from 'path';\nimport { parseImportString, type ImportStringResult } from '@ms-cloudpack/path-string-parsing';\nimport { sourceExtensions } from '@ms-cloudpack/path-utilities';\nimport { builtinModules } from 'module';\n\n/** Treat files with no extension as JS for purposes below */\nconst allSourceExtensions = [...sourceExtensions, ''];\n\n/**\n * Returns a dictionary where key is the package name and value is a set of required paths.\n * Eg. `{ '@fluentui/react': new Set([ '.', './lib/Button' ]) }`\n */\nexport async function findImports(filePaths: string[]): Promise<Record<string, Set<string>>> {\n const requiredExports: Record<string, Set<string>> = {};\n const visitedPaths = new Set(filePaths);\n const pathsToParse: string[] = [...filePaths];\n\n while (pathsToParse.length) {\n const filePath = pathsToParse.shift();\n // Ignore any non-JS/TS files such as SVGs\n if (!filePath || !allSourceExtensions.includes(path.extname(filePath))) {\n continue;\n }\n\n const source = await fsPromises.readFile(filePath, 'utf-8');\n let rawImports: ReturnType<typeof parse>[0];\n try {\n [rawImports] = parse(source);\n } catch (err) {\n // This could happen if the source file isn't valid JS\n // (unlikely after adding the check above to only attempt parsing JS/TS files)\n console.warn(`Failed to parse ${filePath}:`, err);\n continue;\n }\n const imports = Array.from(new Set(rawImports))\n .map((i) => {\n // The es-module-lexer returns entries where the \"n\" property equals the import source.\n // This includes the package name and path. For example, in this case:\n //\n // import { Button } from '@fluentui/react/lib/Button';\n //\n // The \"n\" property would be \"@fluentui/react/lib/Button\".\n // The \"s\" and \"e\" properties represent the start/end character positions of\n // the import source. The \"ss\" and \"se\" properties represent the start/end\n // character positions of the import specifier starting with \"import\". This\n // may be useful for determining if the import is sync or async.\n //\n // Currently when the import source is a backtick string, the \"n\" property\n // is undefined. This is a bug in es-module-lexer. We may need to handle this\n // at the javascript layer and expand it into multiple potential imports.\n if (!i.n) {\n console.debug(\n `Found an import that didn't parse correctly:\\nFilename:\\n${filePath}\\n\\nImport:\\n${source.slice(\n i.s,\n i.e,\n )}`,\n );\n return undefined;\n }\n\n return parseImportString(i.n);\n })\n .filter(Boolean) as ImportStringResult[];\n\n for (const { packageName, importPath } of imports) {\n if (packageName?.startsWith('.')) {\n const localPath = path.resolve(path.dirname(filePath), packageName, importPath || '');\n\n if (!visitedPaths.has(localPath)) {\n visitedPaths.add(localPath);\n pathsToParse.push(localPath);\n }\n } else if (packageName && !packageName.startsWith('node:') && !builtinModules.includes(packageName)) {\n requiredExports[packageName] ||= new Set();\n requiredExports[packageName].add(importPath || '.');\n }\n }\n }\n\n return requiredExports;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAmBA;;;GAGG;AACH,wBAAsB,IAAI,kBAuEzB;AAED,YAAY,EACV,SAAS,EACT,SAAS,EACT,YAAY,EACZ,IAAI,EACJ,eAAe,EACf,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACpF,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,YAAY,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtE,YAAY,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACxE,YAAY,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtE,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,YAAY,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAmBA;;;GAGG;AACH,wBAAsB,IAAI,kBAiEzB;AAED,YAAY,EACV,SAAS,EACT,SAAS,EACT,YAAY,EACZ,IAAI,EACJ,eAAe,EACf,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACpF,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,YAAY,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtE,YAAY,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACxE,YAAY,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtE,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,YAAY,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC"}
package/lib/index.js CHANGED
@@ -17,12 +17,7 @@ export async function main() {
17
17
  performance.mark(PerfMarkerCliEntry);
18
18
  const program = new Command();
19
19
  const plainTextMode = process.argv.includes('--no-color') || process.argv.includes('-n');
20
- // Initialize the color setting as soon as possible.
21
- setReporterOptions({
22
- plainTextMode,
23
- });
24
20
  const version = getVersion(import.meta.url);
25
- // the name "Cloudpack" preceed by an emoji representing sun behind cloud
26
21
  const productName = gradient(`Cloudpack`);
27
22
  const useDebugLogging = process.argv.includes('--debug') || process.argv.includes('-d');
28
23
  const verb = process.argv[2];
@@ -32,6 +27,7 @@ export async function main() {
32
27
  setReporterOptions({
33
28
  productName,
34
29
  version,
30
+ plainTextMode,
35
31
  description: `Running "${bold(process.argv.slice(2).join(' '))}"`,
36
32
  helpMessage: config.helpMessage,
37
33
  ...defaultLoggingConfig,
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,EACL,IAAI,EACJ,kBAAkB,EAClB,oBAAoB,EACpB,QAAQ,EACR,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAEjE;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI;IACxB,WAAW,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IAErC,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;IAC9B,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEzF,oDAAoD;IACpD,kBAAkB,CAA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pack/package-utilities';\nimport {\n bold,\n debugLoggingConfig,\n defaultLoggingConfig,\n gradient,\n verboseLoggingConfig,\n} from '@ms-cloudpack/task-reporter';\nimport { Command } from 'commander';\nimport glob from 'glob';\nimport path from 'path';\nimport { fileURLToPath, pathToFileURL } from 'url';\nimport { initTelemetry, setSharedTelemetryAttributes } from './initTelemetry.js';\nimport { PerfMarkerCliEntry } from './performance/markers.js';\nimport { setReporterOptions } from './reporter.js';\nimport { readConfig } from '@ms-cloudpack/config';\n\nconst currentPath = path.dirname(fileURLToPath(import.meta.url));\n\n/**\n * Entry point for the cloudpack CLI. Resolves all commands defined\n * within the \"./commands\" folder.\n */\nexport async function main() {\n performance.mark(PerfMarkerCliEntry);\n\n const program = new Command();\n const plainTextMode = process.argv.includes('--no-color') || process.argv.includes('-n');\n\n // Initialize the color setting as soon as possible.\n setReporterOptions({\n plainTextMode,\n });\n\n const version = getVersion(import.meta.url);\n // the name \"Cloudpack\" preceed by an emoji representing sun behind cloud\n const productName = gradient(`Cloudpack`);\n const useDebugLogging = process.argv.includes('--debug') || process.argv.includes('-d');\n const verb = process.argv[2];\n const useVerboseLogging = process.argv.includes('--verbose') || process.argv.includes('-v') || verb === 'bundle';\n\n program.name(productName).version(version).usage('<command> [options]');\n\n const config = await readConfig();\n\n setReporterOptions({\n productName,\n version,\n description: `Running \"${bold(process.argv.slice(2).join(' '))}\"`,\n helpMessage: config.helpMessage,\n ...defaultLoggingConfig,\n ...(useVerboseLogging && verboseLoggingConfig),\n ...(useDebugLogging && debugLoggingConfig),\n });\n\n await initTelemetry({\n useDebugLogging,\n useVerboseLogging,\n });\n\n // Make sure the package has a valid definition.\n const appPath = process.cwd();\n const definition = await PackageDefinitions.getInstance().get(appPath);\n\n if (!definition) {\n throw new Error(`There was no package.json located at \"${appPath}\".`);\n }\n\n setSharedTelemetryAttributes({\n verb,\n arguments: process.argv.slice(3).join(' '),\n environment: process.env.CI || process.env.TF_BUILD ? 'ci' : 'local',\n appName: definition.name || '<unkown>',\n });\n\n const commands = glob.sync('commands/*/index.js', { cwd: currentPath });\n\n for (const commandPath of commands) {\n const command = (await import(pathToFileURL(path.resolve(currentPath, commandPath)).toString())) as {\n init: (cmd: Command) => void;\n };\n\n command.init(program);\n }\n\n program.option('-v, --verbose', 'Show additional details about the running tasks. (default: false)');\n program.option('-d, --debug', 'Show debug information (superset of --verbose). (default: false)');\n program.option('-n, --no-color', 'Disable colors in the output. (default: false)');\n\n program.parse(process.argv);\n\n if (program.args.length === 0) {\n program.help();\n }\n}\n\nexport type {\n ApiServer,\n DevServer,\n SessionStats,\n Task,\n TaskDescription,\n TaskEndDescription,\n TaskError,\n TaskOptions,\n TaskStartDescription,\n} from '@ms-cloudpack/api-server';\nexport type { CloudpackConfig, Route, TelemetryConfig } from '@ms-cloudpack/config';\nexport type { BundleRequest } from './types/BundleRequest.js';\nexport type { BundleServer } from './types/BundleServer.js';\nexport type { BundleTaskOptions } from './types/BundleTaskOptions.js';\nexport type { CreateHtmlFunction } from './types/CreateHtmlFunction.js';\nexport type { CreateHtmlOptions } from './types/CreateHtmlOptions.js';\nexport type { CreateHtmlResult } from './types/CreateHtmlResult.js';\nexport type { CreateHtmlScript } from './types/CreateHtmlScript.js';\nexport type { Watcher } from './types/Watcher.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,EACL,IAAI,EACJ,kBAAkB,EAClB,oBAAoB,EACpB,QAAQ,EACR,oBAAoB,GACrB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,4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,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAE9F,CAAC;QAEF,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KACvB;IAED,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,mEAAmE,CAAC,CAAC;IACrG,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,kEAAkE,CAAC,CAAC;IAClG,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,gDAAgD,CAAC,CAAC;IAEnF,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5B,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QAC7B,OAAO,CAAC,IAAI,EAAE,CAAC;KAChB;AACH,CAAC","sourcesContent":["import { PackageDefinitions, getVersion } from '@ms-cloudpack/package-utilities';\nimport {\n bold,\n debugLoggingConfig,\n defaultLoggingConfig,\n gradient,\n verboseLoggingConfig,\n} from '@ms-cloudpack/task-reporter';\nimport { Command } from 'commander';\nimport glob from 'glob';\nimport path from 'path';\nimport { fileURLToPath, pathToFileURL } from 'url';\nimport { initTelemetry, setSharedTelemetryAttributes } from './initTelemetry.js';\nimport { PerfMarkerCliEntry } from './performance/markers.js';\nimport { setReporterOptions } from './reporter.js';\nimport { readConfig } from '@ms-cloudpack/config';\n\nconst currentPath = path.dirname(fileURLToPath(import.meta.url));\n\n/**\n * Entry point for the cloudpack CLI. Resolves all commands defined\n * within the \"./commands\" folder.\n */\nexport async function main() {\n performance.mark(PerfMarkerCliEntry);\n\n const program = new Command();\n const plainTextMode = process.argv.includes('--no-color') || process.argv.includes('-n');\n const version = getVersion(import.meta.url);\n const productName = gradient(`Cloudpack`);\n const useDebugLogging = process.argv.includes('--debug') || process.argv.includes('-d');\n const verb = process.argv[2];\n const useVerboseLogging = process.argv.includes('--verbose') || process.argv.includes('-v') || verb === 'bundle';\n\n program.name(productName).version(version).usage('<command> [options]');\n\n const config = await readConfig();\n\n setReporterOptions({\n productName,\n version,\n plainTextMode,\n description: `Running \"${bold(process.argv.slice(2).join(' '))}\"`,\n helpMessage: config.helpMessage,\n ...defaultLoggingConfig,\n ...(useVerboseLogging && verboseLoggingConfig),\n ...(useDebugLogging && debugLoggingConfig),\n });\n\n await initTelemetry({\n useDebugLogging,\n useVerboseLogging,\n });\n\n // Make sure the package has a valid definition.\n const appPath = process.cwd();\n const definition = await PackageDefinitions.getInstance().get(appPath);\n\n if (!definition) {\n throw new Error(`There was no package.json located at \"${appPath}\".`);\n }\n\n setSharedTelemetryAttributes({\n verb,\n arguments: process.argv.slice(3).join(' '),\n environment: process.env.CI || process.env.TF_BUILD ? 'ci' : 'local',\n appName: definition.name || '<unkown>',\n });\n\n const commands = glob.sync('commands/*/index.js', { cwd: currentPath });\n\n for (const commandPath of commands) {\n const command = (await import(pathToFileURL(path.resolve(currentPath, commandPath)).toString())) as {\n init: (cmd: Command) => void;\n };\n\n command.init(program);\n }\n\n program.option('-v, --verbose', 'Show additional details about the running tasks. (default: false)');\n program.option('-d, --debug', 'Show debug information (superset of --verbose). (default: false)');\n program.option('-n, --no-color', 'Disable colors in the output. (default: false)');\n\n program.parse(process.argv);\n\n if (program.args.length === 0) {\n program.help();\n }\n}\n\nexport type {\n ApiServer,\n DevServer,\n SessionStats,\n Task,\n TaskDescription,\n TaskEndDescription,\n TaskError,\n TaskOptions,\n TaskStartDescription,\n} from '@ms-cloudpack/api-server';\nexport type { CloudpackConfig, Route, TelemetryConfig } from '@ms-cloudpack/config';\nexport type { BundleRequest } from './types/BundleRequest.js';\nexport type { BundleServer } from './types/BundleServer.js';\nexport type { BundleTaskOptions } from './types/BundleTaskOptions.js';\nexport type { CreateHtmlFunction } from './types/CreateHtmlFunction.js';\nexport type { CreateHtmlOptions } from './types/CreateHtmlOptions.js';\nexport type { CreateHtmlResult } from './types/CreateHtmlResult.js';\nexport type { CreateHtmlScript } from './types/CreateHtmlScript.js';\nexport type { Watcher } from './types/Watcher.js';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/cli",
3
- "version": "0.39.9",
3
+ "version": "0.39.11",
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",
@@ -10,17 +10,17 @@
10
10
  "cloudpack": "./bin/cloudpack.js"
11
11
  },
12
12
  "dependencies": {
13
- "@ms-cloudpack/api-server": "^0.6.14",
14
- "@ms-cloudpack/bundler": "^0.13.1",
15
- "@ms-cloudpack/config": "^0.7.3",
16
- "@ms-cloudpack/create-express-app": "^1.3.6",
13
+ "@ms-cloudpack/api-server": "^0.6.16",
14
+ "@ms-cloudpack/bundler": "^0.13.2",
15
+ "@ms-cloudpack/config": "^0.7.4",
16
+ "@ms-cloudpack/create-express-app": "^1.3.7",
17
17
  "@ms-cloudpack/data-bus": "^0.3.0",
18
18
  "@ms-cloudpack/json-utilities": "^0.0.6",
19
19
  "@ms-cloudpack/overlay": "^0.13.10",
20
- "@ms-cloudpack/package-utilities": "^3.1.4",
20
+ "@ms-cloudpack/package-utilities": "^3.1.5",
21
21
  "@ms-cloudpack/path-string-parsing": "^1.0.2",
22
- "@ms-cloudpack/path-utilities": "^2.2.3",
23
- "@ms-cloudpack/task-reporter": "^0.4.2",
22
+ "@ms-cloudpack/path-utilities": "^2.3.0",
23
+ "@ms-cloudpack/task-reporter": "^0.5.0",
24
24
  "@ms-cloudpack/telemetry": "^0.3.3",
25
25
  "chokidar": "^3.5.3",
26
26
  "commander": "^10.0.0",