@jchat/addon-sdk 1.0.0-alpha.2 → 1.0.0-alpha.20
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/CHANGELOG.md +112 -0
- package/LICENSE +18 -196
- package/README.md +385 -20
- package/dist/cli.d.mts +35 -0
- package/dist/cli.mjs +136 -0
- package/dist/contracts.d.mts +20 -29
- package/dist/contracts.mjs +38 -0
- package/dist/diagnostics.d.mts +55 -9
- package/dist/diagnostics.mjs +66 -1
- package/dist/i18n-validator.d.mts +17 -0
- package/dist/i18n-validator.mjs +90 -0
- package/dist/i18n.mjs +191 -0
- package/dist/icon.d.mts +4 -0
- package/dist/icon.mjs +4 -0
- package/dist/index.d.mts +16 -253
- package/dist/index.mjs +106 -43
- package/dist/index2.d.mts +478 -0
- package/dist/state.d.mts +1 -0
- package/dist/state.mjs +2 -0
- package/dist/types.d.mts +12 -0
- package/dist/ui.d.mts +1 -0
- package/dist/ui.mjs +2 -0
- package/dist/vite.d.mts +64 -10
- package/dist/vite.mjs +222 -32
- package/package.json +119 -17
- package/skills/create-jchat-addon/SKILL.md +140 -0
- package/skills/jchat-addon-development/SKILL.md +260 -0
- package/tsconfig.addon.json +20 -0
- package/src/contracts.d.ts +0 -127
- package/src/contracts.ts +0 -132
- package/src/diagnostics.d.ts +0 -19
- package/src/diagnostics.test.ts +0 -106
- package/src/diagnostics.ts +0 -182
- package/src/index.d.ts +0 -249
- package/src/index.test.ts +0 -35
- package/src/index.ts +0 -299
- package/src/vite.test.ts +0 -62
- package/src/vite.ts +0 -289
package/dist/vite.mjs
CHANGED
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { execFileSync } from "node:child_process";
|
|
4
3
|
import crypto from "node:crypto";
|
|
5
4
|
//#region src/vite.ts
|
|
6
5
|
/**
|
|
7
|
-
* Vite plugin
|
|
8
|
-
*
|
|
6
|
+
* Vite plugin for building JChat sandboxed addon extensions.
|
|
7
|
+
*
|
|
8
|
+
* Configures automatic manifest generation (`manifest.json`), bundles server-side API scripts
|
|
9
|
+
* (`src/api.ts`), embeds scoped Tailwind CSS into the frontend bundle, packages database migrations
|
|
10
|
+
* and seed files, copies documentation (`README.md`), signs database-bearing addon manifests, and
|
|
11
|
+
* zips production build artifacts.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ;```ts
|
|
15
|
+
* import { jchatAddon } from "@jchat/addon-sdk/vite"
|
|
16
|
+
* import manifest from "./src/manifest"
|
|
17
|
+
* import { defineConfig } from "vite"
|
|
18
|
+
*
|
|
19
|
+
* export default defineConfig({
|
|
20
|
+
* plugins: [jchatAddon({ manifest })]
|
|
21
|
+
* })
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @param options - Configuration options for the JChat addon Vite plugin.
|
|
25
|
+
* @returns A Vite {@link Plugin} instance configured for addon compilation.
|
|
9
26
|
*/
|
|
10
27
|
function jchatAddon(options) {
|
|
11
28
|
const { manifest: manifestData } = options;
|
|
@@ -15,10 +32,45 @@ function jchatAddon(options) {
|
|
|
15
32
|
name: "jchat-addon",
|
|
16
33
|
apply: "build",
|
|
17
34
|
config(_, env) {
|
|
18
|
-
|
|
35
|
+
const rootDir = process.cwd();
|
|
36
|
+
const uiEntry = path.resolve(rootDir, "src/ui.tsx");
|
|
37
|
+
const hasUi = fs.existsSync(uiEntry);
|
|
38
|
+
return {
|
|
39
|
+
define: {
|
|
40
|
+
global: "window",
|
|
41
|
+
"process.env.NODE_ENV": JSON.stringify(env.mode || "production")
|
|
42
|
+
},
|
|
43
|
+
build: {
|
|
44
|
+
outDir: "build",
|
|
45
|
+
emptyOutDir: true,
|
|
46
|
+
minify: env.mode === "production",
|
|
47
|
+
...hasUi ? {
|
|
48
|
+
lib: {
|
|
49
|
+
entry: uiEntry,
|
|
50
|
+
name: manifestData.id,
|
|
51
|
+
formats: ["es"],
|
|
52
|
+
fileName: () => "ui.[hash].js"
|
|
53
|
+
},
|
|
54
|
+
rolldownOptions: {
|
|
55
|
+
external: [
|
|
56
|
+
"react",
|
|
57
|
+
"react-dom",
|
|
58
|
+
"react/jsx-runtime",
|
|
59
|
+
"react/jsx-dev-runtime",
|
|
60
|
+
"@tanstack/react-query",
|
|
61
|
+
"@jchat/addon-sdk",
|
|
62
|
+
"@jchat/addon-sdk/state",
|
|
63
|
+
"@jchat/addon-sdk/ui",
|
|
64
|
+
"@jchat/addon-sdk/icon"
|
|
65
|
+
],
|
|
66
|
+
output: { format: "esm" }
|
|
67
|
+
}
|
|
68
|
+
} : {}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
19
71
|
},
|
|
20
72
|
configResolved(config) {
|
|
21
|
-
developmentBuild = config.mode === "development";
|
|
73
|
+
developmentBuild = options.development ?? (config.mode === "development" || process.env.JCHAT_ADDON_DEV === "true" || process.env.NODE_ENV === "development");
|
|
22
74
|
if (shouldZip === void 0) shouldZip = config.mode === "production";
|
|
23
75
|
},
|
|
24
76
|
async writeBundle() {
|
|
@@ -41,9 +93,13 @@ function jchatAddon(options) {
|
|
|
41
93
|
}
|
|
42
94
|
};
|
|
43
95
|
const serverSrcPath = path.resolve(rootDir, "src/api.ts");
|
|
44
|
-
const hasServer =
|
|
96
|
+
const hasServer = await Bun.file(serverSrcPath).exists();
|
|
45
97
|
if (hasServer) {
|
|
46
|
-
|
|
98
|
+
Bun.spawnSync(["bun", ...createAddonServerBuildArguments(serverSrcPath, path.resolve(buildDir, "api.js"), developmentBuild)], { stdio: [
|
|
99
|
+
"inherit",
|
|
100
|
+
"inherit",
|
|
101
|
+
"inherit"
|
|
102
|
+
] });
|
|
47
103
|
manifest = {
|
|
48
104
|
...manifest,
|
|
49
105
|
server: {
|
|
@@ -59,12 +115,15 @@ function jchatAddon(options) {
|
|
|
59
115
|
});
|
|
60
116
|
for (const relativePath of databaseFiles) {
|
|
61
117
|
if (path.isAbsolute(relativePath) || relativePath.includes("\\") || relativePath.split("/").includes("..")) throw new Error(`Unsafe addon database file path: ${relativePath}`);
|
|
62
|
-
const source = path.resolve(rootDir, relativePath);
|
|
63
|
-
if (!fs.existsSync(source) || !fs.statSync(source).isFile()) throw new Error(`Missing addon database file: ${relativePath}`);
|
|
64
118
|
const destination = path.resolve(buildDir, relativePath);
|
|
65
119
|
fs.mkdirSync(path.dirname(destination), { recursive: true });
|
|
66
|
-
fs.copyFileSync(source, destination);
|
|
67
120
|
}
|
|
121
|
+
await Promise.all(databaseFiles.map(async (relativePath) => {
|
|
122
|
+
const source = path.resolve(rootDir, relativePath);
|
|
123
|
+
if (!await Bun.file(source).exists() || !fs.statSync(source).isFile()) throw new Error(`Missing addon database file: ${relativePath}`);
|
|
124
|
+
const destination = path.resolve(buildDir, relativePath);
|
|
125
|
+
return Bun.write(destination, Bun.file(source));
|
|
126
|
+
}));
|
|
68
127
|
if (manifest.server?.migrations?.length || manifest.server?.seeds?.length) {
|
|
69
128
|
const signingPrivateKey = requireAddonSigningKey(options.signingPrivateKey ?? process.env.JCHAT_ADDON_SIGNING_PRIVATE_KEY, developmentBuild);
|
|
70
129
|
if (signingPrivateKey) {
|
|
@@ -75,36 +134,57 @@ function jchatAddon(options) {
|
|
|
75
134
|
...manifest.server?.seeds ?? []
|
|
76
135
|
];
|
|
77
136
|
if (hasServer) archivePaths.push("api.js");
|
|
78
|
-
|
|
137
|
+
const resolvedFiles = await Promise.all(archivePaths.map(async (file) => ({
|
|
79
138
|
path: file,
|
|
80
|
-
contents: file === "manifest.json" ? Buffer.from("") :
|
|
81
|
-
}))
|
|
139
|
+
contents: file === "manifest.json" ? Buffer.from("") : Buffer.from(await Bun.file(path.resolve(buildDir, file)).arrayBuffer())
|
|
140
|
+
})));
|
|
141
|
+
manifest = signAddonManifest(manifest, resolvedFiles, signingPrivateKey);
|
|
82
142
|
}
|
|
83
143
|
}
|
|
144
|
+
const readmeSource = path.resolve(rootDir, "README.md");
|
|
145
|
+
if (await Bun.file(readmeSource).exists()) await Bun.write(path.resolve(buildDir, "README.md"), Bun.file(readmeSource));
|
|
146
|
+
const vendorLicensesContent = await generateAddonVendorLicenses(rootDir, manifest.name);
|
|
147
|
+
await Bun.write(path.resolve(buildDir, "vendor-licenses.txt"), vendorLicensesContent);
|
|
84
148
|
const manifestJson = JSON.stringify(manifest, null, 2);
|
|
85
|
-
|
|
149
|
+
await Bun.write(path.resolve(buildDir, "manifest.json"), manifestJson);
|
|
86
150
|
if (shouldZip) {
|
|
87
151
|
const zipName = `${manifest.id}-${pkg.version}.zip`;
|
|
88
152
|
const filesToZip = ["manifest.json", bundleFile];
|
|
89
|
-
if (
|
|
153
|
+
if (await Bun.file(path.resolve(buildDir, "api.js")).exists()) filesToZip.push("api.js");
|
|
154
|
+
if (await Bun.file(path.resolve(buildDir, "README.md")).exists()) filesToZip.push("README.md");
|
|
155
|
+
if (await Bun.file(path.resolve(buildDir, "vendor-licenses.txt")).exists()) filesToZip.push("vendor-licenses.txt");
|
|
90
156
|
const migrationsDest = path.resolve(buildDir, "migrations");
|
|
91
157
|
if (fs.existsSync(migrationsDest)) filesToZip.push("migrations");
|
|
92
158
|
const seedsDest = path.resolve(buildDir, "seeds");
|
|
93
159
|
if (fs.existsSync(seedsDest)) filesToZip.push("seeds");
|
|
94
|
-
|
|
160
|
+
Bun.spawnSync([
|
|
161
|
+
"tar",
|
|
95
162
|
"-a",
|
|
96
163
|
"-cf",
|
|
97
164
|
zipName,
|
|
98
165
|
...filesToZip
|
|
99
166
|
], {
|
|
100
167
|
cwd: buildDir,
|
|
101
|
-
stdio:
|
|
168
|
+
stdio: [
|
|
169
|
+
"inherit",
|
|
170
|
+
"inherit",
|
|
171
|
+
"inherit"
|
|
172
|
+
]
|
|
102
173
|
});
|
|
103
174
|
console.log(`Build Complete: ${manifest.id} v${pkg.version} → ${zipName}`);
|
|
104
175
|
}
|
|
105
176
|
}
|
|
106
177
|
};
|
|
107
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* Generates CLI argument parameters for bundling server-side Elysia API scripts (`src/api.ts`) via
|
|
181
|
+
* Bun.
|
|
182
|
+
*
|
|
183
|
+
* @param entryPath - Absolute file path to the server entry script (`src/api.ts`).
|
|
184
|
+
* @param outputPath - Absolute destination file path for the bundled output (`build/api.js`).
|
|
185
|
+
* @param developmentBuild - Indicates whether to enable external sourcemaps or minification.
|
|
186
|
+
* @returns Array of command line arguments for running `bun build`.
|
|
187
|
+
*/
|
|
108
188
|
function createAddonServerBuildArguments(entryPath, outputPath, developmentBuild) {
|
|
109
189
|
return [
|
|
110
190
|
"build",
|
|
@@ -112,9 +192,17 @@ function createAddonServerBuildArguments(entryPath, outputPath, developmentBuild
|
|
|
112
192
|
"--target=bun",
|
|
113
193
|
"--format=esm",
|
|
114
194
|
`--outfile=${outputPath}`,
|
|
115
|
-
developmentBuild ? "--sourcemap=
|
|
195
|
+
developmentBuild ? "--sourcemap=inline" : "--minify"
|
|
116
196
|
];
|
|
117
197
|
}
|
|
198
|
+
/**
|
|
199
|
+
* Cryptographically signs an addon manifest using RSA-SHA256 over all archive file contents.
|
|
200
|
+
*
|
|
201
|
+
* @param manifest - Unsigned or base addon manifest.
|
|
202
|
+
* @param files - List of archive file paths and raw contents to digest.
|
|
203
|
+
* @param privateKey - RSA private key in PEM format.
|
|
204
|
+
* @returns Updated {@link AddonManifest} containing an RSA signature block.
|
|
205
|
+
*/
|
|
118
206
|
function signAddonManifest(manifest, files, privateKey) {
|
|
119
207
|
if (!manifest.publisher?.id) throw new Error("Signed addons require manifest.publisher.id");
|
|
120
208
|
const unsigned = {
|
|
@@ -126,7 +214,7 @@ function signAddonManifest(manifest, files, privateKey) {
|
|
|
126
214
|
}
|
|
127
215
|
};
|
|
128
216
|
const hash = crypto.createHash("sha256");
|
|
129
|
-
for (const file of [...files].
|
|
217
|
+
for (const file of [...files].toSorted((a, b) => a.path.localeCompare(b.path))) {
|
|
130
218
|
hash.update(file.path);
|
|
131
219
|
hash.update("\0");
|
|
132
220
|
hash.update(file.path === "manifest.json" ? stableStringify(unsigned) : file.contents);
|
|
@@ -142,6 +230,14 @@ function signAddonManifest(manifest, files, privateKey) {
|
|
|
142
230
|
}
|
|
143
231
|
};
|
|
144
232
|
}
|
|
233
|
+
/**
|
|
234
|
+
* Resolves the required RSA signing key for database-bearing addons.
|
|
235
|
+
*
|
|
236
|
+
* @param signingPrivateKey - Provided signing key or undefined.
|
|
237
|
+
* @param developmentBuild - Whether the current build is targeting development mode.
|
|
238
|
+
* @returns Resolved signing key string or undefined (in dev builds).
|
|
239
|
+
* @throws {@link Error} If building a database-bearing addon in production without a signing key.
|
|
240
|
+
*/
|
|
145
241
|
function requireAddonSigningKey(signingPrivateKey, developmentBuild) {
|
|
146
242
|
if (signingPrivateKey) return signingPrivateKey;
|
|
147
243
|
if (developmentBuild) return void 0;
|
|
@@ -158,34 +254,128 @@ function embedCssIntoBundle(buildDir, addonId) {
|
|
|
158
254
|
const js = fs.readFileSync(jsPath, "utf-8");
|
|
159
255
|
if (css.length < 10) css = "";
|
|
160
256
|
else {
|
|
257
|
+
css = stripLayer(css, "properties");
|
|
258
|
+
css = stripLayer(css, "base");
|
|
161
259
|
css = css.replace(/:root\s*\{[^}]+\}/g, "");
|
|
260
|
+
css = css.replace(/:root:not\([^)]+\)\s*\{[^}]+\}/g, "");
|
|
162
261
|
css = css.replace(/\.dark\s*\{[^}]+\}/g, "");
|
|
163
262
|
css = css.replace(/\[data-theme=[^\]]+\]\s*\{[^}]+\}/g, "");
|
|
164
263
|
css = css.replace(/\.dark\s*\[data-theme=[^\]]+\]\s*\{[^}]+\}/g, "");
|
|
165
|
-
css =
|
|
264
|
+
css = css.replace(/\.font-(?:lato|playfair|dancing|poppins|jetbrains|quicksand|roboto-serif|audiowide|special-elite|press-start|grenze|righteous|creepster|vast-shadow|syncopate|lobster)\s*\{[^}]+\}/g, "");
|
|
265
|
+
css = css.replace(/--font-(?:lato|playfair|dancing|poppins|jetbrains|quicksand|roboto-serif|audiowide|special-elite|press-start|grenze|righteous|creepster|vast-shadow|syncopate|lobster):[^;]+;/g, "");
|
|
266
|
+
css = css.replace(/[^{}]*\[data-color[^{}]*\{[^}]+\}/g, "");
|
|
267
|
+
css = css.replace(/@property\s+--tw-[^{]+\{[^}]+\}/g, "");
|
|
268
|
+
css = css.replace(/\.loader-dots\s*\{[^}]+\}/g, "");
|
|
269
|
+
css = css.replace(/\.loader-dots\s+span[^{]*\{[^}]+\}/g, "");
|
|
270
|
+
css = css.replace(/@keyframes\s+wave-dots\s*\{[\s\S]*?\n\}/g, "");
|
|
271
|
+
css = css.replace(/@keyframes\s+gradient-border\s*\{[\s\S]*?\n\}/g, "");
|
|
272
|
+
css = css.replace(/\.animate-gradient(?:-border|-text)?\s*\{[^}]+\}/g, "");
|
|
273
|
+
css = css.replace(/\.me\s*\{[^}]+\}/g, "");
|
|
274
|
+
css = css.replace(/\.user-border\s*\{[^}]+\}/g, "");
|
|
275
|
+
css = css.replace(/\.scrollbar-hide[^{]*\{[^}]+\}/g, "");
|
|
276
|
+
css = css.replace(/@layer\s+components(?:\s*\{[^}]*\}|;)/g, "");
|
|
277
|
+
css = minifyCss(`@scope (#addon-${addonId}) { ${css} }`);
|
|
166
278
|
}
|
|
167
|
-
|
|
279
|
+
if (css.trim().length > 0) {
|
|
280
|
+
const injection = `
|
|
168
281
|
(function() {
|
|
169
|
-
if (typeof document !== 'undefined'
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
document.head.appendChild(
|
|
282
|
+
if (typeof document !== 'undefined') {
|
|
283
|
+
var s = document.createElement('style');
|
|
284
|
+
s.type = 'text/css';
|
|
285
|
+
s.textContent = ${JSON.stringify(css)};
|
|
286
|
+
document.head.appendChild(s);
|
|
174
287
|
}
|
|
175
288
|
})();
|
|
176
289
|
`;
|
|
177
|
-
|
|
290
|
+
fs.writeFileSync(jsPath, injection + js);
|
|
291
|
+
}
|
|
178
292
|
try {
|
|
179
293
|
fs.unlinkSync(cssPath);
|
|
180
294
|
} catch {}
|
|
181
295
|
}
|
|
296
|
+
function stripLayer(css, layerName) {
|
|
297
|
+
const marker = `@layer ${layerName} {`;
|
|
298
|
+
let idx = css.indexOf(marker);
|
|
299
|
+
while (idx !== -1) {
|
|
300
|
+
let braceCount = 0;
|
|
301
|
+
let endIdx = idx + marker.length - 1;
|
|
302
|
+
for (let i = idx + marker.length - 1; i < css.length; i++) if (css[i] === "{") braceCount++;
|
|
303
|
+
else if (css[i] === "}") {
|
|
304
|
+
braceCount--;
|
|
305
|
+
if (braceCount === 0) {
|
|
306
|
+
endIdx = i;
|
|
307
|
+
break;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
css = css.slice(0, idx) + css.slice(endIdx + 1);
|
|
311
|
+
idx = css.indexOf(marker);
|
|
312
|
+
}
|
|
313
|
+
return css;
|
|
314
|
+
}
|
|
315
|
+
function minifyCss(css) {
|
|
316
|
+
return css.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{};:,>])\s*/g, "$1").replace(/;}/g, "}").trim();
|
|
317
|
+
}
|
|
318
|
+
function sortValue(child) {
|
|
319
|
+
if (Array.isArray(child)) return child.map(sortValue);
|
|
320
|
+
if (child && typeof child === "object") return Object.fromEntries(Object.entries(child).toSorted(([left], [right]) => left.localeCompare(right)).map(([key, nested]) => [key, sortValue(nested)]));
|
|
321
|
+
return child;
|
|
322
|
+
}
|
|
182
323
|
function stableStringify(value) {
|
|
183
|
-
const sortValue = (child) => {
|
|
184
|
-
if (Array.isArray(child)) return child.map(sortValue);
|
|
185
|
-
if (child && typeof child === "object") return Object.fromEntries(Object.entries(child).sort(([left], [right]) => left.localeCompare(right)).map(([key, nested]) => [key, sortValue(nested)]));
|
|
186
|
-
return child;
|
|
187
|
-
};
|
|
188
324
|
return JSON.stringify(sortValue(value));
|
|
189
325
|
}
|
|
326
|
+
async function generateAddonVendorLicenses(addonDir, addonName) {
|
|
327
|
+
const title = addonName ? `${addonName} Addon` : "JChat Addon";
|
|
328
|
+
try {
|
|
329
|
+
const proc = Bun.spawn([
|
|
330
|
+
"bun",
|
|
331
|
+
"pm",
|
|
332
|
+
"licenses",
|
|
333
|
+
"--json",
|
|
334
|
+
"--prod"
|
|
335
|
+
], {
|
|
336
|
+
cwd: addonDir,
|
|
337
|
+
stdout: "pipe",
|
|
338
|
+
stderr: "pipe"
|
|
339
|
+
});
|
|
340
|
+
const output = await new Response(proc.stdout).text();
|
|
341
|
+
await proc.exited;
|
|
342
|
+
const data = JSON.parse(output);
|
|
343
|
+
const lines = [
|
|
344
|
+
"================================================================================",
|
|
345
|
+
`${title} - Third-Party Vendor Licenses & Open Source Attribution`,
|
|
346
|
+
"================================================================================",
|
|
347
|
+
"This distribution incorporates open-source libraries and software components.",
|
|
348
|
+
"Their licenses and attributions are listed below.",
|
|
349
|
+
"================================================================================",
|
|
350
|
+
""
|
|
351
|
+
];
|
|
352
|
+
let totalPackages = 0;
|
|
353
|
+
const sortedCategories = Object.keys(data).toSorted((a, b) => a.localeCompare(b));
|
|
354
|
+
for (const licenseCategory of sortedCategories) {
|
|
355
|
+
const packages = data[licenseCategory];
|
|
356
|
+
if (!packages || packages.length === 0) continue;
|
|
357
|
+
lines.push(`\n## License: ${licenseCategory} (${packages.length} packages)\n`);
|
|
358
|
+
for (const pkg of packages) {
|
|
359
|
+
totalPackages++;
|
|
360
|
+
lines.push(`- Package: ${pkg.name}@${pkg.versions.join(", ")}`);
|
|
361
|
+
if (pkg.description) lines.push(` Description: ${pkg.description}`);
|
|
362
|
+
if (pkg.author) lines.push(` Author: ${pkg.author}`);
|
|
363
|
+
if (pkg.homepage) lines.push(` Homepage: ${pkg.homepage}`);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
lines.splice(5, 0, `Total Open-Source Dependencies: ${totalPackages}\n`);
|
|
367
|
+
return lines.join("\n") + "\n";
|
|
368
|
+
} catch {
|
|
369
|
+
return [
|
|
370
|
+
"================================================================================",
|
|
371
|
+
`${title} - Third-Party Vendor Licenses & Open Source Attribution`,
|
|
372
|
+
"================================================================================",
|
|
373
|
+
"This distribution incorporates open-source libraries and software components.",
|
|
374
|
+
"See individual package.json files and dependencies for specific license details.",
|
|
375
|
+
"================================================================================",
|
|
376
|
+
""
|
|
377
|
+
].join("\n");
|
|
378
|
+
}
|
|
379
|
+
}
|
|
190
380
|
//#endregion
|
|
191
381
|
export { createAddonServerBuildArguments, jchatAddon, requireAddonSigningKey, signAddonManifest };
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jchat/addon-sdk",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.20",
|
|
4
4
|
"private": false,
|
|
5
|
+
"description": "JChat Addon SDK for building JChat addons.",
|
|
5
6
|
"keywords": [
|
|
6
7
|
"addon",
|
|
7
8
|
"chat",
|
|
@@ -11,55 +12,156 @@
|
|
|
11
12
|
"sdk",
|
|
12
13
|
"vite"
|
|
13
14
|
],
|
|
14
|
-
"license": "
|
|
15
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
15
16
|
"repository": {
|
|
16
17
|
"type": "git",
|
|
17
18
|
"url": "git+https://github.com/mjjabarullah/jchat.git",
|
|
18
19
|
"directory": "packages/addon-sdk"
|
|
19
20
|
},
|
|
21
|
+
"bin": {
|
|
22
|
+
"jchat-addon": "./dist/cli.mjs"
|
|
23
|
+
},
|
|
20
24
|
"files": [
|
|
21
25
|
"dist",
|
|
22
|
-
"
|
|
26
|
+
"tsconfig.addon.json",
|
|
27
|
+
"skills",
|
|
23
28
|
"README.md",
|
|
24
|
-
"CHANGELOG.md"
|
|
29
|
+
"CHANGELOG.md",
|
|
30
|
+
"LICENSE"
|
|
25
31
|
],
|
|
26
32
|
"type": "module",
|
|
27
|
-
"main": "./
|
|
28
|
-
"types": "./
|
|
33
|
+
"main": "./src/index.ts",
|
|
34
|
+
"types": "./src/index.ts",
|
|
29
35
|
"exports": {
|
|
30
36
|
".": {
|
|
31
|
-
"types": "./
|
|
32
|
-
"import": "./
|
|
37
|
+
"types": "./src/index.ts",
|
|
38
|
+
"import": "./src/index.ts",
|
|
39
|
+
"default": "./src/index.ts"
|
|
40
|
+
},
|
|
41
|
+
"./contracts": {
|
|
42
|
+
"types": "./src/contracts.ts",
|
|
43
|
+
"import": "./src/contracts.ts",
|
|
44
|
+
"default": "./src/contracts.ts"
|
|
45
|
+
},
|
|
46
|
+
"./cli": {
|
|
47
|
+
"types": "./src/cli.ts",
|
|
48
|
+
"import": "./src/cli.ts",
|
|
49
|
+
"default": "./src/cli.ts"
|
|
33
50
|
},
|
|
34
51
|
"./diagnostics": {
|
|
35
|
-
"types": "./
|
|
36
|
-
"import": "./
|
|
52
|
+
"types": "./src/diagnostics.ts",
|
|
53
|
+
"import": "./src/diagnostics.ts",
|
|
54
|
+
"default": "./src/diagnostics.ts"
|
|
37
55
|
},
|
|
38
56
|
"./vite": {
|
|
39
|
-
"types": "./
|
|
40
|
-
"import": "./
|
|
41
|
-
|
|
57
|
+
"types": "./src/vite.ts",
|
|
58
|
+
"import": "./src/vite.ts",
|
|
59
|
+
"default": "./src/vite.ts"
|
|
60
|
+
},
|
|
61
|
+
"./i18n-validator": {
|
|
62
|
+
"types": "./src/i18n-validator.ts",
|
|
63
|
+
"import": "./src/i18n-validator.ts",
|
|
64
|
+
"default": "./src/i18n-validator.ts"
|
|
65
|
+
},
|
|
66
|
+
"./ui": {
|
|
67
|
+
"types": "./src/ui.ts",
|
|
68
|
+
"import": "./src/ui.ts",
|
|
69
|
+
"default": "./src/ui.ts"
|
|
70
|
+
},
|
|
71
|
+
"./icon": {
|
|
72
|
+
"types": "./src/icon.ts",
|
|
73
|
+
"import": "./src/icon.ts",
|
|
74
|
+
"default": "./src/icon.ts"
|
|
75
|
+
},
|
|
76
|
+
"./state": {
|
|
77
|
+
"types": "./src/state.ts",
|
|
78
|
+
"import": "./src/state.ts",
|
|
79
|
+
"default": "./src/state.ts"
|
|
80
|
+
},
|
|
81
|
+
"./ui/tailwind.css": {
|
|
82
|
+
"style": "./src/tailwind.css",
|
|
83
|
+
"import": "./src/tailwind.css",
|
|
84
|
+
"default": "./src/tailwind.css"
|
|
85
|
+
},
|
|
86
|
+
"./tsconfig.json": "./tsconfig.addon.json"
|
|
42
87
|
},
|
|
43
88
|
"publishConfig": {
|
|
89
|
+
"main": "./dist/index.mjs",
|
|
90
|
+
"types": "./dist/index.d.mts",
|
|
91
|
+
"exports": {
|
|
92
|
+
".": {
|
|
93
|
+
"types": "./dist/index.d.mts",
|
|
94
|
+
"import": "./dist/index.mjs"
|
|
95
|
+
},
|
|
96
|
+
"./contracts": {
|
|
97
|
+
"types": "./dist/contracts.d.mts",
|
|
98
|
+
"import": "./dist/contracts.mjs"
|
|
99
|
+
},
|
|
100
|
+
"./cli": {
|
|
101
|
+
"types": "./dist/cli.d.mts",
|
|
102
|
+
"import": "./dist/cli.mjs"
|
|
103
|
+
},
|
|
104
|
+
"./diagnostics": {
|
|
105
|
+
"types": "./dist/diagnostics.d.mts",
|
|
106
|
+
"import": "./dist/diagnostics.mjs"
|
|
107
|
+
},
|
|
108
|
+
"./vite": {
|
|
109
|
+
"types": "./dist/vite.d.mts",
|
|
110
|
+
"import": "./dist/vite.mjs"
|
|
111
|
+
},
|
|
112
|
+
"./i18n-validator": {
|
|
113
|
+
"types": "./dist/i18n-validator.d.mts",
|
|
114
|
+
"import": "./dist/i18n-validator.mjs"
|
|
115
|
+
},
|
|
116
|
+
"./ui": {
|
|
117
|
+
"types": "./dist/ui.d.mts",
|
|
118
|
+
"import": "./dist/ui.mjs"
|
|
119
|
+
},
|
|
120
|
+
"./icon": {
|
|
121
|
+
"types": "./dist/icon.d.mts",
|
|
122
|
+
"import": "./dist/icon.mjs"
|
|
123
|
+
},
|
|
124
|
+
"./state": {
|
|
125
|
+
"types": "./dist/state.d.mts",
|
|
126
|
+
"import": "./dist/state.mjs"
|
|
127
|
+
},
|
|
128
|
+
"./ui/tailwind.css": {
|
|
129
|
+
"style": "./src/tailwind.css",
|
|
130
|
+
"import": "./src/tailwind.css",
|
|
131
|
+
"default": "./src/tailwind.css"
|
|
132
|
+
},
|
|
133
|
+
"./tsconfig.json": "./tsconfig.addon.json"
|
|
134
|
+
},
|
|
44
135
|
"access": "public"
|
|
45
136
|
},
|
|
46
137
|
"scripts": {
|
|
47
138
|
"build": "tsdown",
|
|
48
|
-
"lint": "oxlint .
|
|
139
|
+
"lint": "oxlint .",
|
|
49
140
|
"format": "oxfmt . --write",
|
|
50
|
-
"
|
|
51
|
-
"
|
|
141
|
+
"test": "bun test",
|
|
142
|
+
"typecheck": "tsc --noEmit"
|
|
143
|
+
},
|
|
144
|
+
"dependencies": {
|
|
145
|
+
"lucide-react": "catalog:"
|
|
52
146
|
},
|
|
53
147
|
"devDependencies": {
|
|
54
148
|
"@jchat/icon": "workspace:*",
|
|
149
|
+
"@jchat/ui": "workspace:*",
|
|
150
|
+
"@tailwindcss/vite": "catalog:",
|
|
151
|
+
"@tanstack/react-query": "catalog:",
|
|
152
|
+
"@types/bun": "catalog:",
|
|
55
153
|
"@types/react": "catalog:",
|
|
56
154
|
"elysia": "catalog:",
|
|
155
|
+
"jotai": "catalog:",
|
|
57
156
|
"kysely": "^catalog:",
|
|
58
|
-
"tsdown": "
|
|
157
|
+
"tsdown": "catalog:",
|
|
59
158
|
"vite": "catalog:"
|
|
60
159
|
},
|
|
61
160
|
"peerDependencies": {
|
|
161
|
+
"@tailwindcss/vite": "catalog:",
|
|
162
|
+
"@tanstack/react-query": "catalog:",
|
|
62
163
|
"elysia": "catalog:",
|
|
164
|
+
"jotai": "catalog:",
|
|
63
165
|
"kysely": "^catalog:",
|
|
64
166
|
"react": "catalog:",
|
|
65
167
|
"vite": "catalog:"
|