@nowline/embed 0.2.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.
- package/LICENSE +190 -0
- package/README.md +118 -0
- package/dist/auto-scan.d.ts +23 -0
- package/dist/auto-scan.d.ts.map +1 -0
- package/dist/auto-scan.js +71 -0
- package/dist/auto-scan.js.map +1 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +119 -0
- package/dist/index.js.map +1 -0
- package/dist/meta.json +10226 -0
- package/dist/no-op-include-resolver.d.ts +4 -0
- package/dist/no-op-include-resolver.d.ts.map +1 -0
- package/dist/no-op-include-resolver.js +18 -0
- package/dist/no-op-include-resolver.js.map +1 -0
- package/dist/nowline.esm.js +38295 -0
- package/dist/nowline.esm.js.map +7 -0
- package/dist/nowline.min.js +2663 -0
- package/dist/nowline.min.js.map +7 -0
- package/dist/pipeline.d.ts +28 -0
- package/dist/pipeline.d.ts.map +1 -0
- package/dist/pipeline.js +94 -0
- package/dist/pipeline.js.map +1 -0
- package/dist/theme.d.ts +5 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +32 -0
- package/dist/theme.js.map +1 -0
- package/package.json +59 -0
- package/src/auto-scan.ts +107 -0
- package/src/index.ts +176 -0
- package/src/no-op-include-resolver.ts +22 -0
- package/src/pipeline.ts +143 -0
- package/src/theme.ts +33 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const NOWLINE_EMBED_NOOP_INCLUDE_TAG = "__nowline_embed_noop_include__";
|
|
2
|
+
export declare function noOpIncludeReadFile(absPath: string): Promise<string>;
|
|
3
|
+
export declare function isNoOpIncludeDiagnosticMessage(message: string): boolean;
|
|
4
|
+
//# sourceMappingURL=no-op-include-resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-op-include-resolver.d.ts","sourceRoot":"","sources":["../src/no-op-include-resolver.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,8BAA8B,mCAAmC,CAAC;AAE/E,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAI1E;AAED,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEvE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Browser-side `readFile` that always rejects with a stable, sniff-able
|
|
2
|
+
// error. The render pipeline catches matching diagnostics and converts
|
|
3
|
+
// them into a single `console.warn` (deduped), so authors notice when
|
|
4
|
+
// they ship a file with `include` directives that the embed cannot
|
|
5
|
+
// satisfy without a network fetch.
|
|
6
|
+
//
|
|
7
|
+
// A real HTTP-fetch resolver is intentionally out of scope for m4 (see
|
|
8
|
+
// `specs/handoffs/handoff-m4-embed.md`): CORS, relative-URL semantics,
|
|
9
|
+
// and waterfall performance each warrant their own decision and are
|
|
10
|
+
// best handled behind an opt-in flag in a follow-up.
|
|
11
|
+
export const NOWLINE_EMBED_NOOP_INCLUDE_TAG = '__nowline_embed_noop_include__';
|
|
12
|
+
export async function noOpIncludeReadFile(absPath) {
|
|
13
|
+
throw new Error(`${NOWLINE_EMBED_NOOP_INCLUDE_TAG}: include "${absPath}" was skipped — the embed runs in single-file mode.`);
|
|
14
|
+
}
|
|
15
|
+
export function isNoOpIncludeDiagnosticMessage(message) {
|
|
16
|
+
return message.includes(NOWLINE_EMBED_NOOP_INCLUDE_TAG);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=no-op-include-resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-op-include-resolver.js","sourceRoot":"","sources":["../src/no-op-include-resolver.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,uEAAuE;AACvE,sEAAsE;AACtE,mEAAmE;AACnE,mCAAmC;AACnC,EAAE;AACF,uEAAuE;AACvE,uEAAuE;AACvE,oEAAoE;AACpE,qDAAqD;AAErD,MAAM,CAAC,MAAM,8BAA8B,GAAG,gCAAgC,CAAC;AAE/E,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,OAAe;IACrD,MAAM,IAAI,KAAK,CACX,GAAG,8BAA8B,cAAc,OAAO,qDAAqD,CAC9G,CAAC;AACN,CAAC;AAED,MAAM,UAAU,8BAA8B,CAAC,OAAe;IAC1D,OAAO,OAAO,CAAC,QAAQ,CAAC,8BAA8B,CAAC,CAAC;AAC5D,CAAC"}
|