@jchat/create-addon 1.0.0-alpha.4 → 1.0.0-alpha.6
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 +10 -0
- package/README.md +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/generator.mjs +5 -16
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @jchat/create-addon
|
|
2
2
|
|
|
3
|
+
## 1.0.0-alpha.6
|
|
4
|
+
|
|
5
|
+
## 1.0.0-alpha.5
|
|
6
|
+
|
|
7
|
+
### Patch Changes
|
|
8
|
+
|
|
9
|
+
- 9755c28: Export curated UI components, types, and Tailwind styles from `@jchat/addon-sdk/ui` (`@jchat/addon-sdk/ui/tailwind.css`) for sandbox and third-party addon developers.
|
|
10
|
+
- 8b8297f: Rename package from `create-jchat-addon` to `@jchat/create-addon` and update binary script to `create-addon`.
|
|
11
|
+
- 5bbb2b6: Inherit jchatVersion and addonSdkVersion directly from @jchat/create-addon package version when generating standalone devkit.
|
|
12
|
+
|
|
3
13
|
## 1.0.0-alpha.4
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ bunx @jchat/create-addon <addon-id>
|
|
|
14
14
|
|
|
15
15
|
- `<addon-id>`: (Required) The unique ID for your addon, typically hyphenated (e.g., `weather-addon`).
|
|
16
16
|
- `--target=<directory>`: (Optional) The directory to generate the workspace in. Defaults to `../<addon-id>` relative to the current working directory.
|
|
17
|
-
- `--image=<image>`: (Optional) A specific Docker / Podman container image to use for the sandbox environment. Defaults to `ghcr.io/mjjabarullah/
|
|
17
|
+
- `--image=<image>`: (Optional) A specific Docker / Podman container image to use for the sandbox environment. Defaults to `ghcr.io/mjjabarullah/jchat-sandbox`.
|
|
18
18
|
|
|
19
19
|
### Example
|
|
20
20
|
|
package/dist/cli.mjs
CHANGED
|
@@ -20,7 +20,7 @@ async function runCreator(arguments_) {
|
|
|
20
20
|
...options,
|
|
21
21
|
jchatVersion: manifest.version,
|
|
22
22
|
addonSdkVersion: manifest.version,
|
|
23
|
-
sandboxImage: options.sandboxImage ?? `${manifest.jchat?.sandboxImage ?? "ghcr.io/mjjabarullah/
|
|
23
|
+
sandboxImage: options.sandboxImage ?? `${manifest.jchat?.sandboxImage ?? "ghcr.io/mjjabarullah/jchat-sandbox"}:${manifest.version.replaceAll("+", "-")}`
|
|
24
24
|
});
|
|
25
25
|
return path.resolve(options.targetDir);
|
|
26
26
|
}
|
package/dist/generator.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import * as path from "node:path";
|
|
|
6
6
|
* current major version.
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
|
-
*
|
|
9
|
+
* ;```ts
|
|
10
10
|
* createCompatibleMajorRange("1.4.2") // returns ">=1.4.2 <2.0.0"
|
|
11
11
|
* ```
|
|
12
12
|
*
|
|
@@ -28,7 +28,7 @@ function createCompatibleMajorRange(version) {
|
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region src/generator.ts
|
|
30
30
|
const ADDON_ID_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
31
|
-
const DEFAULT_SANDBOX_IMAGE = "ghcr.io/mjjabarullah/
|
|
31
|
+
const DEFAULT_SANDBOX_IMAGE = "ghcr.io/mjjabarullah/jchat-sandbox";
|
|
32
32
|
function createStandaloneDevkitFiles(options) {
|
|
33
33
|
if (!ADDON_ID_PATTERN.test(options.addonId)) throw new Error("Addon id must contain lowercase letters, numbers, and hyphens");
|
|
34
34
|
const image = options.sandboxImage ?? `${DEFAULT_SANDBOX_IMAGE}:${options.jchatVersion.replace(/\+/g, "-")}`;
|
|
@@ -261,7 +261,8 @@ export default defineConfig({
|
|
|
261
261
|
"react-dom",
|
|
262
262
|
"react/jsx-runtime",
|
|
263
263
|
"@tanstack/react-query",
|
|
264
|
-
"@jchat/addon-sdk"
|
|
264
|
+
"@jchat/addon-sdk",
|
|
265
|
+
"@jchat/addon-sdk/ui"
|
|
265
266
|
],
|
|
266
267
|
output: {
|
|
267
268
|
format: "esm"
|
|
@@ -300,19 +301,7 @@ export default function Addon({ mountPoint }: AddonProps) {
|
|
|
300
301
|
`;
|
|
301
302
|
}
|
|
302
303
|
function createTailwindSource() {
|
|
303
|
-
return `@import "
|
|
304
|
-
|
|
305
|
-
@theme inline {
|
|
306
|
-
--color-background: var(--background);
|
|
307
|
-
--color-foreground: var(--foreground);
|
|
308
|
-
--color-card: var(--card);
|
|
309
|
-
--color-card-foreground: var(--card-foreground);
|
|
310
|
-
--color-border: var(--border);
|
|
311
|
-
--color-primary: var(--primary);
|
|
312
|
-
--color-primary-foreground: var(--primary-foreground);
|
|
313
|
-
--color-muted-foreground: var(--muted-foreground);
|
|
314
|
-
}
|
|
315
|
-
`;
|
|
304
|
+
return `@import "@jchat/addon-sdk/ui/tailwind.css";`;
|
|
316
305
|
}
|
|
317
306
|
function createLifecycleScript() {
|
|
318
307
|
return `import * as fs from "node:fs"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jchat/create-addon",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"keywords": [
|
|
6
6
|
"addon",
|
|
@@ -54,6 +54,6 @@
|
|
|
54
54
|
"bun": ">=1.3.11"
|
|
55
55
|
},
|
|
56
56
|
"jchat": {
|
|
57
|
-
"sandboxImage": "ghcr.io/mjjabarullah/
|
|
57
|
+
"sandboxImage": "ghcr.io/mjjabarullah/jchat-sandbox"
|
|
58
58
|
}
|
|
59
59
|
}
|