@altano/html-cdnify 6.0.1 → 6.0.2

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,5 +1,4 @@
1
- import { HtmlAttributeStreamTransformer, HtmlAttributeStreamTransformer_d_exports, TransformDefinition } from "./HtmlAttributeStreamTransformer.js";
2
- //#region src/CDNTransformer.d.ts
1
+ import { HtmlAttributeStreamTransformer, TransformDefinition } from "./HtmlAttributeStreamTransformer.js";
3
2
  export type CDNTransformFunction = (cdnUrl: string, oldUrl: string, bufferPath: string) => string;
4
3
  export interface CDNTransformerOptions {
5
4
  cdnUrl: string;
@@ -19,5 +18,4 @@ export declare class CDNTransformer extends HtmlAttributeStreamTransformer {
19
18
  constructor(cdnOptions: CDNTransformerOptions);
20
19
  static defaultTransformFunction: CDNTransformFunction;
21
20
  }
22
- //#endregion
23
21
  //# sourceMappingURL=CDNTransformer.d.ts.map
@@ -2,7 +2,7 @@ import urlConverter_default from "./urlConverter.js";
2
2
  import { HtmlAttributeStreamTransformer } from "./HtmlAttributeStreamTransformer.js";
3
3
  import { merge, mergeWith, unionBy } from "lodash-es";
4
4
 
5
- //#region src/CDNTransformer.ts
5
+ // src/CDNTransformer.ts
6
6
  /**
7
7
  * Handles merging objects that have TransformDefinition arrays
8
8
  */
@@ -95,6 +95,5 @@ var CDNTransformer = class CDNTransformer extends HtmlAttributeStreamTransformer
95
95
  };
96
96
  };
97
97
 
98
- //#endregion
99
98
  export { CDNTransformer };
100
99
  //# sourceMappingURL=CDNTransformer.js.map
@@ -1,7 +1,4 @@
1
1
  import HtmlTransformer from "./HtmlTransformer.js";
2
- declare namespace HtmlAttributeStreamTransformer_d_exports {
3
- export { AttributeParser, AttributeParsers, HtmlAttributeStreamTransformer, HtmlAttributeStreamTransformerOptions, TransformDefinition, TransformFunction };
4
- }
5
2
  export interface HtmlAttributeStreamTransformerOptions {
6
3
  transformDefinitions: TransformDefinition[];
7
4
  transformFunction: TransformFunction;
@@ -33,6 +30,4 @@ export declare class HtmlAttributeStreamTransformer extends HtmlTransformer {
33
30
  protected applyTransforms(): void;
34
31
  private processTransforms;
35
32
  }
36
- //#endregion
37
- export { HtmlAttributeStreamTransformer_d_exports };
38
33
  //# sourceMappingURL=HtmlAttributeStreamTransformer.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import HtmlTransformer from "./HtmlTransformer.js";
2
2
  import { groupBy } from "lodash-es";
3
3
 
4
- //#region src/HtmlAttributeStreamTransformer.ts
4
+ // src/HtmlAttributeStreamTransformer.ts
5
5
  /**
6
6
  * Wraps an HtmlRewriteStream, w/ HTML as input and
7
7
  * HTML as output. The output will have all non-absolute-URL
@@ -61,6 +61,5 @@ var HtmlAttributeStreamTransformer = class HtmlAttributeStreamTransformer extend
61
61
  }
62
62
  };
63
63
 
64
- //#endregion
65
64
  export { HtmlAttributeStreamTransformer };
66
65
  //# sourceMappingURL=HtmlAttributeStreamTransformer.js.map
@@ -1,5 +1,4 @@
1
1
  import { RewritingStream } from "parse5-html-rewriting-stream";
2
- //#region src/HtmlRewriteStream.d.ts
3
2
  /**
4
3
  * The subset of a DOM element that transforms are allowed to touch.
5
4
  *
@@ -43,5 +42,4 @@ export declare class HtmlRewriteStream extends RewritingStream {
43
42
  override _transform(chunk: string | Buffer, encoding: string, callback: (error?: Error | null, data?: string) => void): void;
44
43
  override _final(callback: (error?: Error | null, data?: string) => void): void;
45
44
  }
46
- //#endregion
47
45
  //# sourceMappingURL=HtmlRewriteStream.d.ts.map
@@ -3,7 +3,7 @@ import { Element } from "domhandler";
3
3
  import { compile } from "css-select";
4
4
  import { StringDecoder } from "node:string_decoder";
5
5
 
6
- //#region src/HtmlRewriteStream.ts
6
+ // src/HtmlRewriteStream.ts
7
7
  /**
8
8
  * An HTML-in, HTML-out transform stream that rewrites attributes on elements
9
9
  * matching a CSS selector.
@@ -80,6 +80,5 @@ var HtmlRewriteStream = class extends RewritingStream {
80
80
  }
81
81
  };
82
82
 
83
- //#endregion
84
83
  export { HtmlRewriteStream };
85
84
  //# sourceMappingURL=HtmlRewriteStream.js.map
@@ -1,5 +1,4 @@
1
1
  import { HtmlRewriteStream, SelectedElement, SelectionHandler } from "./HtmlRewriteStream.js";
2
- //#region src/HtmlTransformer.d.ts
3
2
  export default class HtmlTransformer {
4
3
  private transformStream;
5
4
  /**
@@ -11,6 +10,5 @@ export default class HtmlTransformer {
11
10
  */
12
11
  get outputBufferPromise(): Promise<Buffer>;
13
12
  }
14
- //#endregion
15
13
  export { HtmlRewriteStream, type SelectedElement, type SelectionHandler };
16
14
  //# sourceMappingURL=HtmlTransformer.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import { HtmlRewriteStream } from "./HtmlRewriteStream.js";
2
2
  import { buffer } from "node:stream/consumers";
3
3
 
4
- //#region src/HtmlTransformer.ts
4
+ // src/HtmlTransformer.ts
5
5
  var HtmlTransformer = class {
6
6
  transformStream = new HtmlRewriteStream();
7
7
  /**
@@ -18,6 +18,5 @@ var HtmlTransformer = class {
18
18
  }
19
19
  };
20
20
 
21
- //#endregion
22
21
  export { HtmlRewriteStream, HtmlTransformer as default };
23
22
  //# sourceMappingURL=HtmlTransformer.js.map
package/dist/cdnify.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { CDNTransformerOptions } from "./CDNTransformer.js";
2
- //#region src/cdnify.d.ts
3
2
  export interface CdnifyOptions extends CDNTransformerOptions {
4
3
  buffer: string | Buffer;
5
4
  }
@@ -7,6 +6,5 @@ export interface CdnifyOptions extends CDNTransformerOptions {
7
6
  * Alternative wrapper for simple Promise-based use of library (as opposed to transform stream)
8
7
  */
9
8
  export declare function cdnify(options: CdnifyOptions): Promise<Buffer>;
10
- //#endregion
11
9
  export { cdnify as default };
12
10
  //# sourceMappingURL=cdnify.d.ts.map
package/dist/cdnify.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { CDNTransformer } from "./CDNTransformer.js";
2
2
  import streamifier from "streamifier";
3
3
 
4
- //#region src/cdnify.ts
4
+ // src/cdnify.ts
5
5
  /**
6
6
  * Alternative wrapper for simple Promise-based use of library (as opposed to transform stream)
7
7
  */
@@ -12,6 +12,5 @@ function cdnify(options) {
12
12
  return cdnTransformer.outputBufferPromise;
13
13
  }
14
14
 
15
- //#endregion
16
15
  export { cdnify, cdnify as default };
17
16
  //# sourceMappingURL=cdnify.js.map
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { CDNTransformFunction, CDNTransformer, CDNTransformerOptions } from "./CDNTransformer.js";
2
1
  import { CdnifyOptions, cdnify } from "./cdnify.js";
2
+ import { CDNTransformFunction, CDNTransformer, CDNTransformerOptions } from "./CDNTransformer.js";
3
3
  export { CDNTransformFunction, CDNTransformer, CDNTransformerOptions, CdnifyOptions, cdnify };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { CDNTransformer } from "./CDNTransformer.js";
2
1
  import { cdnify } from "./cdnify.js";
2
+ import { CDNTransformer } from "./CDNTransformer.js";
3
3
 
4
4
  export { CDNTransformer, cdnify };
@@ -1,8 +1,6 @@
1
- //#region src/urlConverter.d.ts
2
1
  /**
3
2
  * Resolve oldUrl against pathOldUrlIsRelativeTo, and then prepend newUrlBase
4
3
  */
5
4
  declare const _default: (newUrlBase: string, oldUrl: string, pathOldUrlIsRelativeTo?: string) => string;
6
- //#endregion
7
5
  export { _default as default };
8
6
  //# sourceMappingURL=urlConverter.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import path from "node:path";
2
2
 
3
- //#region src/urlConverter.ts
3
+ // src/urlConverter.ts
4
4
  /** Origin used to resolve path-only bases, which `new URL()` can't parse. */
5
5
  const PLACEHOLDER_ORIGIN = "http://html-cdnify.invalid";
6
6
  const SCHEME_PATTERN = /^[a-z][a-z0-9+\-.]*:/i;
@@ -43,6 +43,5 @@ var urlConverter_default = (newUrlBase, oldUrl, pathOldUrlIsRelativeTo) => {
43
43
  }
44
44
  };
45
45
 
46
- //#endregion
47
46
  export { urlConverter_default as default };
48
47
  //# sourceMappingURL=urlConverter.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altano/html-cdnify",
3
- "version": "6.0.1",
3
+ "version": "6.0.2",
4
4
  "description": "Transform the relative URLs in your HTML markup (e.g. scripts, stylesheets, images) to use your CDN URL.",
5
5
  "keywords": [
6
6
  "cdn",
@@ -34,22 +34,22 @@
34
34
  "css-select": "^7.0.0",
35
35
  "domhandler": "^6.0.1",
36
36
  "lodash-es": "^4.18.1",
37
- "parse5-html-rewriting-stream": "^8.0.1",
37
+ "parse5-html-rewriting-stream": "^8.1.0",
38
38
  "streamifier": "^0.1.1"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@arethetypeswrong/cli": "^0.18.5",
42
42
  "@types/lodash-es": "^4.17.12",
43
- "@types/node": "^26.6.4",
43
+ "@types/node": "^26.6.6",
44
44
  "@types/streamifier": "^0.1.2",
45
- "@vitest/coverage-v8": "^5.0.3",
45
+ "@vitest/coverage-v8": "^5.1.0",
46
46
  "depcheck": "^1.4.7",
47
- "eslint": "^10.12.0",
48
- "prettier": "3.9.9",
49
- "tsdown": "^0.23.0",
47
+ "eslint": "^10.14.0",
48
+ "prettier": "3.9.10",
49
+ "tsdown": "^0.23.5",
50
50
  "typescript": "^6.0.3",
51
- "vite": "^8.3.2",
52
- "vitest": "^5.0.3",
51
+ "vite": "^8.3.5",
52
+ "vitest": "^5.1.0",
53
53
  "@altano/build-config": "0.0.1",
54
54
  "@altano/testing": "0.0.1",
55
55
  "@altano/tsconfig": "0.0.1"
@@ -1,18 +0,0 @@
1
- //#region \0rolldown/runtime.js
2
- var __defProp = Object.defineProperty;
3
- var __exportAll = (all, no_symbols) => {
4
- let target = {};
5
- for (var name in all) {
6
- __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true
9
- });
10
- }
11
- if (!no_symbols) {
12
- __defProp(target, Symbol.toStringTag, { value: "Module" });
13
- }
14
- return target;
15
- };
16
-
17
- //#endregion
18
- export { __exportAll };