@kitschpatrol/unplugin-tldraw 1.1.2 → 1.1.4
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/api.d.ts +3 -4
- package/dist/api.js +1 -1
- package/dist/bun.d.ts +1 -2
- package/dist/esbuild.d.ts +1 -2
- package/dist/farm.d.ts +1 -2
- package/dist/index.d.ts +4 -5
- package/dist/index.js +1 -1
- package/dist/nuxt.d.ts +3 -4
- package/dist/{options-D2_OB7_C.d.ts → options-D2Q0JXtI.d.ts} +3 -2
- package/dist/rolldown.d.ts +1 -2
- package/dist/rollup.d.ts +1 -2
- package/dist/rspack.d.ts +1 -2
- package/dist/{tldraw--EsjzXjm.js → tldraw-GlKM6YdO.js} +5 -7
- package/dist/vite.d.ts +1 -2
- package/dist/webpack.d.ts +1 -2
- package/package.json +26 -32
- package/readme.md +4 -4
package/dist/api.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { n as Options, r as resolveOptions, t as ImportOverrides } from "./options-
|
|
2
|
-
|
|
1
|
+
import { n as Options, r as resolveOptions, t as ImportOverrides } from "./options-D2Q0JXtI.js";
|
|
3
2
|
//#region src/core/tldraw.d.ts
|
|
4
|
-
declare class TldrawExport {
|
|
3
|
+
export declare class TldrawExport {
|
|
5
4
|
/**
|
|
6
5
|
* Pattern matching `.tldr` file imports. The `resolveId` hook filters on
|
|
7
6
|
* this.
|
|
@@ -47,4 +46,4 @@ declare class TldrawExport {
|
|
|
47
46
|
private toRelativeCacheKey;
|
|
48
47
|
}
|
|
49
48
|
//#endregion
|
|
50
|
-
export {
|
|
49
|
+
export { resolveOptions };
|
package/dist/api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { r as resolveOptions, t as TldrawExport } from "./tldraw
|
|
1
|
+
import { r as resolveOptions, t as TldrawExport } from "./tldraw-GlKM6YdO.js";
|
|
2
2
|
export { TldrawExport, resolveOptions };
|
package/dist/bun.d.ts
CHANGED
package/dist/esbuild.d.ts
CHANGED
package/dist/farm.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { n as Options } from "./options-
|
|
1
|
+
import { n as Options } from "./options-D2Q0JXtI.js";
|
|
2
2
|
import { UnpluginFactory } from "unplugin";
|
|
3
|
-
|
|
4
3
|
//#region src/index.d.ts
|
|
5
|
-
declare const unpluginFactory: UnpluginFactory<Options | undefined>;
|
|
6
|
-
declare const unplugin: import("unplugin").UnpluginInstance<Options | undefined, boolean>;
|
|
4
|
+
export declare const unpluginFactory: UnpluginFactory<Options | undefined>;
|
|
5
|
+
export declare const unplugin: import("unplugin").UnpluginInstance<Options | undefined, boolean>;
|
|
7
6
|
//#endregion
|
|
8
|
-
export { unplugin as default
|
|
7
|
+
export { unplugin as default };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as parseImportOverrides, t as TldrawExport } from "./tldraw
|
|
1
|
+
import { n as parseImportOverrides, t as TldrawExport } from "./tldraw-GlKM6YdO.js";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { createUnplugin } from "unplugin";
|
|
4
4
|
//#region src/index.ts
|
package/dist/nuxt.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { n as Options } from "./options-
|
|
2
|
-
|
|
1
|
+
import { n as Options } from "./options-D2Q0JXtI.js";
|
|
3
2
|
//#region src/nuxt.d.ts
|
|
4
|
-
type ModuleOptions = Options;
|
|
3
|
+
export type ModuleOptions = Options;
|
|
5
4
|
/**
|
|
6
5
|
* Nuxt module
|
|
7
6
|
*
|
|
@@ -13,4 +12,4 @@ type ModuleOptions = Options;
|
|
|
13
12
|
*/
|
|
14
13
|
declare const _default: import("@nuxt/schema").NuxtModule<Options, Options, false>;
|
|
15
14
|
//#endregion
|
|
16
|
-
export {
|
|
15
|
+
export { _default as default };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { TldrawToImageOptions } from "@kitschpatrol/tldraw-cli";
|
|
2
|
-
|
|
3
2
|
//#region src/core/options.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Image conversion options for `.tldr` exports. Subset of
|
|
@@ -11,7 +10,9 @@ type TldrawImageOptions = Pick<TldrawToImageOptions, 'dark' | 'format' | 'paddin
|
|
|
11
10
|
* Extends TldrawImageOptions with frame/page selection.
|
|
12
11
|
*/
|
|
13
12
|
type ImportOverrides = TldrawImageOptions & {
|
|
14
|
-
/** Export a specific frame by name or ID. */
|
|
13
|
+
/** Export a specific frame by name or ID. */
|
|
14
|
+
frame?: string;
|
|
15
|
+
/** Export a specific page by name, ID, or index. */
|
|
15
16
|
page?: string;
|
|
16
17
|
};
|
|
17
18
|
type Options = {
|
package/dist/rolldown.d.ts
CHANGED
package/dist/rollup.d.ts
CHANGED
package/dist/rspack.d.ts
CHANGED
|
@@ -63,7 +63,6 @@ function applyOverride(overrides, key, value) {
|
|
|
63
63
|
if (!Number.isNaN(numberValue)) overrides[key] = numberValue;
|
|
64
64
|
break;
|
|
65
65
|
}
|
|
66
|
-
default: break;
|
|
67
66
|
}
|
|
68
67
|
}
|
|
69
68
|
//#endregion
|
|
@@ -152,11 +151,9 @@ var TldrawExport = class {
|
|
|
152
151
|
const destinationFiles = await fs.readdir(this.options.cacheDirectory);
|
|
153
152
|
const fileNamesToKeep = new Set(Array.from(this.pathsSeen, (filePath) => path.basename(filePath)));
|
|
154
153
|
for (const destinationFile of destinationFiles) {
|
|
155
|
-
if (destinationFile === CACHE_FILE_NAME) continue;
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
await fs.rm(path.join(this.options.cacheDirectory, destinationFile));
|
|
159
|
-
}
|
|
154
|
+
if (destinationFile === CACHE_FILE_NAME || fileNamesToKeep.has(destinationFile)) continue;
|
|
155
|
+
log.debug(`Cleaning up unused image: ${destinationFile}`);
|
|
156
|
+
await fs.rm(path.join(this.options.cacheDirectory, destinationFile));
|
|
160
157
|
}
|
|
161
158
|
}
|
|
162
159
|
/**
|
|
@@ -217,7 +214,8 @@ var TldrawExport = class {
|
|
|
217
214
|
}
|
|
218
215
|
if (this.options.pruneCacheOnBuild) this.pathsSeen.add(cachedFilePath);
|
|
219
216
|
const elapsed = prettyMilliseconds(performance.now() - startTime);
|
|
220
|
-
const
|
|
217
|
+
const stat = await fs.stat(cachedFilePath);
|
|
218
|
+
const fileSize = prettyBytes(stat.size);
|
|
221
219
|
log.debug(`Converted in ${elapsed} (${fileSize}) → "${cachedFileName}"`);
|
|
222
220
|
return cachedFilePath;
|
|
223
221
|
}
|
package/dist/vite.d.ts
CHANGED
package/dist/webpack.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitschpatrol/unplugin-tldraw",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "Unplugin for module-style import of local tldraw .tldr files with automatic conversion to SVG or PNG.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tldraw",
|
|
@@ -68,35 +68,35 @@
|
|
|
68
68
|
"dist"
|
|
69
69
|
],
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@kitschpatrol/tldraw-cli": "^6.0
|
|
72
|
-
"@types/node": "~
|
|
71
|
+
"@kitschpatrol/tldraw-cli": "^6.1.0",
|
|
72
|
+
"@types/node": "~24.13.3",
|
|
73
73
|
"defu": "^6.1.7",
|
|
74
|
-
"lognow": "^0.
|
|
75
|
-
"p-limit": "^7.3.
|
|
76
|
-
"pretty-bytes": "^7.
|
|
77
|
-
"pretty-ms": "^9.3.
|
|
78
|
-
"unplugin": "^3.
|
|
74
|
+
"lognow": "^0.8.4",
|
|
75
|
+
"p-limit": "^7.3.3",
|
|
76
|
+
"pretty-bytes": "^7.2.0",
|
|
77
|
+
"pretty-ms": "^9.3.1",
|
|
78
|
+
"unplugin": "^3.4.0"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@farmfe/core": ">=1.7.11",
|
|
82
|
-
"@kitschpatrol/shared-config": "^8.
|
|
83
|
-
"@nuxt/kit": "^4.
|
|
84
|
-
"@nuxt/schema": "^4.
|
|
85
|
-
"@rspack/core": "^2.
|
|
86
|
-
"@
|
|
87
|
-
"
|
|
88
|
-
"bumpp": "^11.1.0",
|
|
82
|
+
"@kitschpatrol/shared-config": "^8.12.1",
|
|
83
|
+
"@nuxt/kit": "^4.6.0",
|
|
84
|
+
"@nuxt/schema": "^4.6.0",
|
|
85
|
+
"@rspack/core": "^2.2.8",
|
|
86
|
+
"@vitest/browser-playwright": "^5.0.3",
|
|
87
|
+
"bumpp": "^12.3.0",
|
|
89
88
|
"esbuild": "*",
|
|
90
|
-
"playwright": "^1.
|
|
91
|
-
"poptab": "^1.
|
|
92
|
-
"rolldown": "^1.
|
|
93
|
-
"rollup": "^4.
|
|
89
|
+
"playwright": "^1.63.0",
|
|
90
|
+
"poptab": "^1.2.1",
|
|
91
|
+
"rolldown": "^1.2.12",
|
|
92
|
+
"rollup": "^4.64.0",
|
|
94
93
|
"shx": "^0.4.0",
|
|
95
|
-
"
|
|
94
|
+
"skills": "^1.7.0",
|
|
95
|
+
"tsdown": "^0.23.0",
|
|
96
96
|
"typescript": "~6.0.3",
|
|
97
|
-
"vite": "^8.
|
|
98
|
-
"vitest": "^
|
|
99
|
-
"webpack": "^5.
|
|
97
|
+
"vite": "^8.3.2",
|
|
98
|
+
"vitest": "^5.0.3",
|
|
99
|
+
"webpack": "^5.111.1"
|
|
100
100
|
},
|
|
101
101
|
"peerDependencies": {
|
|
102
102
|
"@farmfe/core": ">=1",
|
|
@@ -139,25 +139,19 @@
|
|
|
139
139
|
}
|
|
140
140
|
},
|
|
141
141
|
"engines": {
|
|
142
|
-
"node": ">=
|
|
143
|
-
},
|
|
144
|
-
"devEngines": {
|
|
145
|
-
"runtime": {
|
|
146
|
-
"name": "node",
|
|
147
|
-
"version": ">=24.16.0"
|
|
148
|
-
}
|
|
142
|
+
"node": "^24.16.0 || >=26.3.0"
|
|
149
143
|
},
|
|
150
144
|
"publishConfig": {
|
|
151
145
|
"access": "public"
|
|
152
146
|
},
|
|
153
147
|
"scripts": {
|
|
154
148
|
"build": "tsdown",
|
|
155
|
-
"clean": "shx rm -f pnpm-lock.yaml && git clean -fdX -e !.claude/",
|
|
149
|
+
"clean-deep": "shx rm -f pnpm-lock.yaml && git clean -fdX -e !.claude/",
|
|
156
150
|
"dev": "tsdown --watch",
|
|
157
151
|
"fix": "ksc fix",
|
|
158
152
|
"lint": "ksc lint",
|
|
159
153
|
"play": "poptab && pnpm -C playground run dev",
|
|
160
|
-
"release": "bumpp --commit 'Release: %s' && pnpm build &&
|
|
154
|
+
"release": "bumpp --commit 'Release: %s' && pnpm build && pnpm publish --otp $(op item get npm --otp)",
|
|
161
155
|
"test": "vitest run",
|
|
162
156
|
"test:browser": "vitest run --config vitest.browser.config.ts"
|
|
163
157
|
}
|
package/readme.md
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
<!-- badges -->
|
|
8
8
|
|
|
9
|
-
[](https://npmjs.com/package/@kitschpatrol/unplugin-tldraw)
|
|
10
|
-
[](https://opensource.org/license/mit
|
|
9
|
+
[](https://www.npmjs.com/package/@kitschpatrol/unplugin-tldraw)
|
|
10
|
+
[](https://opensource.org/license/mit)
|
|
11
11
|
[](https://github.com/kitschpatrol/unplugin-tldraw/actions/workflows/ci.yml)
|
|
12
12
|
|
|
13
13
|
<!-- /badges -->
|
|
@@ -210,10 +210,10 @@ Cannot find module './assets/test-sketch.tldr' or its corresponding type declara
|
|
|
210
210
|
|
|
211
211
|
If you're using VS Code, an [extension](https://github.com/kitschpatrol/vscode-tldraw-preview) is available to provide hover-previews for tldr file paths:
|
|
212
212
|
|
|
213
|
-
Install the extension from the [Marketplace](https://marketplace.visualstudio.com/items?itemName=kitschpatrol.
|
|
213
|
+
Install the extension from the [Marketplace](https://marketplace.visualstudio.com/items?itemName=kitschpatrol.tldraw-preview), or run the following in VS Code's command palette:
|
|
214
214
|
|
|
215
215
|
```sh
|
|
216
|
-
ext install kitschpatrol.
|
|
216
|
+
ext install kitschpatrol.tldraw-preview
|
|
217
217
|
```
|
|
218
218
|
|
|
219
219
|
## Usage
|