@tiqian/precompute 0.0.0-stage → 0.1.0-alpha.10
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 +373 -0
- package/README.md +210 -2
- package/lib/cache.d.ts +58 -0
- package/lib/cache.js +196 -0
- package/lib/canonical.d.ts +26 -0
- package/lib/canonical.js +82 -0
- package/lib/fonts.d.ts +177 -0
- package/lib/fonts.js +89 -0
- package/lib/load.d.ts +138 -0
- package/lib/load.js +38 -0
- package/lib/nixos.d.ts +26 -0
- package/lib/nixos.js +315 -0
- package/lib/persistence.d.ts +127 -0
- package/lib/persistence.js +294 -0
- package/lib/precompute-html-projection.d.ts +32 -0
- package/lib/precompute-html-projection.js +140 -0
- package/lib/precompute-html.d.ts +98 -0
- package/lib/precompute-html.js +324 -0
- package/lib/precompute.d.ts +323 -0
- package/lib/precompute.js +539 -0
- package/lib/sqlite-store.d.ts +57 -0
- package/lib/sqlite-store.js +365 -0
- package/lib/stable-stringify.d.ts +8 -0
- package/lib/stable-stringify.js +40 -0
- package/lib/transport.d.ts +74 -0
- package/lib/transport.js +165 -0
- package/lib/vite.d.ts +6 -0
- package/lib/vite.js +22 -0
- package/package.json +115 -4
package/lib/vite.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// SSR externals for hosts whose server build bundles dependencies (Vite,
|
|
2
|
+
// SvelteKit). The native addon resolves relative to this package's own files,
|
|
3
|
+
// so bundling any entry point moves the addon and manifest lookups inside the
|
|
4
|
+
// output chunks and breaks them; hosts keep every entry external instead.
|
|
5
|
+
// The list derives from this package's manifest at run time, so it carries
|
|
6
|
+
// the installed scope and grows with the exports map without a host-side
|
|
7
|
+
// copy of entry names.
|
|
8
|
+
import { readFile } from "node:fs/promises";
|
|
9
|
+
/**
|
|
10
|
+
* Derives the importable entry specifiers of this package from its manifest:
|
|
11
|
+
* the bare name plus one specifier per exports key. Reads the shipped
|
|
12
|
+
* manifest by default; a URL argument serves tests and other manifests.
|
|
13
|
+
*/
|
|
14
|
+
export const tiqianSsrExternals = async (manifestUrl = new URL("../package.json", import.meta.url)) => {
|
|
15
|
+
const manifest = JSON.parse(await readFile(manifestUrl, "utf8"));
|
|
16
|
+
if (typeof manifest.name !== "string" ||
|
|
17
|
+
manifest.exports === undefined ||
|
|
18
|
+
typeof manifest.exports !== "object") {
|
|
19
|
+
throw new Error("TiqianViteManifestInvalid");
|
|
20
|
+
}
|
|
21
|
+
return Object.keys(manifest.exports).map((entry) => entry === "." ? manifest.name : `${manifest.name}${entry.slice(1)}`);
|
|
22
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,117 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiqian/precompute",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0-alpha.10",
|
|
4
|
+
"description": "Native font session and precompute entry points for Tiqian.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"cjk",
|
|
7
|
+
"chinese",
|
|
8
|
+
"typography",
|
|
9
|
+
"layout",
|
|
10
|
+
"precompute",
|
|
11
|
+
"neon"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://github.com/tiqian-cjk/tiqian#readme",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/tiqian-cjk/tiqian/issues"
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/tiqian-cjk/tiqian.git",
|
|
20
|
+
"directory": "platforms/web/server/core"
|
|
21
|
+
},
|
|
22
|
+
"license": "MPL-2.0",
|
|
23
|
+
"type": "module",
|
|
24
|
+
"main": "./lib/fonts.js",
|
|
25
|
+
"types": "./lib/fonts.d.ts",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"types": "./lib/fonts.d.ts",
|
|
29
|
+
"default": "./lib/fonts.js"
|
|
30
|
+
},
|
|
31
|
+
"./precompute": {
|
|
32
|
+
"types": "./lib/precompute.d.ts",
|
|
33
|
+
"default": "./lib/precompute.js"
|
|
34
|
+
},
|
|
35
|
+
"./transport": {
|
|
36
|
+
"types": "./lib/transport.d.ts",
|
|
37
|
+
"default": "./lib/transport.js"
|
|
38
|
+
},
|
|
39
|
+
"./cache": {
|
|
40
|
+
"types": "./lib/cache.d.ts",
|
|
41
|
+
"default": "./lib/cache.js"
|
|
42
|
+
},
|
|
43
|
+
"./persistence": {
|
|
44
|
+
"types": "./lib/persistence.d.ts",
|
|
45
|
+
"default": "./lib/persistence.js"
|
|
46
|
+
},
|
|
47
|
+
"./sqlite-store": {
|
|
48
|
+
"types": "./lib/sqlite-store.d.ts",
|
|
49
|
+
"default": "./lib/sqlite-store.js"
|
|
50
|
+
},
|
|
51
|
+
"./precompute-html": {
|
|
52
|
+
"types": "./lib/precompute-html.d.ts",
|
|
53
|
+
"default": "./lib/precompute-html.js"
|
|
54
|
+
},
|
|
55
|
+
"./vite": {
|
|
56
|
+
"types": "./lib/vite.d.ts",
|
|
57
|
+
"default": "./lib/vite.js"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"engines": {
|
|
61
|
+
"node": ">=22"
|
|
62
|
+
},
|
|
63
|
+
"publishConfig": {
|
|
64
|
+
"access": "public",
|
|
65
|
+
"tag": "alpha"
|
|
66
|
+
},
|
|
67
|
+
"scripts": {
|
|
68
|
+
"build": "tsc -p tsconfig.build.json",
|
|
69
|
+
"typecheck": "tsc -p tsconfig.json",
|
|
70
|
+
"lint": "eslint .",
|
|
71
|
+
"pretest": "npm run build",
|
|
72
|
+
"test": "node --test \"test/**/*.test.ts\"",
|
|
73
|
+
"debug:native": "cargo build --manifest-path ../precompute/binding/Cargo.toml --message-format=json-render-diagnostics > cargo.log && neon dist --name tiqian-precompute-neon --platform $(neon current-platform) < cargo.log",
|
|
74
|
+
"build:native": "cargo build --manifest-path ../precompute/binding/Cargo.toml --release --message-format=json-render-diagnostics > cargo.log && neon dist --name tiqian-precompute-neon < cargo.log"
|
|
75
|
+
},
|
|
76
|
+
"neon": {
|
|
77
|
+
"type": "library",
|
|
78
|
+
"org": "@tiqian",
|
|
79
|
+
"prefix": "precompute-",
|
|
80
|
+
"platforms": [
|
|
81
|
+
"win32-x64-msvc",
|
|
82
|
+
"darwin-arm64",
|
|
83
|
+
"linux-x64-gnu",
|
|
84
|
+
"linux-arm64-gnu"
|
|
85
|
+
],
|
|
86
|
+
"load": "./lib/load.js"
|
|
87
|
+
},
|
|
88
|
+
"files": [
|
|
89
|
+
"LICENSE",
|
|
90
|
+
"README.md",
|
|
91
|
+
"lib"
|
|
92
|
+
],
|
|
93
|
+
"dependencies": {
|
|
94
|
+
"@neon-rs/load": "^0.1.82",
|
|
95
|
+
"@tiqian/core": "0.1.0-alpha.10",
|
|
96
|
+
"@tiqian/web-component": "0.1.0-alpha.10",
|
|
97
|
+
"linkedom": "^0.18.13",
|
|
98
|
+
"@tiqian/protocol": "0.1.0-alpha.10",
|
|
99
|
+
"@tiqian/shared": "0.1.0-alpha.10"
|
|
100
|
+
},
|
|
101
|
+
"optionalDependencies": {
|
|
102
|
+
"@tiqian/precompute-darwin-arm64": "0.1.0-alpha.10",
|
|
103
|
+
"@tiqian/precompute-linux-arm64-gnu": "0.1.0-alpha.10",
|
|
104
|
+
"@tiqian/precompute-linux-x64-gnu": "0.1.0-alpha.10",
|
|
105
|
+
"@tiqian/precompute-win32-x64-msvc": "0.1.0-alpha.10"
|
|
106
|
+
},
|
|
107
|
+
"devDependencies": {
|
|
108
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.7.2",
|
|
109
|
+
"@eslint/js": "^10.0.1",
|
|
110
|
+
"@neon-rs/cli": "^0.1.82",
|
|
111
|
+
"@types/node": "^26.2.0",
|
|
112
|
+
"eslint": "^10.8.1",
|
|
113
|
+
"jiti": "^2.7.0",
|
|
114
|
+
"typescript": "^6",
|
|
115
|
+
"typescript-eslint": "^8.67.0"
|
|
116
|
+
}
|
|
117
|
+
}
|