@rohal12/twee-ts 1.8.0 → 1.9.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.
- package/dist/bin/twee-ts.js.map +1 -1
- package/dist/{chunk-N2OR5KHL.js → chunk-FSZ5FD3P.js} +6 -2
- package/dist/chunk-FSZ5FD3P.js.map +1 -0
- package/dist/index.cjs +5 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/plugins/rollup.js +1 -1
- package/dist/plugins/vite.d.ts +10 -3
- package/dist/plugins/vite.js +43 -19
- package/dist/plugins/vite.js.map +1 -1
- package/package.json +3 -1
- package/dist/chunk-N2OR5KHL.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -161,6 +161,11 @@ interface SFAIndex {
|
|
|
161
161
|
twine1: SFAIndexEntry[];
|
|
162
162
|
twine2: SFAIndexEntry[];
|
|
163
163
|
}
|
|
164
|
+
interface FileCacheEntry {
|
|
165
|
+
readonly mtimeMs: number;
|
|
166
|
+
readonly passages: readonly Passage[];
|
|
167
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
168
|
+
}
|
|
164
169
|
interface TweeTsConfig {
|
|
165
170
|
sources?: string[];
|
|
166
171
|
output?: string;
|
|
@@ -193,6 +198,11 @@ declare function compile(options: CompileOptions): Promise<CompileResult>;
|
|
|
193
198
|
* Compile and write to a file.
|
|
194
199
|
*/
|
|
195
200
|
declare function compileToFile(options: CompileToFileOptions): Promise<CompileResult>;
|
|
201
|
+
/**
|
|
202
|
+
* Compile with incremental caching support.
|
|
203
|
+
* Plugins and advanced users can manage their own cache and changed-file tracking.
|
|
204
|
+
*/
|
|
205
|
+
declare function compileIncremental(options: CompileOptions, cache: Map<string, FileCacheEntry>, changedFiles?: ReadonlySet<string>): Promise<CompileResult>;
|
|
196
206
|
/**
|
|
197
207
|
* Watch for file changes and recompile.
|
|
198
208
|
*/
|
|
@@ -428,4 +438,4 @@ declare function getCacheSize(): {
|
|
|
428
438
|
count: number;
|
|
429
439
|
};
|
|
430
440
|
|
|
431
|
-
export { type BrokenLink, CONFIG_FILENAME, type CachedFormatEntry, type CompileOptions, type CompileResult, type CompileStats, type CompileToFileOptions, type Diagnostic, type InlineSource, ItemType, type LexerItem, type LintResult, type OutputMode, type Passage, type PassageMetadata, type SFAIndex, type SFAIndexEntry, type SourceInput, type SourceLocation, type Story, type StoryFormatInfo, type StoryMap, TweeLexer, type TweeTsConfig, TweeTsError, type WatchOptions, applyTagAliases, clearCachedFormats, compile, compileToFile, discoverCachedFormats, discoverFormats, fetchAndCacheFormat, fetchDirectFormat, formatLintReport, generateIFID, getCacheDir, getCacheSize, getFormatSearchDirs, lint, listCachedFormats, loadConfig, loadConfigFile, parseFormatJSON, parseSemver, parseTwee, resolveRemoteFormat, scaffoldConfig, semverCompare, storyInspect, tweeLexer, validateConfig, validateIFID, watch };
|
|
441
|
+
export { type BrokenLink, CONFIG_FILENAME, type CachedFormatEntry, type CompileOptions, type CompileResult, type CompileStats, type CompileToFileOptions, type Diagnostic, type FileCacheEntry, type InlineSource, ItemType, type LexerItem, type LintResult, type OutputMode, type Passage, type PassageMetadata, type SFAIndex, type SFAIndexEntry, type SourceInput, type SourceLocation, type Story, type StoryFormatInfo, type StoryMap, TweeLexer, type TweeTsConfig, TweeTsError, type WatchOptions, applyTagAliases, clearCachedFormats, compile, compileIncremental, compileToFile, discoverCachedFormats, discoverFormats, fetchAndCacheFormat, fetchDirectFormat, formatLintReport, generateIFID, getCacheDir, getCacheSize, getFormatSearchDirs, lint, listCachedFormats, loadConfig, loadConfigFile, parseFormatJSON, parseSemver, parseTwee, resolveRemoteFormat, scaffoldConfig, semverCompare, storyInspect, tweeLexer, validateConfig, validateIFID, watch };
|
package/dist/index.d.ts
CHANGED
|
@@ -161,6 +161,11 @@ interface SFAIndex {
|
|
|
161
161
|
twine1: SFAIndexEntry[];
|
|
162
162
|
twine2: SFAIndexEntry[];
|
|
163
163
|
}
|
|
164
|
+
interface FileCacheEntry {
|
|
165
|
+
readonly mtimeMs: number;
|
|
166
|
+
readonly passages: readonly Passage[];
|
|
167
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
168
|
+
}
|
|
164
169
|
interface TweeTsConfig {
|
|
165
170
|
sources?: string[];
|
|
166
171
|
output?: string;
|
|
@@ -193,6 +198,11 @@ declare function compile(options: CompileOptions): Promise<CompileResult>;
|
|
|
193
198
|
* Compile and write to a file.
|
|
194
199
|
*/
|
|
195
200
|
declare function compileToFile(options: CompileToFileOptions): Promise<CompileResult>;
|
|
201
|
+
/**
|
|
202
|
+
* Compile with incremental caching support.
|
|
203
|
+
* Plugins and advanced users can manage their own cache and changed-file tracking.
|
|
204
|
+
*/
|
|
205
|
+
declare function compileIncremental(options: CompileOptions, cache: Map<string, FileCacheEntry>, changedFiles?: ReadonlySet<string>): Promise<CompileResult>;
|
|
196
206
|
/**
|
|
197
207
|
* Watch for file changes and recompile.
|
|
198
208
|
*/
|
|
@@ -428,4 +438,4 @@ declare function getCacheSize(): {
|
|
|
428
438
|
count: number;
|
|
429
439
|
};
|
|
430
440
|
|
|
431
|
-
export { type BrokenLink, CONFIG_FILENAME, type CachedFormatEntry, type CompileOptions, type CompileResult, type CompileStats, type CompileToFileOptions, type Diagnostic, type InlineSource, ItemType, type LexerItem, type LintResult, type OutputMode, type Passage, type PassageMetadata, type SFAIndex, type SFAIndexEntry, type SourceInput, type SourceLocation, type Story, type StoryFormatInfo, type StoryMap, TweeLexer, type TweeTsConfig, TweeTsError, type WatchOptions, applyTagAliases, clearCachedFormats, compile, compileToFile, discoverCachedFormats, discoverFormats, fetchAndCacheFormat, fetchDirectFormat, formatLintReport, generateIFID, getCacheDir, getCacheSize, getFormatSearchDirs, lint, listCachedFormats, loadConfig, loadConfigFile, parseFormatJSON, parseSemver, parseTwee, resolveRemoteFormat, scaffoldConfig, semverCompare, storyInspect, tweeLexer, validateConfig, validateIFID, watch };
|
|
441
|
+
export { type BrokenLink, CONFIG_FILENAME, type CachedFormatEntry, type CompileOptions, type CompileResult, type CompileStats, type CompileToFileOptions, type Diagnostic, type FileCacheEntry, type InlineSource, ItemType, type LexerItem, type LintResult, type OutputMode, type Passage, type PassageMetadata, type SFAIndex, type SFAIndexEntry, type SourceInput, type SourceLocation, type Story, type StoryFormatInfo, type StoryMap, TweeLexer, type TweeTsConfig, TweeTsError, type WatchOptions, applyTagAliases, clearCachedFormats, compile, compileIncremental, compileToFile, discoverCachedFormats, discoverFormats, fetchAndCacheFormat, fetchDirectFormat, formatLintReport, generateIFID, getCacheDir, getCacheSize, getFormatSearchDirs, lint, listCachedFormats, loadConfig, loadConfigFile, parseFormatJSON, parseSemver, parseTwee, resolveRemoteFormat, scaffoldConfig, semverCompare, storyInspect, tweeLexer, validateConfig, validateIFID, watch };
|
package/dist/index.js
CHANGED
|
@@ -2173,6 +2173,9 @@ async function compileToFile(options) {
|
|
|
2173
2173
|
writeFileSync2(options.outFile, result.output, "utf-8");
|
|
2174
2174
|
return result;
|
|
2175
2175
|
}
|
|
2176
|
+
async function compileIncremental(options, cache, changedFiles) {
|
|
2177
|
+
return buildOutput(options, cache, changedFiles);
|
|
2178
|
+
}
|
|
2176
2179
|
async function watch(options) {
|
|
2177
2180
|
const controller = new AbortController();
|
|
2178
2181
|
const cache = /* @__PURE__ */ new Map();
|
|
@@ -2625,6 +2628,7 @@ export {
|
|
|
2625
2628
|
applyTagAliases,
|
|
2626
2629
|
clearCachedFormats,
|
|
2627
2630
|
compile,
|
|
2631
|
+
compileIncremental,
|
|
2628
2632
|
compileToFile,
|
|
2629
2633
|
discoverCachedFormats,
|
|
2630
2634
|
discoverFormats,
|