@lwrjs/shared-utils 0.17.2-alpha.1 → 0.17.2-alpha.3

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/build/cjs/fs.cjs CHANGED
@@ -168,9 +168,7 @@ function normalizeResourcePath(rawPath, {rootDir, assets, contentDir, layoutsDir
168
168
  return rawPath.replace(RESOURCE_DIR_REGEX, function(fullMatch, m1, m2) {
169
169
  const alias = assetsMap[m1] || assetsMap[m2];
170
170
  if (!alias && !allowUnresolvedAlias) {
171
- throw (0, import_diagnostics.createSingleDiagnosticError)({
172
- description: import_diagnostics.descriptions.UNRESOLVABLE.DIR_ALIAS(fullMatch)
173
- }, import_diagnostics.LwrUnresolvableError);
171
+ throw new import_diagnostics.LwrUnresolvableError(import_diagnostics.descriptions.UNRESOLVABLE.DIR_ALIAS(fullMatch), "asset");
174
172
  }
175
173
  return alias;
176
174
  });
@@ -112,9 +112,7 @@ async function getModuleGraphs(specifier, options, moduleRegistry, defRegistry,
112
112
  };
113
113
  const moduleDef = isBundler(defRegistry) ? await defRegistry.getModuleBundle(versionedModuleId, runtimeEnvironment, runtimeParams) : await defRegistry.getModule(versionedModuleId, runtimeParams);
114
114
  if (!moduleDef) {
115
- throw (0, import_diagnostics.createSingleDiagnosticError)({
116
- description: import_diagnostics.descriptions.UNRESOLVABLE.MODULE_ENTRY(versionedModuleId.specifier)
117
- }, import_diagnostics.LwrUnresolvableError);
115
+ throw new import_diagnostics.LwrUnresolvableError(import_diagnostics.descriptions.UNRESOLVABLE.MODULE_ENTRY(versionedModuleId.specifier), "module");
118
116
  }
119
117
  const flattened = [];
120
118
  await traverse(moduleDef, depth, flattened, 0, acc, defRegistry, runtimeEnvironment, runtimeParams);
@@ -95,7 +95,7 @@ function explodeSpecifier(rawSpecifier) {
95
95
  const name = rawName ? [rawName, ...remaining].join("/") : rawNamespace;
96
96
  return {
97
97
  specifier: importee,
98
- namespace,
98
+ namespace: namespace || "",
99
99
  name,
100
100
  version: version ? normalizeVersionFromUri(version) : version
101
101
  };
package/build/es/fs.js CHANGED
@@ -3,7 +3,7 @@ import pathLib from 'path';
3
3
  import url from 'url';
4
4
  import crypto from 'crypto';
5
5
  import { slugify } from './identity.js';
6
- import { LwrUnresolvableError, createSingleDiagnosticError, descriptions } from '@lwrjs/diagnostics';
6
+ import { LwrUnresolvableError, descriptions } from '@lwrjs/diagnostics';
7
7
  import { lookup } from 'mime-types';
8
8
  import { Readable } from 'stream';
9
9
  import { logger } from '@lwrjs/diagnostics';
@@ -185,9 +185,7 @@ export function normalizeResourcePath(rawPath, { rootDir, assets, contentDir, la
185
185
  return rawPath.replace(RESOURCE_DIR_REGEX, function (fullMatch, m1, m2) {
186
186
  const alias = assetsMap[m1] || assetsMap[m2];
187
187
  if (!alias && !allowUnresolvedAlias) {
188
- throw createSingleDiagnosticError({
189
- description: descriptions.UNRESOLVABLE.DIR_ALIAS(fullMatch),
190
- }, LwrUnresolvableError);
188
+ throw new LwrUnresolvableError(descriptions.UNRESOLVABLE.DIR_ALIAS(fullMatch), 'asset');
191
189
  }
192
190
  return alias;
193
191
  });
package/build/es/graph.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { getSpecifier, getVersionedModuleId, isBundleDefinition } from './identity.js';
2
- import { LwrUnresolvableError, createSingleDiagnosticError, descriptions } from '@lwrjs/diagnostics';
2
+ import { LwrUnresolvableError, descriptions } from '@lwrjs/diagnostics';
3
3
  import { ModuleNameType } from './import-metadata.js';
4
4
  export var GraphDepth;
5
5
  (function (GraphDepth) {
@@ -117,9 +117,7 @@ options, moduleRegistry, defRegistry, runtimeEnvironment, runtimeParams, visited
117
117
  ? await defRegistry.getModuleBundle(versionedModuleId, runtimeEnvironment, runtimeParams)
118
118
  : await defRegistry.getModule(versionedModuleId, runtimeParams);
119
119
  if (!moduleDef) {
120
- throw createSingleDiagnosticError({
121
- description: descriptions.UNRESOLVABLE.MODULE_ENTRY(versionedModuleId.specifier),
122
- }, LwrUnresolvableError);
120
+ throw new LwrUnresolvableError(descriptions.UNRESOLVABLE.MODULE_ENTRY(versionedModuleId.specifier), 'module');
123
121
  }
124
122
  const flattened = [];
125
123
  await traverse(moduleDef, depth, flattened, 0, acc, defRegistry, runtimeEnvironment, runtimeParams);
@@ -43,6 +43,7 @@ export declare function prettyModuleUriSuffix(specifier: string): string;
43
43
  */
44
44
  interface PartialModuleId extends AbstractModuleId {
45
45
  name: string;
46
+ namespace: string;
46
47
  }
47
48
  export declare function explodeSpecifier(rawSpecifier: string): PartialModuleId;
48
49
  export declare function explodeSpecifiers(rawSpecifiers: string): PartialModuleId[];
@@ -55,7 +55,7 @@ export function explodeSpecifier(rawSpecifier) {
55
55
  // Return an abstract ModuleIdentifier
56
56
  return {
57
57
  specifier: importee,
58
- namespace,
58
+ namespace: namespace || '',
59
59
  name,
60
60
  version: version ? normalizeVersionFromUri(version) : version,
61
61
  };
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.17.2-alpha.1",
7
+ "version": "0.17.2-alpha.3",
8
8
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
9
9
  "repository": {
10
10
  "type": "git",
@@ -37,7 +37,7 @@
37
37
  "build/**/*.d.ts"
38
38
  ],
39
39
  "dependencies": {
40
- "@lwrjs/diagnostics": "0.17.2-alpha.1",
40
+ "@lwrjs/diagnostics": "0.17.2-alpha.3",
41
41
  "es-module-lexer": "^1.5.4",
42
42
  "fast-json-stable-stringify": "^2.1.0",
43
43
  "magic-string": "^0.30.9",
@@ -50,7 +50,7 @@
50
50
  "slugify": "^1.4.5"
51
51
  },
52
52
  "devDependencies": {
53
- "@lwrjs/types": "0.17.2-alpha.1",
53
+ "@lwrjs/types": "0.17.2-alpha.3",
54
54
  "@types/mime-types": "2.1.4",
55
55
  "@types/path-to-regexp": "^1.7.0",
56
56
  "memfs": "^4.13.0"
@@ -58,5 +58,5 @@
58
58
  "engines": {
59
59
  "node": ">=18.0.0"
60
60
  },
61
- "gitHead": "bba15ca717a242b0375decaa378af06bdee813b5"
61
+ "gitHead": "43757693dfca356cff105d4896a7a3cbf11ac017"
62
62
  }