@normed/bundle 4.8.6 → 4.8.8

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,15 +1,5 @@
1
1
  import type * as esbuild from "esbuild";
2
2
  export declare function getLinkingAttrs(elementName: string): string[] | undefined;
3
- export declare function findPackageRoot(filePath: string): string | null;
4
- /**
5
- * Resolve an asset path from a pug file, treating "/" as srcWebRoot (not filesystem root).
6
- */
7
- export declare function resolveAssetPath(assetPath: string, pugDir: string, srcWebRoot: string): string;
8
- /**
9
- * Assert that an absolute path is within one of the allowed source roots.
10
- * Throws if the path escapes all allowed roots.
11
- */
12
- export declare function assertWithinAllowedRoots(absolutePath: string, allowedRoots: string[], originalValue: string, pugFilePath: string): void;
13
3
  /**
14
4
  * Discovered pug file reference from HTML.
15
5
  */
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Prefix for package references in pug files.
3
+ * Usage: pkg:bootstrap/dist/js/bootstrap.min.js
4
+ * @deprecated Use `copy:` instead. `pkg:` is a legacy alias for `copy:`.
5
+ */
6
+ export declare const PKG_PREFIX = "pkg:";
7
+ /**
8
+ * Prefix for build references in pug files.
9
+ * Resolves via Node's require.resolve, then compiles through the appropriate pipeline.
10
+ * Usage: build:#shared/styles.less, build:@acme/design-system/src/theme.less
11
+ */
12
+ export declare const BUILD_PREFIX = "build:";
13
+ /**
14
+ * Prefix for copy references in pug files.
15
+ * Resolves via Node's require.resolve, then copies to output with content-hashing.
16
+ * Usage: copy:bootstrap/dist/js/bootstrap.min.js, copy:#assets/logo.png
17
+ */
18
+ export declare const COPY_PREFIX = "copy:";
19
+ /**
20
+ * Prefix for verbatim references that bypass all path processing.
21
+ * Usage: verbatim:./runtime-path.png
22
+ */
23
+ export declare const VERBATIM_PREFIX = "verbatim:";
24
+ /**
25
+ * Check if a path is a relative asset path that should be processed.
26
+ * Returns false for URLs, data URIs, fragments, etc.
27
+ */
28
+ export declare function isRelativeAssetPath(assetPath: string): boolean;
29
+ /**
30
+ * Check if a path is a build reference (starts with build:).
31
+ */
32
+ export declare function isBuildReference(assetPath: string): boolean;
33
+ /**
34
+ * Check if a path is a copy reference (starts with copy:).
35
+ */
36
+ export declare function isCopyReference(assetPath: string): boolean;
37
+ /**
38
+ * Check if a path is a package reference (starts with pkg:).
39
+ * @deprecated Use `isCopyReference` instead.
40
+ */
41
+ export declare function isPackageReference(assetPath: string): boolean;
42
+ /**
43
+ * Check if a path is a verbatim reference (starts with verbatim:).
44
+ */
45
+ export declare function isVerbatimReference(assetPath: string): boolean;
46
+ /**
47
+ * Check if a package reference is a CSS file that needs processing.
48
+ */
49
+ export declare function isPackageCssReference(assetPath: string): boolean;
50
+ /**
51
+ * Strip the build:/copy:/pkg: prefix and return the specifier.
52
+ */
53
+ export declare function getResolvedSpecifier(assetPath: string): string;
54
+ /**
55
+ * Get the package specifier from a pkg: reference.
56
+ * @deprecated Use `getResolvedSpecifier` instead.
57
+ */
58
+ export declare function getPackageSpecifier(assetPath: string): string;
59
+ /**
60
+ * Get the raw path from a verbatim: reference.
61
+ */
62
+ export declare function getVerbatimPath(assetPath: string): string;
63
+ /**
64
+ * Resolve a package specifier to an absolute file path.
65
+ * Uses Node's module resolution from the context of the pug file.
66
+ */
67
+ export declare function resolvePackagePath(packageSpecifier: string, fromFile: string): string | null;
68
+ export declare function findPackageRoot(filePath: string): string | null;
69
+ /**
70
+ * Resolve an asset path from a pug file, treating "/" as srcWebRoot (not filesystem root).
71
+ */
72
+ export declare function resolveAssetPath(assetPath: string, pugDir: string, srcWebRoot: string): string;
73
+ /**
74
+ * Assert that an absolute path is within one of the allowed source roots.
75
+ * Throws if the path escapes all allowed roots.
76
+ */
77
+ export declare function assertWithinAllowedRoots(absolutePath: string, allowedRoots: string[], originalValue: string, pugFilePath: string): void;