feat(FN-3907): add fusion-plugin-cli-printing-press plugin scaffold
Restores and stabilizes a new `fusion-plugin-cli-printing-press` plugin scaffold, including the plugin manifest, TypeScript configuration, source entry point, and test suite, with vitest aliases added in a follow-up fix. Fusion-Task-Id: FN-3907
This commit is contained in:
9
plugins/fusion-plugin-cli-printing-press/README.md
Normal file
9
plugins/fusion-plugin-cli-printing-press/README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# fusion-plugin-cli-printing-press
|
||||
|
||||
Bundled first-party Fusion plugin integrating [cli-printing-press](https://github.com/mvanhorn/cli-printing-press) for generating and managing CLIs for external services.
|
||||
|
||||
## Status
|
||||
|
||||
v1 design: see `docs/design/cli-printing-press-plugin.md`.
|
||||
|
||||
Implementation forthcoming in FN-3763 through FN-3770. This directory currently contains a no-op plugin stub that registers with the Fusion plugin system and passes manifest validation.
|
||||
6
plugins/fusion-plugin-cli-printing-press/manifest.json
Normal file
6
plugins/fusion-plugin-cli-printing-press/manifest.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"id": "fusion-plugin-cli-printing-press",
|
||||
"name": "CLI Printing Press",
|
||||
"version": "0.1.0",
|
||||
"description": "Generate and manage CLIs for external services using cli-printing-press"
|
||||
}
|
||||
26
plugins/fusion-plugin-cli-printing-press/package.json
Normal file
26
plugins/fusion-plugin-cli-printing-press/package.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "@fusion-plugin-examples/cli-printing-press",
|
||||
"version": "0.1.0",
|
||||
"type": "module",
|
||||
"description": "CLI Printing Press plugin package for Fusion",
|
||||
"private": true,
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./src/index.ts",
|
||||
"import": "./src/index.ts"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"test": "vitest run --silent=passed-only --reporter=dot"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fusion/core": "workspace:*",
|
||||
"@fusion/plugin-sdk": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^25.5.2",
|
||||
"typescript": "^5.7.0",
|
||||
"vitest": "^3.2.4"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { validatePluginManifest } from "@fusion/core";
|
||||
import plugin from "../index.js";
|
||||
import manifestJson from "../../manifest.json" with { type: "json" };
|
||||
|
||||
describe("cli-printing-press plugin stub (FN-3762)", () => {
|
||||
it("registers with the correct manifest id", () => {
|
||||
expect(plugin.manifest.id).toBe("fusion-plugin-cli-printing-press");
|
||||
});
|
||||
|
||||
it("passes manifest validation", () => {
|
||||
const validation = validatePluginManifest(manifestJson);
|
||||
expect(validation.valid).toBe(true);
|
||||
});
|
||||
|
||||
it("has no routes or dashboardViews in the stub", () => {
|
||||
expect(plugin.routes).toBeUndefined();
|
||||
expect(plugin.dashboardViews).toBeUndefined();
|
||||
});
|
||||
});
|
||||
14
plugins/fusion-plugin-cli-printing-press/src/index.ts
Normal file
14
plugins/fusion-plugin-cli-printing-press/src/index.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { definePlugin } from "@fusion/plugin-sdk";
|
||||
|
||||
const plugin = definePlugin({
|
||||
manifest: {
|
||||
id: "fusion-plugin-cli-printing-press",
|
||||
name: "CLI Printing Press",
|
||||
version: "0.1.0",
|
||||
description: "Generate and manage CLIs for external services using cli-printing-press",
|
||||
},
|
||||
state: "installed",
|
||||
hooks: {},
|
||||
});
|
||||
|
||||
export default plugin;
|
||||
9
plugins/fusion-plugin-cli-printing-press/tsconfig.json
Normal file
9
plugins/fusion-plugin-cli-printing-press/tsconfig.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "dist",
|
||||
"rootDir": "src"
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/**/*.tsx"],
|
||||
"exclude": ["src/**/*.test.ts", "src/**/__tests__/**"]
|
||||
}
|
||||
26
plugins/fusion-plugin-cli-printing-press/vitest.config.ts
Normal file
26
plugins/fusion-plugin-cli-printing-press/vitest.config.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { defineConfig } from "vitest/config";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { computeMaxWorkers } from "../../packages/core/src/__test-utils__/vitest-workers";
|
||||
|
||||
const maxWorkers = computeMaxWorkers();
|
||||
|
||||
export default defineConfig({
|
||||
resolve: {
|
||||
alias: [
|
||||
{ find: "@fusion/core", replacement: fileURLToPath(new URL("../../packages/core/src/index.ts", import.meta.url)) },
|
||||
{
|
||||
find: "@fusion/plugin-sdk",
|
||||
replacement: fileURLToPath(new URL("../../packages/plugin-sdk/src/index.ts", import.meta.url)),
|
||||
},
|
||||
],
|
||||
},
|
||||
test: {
|
||||
include: ["src/**/*.test.{ts,tsx}"],
|
||||
environment: "node",
|
||||
setupFiles: [fileURLToPath(new URL("../../packages/core/src/__test-utils__/vitest-setup.ts", import.meta.url))],
|
||||
globalSetup: [fileURLToPath(new URL("../../packages/core/src/__test-utils__/vitest-teardown.ts", import.meta.url))],
|
||||
pool: "threads",
|
||||
maxWorkers,
|
||||
poolOptions: { threads: { minThreads: 1, maxThreads: maxWorkers }, forks: { minForks: 1, maxForks: maxWorkers } },
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user