@lwrjs/shared-utils 0.11.1 → 0.11.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
@@ -122,7 +122,7 @@ function normalizeResourcePath(rawPath, {rootDir, assets, contentDir, layoutsDir
122
122
  });
123
123
  }
124
124
  function logMetrics(filePath) {
125
- if (import_diagnostics2.logger.currentLevel == import_diagnostics2.DEBUG || import_diagnostics2.logger.currentLevel == import_diagnostics2.VERBOSE) {
125
+ if (import_diagnostics2.logger.isDebugEnabled()) {
126
126
  let count = files.get(filePath) || 0;
127
127
  if (++count % 100 === 0) {
128
128
  import_diagnostics2.logger.debug(`[${count}] Repeat Read ${filePath}`);
@@ -53,7 +53,7 @@ async function getImportMetadata(compiledSource) {
53
53
  const isStringLiteral = moduleSpecifier.startsWith("'") || moduleSpecifier.startsWith('"');
54
54
  const moduleNameType = isStringLiteral ? ModuleNameType.string : ModuleNameType.unresolved;
55
55
  moduleSpecifier = isStringLiteral ? moduleSpecifier.slice(1, -1) : moduleSpecifier;
56
- if (import_diagnostics.logger.currentLevel === import_diagnostics.DEBUG || import_diagnostics.logger.currentLevel === import_diagnostics.VERBOSE) {
56
+ if (import_diagnostics.logger.isDebugEnabled()) {
57
57
  import_diagnostics.logger.debug(`[import-metadata] Import from dynamic import ${compiledSource.slice(moduleImportLocation.ss, moduleImportLocation.se)} -> ${compiledSource.slice(moduleImportLocation.ss, moduleImportLocation.s)}`);
58
58
  }
59
59
  dynamicImports.push({
package/build/es/fs.js CHANGED
@@ -5,7 +5,7 @@ import { slugify } from './identity.js';
5
5
  import { LwrUnresolvableError, createSingleDiagnosticError, descriptions } from '@lwrjs/diagnostics';
6
6
  import { lookup } from 'mime-types';
7
7
  import { Readable } from 'stream';
8
- import { DEBUG, logger, VERBOSE } from '@lwrjs/diagnostics';
8
+ import { logger } from '@lwrjs/diagnostics';
9
9
  let fileCount = 0;
10
10
  const files = new Map();
11
11
  /**
@@ -125,7 +125,7 @@ export function normalizeResourcePath(rawPath, { rootDir, assets, contentDir, la
125
125
  }
126
126
  export { lookup as mimeLookup };
127
127
  function logMetrics(filePath) {
128
- if (logger.currentLevel == DEBUG || logger.currentLevel == VERBOSE) {
128
+ if (logger.isDebugEnabled()) {
129
129
  let count = files.get(filePath) || 0;
130
130
  if (++count % 100 === 0) {
131
131
  logger.debug(`[${count}] Repeat Read ${filePath}`);
@@ -1,5 +1,5 @@
1
1
  import { parse as parseImports } from 'es-module-lexer';
2
- import { DEBUG, logger, VERBOSE } from '@lwrjs/diagnostics';
2
+ import { logger } from '@lwrjs/diagnostics';
3
3
  const IMPORT_META_REGEX = /^import\.meta(\.\w+)+/;
4
4
  export var ModuleNameType;
5
5
  (function (ModuleNameType) {
@@ -27,7 +27,7 @@ export async function getImportMetadata(compiledSource) {
27
27
  const moduleNameType = isStringLiteral ? ModuleNameType.string : ModuleNameType.unresolved;
28
28
  moduleSpecifier = isStringLiteral ? moduleSpecifier.slice(1, -1) : moduleSpecifier; // remove quotes
29
29
  // Expecting: import(rootSpecifier) -> import(
30
- if (logger.currentLevel === DEBUG || logger.currentLevel === VERBOSE) {
30
+ if (logger.isDebugEnabled()) {
31
31
  logger.debug(`[import-metadata] Import from dynamic import ${compiledSource.slice(moduleImportLocation.ss, moduleImportLocation.se)} -> ${compiledSource.slice(moduleImportLocation.ss, moduleImportLocation.s)}`);
32
32
  }
33
33
  dynamicImports.push({
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.11.1",
7
+ "version": "0.11.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.11.1",
40
+ "@lwrjs/diagnostics": "0.11.3",
41
41
  "es-module-lexer": "^1.3.0",
42
42
  "fast-json-stable-stringify": "^2.1.0",
43
43
  "magic-string": "^0.30.0",
@@ -50,12 +50,12 @@
50
50
  "slugify": "^1.4.5"
51
51
  },
52
52
  "devDependencies": {
53
- "@lwrjs/types": "0.11.1",
53
+ "@lwrjs/types": "0.11.3",
54
54
  "@types/mime-types": "2.1.1",
55
55
  "@types/path-to-regexp": "^1.7.0"
56
56
  },
57
57
  "engines": {
58
58
  "node": ">=16.0.0"
59
59
  },
60
- "gitHead": "b7c40fdcd86635dd4e368c0a2e91c5d3374c0fcf"
60
+ "gitHead": "e420814f37150c71850f7f46f20372a33e1bb6d8"
61
61
  }