@pantoken/scaffold 0.1.0 → 0.2.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/README.md +13 -4
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +48 -14
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -6,9 +6,11 @@ Scaffold a starter project — with [pantoken](https://www.npmjs.com/package/@pa
|
|
|
6
6
|
## Usage
|
|
7
7
|
|
|
8
8
|
```sh
|
|
9
|
-
npx @pantoken/scaffold
|
|
10
|
-
npx @pantoken/scaffold react
|
|
11
|
-
npx @pantoken/scaffold next
|
|
9
|
+
npx @pantoken/scaffold html # plain HTML/CSS (Vite + TS) + @pantoken/components
|
|
10
|
+
npx @pantoken/scaffold react # Vite + React + @pantoken/react
|
|
11
|
+
npx @pantoken/scaffold next # Next.js (App Router) + @pantoken/next
|
|
12
|
+
npx @pantoken/scaffold angular # Vite + Angular (standalone) + @pantoken/web-components
|
|
13
|
+
npx @pantoken/scaffold web-components # Vite + @pantoken/web-components (no framework)
|
|
12
14
|
|
|
13
15
|
# Target a directory other than the current one:
|
|
14
16
|
npx @pantoken/scaffold react --dir ./my-app
|
|
@@ -31,11 +33,18 @@ scaffoldProject("react", "./my-app");
|
|
|
31
33
|
`ScaffoldPlatform` into `dir` (defaults to `"."`). Its basename (or `"pantoken-app"` for `"."`)
|
|
32
34
|
is substituted for `{{projectName}}` in the template files. Returns the paths written.
|
|
33
35
|
- **`SCAFFOLD_PLATFORMS: readonly ScaffoldPlatform[]`** — every scaffoldable platform key.
|
|
34
|
-
- **`ScaffoldPlatform`** — the platform union: `"
|
|
36
|
+
- **`ScaffoldPlatform`** — the platform union: `"html"`, `"react"`, `"next"`, `"angular"`,
|
|
37
|
+
`"web-components"`.
|
|
35
38
|
|
|
36
39
|
`@pantoken/ai`'s `pantoken-ai scaffold <platform>` command wraps this package and additionally
|
|
37
40
|
installs pantoken's agent assets (AGENTS.md, editor/agent rules, skills) into the same directory.
|
|
38
41
|
|
|
42
|
+
Every scaffolded starter's entry markup follows the `wrapper` app-shell layout from
|
|
43
|
+
[`@pantoken/plugin-layouts`](https://www.npmjs.com/package/@pantoken/plugin-layouts) — the
|
|
44
|
+
container/header/content skeleton is generated at build time from that package's `wrapper.css`
|
|
45
|
+
cssdoc (`@part`/`@slot` tags), so every platform stays in sync automatically when the layout
|
|
46
|
+
changes. See `scripts/wrapper-layout.ts`.
|
|
47
|
+
|
|
39
48
|
## License
|
|
40
49
|
|
|
41
50
|
MIT
|
package/dist/index.d.mts
CHANGED
|
@@ -11,7 +11,7 @@ type ScaffoldPlatform = keyof typeof SCAFFOLDS;
|
|
|
11
11
|
* ```ts
|
|
12
12
|
* import { SCAFFOLD_PLATFORMS } from "@pantoken/scaffold";
|
|
13
13
|
*
|
|
14
|
-
* console.log(SCAFFOLD_PLATFORMS); // → ["
|
|
14
|
+
* console.log(SCAFFOLD_PLATFORMS); // → ["html", "react", "next", "angular", "web-components"]
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
17
|
declare const SCAFFOLD_PLATFORMS: readonly ScaffoldPlatform[];
|
package/dist/index.mjs
CHANGED
|
@@ -2,33 +2,67 @@ import { mkdirSync, writeFileSync } from "node:fs";
|
|
|
2
2
|
import { dirname, join } from "node:path";
|
|
3
3
|
//#region generated/scaffolds.ts
|
|
4
4
|
const SCAFFOLDS = {
|
|
5
|
+
"angular": {
|
|
6
|
+
".gitignore": "node_modules\ndist\n",
|
|
7
|
+
"README.md": "# {{projectName}}\n\nScaffolded with `pantoken-scaffold angular` (or `pantoken-ai scaffold angular`) — a standalone\nAngular app (via Vite + `@analogjs/vite-plugin-angular`, no Angular CLI) styled with\n[`@pantoken/components`](https://www.npmjs.com/package/@pantoken/components) and\n[`@pantoken/angular`](https://www.npmjs.com/package/@pantoken/angular) (pantoken custom elements\nfor Angular).\n\n## Develop\n\n```sh\nnpm install\nnpm run dev\n```\n\n## What's here\n\n- `src/main.ts` calls `registerPantokenElements()` (from `@pantoken/angular`) once at bootstrap so\n elements like `<instui-icon>` work in templates, and imports the token/component CSS plus\n `@pantoken/plugin-layouts/layouts.css`.\n- `src/app.component.ts` is a standalone component (`CUSTOM_ELEMENTS_SCHEMA` lets the template\n compiler accept pantoken's custom element tags) whose template follows the `wrapper` app-shell\n layout from `@pantoken/plugin-layouts` (`.container` / `.header` / `.content` parts).\n- Apply classes like `class=\"instui-button\"` to markup; see the\n [component reference](https://pantoken.iywahl.com/api/css) for the full class list.\n",
|
|
8
|
+
"index.html": "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>{{projectName}}</title>\n </head>\n <body class=\"instui-display-flex\">\n <app-root></app-root>\n <script type=\"module\" src=\"/src/main.ts\"><\/script>\n </body>\n</html>\n",
|
|
9
|
+
"package.json": "{\n \"name\": \"{{projectName}}\",\n \"version\": \"0.0.0\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vite\",\n \"build\": \"vite build\",\n \"preview\": \"vite preview\"\n },\n \"dependencies\": {\n \"@angular/common\": \"^19.0.0\",\n \"@angular/compiler\": \"^19.0.0\",\n \"@angular/core\": \"^19.0.0\",\n \"@angular/platform-browser\": \"^19.0.0\",\n \"@pantoken/angular\": \"latest\",\n \"@pantoken/plugin-layouts\": \"latest\",\n \"rxjs\": \"^7.8.0\",\n \"zone.js\": \"^0.15.0\"\n },\n \"devDependencies\": {\n \"@analogjs/vite-plugin-angular\": \"^1.10.0\",\n \"@pantoken/pantoken\": \"latest\",\n \"typescript\": \"^5.7.0\",\n \"vite\": \"^6.0.0\"\n }\n}\n",
|
|
10
|
+
"tsconfig.json": "{\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"lib\": [\"ES2022\", \"DOM\", \"DOM.Iterable\"],\n \"module\": \"ESNext\",\n \"moduleResolution\": \"Bundler\",\n \"experimentalDecorators\": true,\n \"useDefineForClassFields\": false,\n \"strict\": true,\n \"skipLibCheck\": true\n },\n \"include\": [\"src\"]\n}\n",
|
|
11
|
+
"vite.config.ts": "import angular from \"@analogjs/vite-plugin-angular\";\nimport { defineConfig } from \"vite\";\n\nexport default defineConfig({\n plugins: [angular()],\n});\n",
|
|
12
|
+
".vscode/extensions.json": "{\n \"recommendations\": [\"cssdoc.cssdoc-vscode\", \"angular.ng-template\"]\n}\n",
|
|
13
|
+
".vscode/settings.json": "{\n \"html.customData\": [\"./node_modules/@pantoken/pantoken/dist/html-custom-data.json\"],\n \"css.customData\": [\"./node_modules/@pantoken/pantoken/dist/css-custom-data.json\"]\n}\n",
|
|
14
|
+
"src/app.component.ts": "import { CUSTOM_ELEMENTS_SCHEMA, Component } from \"@angular/core\";\n\n@Component({\n selector: \"app-root\",\n standalone: true,\n schemas: [CUSTOM_ELEMENTS_SCHEMA], // accepts pantoken custom elements like <instui-icon>\n template: `\n<div class=\"container\">\n <div class=\"header\">\n <div class=\"top\">\n <!-- breadcrumb -->\n <div class=\"utilities\"> <!-- optional -->\n <button class=\"instui-button\"></button>\n </div>\n </div>\n <div class=\"info\">\n <div class=\"title\">\n {{projectName}}\n </div>\n <div class=\"description\"> <!-- optional -->\n Styled with <code>@pantoken/components</code> and laid out with the <code>wrapper</code> layout from <code>@pantoken/plugin-layouts</code>.\n </div>\n </div>\n <slot name=\"header\"></slot> <!-- optional -->\n <div class=\"actions\"> <!-- optional -->\n <button class=\"instui-button\"></button>\n </div>\n <div class=\"tabs\"> <!-- optional -->\n <!-- tabs -->\n </div>\n <div class=\"filters\"> <!-- optional -->\n <slot name=\"filters\"></slot>\n </div>\n </div>\n <div class=\"content\">\n <div class=\"list\"></div> <!-- optional -->\n <slot name=\"content\">\n <p>Get started building with pantoken.</p>\n <button class=\"instui-button -color-primary\" type=\"button\">Get started</button>\n </slot>\n <slot name=\"trailing\"></slot> <!-- optional -->\n </div>\n </div>\n `,\n})\nexport class AppComponent {}\n",
|
|
15
|
+
"src/main.ts": "import \"zone.js\";\nimport { registerPantokenElements } from \"@pantoken/angular\";\nimport { bootstrapApplication } from \"@angular/platform-browser\";\n// Defines every --instui-* custom property this app can reference.\nimport \"@pantoken/components/base.css\";\nimport \"@pantoken/components/components.css\";\nimport \"@pantoken/plugin-layouts/layouts.css\";\nimport { AppComponent } from \"./app.component.ts\";\n\nregisterPantokenElements(); // registers <instui-icon> and friends for use in templates\nbootstrapApplication(AppComponent);\n",
|
|
16
|
+
"cssdoc.json": "{\n \"$schema\": \"https://cssdoc.dev/cssdoc.schema.json\",\n \"extends\": [\"./node_modules/@pantoken/pantoken/cssdoc-base.json\"],\n \"modifierConvention\": \"rscss\",\n \"inlineComments\": \"ignore\"\n}\n"
|
|
17
|
+
},
|
|
18
|
+
"html": {
|
|
19
|
+
".gitignore": "node_modules\ndist\n",
|
|
20
|
+
"README.md": "# {{projectName}}\n\nScaffolded with `pantoken-scaffold html` (or `pantoken-ai scaffold html`) — a plain TypeScript app (via Vite) styled with\n[`@pantoken/components`](https://www.npmjs.com/package/@pantoken/components), Instructure's\ndesign tokens and icons.\n\n## Develop\n\n```sh\nnpm install\nnpm run dev\n```\n\n## What's here\n\n- `src/main.ts` imports `@pantoken/components/base.css` (document defaults + focus ring),\n `components.css` (`.instui-*` classes), and `@pantoken/plugin-layouts/layouts.css`, then renders\n markup into `#app`.\n- The markup follows the `wrapper` app-shell layout from `@pantoken/plugin-layouts` (`.container` /\n `.header` / `.content` parts) — see that package's README for what each part is for.\n- Apply classes like `class=\"instui-button\"` to markup; see the\n [component reference](https://pantoken.iywahl.com/api/css) for the full class list.\n",
|
|
21
|
+
"index.html": "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>{{projectName}}</title>\n </head>\n <body class=\"instui-display-flex\">\n <div id=\"app\"></div>\n <script type=\"module\" src=\"/src/main.ts\"><\/script>\n </body>\n</html>\n",
|
|
22
|
+
"package.json": "{\n \"name\": \"{{projectName}}\",\n \"version\": \"0.0.0\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vite\",\n \"build\": \"vite build\",\n \"preview\": \"vite preview\"\n },\n \"dependencies\": {\n \"@pantoken/components\": \"latest\",\n \"@pantoken/plugin-layouts\": \"latest\"\n },\n \"devDependencies\": {\n \"@pantoken/pantoken\": \"latest\",\n \"typescript\": \"^5.7.0\",\n \"vite\": \"^6.0.0\"\n }\n}\n",
|
|
23
|
+
"tsconfig.json": "{\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"lib\": [\"ES2022\", \"DOM\", \"DOM.Iterable\"],\n \"module\": \"ESNext\",\n \"moduleResolution\": \"Bundler\",\n \"strict\": true,\n \"skipLibCheck\": true\n },\n \"include\": [\"src\"]\n}\n",
|
|
24
|
+
"vite.config.ts": "import { defineConfig } from \"vite\";\n\nexport default defineConfig({});\n",
|
|
25
|
+
".vscode/extensions.json": "{\n \"recommendations\": [\"cssdoc.cssdoc-vscode\"]\n}\n",
|
|
26
|
+
".vscode/settings.json": "{\n \"html.customData\": [\"./node_modules/@pantoken/pantoken/dist/html-custom-data.json\"],\n \"css.customData\": [\"./node_modules/@pantoken/pantoken/dist/css-custom-data.json\"]\n}\n",
|
|
27
|
+
"src/main.ts": "// Defines every --instui-* custom property this app can reference.\nimport \"@pantoken/components/base.css\";\nimport \"@pantoken/components/components.css\";\nimport \"@pantoken/plugin-layouts/layouts.css\";\n\ndocument.querySelector<HTMLDivElement>(\"#app\")!.innerHTML = `\n<div class=\"container\">\n <div class=\"header\">\n <div class=\"top\">\n <!-- breadcrumb -->\n <div class=\"utilities\"> <!-- optional -->\n <button class=\"instui-button\"></button>\n </div>\n </div>\n <div class=\"info\">\n <div class=\"title\">\n {{projectName}}\n </div>\n <div class=\"description\"> <!-- optional -->\n Styled with <code>@pantoken/components</code> and laid out with the <code>wrapper</code> layout from <code>@pantoken/plugin-layouts</code>.\n </div>\n </div>\n <slot name=\"header\"></slot> <!-- optional -->\n <div class=\"actions\"> <!-- optional -->\n <button class=\"instui-button\"></button>\n </div>\n <div class=\"tabs\"> <!-- optional -->\n <!-- tabs -->\n </div>\n <div class=\"filters\"> <!-- optional -->\n <slot name=\"filters\"></slot>\n </div>\n </div>\n <div class=\"content\">\n <div class=\"list\"></div> <!-- optional -->\n <slot name=\"content\">\n <p>Get started building with pantoken.</p>\n <button class=\"instui-button -color-primary\" type=\"button\">Get started</button>\n </slot>\n <slot name=\"trailing\"></slot> <!-- optional -->\n </div>\n </div>\n`;\n",
|
|
28
|
+
"cssdoc.json": "{\n \"$schema\": \"https://cssdoc.dev/cssdoc.schema.json\",\n \"extends\": [\"./node_modules/@pantoken/pantoken/cssdoc-base.json\"],\n \"modifierConvention\": \"rscss\",\n \"inlineComments\": \"ignore\"\n}\n"
|
|
29
|
+
},
|
|
5
30
|
"next": {
|
|
6
31
|
".gitignore": "node_modules\n.next\n",
|
|
7
|
-
"README.md": "# {{projectName}}\n\nScaffolded with `pantoken-scaffold next` (or `pantoken-ai scaffold next`) — a Next.js (App Router) app styled with\n[`@pantoken/next`](https://www.npmjs.com/package/@pantoken/next), Instructure's design tokens and\nicons.\n\n## Develop\n\n```sh\nnpm install\nnpm run dev\n```\n\n## What's here\n\n- `next.config.mjs` wraps the config with `withPantoken(...)` (adds pantoken to\n `transpilePackages`).\n- `app/layout.tsx` imports `@pantoken/css/inject`, which defines every `--instui-*` custom\n property, at the root so it's available on every page
|
|
32
|
+
"README.md": "# {{projectName}}\n\nScaffolded with `pantoken-scaffold next` (or `pantoken-ai scaffold next`) — a Next.js (App Router) app styled with\n[`@pantoken/next`](https://www.npmjs.com/package/@pantoken/next), Instructure's design tokens and\nicons.\n\n## Develop\n\n```sh\nnpm install\nnpm run dev\n```\n\n## What's here\n\n- `next.config.mjs` wraps the config with `withPantoken(...)` (adds pantoken to\n `transpilePackages`).\n- `app/layout.tsx` imports `@pantoken/css/inject`, which defines every `--instui-*` custom\n property, at the root so it's available on every page, plus `@pantoken/plugin-layouts/layouts.css`\n and the `wrapper` layout's root class on `<body>`.\n- `app/page.tsx` renders markup following the `wrapper` app-shell layout from\n [`@pantoken/plugin-layouts`](https://www.npmjs.com/package/@pantoken/plugin-layouts)\n (`.container` / `.header` / `.content` parts) styled with `instui-*` classes.\n",
|
|
8
33
|
"next.config.mjs": "import { withPantoken } from \"@pantoken/next\";\n\n/** @type {import('next').NextConfig} */\nconst nextConfig = {};\n\nexport default withPantoken(nextConfig);\n",
|
|
9
|
-
"package.json": "{\n \"name\": \"{{projectName}}\",\n \"version\": \"0.0.0\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"next dev\",\n \"build\": \"next build\",\n \"start\": \"next start\"\n },\n \"dependencies\": {\n \"@pantoken/next\": \"latest\",\n \"next\": \"^15.0.0\",\n \"react\": \"^19.0.0\",\n \"react-dom\": \"^19.0.0\"\n }\n}\n",
|
|
34
|
+
"package.json": "{\n \"name\": \"{{projectName}}\",\n \"version\": \"0.0.0\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"next dev\",\n \"build\": \"next build\",\n \"start\": \"next start\"\n },\n \"dependencies\": {\n \"@pantoken/next\": \"latest\",\n \"@pantoken/plugin-layouts\": \"latest\",\n \"next\": \"^15.0.0\",\n \"react\": \"^19.0.0\",\n \"react-dom\": \"^19.0.0\"\n },\n \"devDependencies\": {\n \"@pantoken/pantoken\": \"latest\"\n }\n}\n",
|
|
10
35
|
"tsconfig.json": "{\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"lib\": [\"ES2022\", \"DOM\", \"DOM.Iterable\"],\n \"module\": \"ESNext\",\n \"moduleResolution\": \"Bundler\",\n \"jsx\": \"preserve\",\n \"strict\": true,\n \"skipLibCheck\": true,\n \"plugins\": [{ \"name\": \"next\" }]\n },\n \"include\": [\"app\", \"next-env.d.ts\"]\n}\n",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
36
|
+
".vscode/extensions.json": "{\n \"recommendations\": [\"cssdoc.cssdoc-vscode\"]\n}\n",
|
|
37
|
+
".vscode/settings.json": "{\n \"html.customData\": [\"./node_modules/@pantoken/pantoken/dist/html-custom-data.json\"],\n \"css.customData\": [\"./node_modules/@pantoken/pantoken/dist/css-custom-data.json\"]\n}\n",
|
|
38
|
+
"app/layout.tsx": "import \"@pantoken/css/inject\";\nimport \"@pantoken/plugin-layouts/layouts.css\";\n\nexport const metadata = {\n title: \"{{projectName}}\",\n};\n\nexport default function RootLayout({ children }: { children: React.ReactNode }) {\n return (\n <html lang=\"en\">\n <body className=\"instui-display-flex\">{children}</body>\n </html>\n );\n}\n",
|
|
39
|
+
"app/page.tsx": "export default function Page() {\n return (\n<div className=\"container\">\n <div className=\"header\">\n <div className=\"top\">\n {/* breadcrumb */}\n <div className=\"utilities\"> {/* optional */}\n <button className=\"instui-button\"></button>\n </div>\n </div>\n <div className=\"info\">\n <div className=\"title\">\n {{projectName}}\n </div>\n <div className=\"description\"> {/* optional */}\n Styled with <code>@pantoken/components</code> and laid out with the <code>wrapper</code> layout from <code>@pantoken/plugin-layouts</code>.\n </div>\n </div>\n <slot name=\"header\"></slot> {/* optional */}\n <div className=\"actions\"> {/* optional */}\n <button className=\"instui-button\"></button>\n </div>\n <div className=\"tabs\"> {/* optional */}\n {/* tabs */}\n </div>\n <div className=\"filters\"> {/* optional */}\n <slot name=\"filters\"></slot>\n </div>\n </div>\n <div className=\"content\">\n <div className=\"list\"></div> {/* optional */}\n <slot name=\"content\">\n <p>Get started building with pantoken.</p>\n <button className=\"instui-button -color-primary\" type=\"button\">Get started</button>\n </slot>\n <slot name=\"trailing\"></slot> {/* optional */}\n </div>\n </div>\n );\n}\n",
|
|
40
|
+
"cssdoc.json": "{\n \"$schema\": \"https://cssdoc.dev/cssdoc.schema.json\",\n \"extends\": [\"./node_modules/@pantoken/pantoken/cssdoc-base.json\"],\n \"modifierConvention\": \"rscss\",\n \"inlineComments\": \"ignore\"\n}\n"
|
|
13
41
|
},
|
|
14
42
|
"react": {
|
|
15
43
|
".gitignore": "node_modules\ndist\n",
|
|
16
|
-
"README.md": "# {{projectName}}\n\nScaffolded with `pantoken-scaffold react` (or `pantoken-ai scaffold react`) — a Vite + React app styled with\n[`@pantoken/react`](https://www.npmjs.com/package/@pantoken/react) and\n[`@pantoken/css`](https://www.npmjs.com/package/@pantoken/css), Instructure's design tokens and\nicons.\n\n## Develop\n\n```sh\nnpm install\nnpm run dev\n```\n\n## What's here\n\n- `src/main.tsx` imports `@pantoken/css/inject`, which defines every `--instui-*` custom property.\n- `src/App.tsx`
|
|
44
|
+
"README.md": "# {{projectName}}\n\nScaffolded with `pantoken-scaffold react` (or `pantoken-ai scaffold react`) — a Vite + React app styled with\n[`@pantoken/react`](https://www.npmjs.com/package/@pantoken/react) and\n[`@pantoken/css`](https://www.npmjs.com/package/@pantoken/css), Instructure's design tokens and\nicons.\n\n## Develop\n\n```sh\nnpm install\nnpm run dev\n```\n\n## What's here\n\n- `src/main.tsx` imports `@pantoken/css/inject`, which defines every `--instui-*` custom property.\n- `src/App.tsx` renders markup following the `wrapper` app-shell layout from\n [`@pantoken/plugin-layouts`](https://www.npmjs.com/package/@pantoken/plugin-layouts)\n (`.container` / `.header` / `.content` parts) styled with `instui-*` classes.\n- For InstUI's full React component library (buttons, modals, etc. — including `@pantoken/react`'s\n `<Icon>`), add the specific `@instructure/ui-*` packages you need — see <https://instructure.design>.\n",
|
|
17
45
|
"index.html": "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>{{projectName}}</title>\n </head>\n <body>\n <div id=\"root\"></div>\n <script type=\"module\" src=\"/src/main.tsx\"><\/script>\n </body>\n</html>\n",
|
|
18
|
-
"package.json": "{\n \"name\": \"{{projectName}}\",\n \"version\": \"0.0.0\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vite\",\n \"build\": \"vite build\",\n \"preview\": \"vite preview\"\n },\n \"dependencies\": {\n \"@pantoken/css\": \"latest\",\n \"@pantoken/react\": \"latest\",\n \"react\": \"^19.0.0\",\n \"react-dom\": \"^19.0.0\"\n },\n \"devDependencies\": {\n \"@types/react\": \"^19.0.0\",\n \"@types/react-dom\": \"^19.0.0\",\n \"@vitejs/plugin-react\": \"^4.3.0\",\n \"vite\": \"^6.0.0\"\n }\n}\n",
|
|
46
|
+
"package.json": "{\n \"name\": \"{{projectName}}\",\n \"version\": \"0.0.0\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vite\",\n \"build\": \"vite build\",\n \"preview\": \"vite preview\"\n },\n \"dependencies\": {\n \"@pantoken/css\": \"latest\",\n \"@pantoken/plugin-layouts\": \"latest\",\n \"@pantoken/react\": \"latest\",\n \"react\": \"^19.0.0\",\n \"react-dom\": \"^19.0.0\"\n },\n \"devDependencies\": {\n \"@pantoken/pantoken\": \"latest\",\n \"@types/react\": \"^19.0.0\",\n \"@types/react-dom\": \"^19.0.0\",\n \"@vitejs/plugin-react\": \"^4.3.0\",\n \"vite\": \"^6.0.0\"\n }\n}\n",
|
|
19
47
|
"tsconfig.json": "{\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"lib\": [\"ES2022\", \"DOM\", \"DOM.Iterable\"],\n \"module\": \"ESNext\",\n \"moduleResolution\": \"Bundler\",\n \"jsx\": \"react-jsx\",\n \"strict\": true,\n \"skipLibCheck\": true\n },\n \"include\": [\"src\"]\n}\n",
|
|
20
48
|
"vite.config.ts": "import { defineConfig } from \"vite\";\nimport react from \"@vitejs/plugin-react\";\n\nexport default defineConfig({\n plugins: [react()],\n});\n",
|
|
21
|
-
"
|
|
22
|
-
"
|
|
49
|
+
".vscode/extensions.json": "{\n \"recommendations\": [\"cssdoc.cssdoc-vscode\"]\n}\n",
|
|
50
|
+
".vscode/settings.json": "{\n \"html.customData\": [\"./node_modules/@pantoken/pantoken/dist/html-custom-data.json\"],\n \"css.customData\": [\"./node_modules/@pantoken/pantoken/dist/css-custom-data.json\"]\n}\n",
|
|
51
|
+
"src/App.tsx": "import \"@pantoken/plugin-layouts/layouts.css\";\n\nexport function App() {\n return (\n <div className=\"instui-display-flex\">\n<div className=\"container\">\n <div className=\"header\">\n <div className=\"top\">\n {/* breadcrumb */}\n <div className=\"utilities\"> {/* optional */}\n <button className=\"instui-button\"></button>\n </div>\n </div>\n <div className=\"info\">\n <div className=\"title\">\n {{projectName}}\n </div>\n <div className=\"description\"> {/* optional */}\n Styled with <code>@pantoken/components</code> and laid out with the <code>wrapper</code> layout from <code>@pantoken/plugin-layouts</code>.\n </div>\n </div>\n <slot name=\"header\"></slot> {/* optional */}\n <div className=\"actions\"> {/* optional */}\n <button className=\"instui-button\"></button>\n </div>\n <div className=\"tabs\"> {/* optional */}\n {/* tabs */}\n </div>\n <div className=\"filters\"> {/* optional */}\n <slot name=\"filters\"></slot>\n </div>\n </div>\n <div className=\"content\">\n <div className=\"list\"></div> {/* optional */}\n <slot name=\"content\">\n <p>Get started building with pantoken.</p>\n <button className=\"instui-button -color-primary\" type=\"button\">Get started</button>\n </slot>\n <slot name=\"trailing\"></slot> {/* optional */}\n </div>\n </div>\n </div>\n );\n}\n",
|
|
52
|
+
"src/main.tsx": "import { StrictMode } from \"react\";\nimport { createRoot } from \"react-dom/client\";\n// Defines every --instui-* custom property this app can reference.\nimport \"@pantoken/css/inject\";\nimport { App } from \"./App.tsx\";\n\ncreateRoot(document.getElementById(\"root\")!).render(\n <StrictMode>\n <App />\n </StrictMode>,\n);\n",
|
|
53
|
+
"cssdoc.json": "{\n \"$schema\": \"https://cssdoc.dev/cssdoc.schema.json\",\n \"extends\": [\"./node_modules/@pantoken/pantoken/cssdoc-base.json\"],\n \"modifierConvention\": \"rscss\",\n \"inlineComments\": \"ignore\"\n}\n"
|
|
23
54
|
},
|
|
24
|
-
"web": {
|
|
55
|
+
"web-components": {
|
|
25
56
|
".gitignore": "node_modules\ndist\n",
|
|
26
|
-
"README.md": "# {{projectName}}\n\nScaffolded with `pantoken-scaffold web` (or `pantoken-ai scaffold web`) — a
|
|
27
|
-
"index.html": "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>{{projectName}}</title>\n </head>\n <body>\n <div id=\"app\"></div>\n <script type=\"module\" src=\"/src/main.ts\"><\/script>\n </body>\n</html>\n",
|
|
28
|
-
"package.json": "{\n \"name\": \"{{projectName}}\",\n \"version\": \"0.0.0\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vite\",\n \"build\": \"vite build\",\n \"preview\": \"vite preview\"\n },\n \"dependencies\": {\n \"@pantoken/components\": \"latest\"\n },\n \"devDependencies\": {\n \"typescript\": \"^5.7.0\",\n \"vite\": \"^6.0.0\"\n }\n}\n",
|
|
57
|
+
"README.md": "# {{projectName}}\n\nScaffolded with `pantoken-scaffold web-components` (or `pantoken-ai scaffold web-components`) — a\nplain TypeScript app (via Vite) styled with\n[`@pantoken/components`](https://www.npmjs.com/package/@pantoken/components) and using framework-agnostic\ncustom elements from [`@pantoken/web-components`](https://www.npmjs.com/package/@pantoken/web-components).\n\n## Develop\n\n```sh\nnpm install\nnpm run dev\n```\n\n## What's here\n\n- `src/main.ts` imports `@pantoken/components/base.css` + `components.css` (`.instui-*` classes),\n `@pantoken/plugin-layouts/layouts.css`, and `@pantoken/web-components` (auto-registers elements\n like `<instui-icon>`), then renders markup into `#app`.\n- The markup follows the `wrapper` app-shell layout from `@pantoken/plugin-layouts` (`.container` /\n `.header` / `.content` parts) — see that package's README for what each part is for.\n- Use custom elements directly in markup, e.g. `<instui-button>`, `<instui-alert variant=\"success\">` —\n see the [`@pantoken/web-components` README](https://www.npmjs.com/package/@pantoken/web-components)\n for the full element list.\n",
|
|
58
|
+
"index.html": "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>{{projectName}}</title>\n </head>\n <body class=\"instui-display-flex\">\n <div id=\"app\"></div>\n <script type=\"module\" src=\"/src/main.ts\"><\/script>\n </body>\n</html>\n",
|
|
59
|
+
"package.json": "{\n \"name\": \"{{projectName}}\",\n \"version\": \"0.0.0\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vite\",\n \"build\": \"vite build\",\n \"preview\": \"vite preview\"\n },\n \"dependencies\": {\n \"@pantoken/components\": \"latest\",\n \"@pantoken/plugin-layouts\": \"latest\",\n \"@pantoken/web-components\": \"latest\"\n },\n \"devDependencies\": {\n \"@pantoken/pantoken\": \"latest\",\n \"typescript\": \"^5.7.0\",\n \"vite\": \"^6.0.0\"\n }\n}\n",
|
|
29
60
|
"tsconfig.json": "{\n \"compilerOptions\": {\n \"target\": \"ES2022\",\n \"lib\": [\"ES2022\", \"DOM\", \"DOM.Iterable\"],\n \"module\": \"ESNext\",\n \"moduleResolution\": \"Bundler\",\n \"strict\": true,\n \"skipLibCheck\": true\n },\n \"include\": [\"src\"]\n}\n",
|
|
30
61
|
"vite.config.ts": "import { defineConfig } from \"vite\";\n\nexport default defineConfig({});\n",
|
|
31
|
-
"
|
|
62
|
+
".vscode/extensions.json": "{\n \"recommendations\": [\"cssdoc.cssdoc-vscode\"]\n}\n",
|
|
63
|
+
".vscode/settings.json": "{\n \"html.customData\": [\"./node_modules/@pantoken/pantoken/dist/html-custom-data.json\"],\n \"css.customData\": [\"./node_modules/@pantoken/pantoken/dist/css-custom-data.json\"]\n}\n",
|
|
64
|
+
"src/main.ts": "// Defines every --instui-* custom property this app can reference.\nimport \"@pantoken/components/base.css\";\nimport \"@pantoken/components/components.css\";\nimport \"@pantoken/plugin-layouts/layouts.css\";\nimport \"@pantoken/web-components\"; // auto-registers <instui-icon> and friends\n\ndocument.querySelector<HTMLDivElement>(\"#app\")!.innerHTML = `\n<div class=\"container\">\n <div class=\"header\">\n <div class=\"top\">\n <!-- breadcrumb -->\n <div class=\"utilities\"> <!-- optional -->\n <button class=\"instui-button\"></button>\n </div>\n </div>\n <div class=\"info\">\n <div class=\"title\">\n {{projectName}}\n </div>\n <div class=\"description\"> <!-- optional -->\n Styled with <code>@pantoken/components</code> and laid out with the <code>wrapper</code> layout from <code>@pantoken/plugin-layouts</code>.\n </div>\n </div>\n <slot name=\"header\"></slot> <!-- optional -->\n <div class=\"actions\"> <!-- optional -->\n <button class=\"instui-button\"></button>\n </div>\n <div class=\"tabs\"> <!-- optional -->\n <!-- tabs -->\n </div>\n <div class=\"filters\"> <!-- optional -->\n <slot name=\"filters\"></slot>\n </div>\n </div>\n <div class=\"content\">\n <div class=\"list\"></div> <!-- optional -->\n <slot name=\"content\">\n <p>Get started building with pantoken.</p>\n <button class=\"instui-button -color-primary\" type=\"button\">Get started</button>\n </slot>\n <slot name=\"trailing\"></slot> <!-- optional -->\n </div>\n </div>\n`;\n\n// Framework-agnostic custom elements work anywhere — no per-framework port required.\ndocument\n .querySelector('.content slot[name=\"content\"]')\n ?.insertAdjacentHTML(\"afterbegin\", '<instui-icon name=\"check-mark\"></instui-icon>\\n');\n",
|
|
65
|
+
"cssdoc.json": "{\n \"$schema\": \"https://cssdoc.dev/cssdoc.schema.json\",\n \"extends\": [\"./node_modules/@pantoken/pantoken/cssdoc-base.json\"],\n \"modifierConvention\": \"rscss\",\n \"inlineComments\": \"ignore\"\n}\n"
|
|
32
66
|
}
|
|
33
67
|
};
|
|
34
68
|
//#endregion
|
|
@@ -48,7 +82,7 @@ const SCAFFOLDS = {
|
|
|
48
82
|
* ```ts
|
|
49
83
|
* import { SCAFFOLD_PLATFORMS } from "@pantoken/scaffold";
|
|
50
84
|
*
|
|
51
|
-
* console.log(SCAFFOLD_PLATFORMS); // → ["
|
|
85
|
+
* console.log(SCAFFOLD_PLATFORMS); // → ["html", "react", "next", "angular", "web-components"]
|
|
52
86
|
* ```
|
|
53
87
|
*/
|
|
54
88
|
const SCAFFOLD_PLATFORMS = Object.keys(SCAFFOLDS);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pantoken/scaffold",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "npx @pantoken/scaffold <platform> — scaffold a starter project (
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "npx @pantoken/scaffold <platform> — scaffold a starter project (html, react, next, angular, web-components, ...) with pantoken already installed and wired in.",
|
|
5
5
|
"homepage": "https://pantoken.iywahl.com",
|
|
6
6
|
"bugs": "https://github.com/thedannywahl/pantoken/issues",
|
|
7
7
|
"license": "MIT",
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"@types/node": "^24.13.3",
|
|
32
32
|
"typescript": "^7.0.2",
|
|
33
33
|
"vite": "npm:@voidzero-dev/vite-plus-core@0.2.9",
|
|
34
|
-
"vite-plus": "0.2.9"
|
|
34
|
+
"vite-plus": "0.2.9",
|
|
35
|
+
"@pantoken/plugin-layouts": "0.1.6"
|
|
35
36
|
},
|
|
36
37
|
"engines": {
|
|
37
38
|
"node": ">=22.18.0"
|