@zhama/tego-plugin-sdk 1.36.2 → 1.37.0
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/agent/RULES.md +123 -0
- package/agent/guides/access.md +39 -0
- package/agent/guides/backend.md +76 -0
- package/agent/guides/claw.md +18 -0
- package/agent/guides/desktop-web.md +48 -0
- package/agent/guides/frontend.md +83 -0
- package/agent/guides/host-api-versions.md +34 -0
- package/agent/guides/i18n.md +17 -0
- package/agent/guides/manifest.md +26 -0
- package/agent/guides/migrations.md +17 -0
- package/agent/guides/storage.md +18 -0
- package/agent/guides/testing.md +17 -0
- package/agent/guides/ui.md +22 -0
- package/agent/reference/plugin-sdk-api.md +561 -0
- package/bin/tego-plugin-pack.mjs +1 -1
- package/bin/tego-plugin.mjs +4 -2
- package/dist/chunk-2NTAWYCG.js +1 -0
- package/dist/chunk-2P6UEAPV.cjs +1 -0
- package/dist/chunk-45Y4CR4R.cjs +1 -0
- package/dist/{chunk-PWSTCQRN.cjs → chunk-4LKRXDYY.cjs} +13 -12
- package/dist/{chunk-7XHF3YSK.js → chunk-56QOZQTY.js} +1 -1
- package/dist/{chunk-C2OCOPZQ.cjs → chunk-6HNG5OZI.cjs} +1 -1
- package/dist/{chunk-2ORO36BY.js → chunk-DEGQDJF6.js} +1 -1
- package/dist/chunk-EIVA5BR6.js +1 -0
- package/dist/{chunk-P2Q2AKWP.js → chunk-FCYAAOHC.js} +17 -16
- package/dist/chunk-HZ4YWRYX.cjs +5 -0
- package/dist/chunk-I5Z3ECC4.js +5 -0
- package/dist/chunk-INCA3GFW.js +1 -0
- package/dist/chunk-IVJECPGG.js +1 -0
- package/dist/{chunk-KMN5RHLX.cjs → chunk-MWMGJJ74.cjs} +1 -1
- package/dist/chunk-N4SXZZPY.cjs +1 -0
- package/dist/chunk-SKNPNPJP.cjs +1 -0
- package/dist/dev.cjs +88 -5
- package/dist/dev.d.cts +37 -1
- package/dist/dev.d.ts +37 -1
- package/dist/dev.js +91 -8
- package/dist/doctor.cjs +8 -0
- package/dist/doctor.d.cts +62 -0
- package/dist/doctor.d.ts +62 -0
- package/dist/doctor.js +8 -0
- package/dist/frontend.d.cts +33 -1
- package/dist/frontend.d.ts +33 -1
- package/dist/hono.cjs +1 -0
- package/dist/hono.d.cts +84 -0
- package/dist/hono.d.ts +84 -0
- package/dist/hono.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +1 -1
- package/dist/manifest.cjs +1 -1
- package/dist/manifest.d.cts +55 -2
- package/dist/manifest.d.ts +55 -2
- package/dist/manifest.js +1 -1
- package/dist/migrations-sync.cjs +1 -0
- package/dist/migrations-sync.d.cts +20 -0
- package/dist/migrations-sync.d.ts +20 -0
- package/dist/migrations-sync.js +1 -0
- package/dist/pack.cjs +1 -1
- package/dist/pack.d.cts +5 -0
- package/dist/pack.d.ts +5 -0
- package/dist/pack.js +1 -1
- package/dist/publish.cjs +1 -1
- package/dist/publish.js +1 -1
- package/dist/react.cjs +1 -0
- package/dist/react.d.cts +101 -0
- package/dist/react.d.ts +101 -0
- package/dist/react.js +1 -0
- package/dist/scaffold.cjs +671 -17
- package/dist/scaffold.d.cts +42 -18
- package/dist/scaffold.d.ts +42 -18
- package/dist/scaffold.js +673 -19
- package/dist/server-runtime.cjs +1 -1
- package/dist/server-runtime.d.cts +27 -2
- package/dist/server-runtime.d.ts +27 -2
- package/dist/server-runtime.js +1 -1
- package/dist/testing.cjs +6 -2
- package/dist/testing.d.cts +19 -1
- package/dist/testing.d.ts +19 -1
- package/dist/testing.js +6 -2
- package/dist/verify-FF2RD2MV.cjs +1 -0
- package/dist/verify-W7ZTUCO4.js +1 -0
- package/dist/vite.cjs +1 -1
- package/dist/vite.d.cts +27 -1
- package/dist/vite.d.ts +27 -1
- package/dist/vite.js +1 -1
- package/package.json +31 -3
- package/dist/chunk-3WA3M347.cjs +0 -1
- package/dist/chunk-5CU33JVY.js +0 -1
- package/dist/chunk-7K37PVGV.js +0 -5
- package/dist/chunk-BTHXQWHT.js +0 -1
- package/dist/chunk-ROFUQLOZ.cjs +0 -1
- package/dist/chunk-W7C357A6.cjs +0 -5
package/dist/scaffold.d.cts
CHANGED
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The files a new plugin starts with (`pnpm plugin:new` in this repository,
|
|
3
|
-
* `tego-plugin create` anywhere else), as pure data.
|
|
4
|
-
*
|
|
5
|
-
* Kept apart from the interactive generator (`turbo/generators/config.ts`) so
|
|
6
|
-
* the same builder can be exercised without a TTY: a test — or a one-off
|
|
7
|
-
* script — calls `buildPluginFiles(answers)` and asserts on the tree, where the
|
|
8
|
-
* interactive generator can only be driven by a real terminal.
|
|
9
|
-
*
|
|
10
|
-
* Everything here is faithful to what the upload validator (`@tego/plugin-sdk`
|
|
11
|
-
* manifest schema + the server's `prepare-plugin-package`) accepts, because a
|
|
12
|
-
* scaffold that produces a package the platform then rejects is worse than no
|
|
13
|
-
* scaffold: the author learns the rules by hitting them one at a time.
|
|
14
|
-
*/
|
|
15
1
|
type PluginPart = 'frontend' | 'backend' | 'claw';
|
|
16
2
|
interface PluginAnswers {
|
|
17
3
|
/** kebab-case id, e.g. `tego-notes`. */
|
|
@@ -25,7 +11,17 @@ interface PluginAnswers {
|
|
|
25
11
|
scope: 'avatar' | 'tenant';
|
|
26
12
|
/** Caret range for the current host, e.g. `^1.5.0`. */
|
|
27
13
|
hostApiRange: string;
|
|
14
|
+
/**
|
|
15
|
+
* `standard` (what `tego-plugin create` writes): the patterns the mature
|
|
16
|
+
* plugins use — access catalog with one policy per route, Tailwind scoping,
|
|
17
|
+
* API errors with codes, an error boundary, live updates, locale and route
|
|
18
|
+
* tests. `minimal`: one page and one route, for starting from nothing.
|
|
19
|
+
* Omitted means `minimal`, so existing callers keep their output.
|
|
20
|
+
*/
|
|
21
|
+
template?: PluginTemplate;
|
|
28
22
|
}
|
|
23
|
+
type PluginTemplate = 'standard' | 'minimal';
|
|
24
|
+
declare const PLUGIN_TEMPLATES: readonly PluginTemplate[];
|
|
29
25
|
/**
|
|
30
26
|
* Where the SDK packages come from.
|
|
31
27
|
*
|
|
@@ -45,6 +41,27 @@ interface BuildPluginFilesOptions {
|
|
|
45
41
|
* `plugin-files.test.ts` fails if the two disagree.
|
|
46
42
|
*/
|
|
47
43
|
declare const PUBLISHED_SDK_PACKAGES: Record<string, string>;
|
|
44
|
+
/**
|
|
45
|
+
* The repository's Prettier settings (root `.prettierrc`), which the lint
|
|
46
|
+
* config enforces through `prettier/prettier`. A standalone
|
|
47
|
+
* repository has no root to inherit them from. The Tailwind class-sorting
|
|
48
|
+
* plugin is left out: it is one more dependency, and only reorders classes.
|
|
49
|
+
*/
|
|
50
|
+
declare const STANDALONE_PRETTIER: {
|
|
51
|
+
readonly semi: true;
|
|
52
|
+
readonly trailingComma: "es5";
|
|
53
|
+
readonly singleQuote: true;
|
|
54
|
+
readonly printWidth: 80;
|
|
55
|
+
readonly tabWidth: 2;
|
|
56
|
+
readonly useTabs: false;
|
|
57
|
+
readonly bracketSpacing: true;
|
|
58
|
+
readonly bracketSameLine: false;
|
|
59
|
+
readonly arrowParens: "avoid";
|
|
60
|
+
readonly endOfLine: "lf";
|
|
61
|
+
readonly quoteProps: "as-needed";
|
|
62
|
+
readonly jsxSingleQuote: true;
|
|
63
|
+
readonly proseWrap: "preserve";
|
|
64
|
+
};
|
|
48
65
|
/**
|
|
49
66
|
* The TypeScript presets of `@tego/tsconfig` (packages/tsconfig), copied into a
|
|
50
67
|
* standalone plugin's root instead of published as a package: they only drive
|
|
@@ -158,10 +175,17 @@ declare function writePlugin(repoRoot: string, answers: PluginAnswers): {
|
|
|
158
175
|
* packages come from npm instead of this workspace. Same refusal rule as
|
|
159
176
|
* {@link writePlugin}.
|
|
160
177
|
*/
|
|
161
|
-
declare function writeStandalonePlugin(parentDirectory: string, answers: PluginAnswers): {
|
|
178
|
+
declare function writeStandalonePlugin(parentDirectory: string, answers: PluginAnswers): Promise<{
|
|
162
179
|
directory: string;
|
|
163
180
|
files: string[];
|
|
164
|
-
}
|
|
181
|
+
}>;
|
|
182
|
+
/**
|
|
183
|
+
* The files as Prettier writes them with the plugin's own settings, so a new
|
|
184
|
+
* plugin passes its `lint` gate (which enforces Prettier) from the first run.
|
|
185
|
+
* Done here rather than in the templates: where Prettier breaks a line depends
|
|
186
|
+
* on the plugin id's length.
|
|
187
|
+
*/
|
|
188
|
+
declare function formatPluginFiles(files: GeneratedFile[]): Promise<GeneratedFile[]>;
|
|
165
189
|
/** What `tego-plugin create` prints on success. */
|
|
166
190
|
interface CreatePluginResult {
|
|
167
191
|
directory: string;
|
|
@@ -177,6 +201,6 @@ interface CreatePluginResult {
|
|
|
177
201
|
declare function createStandalonePlugin(input: string, options: {
|
|
178
202
|
parent: string;
|
|
179
203
|
cwd: string;
|
|
180
|
-
}): CreatePluginResult
|
|
204
|
+
}): Promise<CreatePluginResult>;
|
|
181
205
|
|
|
182
|
-
export { type BuildPluginFilesOptions, type CreatePluginResult, type DependencySource, type GeneratedFile, PLUGIN_ID_HINT, PLUGIN_ID_PATTERN, PLUGIN_PARTS, PLUGIN_SCOPES, PUBLISHED_SDK_PACKAGES, type PluginAnswers, type PluginPart, STANDALONE_TSCONFIG_FILES, buildPluginFiles, createStandalonePlugin, packageNameFor, validatePluginAnswers, writePlugin, writeStandalonePlugin };
|
|
206
|
+
export { type BuildPluginFilesOptions, type CreatePluginResult, type DependencySource, type GeneratedFile, PLUGIN_ID_HINT, PLUGIN_ID_PATTERN, PLUGIN_PARTS, PLUGIN_SCOPES, PLUGIN_TEMPLATES, PUBLISHED_SDK_PACKAGES, type PluginAnswers, type PluginPart, type PluginTemplate, STANDALONE_PRETTIER, STANDALONE_TSCONFIG_FILES, buildPluginFiles, createStandalonePlugin, formatPluginFiles, packageNameFor, validatePluginAnswers, writePlugin, writeStandalonePlugin };
|
package/dist/scaffold.d.ts
CHANGED
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The files a new plugin starts with (`pnpm plugin:new` in this repository,
|
|
3
|
-
* `tego-plugin create` anywhere else), as pure data.
|
|
4
|
-
*
|
|
5
|
-
* Kept apart from the interactive generator (`turbo/generators/config.ts`) so
|
|
6
|
-
* the same builder can be exercised without a TTY: a test — or a one-off
|
|
7
|
-
* script — calls `buildPluginFiles(answers)` and asserts on the tree, where the
|
|
8
|
-
* interactive generator can only be driven by a real terminal.
|
|
9
|
-
*
|
|
10
|
-
* Everything here is faithful to what the upload validator (`@tego/plugin-sdk`
|
|
11
|
-
* manifest schema + the server's `prepare-plugin-package`) accepts, because a
|
|
12
|
-
* scaffold that produces a package the platform then rejects is worse than no
|
|
13
|
-
* scaffold: the author learns the rules by hitting them one at a time.
|
|
14
|
-
*/
|
|
15
1
|
type PluginPart = 'frontend' | 'backend' | 'claw';
|
|
16
2
|
interface PluginAnswers {
|
|
17
3
|
/** kebab-case id, e.g. `tego-notes`. */
|
|
@@ -25,7 +11,17 @@ interface PluginAnswers {
|
|
|
25
11
|
scope: 'avatar' | 'tenant';
|
|
26
12
|
/** Caret range for the current host, e.g. `^1.5.0`. */
|
|
27
13
|
hostApiRange: string;
|
|
14
|
+
/**
|
|
15
|
+
* `standard` (what `tego-plugin create` writes): the patterns the mature
|
|
16
|
+
* plugins use — access catalog with one policy per route, Tailwind scoping,
|
|
17
|
+
* API errors with codes, an error boundary, live updates, locale and route
|
|
18
|
+
* tests. `minimal`: one page and one route, for starting from nothing.
|
|
19
|
+
* Omitted means `minimal`, so existing callers keep their output.
|
|
20
|
+
*/
|
|
21
|
+
template?: PluginTemplate;
|
|
28
22
|
}
|
|
23
|
+
type PluginTemplate = 'standard' | 'minimal';
|
|
24
|
+
declare const PLUGIN_TEMPLATES: readonly PluginTemplate[];
|
|
29
25
|
/**
|
|
30
26
|
* Where the SDK packages come from.
|
|
31
27
|
*
|
|
@@ -45,6 +41,27 @@ interface BuildPluginFilesOptions {
|
|
|
45
41
|
* `plugin-files.test.ts` fails if the two disagree.
|
|
46
42
|
*/
|
|
47
43
|
declare const PUBLISHED_SDK_PACKAGES: Record<string, string>;
|
|
44
|
+
/**
|
|
45
|
+
* The repository's Prettier settings (root `.prettierrc`), which the lint
|
|
46
|
+
* config enforces through `prettier/prettier`. A standalone
|
|
47
|
+
* repository has no root to inherit them from. The Tailwind class-sorting
|
|
48
|
+
* plugin is left out: it is one more dependency, and only reorders classes.
|
|
49
|
+
*/
|
|
50
|
+
declare const STANDALONE_PRETTIER: {
|
|
51
|
+
readonly semi: true;
|
|
52
|
+
readonly trailingComma: "es5";
|
|
53
|
+
readonly singleQuote: true;
|
|
54
|
+
readonly printWidth: 80;
|
|
55
|
+
readonly tabWidth: 2;
|
|
56
|
+
readonly useTabs: false;
|
|
57
|
+
readonly bracketSpacing: true;
|
|
58
|
+
readonly bracketSameLine: false;
|
|
59
|
+
readonly arrowParens: "avoid";
|
|
60
|
+
readonly endOfLine: "lf";
|
|
61
|
+
readonly quoteProps: "as-needed";
|
|
62
|
+
readonly jsxSingleQuote: true;
|
|
63
|
+
readonly proseWrap: "preserve";
|
|
64
|
+
};
|
|
48
65
|
/**
|
|
49
66
|
* The TypeScript presets of `@tego/tsconfig` (packages/tsconfig), copied into a
|
|
50
67
|
* standalone plugin's root instead of published as a package: they only drive
|
|
@@ -158,10 +175,17 @@ declare function writePlugin(repoRoot: string, answers: PluginAnswers): {
|
|
|
158
175
|
* packages come from npm instead of this workspace. Same refusal rule as
|
|
159
176
|
* {@link writePlugin}.
|
|
160
177
|
*/
|
|
161
|
-
declare function writeStandalonePlugin(parentDirectory: string, answers: PluginAnswers): {
|
|
178
|
+
declare function writeStandalonePlugin(parentDirectory: string, answers: PluginAnswers): Promise<{
|
|
162
179
|
directory: string;
|
|
163
180
|
files: string[];
|
|
164
|
-
}
|
|
181
|
+
}>;
|
|
182
|
+
/**
|
|
183
|
+
* The files as Prettier writes them with the plugin's own settings, so a new
|
|
184
|
+
* plugin passes its `lint` gate (which enforces Prettier) from the first run.
|
|
185
|
+
* Done here rather than in the templates: where Prettier breaks a line depends
|
|
186
|
+
* on the plugin id's length.
|
|
187
|
+
*/
|
|
188
|
+
declare function formatPluginFiles(files: GeneratedFile[]): Promise<GeneratedFile[]>;
|
|
165
189
|
/** What `tego-plugin create` prints on success. */
|
|
166
190
|
interface CreatePluginResult {
|
|
167
191
|
directory: string;
|
|
@@ -177,6 +201,6 @@ interface CreatePluginResult {
|
|
|
177
201
|
declare function createStandalonePlugin(input: string, options: {
|
|
178
202
|
parent: string;
|
|
179
203
|
cwd: string;
|
|
180
|
-
}): CreatePluginResult
|
|
204
|
+
}): Promise<CreatePluginResult>;
|
|
181
205
|
|
|
182
|
-
export { type BuildPluginFilesOptions, type CreatePluginResult, type DependencySource, type GeneratedFile, PLUGIN_ID_HINT, PLUGIN_ID_PATTERN, PLUGIN_PARTS, PLUGIN_SCOPES, PUBLISHED_SDK_PACKAGES, type PluginAnswers, type PluginPart, STANDALONE_TSCONFIG_FILES, buildPluginFiles, createStandalonePlugin, packageNameFor, validatePluginAnswers, writePlugin, writeStandalonePlugin };
|
|
206
|
+
export { type BuildPluginFilesOptions, type CreatePluginResult, type DependencySource, type GeneratedFile, PLUGIN_ID_HINT, PLUGIN_ID_PATTERN, PLUGIN_PARTS, PLUGIN_SCOPES, PLUGIN_TEMPLATES, PUBLISHED_SDK_PACKAGES, type PluginAnswers, type PluginPart, type PluginTemplate, STANDALONE_PRETTIER, STANDALONE_TSCONFIG_FILES, buildPluginFiles, createStandalonePlugin, formatPluginFiles, packageNameFor, validatePluginAnswers, writePlugin, writeStandalonePlugin };
|