@jchat/create-addon 1.0.0-alpha.6 → 1.0.0-alpha.8
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 +11 -0
- package/LICENSE +18 -196
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +1 -31
- package/dist/generator.mjs +58 -223
- package/dist/index.d.mts +16 -2
- package/dist/index.mjs +1 -2
- package/package.json +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @jchat/create-addon
|
|
2
2
|
|
|
3
|
+
## 1.0.0-alpha.8
|
|
4
|
+
|
|
5
|
+
## 1.0.0-alpha.7
|
|
6
|
+
|
|
7
|
+
### Minor Changes
|
|
8
|
+
|
|
9
|
+
- 7cef24c: - Enhance addon package diagnostics with semantic version compatibility validation for JChat host and Addon SDK
|
|
10
|
+
- Add support for local workspace development, sandbox test harnesses, and distribution packaging
|
|
11
|
+
- Improve runtime license verification and multi-environment path resolution
|
|
12
|
+
- Update addon generator templates with 20-language i18n support, standard scripts, and type definitions
|
|
13
|
+
|
|
3
14
|
## 1.0.0-alpha.6
|
|
4
15
|
|
|
5
16
|
## 1.0.0-alpha.5
|
package/LICENSE
CHANGED
|
@@ -1,201 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
1
|
+
CUSTOM COMMERCIAL END USER LICENSE AGREEMENT (EULA)
|
|
4
2
|
|
|
5
|
-
|
|
3
|
+
Copyright (c) 2026 JChat Project. All rights reserved.
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
1. DEFINITIONS
|
|
6
|
+
"Software" refers to this npm package and its source code.
|
|
7
|
+
"Authorized Application" refers strictly to the application known as "JChat".
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
2. LICENSE GRANT
|
|
10
|
+
Subject to the terms of this Agreement and payment of any applicable fees, the
|
|
11
|
+
Licensor grants you a non-exclusive, non-transferable, revocable license to
|
|
12
|
+
download, install, and use the Software.
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
3. RESTRICTIONS ON USE
|
|
15
|
+
You are expressly prohibited from using this Software, in whole or in part,
|
|
16
|
+
in any application, product, or service other than the Authorized Application (JChat).
|
|
17
|
+
Any deployment, linking, execution, or inclusion of this Software into an
|
|
18
|
+
application that is not JChat constitutes a breach of this contract and
|
|
19
|
+
an infringement of copyright law.
|
|
14
20
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Copyright 2026 Md. Jabarullah
|
|
190
|
-
|
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
-
you may not use this file except in compliance with the License.
|
|
193
|
-
You may obtain a copy of the License at
|
|
194
|
-
|
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
-
|
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
-
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|
|
21
|
+
4. NO REDISTRIBUTION
|
|
22
|
+
You may not sub-license, rent, lease, or publicly redistribute this Software
|
|
23
|
+
to any third party without explicit written consent from the Licensor.
|
package/dist/cli.d.mts
CHANGED
|
@@ -3,6 +3,7 @@ interface CreatorArguments {
|
|
|
3
3
|
addonId: string;
|
|
4
4
|
targetDir: string;
|
|
5
5
|
sandboxImage?: string;
|
|
6
|
+
workspace?: boolean;
|
|
6
7
|
}
|
|
7
8
|
declare function parseCreatorArguments(arguments_: readonly string[]): CreatorArguments;
|
|
8
9
|
declare function runCreator(arguments_: readonly string[]): Promise<string>;
|
package/dist/cli.mjs
CHANGED
|
@@ -1,32 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import
|
|
3
|
-
import * as path from "node:path";
|
|
4
|
-
//#region src/cli.ts
|
|
5
|
-
function parseCreatorArguments(arguments_) {
|
|
6
|
-
const addonId = arguments_.filter((argument) => !argument.startsWith("--"))[0];
|
|
7
|
-
if (addonId === void 0 || addonId.startsWith("-")) throw new Error("Usage: bunx @jchat/create-addon <addon-id> [--target=<directory>] [--image=<image>]");
|
|
8
|
-
const targetArgument = arguments_.find((argument) => argument.startsWith("--target="));
|
|
9
|
-
const imageArgument = arguments_.find((argument) => argument.startsWith("--image="));
|
|
10
|
-
return {
|
|
11
|
-
addonId,
|
|
12
|
-
targetDir: targetArgument?.slice(9) || addonId,
|
|
13
|
-
sandboxImage: imageArgument?.slice(8) || void 0
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
async function runCreator(arguments_) {
|
|
17
|
-
const manifest = await Bun.file(new URL("../package.json", import.meta.url)).json();
|
|
18
|
-
const options = parseCreatorArguments(arguments_);
|
|
19
|
-
writeStandaloneDevkit({
|
|
20
|
-
...options,
|
|
21
|
-
jchatVersion: manifest.version,
|
|
22
|
-
addonSdkVersion: manifest.version,
|
|
23
|
-
sandboxImage: options.sandboxImage ?? `${manifest.jchat?.sandboxImage ?? "ghcr.io/mjjabarullah/jchat-sandbox"}:${manifest.version.replaceAll("+", "-")}`
|
|
24
|
-
});
|
|
25
|
-
return path.resolve(options.targetDir);
|
|
26
|
-
}
|
|
27
|
-
if (import.meta.main) {
|
|
28
|
-
const target = await runCreator(process.argv.slice(2));
|
|
29
|
-
console.log(`Created standalone addon development kit at ${target}`);
|
|
30
|
-
}
|
|
31
|
-
//#endregion
|
|
32
|
-
export { parseCreatorArguments, runCreator };
|
|
2
|
+
import{i as e,r as t}from"./generator.mjs";import*as n from"node:path";function r(e){let t=e.find(e=>!e.startsWith(`--`));if(t===void 0||t.startsWith(`-`))throw Error(`Usage: bunx @jchat/create-addon <addon-id> [--target=<directory>] [--image=<image>] [--workspace]`);let r=e.find(e=>e.startsWith(`--target=`)),i=e.find(e=>e.startsWith(`--image=`)),a=e.includes(`--workspace`),o=a?n.join(`addons`,t):t;return{addonId:t,targetDir:r?.slice(9)||o,sandboxImage:i?.slice(8)||void 0,workspace:a}}async function i(i){let a=await Bun.file(new URL(`../package.json`,import.meta.url)).json(),o=r(i);return o.workspace?(await t({addonId:o.addonId,targetDir:o.targetDir,isMonorepoWorkspace:!0,jchatVersion:a.version,addonSdkVersion:a.version}),n.resolve(o.targetDir)):(await e({...o,jchatVersion:a.version,addonSdkVersion:a.version,sandboxImage:o.sandboxImage??`${a.jchat?.sandboxImage??`ghcr.io/mjjabarullah/jchat-sandbox`}:${a.version.replaceAll(`+`,`-`)}`}),n.resolve(o.targetDir))}if(import.meta.main)try{let e=await i(process.argv.slice(2));console.log(`Created addon at ${e}`)}catch(e){console.error(e),process.exit(1)}export{r as parseCreatorArguments,i as runCreator};
|
package/dist/generator.mjs
CHANGED
|
@@ -1,96 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Constructs a semantic version compatibility range covering all minor/patch versions of the
|
|
6
|
-
* current major version.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ;```ts
|
|
10
|
-
* createCompatibleMajorRange("1.4.2") // returns ">=1.4.2 <2.0.0"
|
|
11
|
-
* ```
|
|
12
|
-
*
|
|
13
|
-
* @param version - Valid semver string (e.g. `"1.2.0"`).
|
|
14
|
-
* @returns Semver range string matching the current major series (e.g. `">=1.2.0 <2.0.0"`).
|
|
15
|
-
* @throws {@link Error} If the input is not a valid semantic version string.
|
|
16
|
-
*/
|
|
17
|
-
function createCompatibleMajorRange(version) {
|
|
18
|
-
try {
|
|
19
|
-
Bun.semver.order(version, version);
|
|
20
|
-
} catch {
|
|
21
|
-
throw new Error(`Invalid semantic version: ${version}`);
|
|
22
|
-
}
|
|
23
|
-
const majorComponent = /^(?:v|=)?(\d+)\./.exec(version)?.[1];
|
|
24
|
-
const major = majorComponent ? Number(majorComponent) : NaN;
|
|
25
|
-
if (!Number.isSafeInteger(major)) throw new Error(`Invalid semantic version: ${version}`);
|
|
26
|
-
return `>=${version} <${major + 1}.0.0`;
|
|
27
|
-
}
|
|
28
|
-
//#endregion
|
|
29
|
-
//#region src/generator.ts
|
|
30
|
-
const ADDON_ID_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
31
|
-
const DEFAULT_SANDBOX_IMAGE = "ghcr.io/mjjabarullah/jchat-sandbox";
|
|
32
|
-
function createStandaloneDevkitFiles(options) {
|
|
33
|
-
if (!ADDON_ID_PATTERN.test(options.addonId)) throw new Error("Addon id must contain lowercase letters, numbers, and hyphens");
|
|
34
|
-
const image = options.sandboxImage ?? `${DEFAULT_SANDBOX_IMAGE}:${options.jchatVersion.replace(/\+/g, "-")}`;
|
|
35
|
-
const manifest = {
|
|
36
|
-
id: options.addonId,
|
|
37
|
-
name: toDisplayName(options.addonId),
|
|
38
|
-
version: "1.0.0",
|
|
39
|
-
description: `${toDisplayName(options.addonId)} addon for JChat`,
|
|
40
|
-
author: "Developer",
|
|
41
|
-
compatibility: {
|
|
42
|
-
jchat: createCompatibleMajorRange(options.jchatVersion),
|
|
43
|
-
addonSdk: createCompatibleMajorRange(options.addonSdkVersion)
|
|
44
|
-
},
|
|
45
|
-
frontend: {
|
|
46
|
-
bundle: "./ui.js",
|
|
47
|
-
mountPoints: ["chat-toolbar"]
|
|
48
|
-
},
|
|
49
|
-
permissions: []
|
|
50
|
-
};
|
|
51
|
-
return Object.freeze({
|
|
52
|
-
".env.example": createEnvironmentFile(options.addonId, image),
|
|
53
|
-
".gitignore": [
|
|
54
|
-
"node_modules/",
|
|
55
|
-
"addon/node_modules/",
|
|
56
|
-
"addon/build/",
|
|
57
|
-
".env",
|
|
58
|
-
""
|
|
59
|
-
].join("\n"),
|
|
60
|
-
"README.md": createReadme(options.addonId),
|
|
61
|
-
"docker-compose.yml": createComposeFile(),
|
|
62
|
-
"package.json": `${JSON.stringify(createRootPackage(options.addonId), null, 2)}\n`,
|
|
63
|
-
"scripts/devkit.ts": createLifecycleScript(),
|
|
64
|
-
"addon/package.json": `${JSON.stringify(createAddonPackage(options.addonId, options.addonSdkVersion), null, 2)}\n`,
|
|
65
|
-
"addon/tsconfig.json": `${JSON.stringify(createTsConfig(), null, 2)}\n`,
|
|
66
|
-
"addon/vite.config.ts": createViteConfig(),
|
|
67
|
-
"addon/src/manifest.ts": createManifestSource(manifest),
|
|
68
|
-
"addon/src/tailwind.css": createTailwindSource(),
|
|
69
|
-
"addon/src/ui.tsx": createUiSource(manifest.name)
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
function writeStandaloneDevkit(options) {
|
|
73
|
-
const targetDir = path.resolve(options.targetDir);
|
|
74
|
-
if (fs.existsSync(targetDir)) throw new Error(`Development kit target already exists: ${targetDir}`);
|
|
75
|
-
for (const [relativePath, contents] of Object.entries(createStandaloneDevkitFiles(options))) {
|
|
76
|
-
const target = path.join(targetDir, ...relativePath.split("/"));
|
|
77
|
-
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
78
|
-
fs.writeFileSync(target, contents);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
function createEnvironmentFile(addonId, image) {
|
|
82
|
-
return [
|
|
83
|
-
`JCHAT_SANDBOX_IMAGE=${image}`,
|
|
84
|
-
`JCHAT_SANDBOX_ADDON_ID=${addonId}`,
|
|
85
|
-
"JCHAT_SANDBOX_PORT=4317",
|
|
86
|
-
"JCHAT_SANDBOX_HTTP_MOCK_PORT=4318",
|
|
87
|
-
"JCHAT_SANDBOX_HTTP_MOCK_OFFLINE=false",
|
|
88
|
-
"JCHAT_SANDBOX_ADDON_HTTP_MOCK_URL=http://http-mock:4318",
|
|
89
|
-
""
|
|
90
|
-
].join("\n");
|
|
91
|
-
}
|
|
92
|
-
function createComposeFile() {
|
|
93
|
-
return `services:
|
|
1
|
+
import*as e from"node:fs";import*as t from"node:path";function n(e){try{Bun.semver.order(e,e)}catch{throw Error(`Invalid semantic version: ${e}`)}let t=/^(?:v|=)?(\d+)\./.exec(e)?.[1],n=t?Number(t):NaN;if(!Number.isSafeInteger(n))throw Error(`Invalid semantic version: ${e}`);return`>=${e} <${n+1}.0.0`}const r=/^[a-z0-9]+(?:-[a-z0-9]+)*$/;function i(e){if(!r.test(e.addonId))throw Error(`Addon id must contain lowercase letters, numbers, and hyphens`);let t={id:e.addonId,name:P(e.addonId),version:`1.0.0`,description:`${P(e.addonId)} addon for JChat`,author:`Developer`,compatibility:{jchat:n(e.jchatVersion??`1.0.0`),addonSdk:n(e.addonSdkVersion??`1.0.0`)},locales:[`ar`,`de`,`en`,`es`,`fr`,`hi`,`kn`,`ml`,`ta`,`te`,`ur`],defaultLocale:`en`,frontend:{bundle:`./ui.js`,mountPoints:[`chat-toolbar`]},permissions:[]},i=e.isMonorepoWorkspace?d(e.addonId):m(e.addonId,e.addonSdkVersion??`1.0.0`),a=e.isMonorepoWorkspace?f():h();return Object.freeze({"package.json":`${JSON.stringify(i,null,2)}\n`,"tsconfig.json":`${JSON.stringify(a,null,2)}\n`,"src/manifest.ts":g(t),"src/tailwind.css":j(),"src/locales/ar.json":_(t.name),"src/locales/de.json":v(t.name),"src/locales/en.json":y(t.name),"src/locales/es.json":b(t.name),"src/locales/fr.json":x(t.name),"src/locales/hi.json":S(t.name),"src/locales/kn.json":C(t.name),"src/locales/ml.json":w(t.name),"src/locales/ta.json":T(t.name),"src/locales/te.json":E(t.name),"src/locales/ur.json":D(t.name),"src/locales/index.ts":O(),"src/locales.test.ts":k(),"src/ui.tsx":A(t.name)})}async function a(n){let r=t.resolve(n.targetDir);if(e.existsSync(r))throw Error(`Addon target already exists: ${r}`);let a=Object.entries(i(n));for(let[n]of a){let i=t.join(r,...n.split(`/`));e.mkdirSync(t.dirname(i),{recursive:!0})}await Promise.all(a.map(([e,n])=>{let i=t.join(r,...e.split(`/`));return Bun.write(i,n)}))}function o(e){if(!r.test(e.addonId))throw Error(`Addon id must contain lowercase letters, numbers, and hyphens`);let t=e.sandboxImage??`ghcr.io/mjjabarullah/jchat-sandbox:${e.jchatVersion.replace(/\+/g,`-`)}`,n=i({addonId:e.addonId,isMonorepoWorkspace:!1,jchatVersion:e.jchatVersion,addonSdkVersion:e.addonSdkVersion}),a={".env.example":c(e.addonId,t),".gitignore":[`node_modules/`,`addon/node_modules/`,`addon/build/`,`.env`,``].join(`
|
|
2
|
+
`),"README.md":N(e.addonId),"docker-compose.yml":l(),"package.json":`${JSON.stringify(u(e.addonId),null,2)}\n`,"scripts/devkit.ts":M()};for(let[e,t]of Object.entries(n))a[`addon/${e}`]=t;return Object.freeze(a)}async function s(n){let r=t.resolve(n.targetDir);if(e.existsSync(r))throw Error(`Development kit target already exists: ${r}`);let i=Object.entries(o(n));for(let[n]of i){let i=t.join(r,...n.split(`/`));e.mkdirSync(t.dirname(i),{recursive:!0})}await Promise.all(i.map(([e,n])=>{let i=t.join(r,...e.split(`/`));return Bun.write(i,n)}))}function c(e,t){return[`JCHAT_SANDBOX_IMAGE=${t}`,`JCHAT_SANDBOX_ADDON_ID=${e}`,`JCHAT_SANDBOX_PORT=4317`,`JCHAT_SANDBOX_HTTP_MOCK_PORT=4318`,`JCHAT_SANDBOX_HTTP_MOCK_OFFLINE=false`,`JCHAT_SANDBOX_ADDON_HTTP_MOCK_URL=http://http-mock:4318`,``].join(`
|
|
3
|
+
`)}function l(){return`services:
|
|
94
4
|
sandbox:
|
|
95
5
|
image: \${JCHAT_SANDBOX_IMAGE:?Copy .env.example to .env}
|
|
96
6
|
restart: unless-stopped
|
|
@@ -163,148 +73,82 @@ volumes:
|
|
|
163
73
|
sandbox_postgres:
|
|
164
74
|
sandbox_redis:
|
|
165
75
|
sandbox_uploads:
|
|
166
|
-
|
|
167
|
-
}
|
|
168
|
-
function createRootPackage(addonId) {
|
|
169
|
-
return {
|
|
170
|
-
name: `${addonId}-development-kit`,
|
|
171
|
-
private: true,
|
|
172
|
-
type: "module",
|
|
173
|
-
workspaces: ["addon"],
|
|
174
|
-
scripts: {
|
|
175
|
-
sandbox: "bun run ./scripts/devkit.ts run",
|
|
176
|
-
"sandbox:test": "bun run ./scripts/devkit.ts test",
|
|
177
|
-
"sandbox:reset": "bun run ./scripts/devkit.ts reset",
|
|
178
|
-
"sandbox:package": "bun run ./scripts/devkit.ts package",
|
|
179
|
-
"sandbox:cleanup": "bun run ./scripts/devkit.ts cleanup"
|
|
180
|
-
},
|
|
181
|
-
devDependencies: { "bun-types": "^1.3.14" },
|
|
182
|
-
engines: { bun: ">=1.3.11" }
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
function createAddonPackage(addonId, addonSdkVersion) {
|
|
186
|
-
return {
|
|
187
|
-
name: `@jchat/${addonId}`,
|
|
188
|
-
version: "1.0.0",
|
|
189
|
-
private: true,
|
|
190
|
-
type: "module",
|
|
191
|
-
scripts: {
|
|
192
|
-
dev: "vite build --watch --mode=development",
|
|
193
|
-
build: "vite build --mode=production",
|
|
194
|
-
test: "bun test",
|
|
195
|
-
typecheck: "tsc --noEmit"
|
|
196
|
-
},
|
|
197
|
-
dependencies: {
|
|
198
|
-
"@jchat/addon-sdk": `^${addonSdkVersion}`,
|
|
199
|
-
"@tanstack/react-query": "^5.101.4",
|
|
200
|
-
react: "^19.2.8",
|
|
201
|
-
"react-dom": "^19.2.8"
|
|
202
|
-
},
|
|
203
|
-
devDependencies: {
|
|
204
|
-
"@tailwindcss/vite": "^4.3.3",
|
|
205
|
-
"@types/node": "^26.1.1",
|
|
206
|
-
"@types/react": "^19.2.17",
|
|
207
|
-
"@types/react-dom": "^19.2.3",
|
|
208
|
-
"bun-types": "^1.3.14",
|
|
209
|
-
tailwindcss: "^4.3.3",
|
|
210
|
-
typescript: "^7.0.2",
|
|
211
|
-
vite: "^8.1.5"
|
|
212
|
-
}
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
function createTsConfig() {
|
|
216
|
-
return {
|
|
217
|
-
compilerOptions: {
|
|
218
|
-
strict: true,
|
|
219
|
-
target: "ESNext",
|
|
220
|
-
module: "ESNext",
|
|
221
|
-
moduleResolution: "bundler",
|
|
222
|
-
jsx: "react-jsx",
|
|
223
|
-
noEmit: true,
|
|
224
|
-
types: ["bun-types", "node"]
|
|
225
|
-
},
|
|
226
|
-
include: [
|
|
227
|
-
"src/**/*.ts",
|
|
228
|
-
"src/**/*.tsx",
|
|
229
|
-
"vite.config.ts"
|
|
230
|
-
]
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
function createManifestSource(manifest) {
|
|
234
|
-
return `import type { AddonManifest } from "@jchat/addon-sdk"
|
|
76
|
+
`}function u(e){return{name:`${e}-development-kit`,private:!0,type:`module`,workspaces:[`addon`],scripts:{sandbox:`bun run ./scripts/devkit.ts run`,"sandbox:test":`bun run ./scripts/devkit.ts test`,"sandbox:reset":`bun run ./scripts/devkit.ts reset`,"sandbox:package":`bun run ./scripts/devkit.ts package`,"sandbox:cleanup":`bun run ./scripts/devkit.ts cleanup`},devDependencies:{"@types/bun":`^1.4.0`},engines:{bun:`>=1.4.0`}}}function d(e){return{name:`@jchat/${e}`,version:`1.0.0-alpha.0`,private:!0,description:`${P(e)} addon for JChat`,repository:{type:`git`,url:`git+https://github.com/mjjabarullah/jchat.git`,directory:`addons/${e}`},type:`module`,scripts:{dev:`jchat-addon dev`,build:`tsc --noEmit && jchat-addon build`,test:`bun test`,lint:`oxlint .`,format:`oxfmt . --write`,typecheck:`tsc --noEmit`},dependencies:{"lucide-react":`catalog:`,"usehooks-ts":`catalog:`},devDependencies:{"@tailwindcss/vite":`catalog:`,"@types/bun":`catalog:`,"@types/react":`catalog:`,"@types/react-dom":`catalog:`,elysia:`catalog:`,vite:`catalog:`},peerDependencies:{"@jchat/addon-sdk":`workspace:*`,"@tanstack/react-query":`catalog:`,react:`catalog:`,"react-dom":`catalog:`}}}function f(){return{extends:`@jchat/addon-sdk/tsconfig.json`,include:[`src/**/*`]}}function p(){try{let n=import.meta.dirname;for(let r=0;r<6;r++){let r=t.join(n,`package.json`);if(e.existsSync(r)){let t=e.readFileSync(r,`utf8`),n=JSON.parse(t);if(n.catalog&&typeof n.catalog==`object`)return n.catalog}let i=t.dirname(n);if(i===n)break;n=i}}catch{}return{}}function m(e,t){let n=p();return{name:`@jchat/${e}`,version:`1.0.0`,private:!0,type:`module`,scripts:{dev:`jchat-addon dev`,build:`tsc --noEmit && jchat-addon build`,test:`bun test`,typecheck:`tsc --noEmit`},dependencies:{"@jchat/addon-sdk":`^${t}`,"@tanstack/react-query":n[`@tanstack/react-query`]??`^5.101.4`,"lucide-react":n[`lucide-react`]??`1.31.0`,react:n.react??`^19.2.8`,"react-dom":n[`react-dom`]??`^19.2.8`,"usehooks-ts":n[`usehooks-ts`]??`^3.1.1`},devDependencies:{"@tailwindcss/vite":n[`@tailwindcss/vite`]??`^4.3.3`,"@types/bun":n[`@types/bun`]??`^1.4.0`,"@types/react":n[`@types/react`]??`^19.2.18`,"@types/react-dom":n[`@types/react-dom`]??`^19.2.4`,elysia:n.elysia??`^1.4.29`,tailwindcss:n.tailwindcss??`^4.3.3`,typescript:n.typescript??`^7.0.2`,vite:n.vite??`^8.2.1`}}}function h(){return{extends:`@jchat/addon-sdk/tsconfig.json`,include:[`src/**/*.ts`,`src/**/*.tsx`]}}function g(e){return`import type { AddonManifest } from "@jchat/addon-sdk"
|
|
235
77
|
|
|
236
|
-
const manifest: AddonManifest = ${JSON.stringify(
|
|
78
|
+
const manifest: AddonManifest = ${JSON.stringify(e,null,2)}
|
|
237
79
|
|
|
238
80
|
export default manifest
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
import
|
|
244
|
-
import
|
|
245
|
-
import
|
|
246
|
-
import
|
|
81
|
+
`}function _(e){return`${JSON.stringify({welcome:`مرحبًا بك في ${e}`,mounted_at:`تم التثبيت في {{mountPoint}}`,test_button:`اختبار الإضافة`,toast_message:`مرحبًا من ${e}`},null,2)}\n`}function v(e){return`${JSON.stringify({welcome:`Willkommen bei ${e}`,mounted_at:`Eingebunden an {{mountPoint}}`,test_button:`Addon testen`,toast_message:`Hallo von ${e}`},null,2)}\n`}function y(e){return`${JSON.stringify({welcome:`Welcome to ${e}`,mounted_at:`Mounted at {{mountPoint}}`,test_button:`Test addon`,toast_message:`Hello from ${e}`},null,2)}\n`}function b(e){return`${JSON.stringify({welcome:`Bienvenido a ${e}`,mounted_at:`Montado en {{mountPoint}}`,test_button:`Probar complemento`,toast_message:`Hola desde ${e}`},null,2)}\n`}function x(e){return`${JSON.stringify({welcome:`Bienvenue sur ${e}`,mounted_at:`Monté sur {{mountPoint}}`,test_button:`Tester le plugin`,toast_message:`Bonjour de ${e}`},null,2)}\n`}function S(e){return`${JSON.stringify({welcome:`${e} में आपका स्वागत है`,mounted_at:`{{mountPoint}} पर माउंट किया गया`,test_button:`ऐडऑन का परीक्षण करें`,toast_message:`${e} की ओर से नमस्कार`},null,2)}\n`}function C(e){return`${JSON.stringify({welcome:`${e} ಗೆ ಸುಸ್ವಾಗತ`,mounted_at:`{{mountPoint}} ನಲ್ಲಿ ಸ್ಥಾಪಿಸಲಾಗಿದೆ`,test_button:`ಆಡ್ಆನ್ ಪರೀಕ್ಷಿಸಿ`,toast_message:`${e} ನಿಂದ ನಮಸ್ಕಾರ`},null,2)}\n`}function w(e){return`${JSON.stringify({welcome:`${e}-ലേക്ക് സ്വാഗതം`,mounted_at:`{{mountPoint}}-ൽ ഘടിപ്പിച്ചിരിക്കുന്നു`,test_button:`ആഡ്ഓൺ പരിശോധിക്കുക`,toast_message:`${e}-ൽ നിന്നുള്ള ആശംസകൾ`},null,2)}\n`}function T(e){return`${JSON.stringify({welcome:`${e}-க்கு வரவேற்கிறோம்`,mounted_at:`{{mountPoint}}-ல் பொருத்தப்பட்டுள்ளது`,test_button:`செருகுநிரலை சோதிக்கவும்`,toast_message:`${e}-லிருந்து வணக்கம்`},null,2)}\n`}function E(e){return`${JSON.stringify({welcome:`${e}కి స్వాగతం`,mounted_at:`{{mountPoint}} వద్ద మౌంట్ చేయబడింది`,test_button:`యాడ్ఆన్ని పరీక్షించండి`,toast_message:`${e} నుండి నమస్కారం`},null,2)}\n`}function D(e){return`${JSON.stringify({welcome:`${e} میں خوش آمدید`,mounted_at:`{{mountPoint}} پر نصب ہے`,test_button:`ایڈ آن کا تجربہ کریں`,toast_message:`${e} کی طرف سے ہیلو`},null,2)}\n`}function O(){return`import ar from "./ar.json"
|
|
82
|
+
import de from "./de.json"
|
|
83
|
+
import en from "./en.json"
|
|
84
|
+
import es from "./es.json"
|
|
85
|
+
import fr from "./fr.json"
|
|
86
|
+
import hi from "./hi.json"
|
|
87
|
+
import kn from "./kn.json"
|
|
88
|
+
import ml from "./ml.json"
|
|
89
|
+
import ta from "./ta.json"
|
|
90
|
+
import te from "./te.json"
|
|
91
|
+
import ur from "./ur.json"
|
|
92
|
+
|
|
93
|
+
export type TranslationKey = keyof typeof en
|
|
94
|
+
|
|
95
|
+
export const locales = {
|
|
96
|
+
ar,
|
|
97
|
+
de,
|
|
98
|
+
en,
|
|
99
|
+
es,
|
|
100
|
+
fr,
|
|
101
|
+
hi,
|
|
102
|
+
kn,
|
|
103
|
+
ml,
|
|
104
|
+
ta,
|
|
105
|
+
te,
|
|
106
|
+
ur
|
|
107
|
+
} as const
|
|
108
|
+
|
|
109
|
+
export default locales
|
|
110
|
+
`}function k(){return`import { describe, expect, test } from "bun:test"
|
|
111
|
+
import { validateAddonLocales } from "@jchat/addon-sdk"
|
|
112
|
+
import * as path from "node:path"
|
|
247
113
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
entry: path.resolve(import.meta.dirname, "src/ui.tsx"),
|
|
255
|
-
formats: ["es"],
|
|
256
|
-
fileName: () => "ui.[hash].js"
|
|
257
|
-
},
|
|
258
|
-
rolldownOptions: {
|
|
259
|
-
external: [
|
|
260
|
-
"react",
|
|
261
|
-
"react-dom",
|
|
262
|
-
"react/jsx-runtime",
|
|
263
|
-
"@tanstack/react-query",
|
|
264
|
-
"@jchat/addon-sdk",
|
|
265
|
-
"@jchat/addon-sdk/ui"
|
|
266
|
-
],
|
|
267
|
-
output: {
|
|
268
|
-
format: "esm"
|
|
269
|
-
}
|
|
114
|
+
describe("addon locales", () => {
|
|
115
|
+
test("maintains key parity across all 11 host languages", () => {
|
|
116
|
+
const localesDir = path.join(import.meta.dir, "locales")
|
|
117
|
+
const result = validateAddonLocales(localesDir)
|
|
118
|
+
if (!result.valid) {
|
|
119
|
+
console.error(result.errors.join("\\n"))
|
|
270
120
|
}
|
|
271
|
-
|
|
121
|
+
expect(result.valid).toBe(true)
|
|
122
|
+
})
|
|
272
123
|
})
|
|
273
|
-
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
return `import type { AddonProps } from "@jchat/addon-sdk"
|
|
277
|
-
import { useAddonSDK, useIcons } from "@jchat/addon-sdk"
|
|
124
|
+
`}function A(e){return`import type { AddonProps } from "@jchat/addon-sdk"
|
|
125
|
+
import { useAddonSDK, useIcons, useTranslation } from "@jchat/addon-sdk"
|
|
126
|
+
import locales from "./locales"
|
|
278
127
|
import "./tailwind.css"
|
|
279
128
|
|
|
280
129
|
export default function Addon({ mountPoint }: AddonProps) {
|
|
281
130
|
const sdk = useAddonSDK()
|
|
282
131
|
const { Icons } = useIcons()
|
|
132
|
+
const { t, dir } = useTranslation(locales)
|
|
283
133
|
|
|
284
134
|
return (
|
|
285
|
-
<div className="rounded border border-border bg-card p-2 text-card-foreground">
|
|
135
|
+
<div dir={dir} className="rounded border border-border bg-card p-2 text-card-foreground">
|
|
286
136
|
<div className="mb-2 flex items-center gap-2">
|
|
287
137
|
<Icons.Plus aria-hidden="true" className="size-4 text-primary" />
|
|
288
|
-
<strong>${
|
|
138
|
+
<strong>${e}</strong>
|
|
289
139
|
</div>
|
|
290
|
-
<p className="mb-2 text-sm text-muted-foreground">
|
|
140
|
+
<p className="mb-2 text-sm text-muted-foreground">{t("mounted_at", { mountPoint })}</p>
|
|
291
141
|
<button
|
|
292
142
|
type="button"
|
|
293
143
|
className="rounded bg-primary px-3 py-2 text-primary-foreground"
|
|
294
|
-
onClick={() => sdk.toast("
|
|
144
|
+
onClick={() => sdk.toast(t("toast_message", { name: "${e}" }))}
|
|
295
145
|
>
|
|
296
|
-
|
|
146
|
+
{t("test_button")}
|
|
297
147
|
</button>
|
|
298
148
|
</div>
|
|
299
149
|
)
|
|
300
150
|
}
|
|
301
|
-
|
|
302
|
-
}
|
|
303
|
-
function createTailwindSource() {
|
|
304
|
-
return `@import "@jchat/addon-sdk/ui/tailwind.css";`;
|
|
305
|
-
}
|
|
306
|
-
function createLifecycleScript() {
|
|
307
|
-
return `import * as fs from "node:fs"
|
|
151
|
+
`}function j(){return`@import "@jchat/addon-sdk/ui/tailwind.css";`}function M(){return`import * as fs from "node:fs"
|
|
308
152
|
import * as path from "node:path"
|
|
309
153
|
|
|
310
154
|
type Command = "run" | "test" | "reset" | "package" | "cleanup"
|
|
@@ -373,12 +217,9 @@ function readEnvironment(file: string): Record<string, string> {
|
|
|
373
217
|
})
|
|
374
218
|
)
|
|
375
219
|
}
|
|
376
|
-
|
|
377
|
-
}
|
|
378
|
-
function createReadme(addonId) {
|
|
379
|
-
return `# ${toDisplayName(addonId)} Development Kit
|
|
220
|
+
`}function N(e){return`# ${P(e)} Development Kit
|
|
380
221
|
|
|
381
|
-
This workspace develops \`${
|
|
222
|
+
This workspace develops \`${e}\` against the license-free JChat developer sandbox without
|
|
382
223
|
including JChat Core source.
|
|
383
224
|
|
|
384
225
|
## Start
|
|
@@ -402,10 +243,4 @@ Open \`http://127.0.0.1:4317\`. The HTTP fixture recorder is available at
|
|
|
402
243
|
|
|
403
244
|
The referenced JChat packages and sandbox image must be published before this standalone kit can
|
|
404
245
|
install or start outside the JChat repository.
|
|
405
|
-
|
|
406
|
-
}
|
|
407
|
-
function toDisplayName(addonId) {
|
|
408
|
-
return addonId.split("-").map((part) => `${part[0]?.toUpperCase() ?? ""}${part.slice(1)}`).join(" ");
|
|
409
|
-
}
|
|
410
|
-
//#endregion
|
|
411
|
-
export { writeStandaloneDevkit as n, createStandaloneDevkitFiles as t };
|
|
246
|
+
`}function P(e){return e.split(`-`).map(e=>`${e[0]?.toUpperCase()??``}${e.slice(1)}`).join(` `)}export{s as i,o as n,a as r,i as t};
|
package/dist/index.d.mts
CHANGED
|
@@ -6,7 +6,21 @@ interface StandaloneDevkitOptions {
|
|
|
6
6
|
addonSdkVersion: string;
|
|
7
7
|
sandboxImage?: string;
|
|
8
8
|
}
|
|
9
|
+
interface AddonWorkspaceOptions {
|
|
10
|
+
addonId: string;
|
|
11
|
+
targetDir: string;
|
|
12
|
+
isMonorepoWorkspace?: boolean;
|
|
13
|
+
jchatVersion?: string;
|
|
14
|
+
addonSdkVersion?: string;
|
|
15
|
+
}
|
|
16
|
+
declare function createAddonFiles(options: {
|
|
17
|
+
addonId: string;
|
|
18
|
+
isMonorepoWorkspace?: boolean;
|
|
19
|
+
jchatVersion?: string;
|
|
20
|
+
addonSdkVersion?: string;
|
|
21
|
+
}): Readonly<Record<string, string>>;
|
|
22
|
+
declare function writeAddonWorkspace(options: AddonWorkspaceOptions): Promise<void>;
|
|
9
23
|
declare function createStandaloneDevkitFiles(options: StandaloneDevkitOptions): Readonly<Record<string, string>>;
|
|
10
|
-
declare function writeStandaloneDevkit(options: StandaloneDevkitOptions): void
|
|
24
|
+
declare function writeStandaloneDevkit(options: StandaloneDevkitOptions): Promise<void>;
|
|
11
25
|
//#endregion
|
|
12
|
-
export { type StandaloneDevkitOptions, createStandaloneDevkitFiles, writeStandaloneDevkit };
|
|
26
|
+
export { type AddonWorkspaceOptions, type StandaloneDevkitOptions, createAddonFiles, createStandaloneDevkitFiles, writeAddonWorkspace, writeStandaloneDevkit };
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { createStandaloneDevkitFiles, writeStandaloneDevkit };
|
|
1
|
+
import{i as e,n as t,r as n,t as r}from"./generator.mjs";export{r as createAddonFiles,t as createStandaloneDevkitFiles,n as writeAddonWorkspace,e as writeStandaloneDevkit};
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jchat/create-addon",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.8",
|
|
4
4
|
"private": false,
|
|
5
|
+
"description": "Command line tool for jchat addon creation.",
|
|
5
6
|
"keywords": [
|
|
6
7
|
"addon",
|
|
7
8
|
"chat",
|
|
@@ -11,7 +12,7 @@
|
|
|
11
12
|
"plugin",
|
|
12
13
|
"scaffold"
|
|
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",
|
|
@@ -39,6 +40,7 @@
|
|
|
39
40
|
},
|
|
40
41
|
"scripts": {
|
|
41
42
|
"build": "tsdown",
|
|
43
|
+
"test": "bun test",
|
|
42
44
|
"lint": "oxlint .",
|
|
43
45
|
"format": "oxfmt . --write",
|
|
44
46
|
"typecheck": "tsc --noEmit",
|
|
@@ -46,12 +48,11 @@
|
|
|
46
48
|
},
|
|
47
49
|
"devDependencies": {
|
|
48
50
|
"@jchat/addon-sdk": "workspace:*",
|
|
49
|
-
"@types/
|
|
50
|
-
"bun-types": "catalog:",
|
|
51
|
+
"@types/bun": "catalog:",
|
|
51
52
|
"tsdown": "^0.22.14"
|
|
52
53
|
},
|
|
53
54
|
"engines": {
|
|
54
|
-
"bun": ">=1.
|
|
55
|
+
"bun": ">=1.4.0"
|
|
55
56
|
},
|
|
56
57
|
"jchat": {
|
|
57
58
|
"sandboxImage": "ghcr.io/mjjabarullah/jchat-sandbox"
|