@ms-cloudpack/package-utilities 12.2.4 → 12.3.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.
@@ -1 +1 @@
1
- {"version":3,"file":"getApiServerTransform.d.ts","sourceRoot":"","sources":["../../src/packageDefinitions/getApiServerTransform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAI7E;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,0BAA0B,CAWlE"}
1
+ {"version":3,"file":"getApiServerTransform.d.ts","sourceRoot":"","sources":["../../src/packageDefinitions/getApiServerTransform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAI7E;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,0BAA0B,CAalE"}
@@ -6,10 +6,14 @@ const apiServerBrowserDeps = ['@ms-cloudpack/data-bus', '@ms-cloudpack/path-stri
6
6
  */
7
7
  export function getApiServerTransform() {
8
8
  return ({ definition }) => {
9
- if (definition.name !== '@ms-cloudpack/api-server') {
9
+ if (definition.name !== '@ms-cloudpack/api-server' || !definition.dependencies) {
10
10
  return undefined;
11
11
  }
12
- definition.dependencies = Object.fromEntries(Object.entries(definition.dependencies || {}).filter(([dep]) => apiServerBrowserDeps.includes(dep)));
12
+ for (const dep of Object.keys(definition.dependencies)) {
13
+ if (!apiServerBrowserDeps.includes(dep)) {
14
+ delete definition.dependencies[dep];
15
+ }
16
+ }
13
17
  return definition;
14
18
  };
15
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"getApiServerTransform.js","sourceRoot":"","sources":["../../src/packageDefinitions/getApiServerTransform.ts"],"names":[],"mappings":"AAEA,MAAM,oBAAoB,GAAG,CAAC,wBAAwB,EAAE,mCAAmC,EAAE,cAAc,EAAE,KAAK,CAAC,CAAC;AAEpH;;;;GAIG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE;QACxB,IAAI,UAAU,CAAC,IAAI,KAAK,0BAA0B,EAAE,CAAC;YACnD,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,UAAU,CAAC,YAAY,GAAG,MAAM,CAAC,WAAW,CAC1C,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,oBAAoB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CACpG,CAAC;QACF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { PackageDefinitionTransform } from '@ms-cloudpack/common-types';\n\nconst apiServerBrowserDeps = ['@ms-cloudpack/data-bus', '@ms-cloudpack/path-string-parsing', '@trpc/client', 'zod'];\n\n/**\n * Returns a transform that will update the dependencies of the `@ms-cloudpack/api-server` package\n * to only include the browser dependencies. This reduces the resolve map packages by removing\n * around ~500 server dependencies.\n */\nexport function getApiServerTransform(): PackageDefinitionTransform {\n return ({ definition }) => {\n if (definition.name !== '@ms-cloudpack/api-server') {\n return undefined;\n }\n\n definition.dependencies = Object.fromEntries(\n Object.entries(definition.dependencies || {}).filter(([dep]) => apiServerBrowserDeps.includes(dep)),\n );\n return definition;\n };\n}\n"]}
1
+ {"version":3,"file":"getApiServerTransform.js","sourceRoot":"","sources":["../../src/packageDefinitions/getApiServerTransform.ts"],"names":[],"mappings":"AAEA,MAAM,oBAAoB,GAAG,CAAC,wBAAwB,EAAE,mCAAmC,EAAE,cAAc,EAAE,KAAK,CAAC,CAAC;AAEpH;;;;GAIG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE;QACxB,IAAI,UAAU,CAAC,IAAI,KAAK,0BAA0B,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC;YAC/E,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;YACvD,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBACxC,OAAO,UAAU,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;YACtC,CAAC;QACH,CAAC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { PackageDefinitionTransform } from '@ms-cloudpack/common-types';\n\nconst apiServerBrowserDeps = ['@ms-cloudpack/data-bus', '@ms-cloudpack/path-string-parsing', '@trpc/client', 'zod'];\n\n/**\n * Returns a transform that will update the dependencies of the `@ms-cloudpack/api-server` package\n * to only include the browser dependencies. This reduces the resolve map packages by removing\n * around ~500 server dependencies.\n */\nexport function getApiServerTransform(): PackageDefinitionTransform {\n return ({ definition }) => {\n if (definition.name !== '@ms-cloudpack/api-server' || !definition.dependencies) {\n return undefined;\n }\n\n for (const dep of Object.keys(definition.dependencies)) {\n if (!apiServerBrowserDeps.includes(dep)) {\n delete definition.dependencies[dep];\n }\n }\n return definition;\n };\n}\n"]}
@@ -1,7 +1,6 @@
1
1
  import type { PackageDefinitionTransform } from '@ms-cloudpack/common-types';
2
2
  /**
3
- * `@types/` dependencies should never be relevant for Cloudpack's purposes, so move them from
4
- * `dependencies` or `peerDependencies` to `devDependencies` so they're not processed by default.
3
+ * `@types/` dependencies should never be relevant for Cloudpack's purposes, so delete them.
5
4
  */
6
5
  export declare function getTypesTransform(): PackageDefinitionTransform;
7
6
  //# sourceMappingURL=getTypesTransform.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getTypesTransform.d.ts","sourceRoot":"","sources":["../../src/packageDefinitions/getTypesTransform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAE7E;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,0BAA0B,CAsB9D"}
1
+ {"version":3,"file":"getTypesTransform.d.ts","sourceRoot":"","sources":["../../src/packageDefinitions/getTypesTransform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAE7E;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,0BAA0B,CAkB9D"}
@@ -1,22 +1,18 @@
1
1
  /**
2
- * `@types/` dependencies should never be relevant for Cloudpack's purposes, so move them from
3
- * `dependencies` or `peerDependencies` to `devDependencies` so they're not processed by default.
2
+ * `@types/` dependencies should never be relevant for Cloudpack's purposes, so delete them.
4
3
  */
5
4
  export function getTypesTransform() {
6
5
  return ({ definition }) => {
7
- for (const depType of ['dependencies', 'peerDependencies']) {
6
+ // Ignore bundle(d)Dependencies since they're so uncommon and unlikely to cause issues if present
7
+ for (const depType of ['dependencies', 'peerDependencies', 'devDependencies', 'optionalDependencies']) {
8
8
  const deps = definition[depType];
9
9
  if (!deps) {
10
10
  continue;
11
11
  }
12
12
  for (const depName of Object.keys(deps)) {
13
- if (!depName.startsWith('@types/')) {
14
- continue;
13
+ if (depName.startsWith('@types/')) {
14
+ delete deps[depName];
15
15
  }
16
- const depVersion = deps[depName];
17
- delete deps[depName];
18
- definition.devDependencies ??= {};
19
- definition.devDependencies[depName] = depVersion;
20
16
  }
21
17
  }
22
18
  return definition;
@@ -1 +1 @@
1
- {"version":3,"file":"getTypesTransform.js","sourceRoot":"","sources":["../../src/packageDefinitions/getTypesTransform.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE;QACxB,KAAK,MAAM,OAAO,IAAI,CAAC,cAAc,EAAE,kBAAkB,CAAU,EAAE,CAAC;YACpE,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;YACjC,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,SAAS;YACX,CAAC;YAED,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBACxC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;oBACnC,SAAS;gBACX,CAAC;gBAED,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;gBACjC,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;gBACrB,UAAU,CAAC,eAAe,KAAK,EAAE,CAAC;gBAClC,UAAU,CAAC,eAAe,CAAC,OAAO,CAAC,GAAG,UAAU,CAAC;YACnD,CAAC;QACH,CAAC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { PackageDefinitionTransform } from '@ms-cloudpack/common-types';\n\n/**\n * `@types/` dependencies should never be relevant for Cloudpack's purposes, so move them from\n * `dependencies` or `peerDependencies` to `devDependencies` so they're not processed by default.\n */\nexport function getTypesTransform(): PackageDefinitionTransform {\n return ({ definition }) => {\n for (const depType of ['dependencies', 'peerDependencies'] as const) {\n const deps = definition[depType];\n if (!deps) {\n continue;\n }\n\n for (const depName of Object.keys(deps)) {\n if (!depName.startsWith('@types/')) {\n continue;\n }\n\n const depVersion = deps[depName];\n delete deps[depName];\n definition.devDependencies ??= {};\n definition.devDependencies[depName] = depVersion;\n }\n }\n\n return definition;\n };\n}\n"]}
1
+ {"version":3,"file":"getTypesTransform.js","sourceRoot":"","sources":["../../src/packageDefinitions/getTypesTransform.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE;QACxB,iGAAiG;QACjG,KAAK,MAAM,OAAO,IAAI,CAAC,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,sBAAsB,CAAU,EAAE,CAAC;YAC/G,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;YACjC,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,SAAS;YACX,CAAC;YAED,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBACxC,IAAI,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;oBAClC,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;gBACvB,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { PackageDefinitionTransform } from '@ms-cloudpack/common-types';\n\n/**\n * `@types/` dependencies should never be relevant for Cloudpack's purposes, so delete them.\n */\nexport function getTypesTransform(): PackageDefinitionTransform {\n return ({ definition }) => {\n // Ignore bundle(d)Dependencies since they're so uncommon and unlikely to cause issues if present\n for (const depType of ['dependencies', 'peerDependencies', 'devDependencies', 'optionalDependencies'] as const) {\n const deps = definition[depType];\n if (!deps) {\n continue;\n }\n\n for (const depName of Object.keys(deps)) {\n if (depName.startsWith('@types/')) {\n delete deps[depName];\n }\n }\n }\n\n return definition;\n };\n}\n"]}
@@ -1,8 +1,4 @@
1
1
  import type { PackageJson, PackageJsonDependencies } from '@ms-cloudpack/common-types';
2
- /**
3
- * Get the extra dependencies that cloudpack doesn't consider for bundling by default:
4
- * bundle, bundled, and optional deps that might not be used, and dev deps which shouldn't
5
- * be used at runtime.
6
- */
2
+ /** @deprecated Not used; to be deleted in v13+ */
7
3
  export declare function getUnusedDependencies(definition: PackageJson): PackageJsonDependencies;
8
4
  //# sourceMappingURL=getUnusedDependencies.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getUnusedDependencies.d.ts","sourceRoot":"","sources":["../../src/packageJson/getUnusedDependencies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAEvF;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,WAAW,GAAG,uBAAuB,CAStF"}
1
+ {"version":3,"file":"getUnusedDependencies.d.ts","sourceRoot":"","sources":["../../src/packageJson/getUnusedDependencies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAEvF,kDAAkD;AAClD,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,WAAW,GAAG,uBAAuB,CAStF"}
@@ -1,8 +1,4 @@
1
- /**
2
- * Get the extra dependencies that cloudpack doesn't consider for bundling by default:
3
- * bundle, bundled, and optional deps that might not be used, and dev deps which shouldn't
4
- * be used at runtime.
5
- */
1
+ /** @deprecated Not used; to be deleted in v13+ */
6
2
  export function getUnusedDependencies(definition) {
7
3
  // This is very simple but needs to be consistent between multiple places,
8
4
  // especially in case it needs to be changed somehow later.
@@ -1 +1 @@
1
- {"version":3,"file":"getUnusedDependencies.js","sourceRoot":"","sources":["../../src/packageJson/getUnusedDependencies.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,UAAuB;IAC3D,0EAA0E;IAC1E,2DAA2D;IAC3D,OAAO;QACL,GAAG,UAAU,CAAC,eAAe;QAC7B,GAAG,2BAA2B,CAAC,UAAU,CAAC,kBAAkB,CAAC;QAC7D,GAAG,2BAA2B,CAAC,UAAU,CAAC,mBAAmB,CAAC;QAC9D,GAAG,UAAU,CAAC,oBAAoB;KACnC,CAAC;AACJ,CAAC;AAED,+EAA+E;AAC/E,SAAS,2BAA2B,CAClC,YAA4D;IAE5D,OAAO,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;AAChH,CAAC","sourcesContent":["import type { PackageJson, PackageJsonDependencies } from '@ms-cloudpack/common-types';\n\n/**\n * Get the extra dependencies that cloudpack doesn't consider for bundling by default:\n * bundle, bundled, and optional deps that might not be used, and dev deps which shouldn't\n * be used at runtime.\n */\nexport function getUnusedDependencies(definition: PackageJson): PackageJsonDependencies {\n // This is very simple but needs to be consistent between multiple places,\n // especially in case it needs to be changed somehow later.\n return {\n ...definition.devDependencies,\n ...normalizeBundleDependencies(definition.bundleDependencies),\n ...normalizeBundleDependencies(definition.bundledDependencies),\n ...definition.optionalDependencies,\n };\n}\n\n/** If the bundle(d) dependencies are an array, normalize them to an object. */\nfunction normalizeBundleDependencies(\n dependencies: PackageJsonDependencies | string[] | undefined,\n): PackageJsonDependencies | undefined {\n return Array.isArray(dependencies) ? Object.fromEntries(dependencies.map((dep) => [dep, '*'])) : dependencies;\n}\n"]}
1
+ {"version":3,"file":"getUnusedDependencies.js","sourceRoot":"","sources":["../../src/packageJson/getUnusedDependencies.ts"],"names":[],"mappings":"AAEA,kDAAkD;AAClD,MAAM,UAAU,qBAAqB,CAAC,UAAuB;IAC3D,0EAA0E;IAC1E,2DAA2D;IAC3D,OAAO;QACL,GAAG,UAAU,CAAC,eAAe;QAC7B,GAAG,2BAA2B,CAAC,UAAU,CAAC,kBAAkB,CAAC;QAC7D,GAAG,2BAA2B,CAAC,UAAU,CAAC,mBAAmB,CAAC;QAC9D,GAAG,UAAU,CAAC,oBAAoB;KACnC,CAAC;AACJ,CAAC;AAED,+EAA+E;AAC/E,SAAS,2BAA2B,CAClC,YAA+C;IAE/C,OAAO,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;AAChH,CAAC","sourcesContent":["import type { PackageJson, PackageJsonDependencies } from '@ms-cloudpack/common-types';\n\n/** @deprecated Not used; to be deleted in v13+ */\nexport function getUnusedDependencies(definition: PackageJson): PackageJsonDependencies {\n // This is very simple but needs to be consistent between multiple places,\n // especially in case it needs to be changed somehow later.\n return {\n ...definition.devDependencies,\n ...normalizeBundleDependencies(definition.bundleDependencies),\n ...normalizeBundleDependencies(definition.bundledDependencies),\n ...definition.optionalDependencies,\n };\n}\n\n/** If the bundle(d) dependencies are an array, normalize them to an object. */\nfunction normalizeBundleDependencies(\n dependencies: PackageJson['bundleDependencies'],\n): PackageJsonDependencies | undefined {\n return Array.isArray(dependencies) ? Object.fromEntries(dependencies.map((dep) => [dep, '*'])) : dependencies;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/package-utilities",
3
- "version": "12.2.4",
3
+ "version": "12.3.1",
4
4
  "description": "Utilities for resolving/parsing packages and their imports.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -18,7 +18,7 @@
18
18
  "@ms-cloudpack/json-utilities": "^0.1.10",
19
19
  "@ms-cloudpack/path-string-parsing": "^1.2.7",
20
20
  "@ms-cloudpack/path-utilities": "^3.0.13",
21
- "@ms-cloudpack/task-reporter": "^0.16.1",
21
+ "@ms-cloudpack/task-reporter": "^0.16.2",
22
22
  "acorn": "^8.11.2",
23
23
  "acorn-walk": "^8.2.1",
24
24
  "fast-glob": "^3.2.12",