@rohal12/twee-ts 1.15.0 → 1.15.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/README.md +1 -1
- package/dist/bin/twee-ts.js +5567 -5267
- package/dist/bin/twee-ts.js.map +1 -1
- package/dist/compiler-Bfi1w-to.js +5074 -0
- package/dist/compiler-Bfi1w-to.js.map +1 -0
- package/dist/index.cjs +5365 -5125
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +306 -331
- package/dist/index.d.ts +306 -331
- package/dist/index.js +5329 -5062
- package/dist/index.js.map +1 -1
- package/dist/plugins/rollup.d.ts +21 -27
- package/dist/plugins/rollup.js +23 -31
- package/dist/plugins/rollup.js.map +1 -1
- package/dist/plugins/vite.d.ts +21 -22
- package/dist/plugins/vite.js +452 -300
- package/dist/plugins/vite.js.map +1 -1
- package/dist/types-BFyb40Zq.d.ts +49 -0
- package/package.json +10 -10
- package/dist/chunk-W3SNMQO4.js +0 -4809
- package/dist/chunk-W3SNMQO4.js.map +0 -1
- package/dist/types-FHZ3rZD6.d.ts +0 -48
package/dist/plugins/rollup.d.ts
CHANGED
|
@@ -1,29 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
format?: string;
|
|
13
|
-
/** Output filename. Default: 'index.html'. */
|
|
14
|
-
outputFilename?: string;
|
|
15
|
-
/** Additional compile options. */
|
|
16
|
-
compileOptions?: Partial<CompileOptions>;
|
|
1
|
+
import { t as CompileOptions } from "../types-BFyb40Zq.js";
|
|
2
|
+
//#region src/plugins/rollup.d.ts
|
|
3
|
+
export interface TweeTsRollupPluginOptions {
|
|
4
|
+
/** Source directories/files to compile. */
|
|
5
|
+
sources: string[];
|
|
6
|
+
/** Story format ID. */
|
|
7
|
+
format?: string;
|
|
8
|
+
/** Output filename. Default: 'index.html'. */
|
|
9
|
+
outputFilename?: string;
|
|
10
|
+
/** Additional compile options. */
|
|
11
|
+
compileOptions?: Partial<CompileOptions>;
|
|
17
12
|
}
|
|
18
|
-
declare function tweeTsPlugin(options: TweeTsRollupPluginOptions): {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
13
|
+
export declare function tweeTsPlugin(options: TweeTsRollupPluginOptions): {
|
|
14
|
+
name: string;
|
|
15
|
+
generateBundle(this: {
|
|
16
|
+
emitFile: (opts: {
|
|
17
|
+
type: string;
|
|
18
|
+
fileName: string;
|
|
19
|
+
source: string;
|
|
20
|
+
}) => void;
|
|
21
|
+
}): Promise<void>;
|
|
27
22
|
};
|
|
28
|
-
|
|
29
|
-
export { type TweeTsRollupPluginOptions, tweeTsPlugin };
|
|
23
|
+
//#endregion
|
package/dist/plugins/rollup.js
CHANGED
|
@@ -1,34 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from "../chunk-W3SNMQO4.js";
|
|
4
|
-
|
|
5
|
-
// src/plugins/rollup.ts
|
|
1
|
+
import { n as compile } from "../compiler-Bfi1w-to.js";
|
|
2
|
+
//#region src/plugins/rollup.ts
|
|
6
3
|
function tweeTsPlugin(options) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
console.error(`[twee-ts] ${d.message}`);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
};
|
|
4
|
+
const outputFilename = options.outputFilename ?? "index.html";
|
|
5
|
+
return {
|
|
6
|
+
name: "twee-ts",
|
|
7
|
+
async generateBundle() {
|
|
8
|
+
const result = await compile({
|
|
9
|
+
sources: options.sources,
|
|
10
|
+
formatId: options.format,
|
|
11
|
+
...options.compileOptions
|
|
12
|
+
});
|
|
13
|
+
this.emitFile({
|
|
14
|
+
type: "asset",
|
|
15
|
+
fileName: outputFilename,
|
|
16
|
+
source: result.output
|
|
17
|
+
});
|
|
18
|
+
for (const d of result.diagnostics) if (d.level === "warning") console.warn(`[twee-ts] ${d.message}`);
|
|
19
|
+
else console.error(`[twee-ts] ${d.message}`);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
30
22
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
//#endregion
|
|
24
|
+
export { tweeTsPlugin };
|
|
25
|
+
|
|
34
26
|
//# sourceMappingURL=rollup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/plugins/rollup.ts"],"sourcesContent":["/**\n * Ready-made Rollup plugin for twee-ts.\n * Compiles .tw files and emits HTML as an asset.\n */\nimport type { CompileOptions } from '../types.js';\nimport { compile } from '../compiler.js';\n\nexport interface TweeTsRollupPluginOptions {\n /** Source directories/files to compile. */\n sources: string[];\n /** Story format ID. */\n format?: string;\n /** Output filename. Default: 'index.html'. */\n outputFilename?: string;\n /** Additional compile options. */\n compileOptions?: Partial<CompileOptions>;\n}\n\nexport function tweeTsPlugin(options: TweeTsRollupPluginOptions) {\n const outputFilename = options.outputFilename ?? 'index.html';\n\n return {\n name: 'twee-ts',\n\n async generateBundle(this: { emitFile: (opts: { type: string; fileName: string; source: string }) => void }) {\n const result = await compile({\n sources: options.sources,\n formatId: options.format,\n ...options.compileOptions,\n });\n\n this.emitFile({\n type: 'asset',\n fileName: outputFilename,\n source: result.output,\n });\n\n for (const d of result.diagnostics) {\n if (d.level === 'warning') {\n console.warn(`[twee-ts] ${d.message}`);\n } else {\n console.error(`[twee-ts] ${d.message}`);\n }\n }\n },\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"rollup.js","names":[],"sources":["../../src/plugins/rollup.ts"],"sourcesContent":["/**\n * Ready-made Rollup plugin for twee-ts.\n * Compiles .tw files and emits HTML as an asset.\n */\nimport type { CompileOptions } from '../types.js';\nimport { compile } from '../compiler.js';\n\nexport interface TweeTsRollupPluginOptions {\n /** Source directories/files to compile. */\n sources: string[];\n /** Story format ID. */\n format?: string;\n /** Output filename. Default: 'index.html'. */\n outputFilename?: string;\n /** Additional compile options. */\n compileOptions?: Partial<CompileOptions>;\n}\n\nexport function tweeTsPlugin(options: TweeTsRollupPluginOptions) {\n const outputFilename = options.outputFilename ?? 'index.html';\n\n return {\n name: 'twee-ts',\n\n async generateBundle(this: { emitFile: (opts: { type: string; fileName: string; source: string }) => void }) {\n const result = await compile({\n sources: options.sources,\n formatId: options.format,\n ...options.compileOptions,\n });\n\n this.emitFile({\n type: 'asset',\n fileName: outputFilename,\n source: result.output,\n });\n\n for (const d of result.diagnostics) {\n if (d.level === 'warning') {\n console.warn(`[twee-ts] ${d.message}`);\n } else {\n console.error(`[twee-ts] ${d.message}`);\n }\n }\n },\n };\n}\n"],"mappings":";;AAkBA,SAAgB,aAAa,SAAoC;CAC/D,MAAM,iBAAiB,QAAQ,kBAAkB;CAEjD,OAAO;EACL,MAAM;EAEN,MAAM,iBAAuG;GAC3G,MAAM,SAAS,MAAM,QAAQ;IAC3B,SAAS,QAAQ;IACjB,UAAU,QAAQ;IAClB,GAAG,QAAQ;GACb,CAAC;GAED,KAAK,SAAS;IACZ,MAAM;IACN,UAAU;IACV,QAAQ,OAAO;GACjB,CAAC;GAED,KAAK,MAAM,KAAK,OAAO,aACrB,IAAI,EAAE,UAAU,WACd,QAAQ,KAAK,aAAa,EAAE,SAAS;QAErC,QAAQ,MAAM,aAAa,EAAE,SAAS;EAG5C;CACF;AACF"}
|
package/dist/plugins/vite.d.ts
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
interface TweeTsVitePluginOptions {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { t as CompileOptions } from "../types-BFyb40Zq.js";
|
|
2
|
+
import { Plugin } from "vite";
|
|
3
|
+
//#region src/plugins/vite.d.ts
|
|
4
|
+
export interface TweeTsVitePluginOptions {
|
|
5
|
+
/** Source directories/files to compile, relative to the working directory. */
|
|
6
|
+
sources: string[];
|
|
7
|
+
/** Story format ID. */
|
|
8
|
+
format?: string;
|
|
9
|
+
/** Output filename in build output. Default: 'index.html'. */
|
|
10
|
+
outputFilename?: string;
|
|
11
|
+
/** Additional compile options. `sources` and `formatId` come from the options above. */
|
|
12
|
+
compileOptions?: Partial<CompileOptions>;
|
|
13
|
+
/**
|
|
14
|
+
* A JS or TS file, relative to the working directory. Vite bundles it and
|
|
15
|
+
* everything it imports into one self-contained script that becomes the
|
|
16
|
+
* story's Story JavaScript; CSS it imports becomes the Story Stylesheet.
|
|
17
|
+
* Requires Vite 8.
|
|
18
|
+
*/
|
|
19
|
+
entry?: string;
|
|
20
20
|
}
|
|
21
|
-
declare function tweeTsPlugin(options: TweeTsVitePluginOptions): Plugin;
|
|
22
|
-
|
|
23
|
-
export { type TweeTsVitePluginOptions, tweeTsPlugin };
|
|
21
|
+
export declare function tweeTsPlugin(options: TweeTsVitePluginOptions): Plugin;
|
|
22
|
+
//#endregion
|