ampless 1.0.0-alpha.38 → 1.0.0-alpha.40
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/dist/index.d.ts
CHANGED
|
@@ -973,7 +973,13 @@ interface PluginSettingsManifest {
|
|
|
973
973
|
}
|
|
974
974
|
interface AmplessPlugin {
|
|
975
975
|
name: string;
|
|
976
|
-
/**
|
|
976
|
+
/**
|
|
977
|
+
* Plugin API version. Currently `1` is the only supported value.
|
|
978
|
+
* `apiVersion` is the breaking-change marker on the plugin contract;
|
|
979
|
+
* additive changes (new optional fields, new reserved capabilities)
|
|
980
|
+
* stay within `apiVersion: 1`. See the apiVersion bump policy in
|
|
981
|
+
* `docs/architecture/08-plugin-architecture.md` for the full criteria.
|
|
982
|
+
*/
|
|
977
983
|
apiVersion: 1;
|
|
978
984
|
/**
|
|
979
985
|
* Optional npm package name (e.g. `'@scope/ampless-plugin-foo'` or
|
|
@@ -172,7 +172,7 @@ export default defineConfig({
|
|
|
172
172
|
interface AmplessPlugin {
|
|
173
173
|
name: string // パッケージ風の識別子。例: 'analytics-ga4'
|
|
174
174
|
packageName?: string // インストール時のクロスチェック用 npm パッケージ名
|
|
175
|
-
apiVersion: 1 //
|
|
175
|
+
apiVersion: 1 // 現状唯一の有効値
|
|
176
176
|
trust_level: 'untrusted' | 'trusted' | 'privileged'
|
|
177
177
|
instanceId?: string // 複数インストール時の namespace
|
|
178
178
|
displayName?: LocalizedString // admin UI ラベル
|
|
@@ -201,6 +201,12 @@ interface AmplessPlugin {
|
|
|
201
201
|
|
|
202
202
|
今日は 1 のみ。将来の互換性破壊バージョンが出たらこの数字が bump され、runtime は未知の値を黙って bind せず拒否します。
|
|
203
203
|
|
|
204
|
+
**現状唯一の有効値は `apiVersion: 1` です。** literal type は他の値を compile-time に拒否し、`package.json#amplessPlugin.apiVersion` が `definePlugin()` の戻り値と異なる場合、または runtime の `SUPPORTED_API_VERSION` を超える場合、runtime は hard-throw します。
|
|
205
|
+
|
|
206
|
+
Phase 1 の compat-break reservation すべて(PR #220、#222、#230、#232、#234)は `apiVersion: 1` 内に収まります。これらをプラグインで declare するかどうかは契約バージョンに影響しません。
|
|
207
|
+
|
|
208
|
+
将来 `apiVersion: 2` が導入される場合は、changeset とこのガイドおよび architecture doc のセクション更新を通じてアナウンスされます。それまでは、**`apiVersion: 1` でプラグインを publish し、唯一の有効値として扱ってください**。v2 bump の trigger となるもの(ならないもの)の全基準については、architecture doc の [apiVersion bump policy](https://github.com/heavymoons/ampless/blob/main/docs/architecture/08-plugin-architecture.md#apiversion-bump-policy) セクションを参照してください。
|
|
209
|
+
|
|
204
210
|
### `instanceId`
|
|
205
211
|
|
|
206
212
|
optional、デフォルトは `name`。同じプラグインを 1 サイトで複数 instance 動かせる作り (例: 2 つの GA4 measurement ID、チャットプラットフォーム毎の webhook) では、ホストに `instanceId` を指定させて各々独立した namespace を持たせる:
|
|
@@ -1218,7 +1224,7 @@ it('admin が空文字保存した場合は空配列', () => {
|
|
|
1218
1224
|
|
|
1219
1225
|
- **パッケージ名**: `@your-scope/plugin-foo`。`@ampless/plugin-*` スコープは本モノレポから ship する公式プラグイン用に予約
|
|
1220
1226
|
- **エントリ**: ESM のみ、default export (factory) + 設定インターフェイス (ユーザの `cms.config.ts` から型付きで引数を渡せるように) を export
|
|
1221
|
-
- **`apiVersion`**:
|
|
1227
|
+
- **`apiVersion`**: 現状は `1` を declare してください — 唯一の有効値で、literal type が他の値を compile-time に reject します。`apiVersion` はプラグイン契約の **breaking-change marker** であって semver 風のチャンネルではありません。additive な追加 (optional field、reserved capability など) は `apiVersion: 1` 内に収まり、bump は不要です。詳細は architecture doc の [apiVersion bump policy](https://github.com/heavymoons/ampless/blob/main/docs/architecture/08-plugin-architecture.md#apiversion-bump-policy) を参照
|
|
1222
1228
|
- **Dist-tag**: ampless 自体が alpha のうちは `@alpha`。`@latest` は ampless v1.0 まで予約
|
|
1223
1229
|
|
|
1224
1230
|
参考実装:
|
|
@@ -1334,4 +1340,4 @@ export default defineConfig({
|
|
|
1334
1340
|
- ファーストパーティプラグインの bug → `heavymoons/ampless` にプラグインの package 名つきで issue
|
|
1335
1341
|
- プラグインランタイム / admin form の bug → 同じレポ、ラベル `area:plugins`
|
|
1336
1342
|
|
|
1337
|
-
ampless
|
|
1343
|
+
ampless レポは現在 alpha 期間中は非公開です。beta に進む (npm `beta` dist-tag、リポジトリ公開) と上記のリンクが GitHub URL に解決されます。現状でも同じ docs が package tarball 内の `node_modules/ampless/docs/` に同梱されているので、GitHub にアクセスせずローカルで読めます。
|
|
@@ -200,7 +200,7 @@ That's it. Restart `npm run dev`, view source on any page, and the
|
|
|
200
200
|
interface AmplessPlugin {
|
|
201
201
|
name: string // package-like identifier, e.g. 'analytics-ga4'
|
|
202
202
|
packageName?: string // npm package name for install-time cross-check
|
|
203
|
-
apiVersion: 1 //
|
|
203
|
+
apiVersion: 1 // the only valid value today
|
|
204
204
|
trust_level: 'untrusted' | 'trusted' | 'privileged'
|
|
205
205
|
instanceId?: string // namespace for multi-instance installs
|
|
206
206
|
displayName?: LocalizedString // admin UI label
|
|
@@ -234,6 +234,23 @@ There's only one version today. Future breaking-change versions will
|
|
|
234
234
|
bump this number; the runtime rejects unknown values rather than
|
|
235
235
|
silently mis-binding.
|
|
236
236
|
|
|
237
|
+
**Today only `apiVersion: 1` is valid.** The literal type accepts
|
|
238
|
+
no other value, and the runtime hard-throws if `package.json#amplessPlugin.apiVersion`
|
|
239
|
+
disagrees with what `definePlugin()` returns or exceeds the runtime's
|
|
240
|
+
`SUPPORTED_API_VERSION`.
|
|
241
|
+
|
|
242
|
+
All Phase 1 compat-break reservations (PRs #220, #222, #230, #232,
|
|
243
|
+
#234) live within `apiVersion: 1` — declaring or not declaring them
|
|
244
|
+
in your plugin does not affect the contract version.
|
|
245
|
+
|
|
246
|
+
If a future `apiVersion: 2` is ever introduced, it will be announced
|
|
247
|
+
through a changeset and a section update in this guide and the
|
|
248
|
+
architecture doc. Until then, **publish your plugin with
|
|
249
|
+
`apiVersion: 1` and treat it as the only valid value**. See the
|
|
250
|
+
[apiVersion bump policy](https://github.com/heavymoons/ampless/blob/main/docs/architecture/08-plugin-architecture.md#apiversion-bump-policy)
|
|
251
|
+
section in the architecture doc for the full criteria around what
|
|
252
|
+
would (and would not) trigger a v2 bump.
|
|
253
|
+
|
|
237
254
|
### `instanceId`
|
|
238
255
|
|
|
239
256
|
Optional, defaults to `name`. When you ship a plugin that can run
|
|
@@ -1641,9 +1658,14 @@ a normal npm package:
|
|
|
1641
1658
|
monorepo.
|
|
1642
1659
|
- **Entry**: ESM only, exports default (the factory) and the
|
|
1643
1660
|
config interface (for typed args in user `cms.config.ts`).
|
|
1644
|
-
- **`apiVersion`**:
|
|
1645
|
-
|
|
1646
|
-
|
|
1661
|
+
- **`apiVersion`**: declare `1` today — it is the only valid
|
|
1662
|
+
value, and the literal type rejects others at compile time.
|
|
1663
|
+
`apiVersion` is the breaking-change marker on the plugin
|
|
1664
|
+
contract, not a semver-style channel: additive changes (new
|
|
1665
|
+
optional fields, new reserved capabilities) stay within
|
|
1666
|
+
`apiVersion: 1` and do NOT require a bump. See the [apiVersion
|
|
1667
|
+
bump policy](https://github.com/heavymoons/ampless/blob/main/docs/architecture/08-plugin-architecture.md#apiversion-bump-policy)
|
|
1668
|
+
in the architecture doc for the full criteria.
|
|
1647
1669
|
- **Dist-tag**: `@alpha` while ampless itself is in alpha. The
|
|
1648
1670
|
`@latest` tag stays reserved until ampless v1.0.
|
|
1649
1671
|
|
|
@@ -1804,6 +1826,8 @@ PROTECTED), so the scaffolded code is safe across ampless upgrades.
|
|
|
1804
1826
|
- Bugs in the plugin runtime / admin form → same repo, label
|
|
1805
1827
|
`area:plugins`.
|
|
1806
1828
|
|
|
1807
|
-
The ampless repo
|
|
1808
|
-
|
|
1809
|
-
the
|
|
1829
|
+
The ampless repo is currently private during the alpha stage; the
|
|
1830
|
+
GitHub URLs above start resolving once beta ships (npm `beta`
|
|
1831
|
+
dist-tag, repo flips public). Today the same docs also live in the
|
|
1832
|
+
package tarball directly under `node_modules/ampless/docs/`, so
|
|
1833
|
+
you can read them locally without browsing GitHub.
|