diff --git a/package-lock.json b/package-lock.json index f8fec7311..76ad8760e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15058,7 +15058,7 @@ }, "packages/plugin-sdk": { "name": "@termix-ssh/plugin-sdk", - "version": "1.0.9", + "version": "1.0.10", "license": "Apache-2.0", "dependencies": { "@deadendjs/swagger-jsdoc": "^8.1.2", diff --git a/packages/plugin-sdk/CHANGELOG.md b/packages/plugin-sdk/CHANGELOG.md index c43f64552..8ef1c7ed5 100644 --- a/packages/plugin-sdk/CHANGELOG.md +++ b/packages/plugin-sdk/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 1.0.10 + +### Changed + +- `termix-plugin pack` includes the plugin's `LICENSE` and `NOTICE` files, so third-party notices ship with it + ## 1.0.9 ### Added diff --git a/packages/plugin-sdk/PLUGIN-GUIDE.md b/packages/plugin-sdk/PLUGIN-GUIDE.md index 9c87ac136..4bcd861d6 100644 --- a/packages/plugin-sdk/PLUGIN-GUIDE.md +++ b/packages/plugin-sdk/PLUGIN-GUIDE.md @@ -1,6 +1,6 @@ # Termix plugin guide -SDK 1.0.9 | Plugin API 1.2.0 +SDK 1.0.10 | Plugin API 1.2.0 This guide is for anyone, person or AI coding tool, building a Termix plugin. It ships inside `@termix-ssh/plugin-sdk`, so the copy in your `node_modules` always matches the SDK you have installed. @@ -90,7 +90,7 @@ npm test # termix-plugin test: Vitest npm run typecheck # tsc npm run validate # termix-plugin validate: manifest, files, migrations, changelog, docs npm run migrations # termix-plugin migrations: write migrations after changing tables.ts -npm run pack # termix-plugin pack: write -.tmxplug +npm run pack # termix-plugin pack: write -.tmxplug (with LICENSE and NOTICE) npm run format # Prettier npm run format:check ``` diff --git a/packages/plugin-sdk/cli/lib/tmxplug.mjs b/packages/plugin-sdk/cli/lib/tmxplug.mjs index d44d44fc6..6c14d4fdc 100644 --- a/packages/plugin-sdk/cli/lib/tmxplug.mjs +++ b/packages/plugin-sdk/cli/lib/tmxplug.mjs @@ -11,6 +11,9 @@ export const TMXPLUG_CONTENTS = [ "README.md", "CHANGELOG.md", "icon.svg", + // Licence texts, so third-party notices travel with the plugin. + "LICENSE", + "NOTICE", ]; const BLOCK = 512; diff --git a/packages/plugin-sdk/package.json b/packages/plugin-sdk/package.json index 80be2f786..d3475798c 100644 --- a/packages/plugin-sdk/package.json +++ b/packages/plugin-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@termix-ssh/plugin-sdk", - "version": "1.0.9", + "version": "1.0.10", "description": "The contract between Termix core and a plugin: types, the capability catalog and the manifest schema.", "license": "Apache-2.0", "repository": { diff --git a/scripts/plugin-pack.test.ts b/scripts/plugin-pack.test.ts index b782aaef2..3d975a0f1 100644 --- a/scripts/plugin-pack.test.ts +++ b/scripts/plugin-pack.test.ts @@ -46,6 +46,8 @@ function fixturePlugin(manifest: Record = {}): string { writeFile(dir, "migrations/mysql/0001_init.sql", "SELECT 1;\n"); writeFile(dir, "README.md", "# Fixture\n"); writeFile(dir, "icon.svg", "\n"); + writeFile(dir, "LICENSE", "Apache-2.0\n"); + writeFile(dir, "NOTICE", "Third-party notices\n"); writeFile(dir, "src/backend/index.ts", "left out of the archive\n"); return dir; } @@ -91,6 +93,8 @@ describe("termix-plugin pack", () => { const names = await entries(file); expect(names).toEqual([ + "LICENSE", + "NOTICE", "README.md", "dist/backend.js", "dist/frontend.js",