@limetech/lime-web-components 6.6.0 → 6.7.0

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.
@@ -0,0 +1,51 @@
1
+ import { Logger } from './logger';
2
+ /**
3
+ * Creates a logger instance using the platform's logger factory
4
+ *
5
+ * This function retrieves the logger factory from the global Lime platform
6
+ * object and creates a scoped logger. If the platform factory is not available,
7
+ * it falls back to the browser console.
8
+ *
9
+ * The package name is automatically determined from the module's URL on the first
10
+ * call and cached for all subsequent calls. This ensures consistent logger scopes
11
+ * across all loggers created from the same module instance.
12
+ *
13
+ * @param scope - The scope/category for the logger (e.g., 'my-component', 'http-client')
14
+ * @returns A logger instance integrated with the platform or console fallback
15
+ *
16
+ * @remarks
17
+ * The console fallback is provided for development scenarios where the full
18
+ * Lime platform is not available. The console object does not fully implement
19
+ * the Logger interface but provides compatible logging methods.
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * const logger = createLogger('my-component');
24
+ * logger.info('Component initialized');
25
+ * logger.debug('Processing data', { count: 42 });
26
+ * ```
27
+ *
28
+ * @beta
29
+ * @group Logger
30
+ */
31
+ export declare function createLogger(scope: string): Logger;
32
+ /**
33
+ * Extracts the package name from a given URL
34
+ *
35
+ * Supports multiple URL patterns:
36
+ * - `/packages/@scope/name/version/...` → extracts `name`
37
+ * - `/static/name+version/...` → extracts `name`
38
+ * - `/static/directory/name+version/...` → extracts `name`
39
+ * - `/static/name/...` → extracts `name`
40
+ *
41
+ * The extracted name is cleaned by removing common prefixes and suffixes.
42
+ *
43
+ * @param url - The URL string to extract the package name from
44
+ *
45
+ * @returns The extracted package name, or null if not found
46
+ *
47
+ * @beta
48
+ * @group Logger
49
+ */
50
+ export declare function getPackageNameFromUrl(url: string | null): string | null;
51
+ //# sourceMappingURL=factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/logger/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAKlC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAqBlD;AAqCD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAcvE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=factory.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory.spec.d.ts","sourceRoot":"","sources":["../../src/logger/factory.spec.ts"],"names":[],"mappings":""}
@@ -1,3 +1,4 @@
1
1
  export * from './logger';
2
2
  export * from './types';
3
+ export { createLogger, getPackageNameFromUrl } from './factory';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/logger/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/logger/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-web-components",
3
- "version": "6.6.0",
3
+ "version": "6.7.0",
4
4
  "description": "Lime Web Components",
5
5
  "author": "Lime Technologies",
6
6
  "license": "Apache-2.0",
@@ -35,21 +35,21 @@
35
35
  "tslib": "^2.8.1"
36
36
  },
37
37
  "devDependencies": {
38
- "@commitlint/config-conventional": "^20.2.0",
38
+ "@commitlint/config-conventional": "^20.3.1",
39
39
  "@limetech/eslint-config": "^4.0.0",
40
40
  "@microsoft/api-extractor": "^7.55.2",
41
41
  "eslint": "^9.39.2",
42
42
  "expect-type": "^1.3.0",
43
- "globals": "^16.5.0",
44
- "jsdom": "^27.3.0",
43
+ "globals": "^17.0.0",
44
+ "jsdom": "^27.4.0",
45
45
  "replace-in-file": "^8.4.0",
46
46
  "shelljs": "0.10.0",
47
47
  "typedoc": "^0.23.24",
48
48
  "typedoc-plugin-markdown": "~3.15.0",
49
49
  "typescript": "^4.9.5",
50
- "vite": "^7.3.0",
50
+ "vite": "^7.3.1",
51
51
  "vite-plugin-dts": "^4.5.0",
52
- "vitest": "^4.0.15",
52
+ "vitest": "^4.0.17",
53
53
  "yargs": "^18.0.0"
54
54
  },
55
55
  "keywords": [