@vertz/create-vertz-app 0.2.7 → 0.2.9

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.
@@ -1 +1 @@
1
- {"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../src/scaffold.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,WAAW,EAAE,MAAM;CAIhC;AAED;;;;GAIG;AACH,wBAAsB,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAmDzF"}
1
+ {"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../src/scaffold.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,WAAW,EAAE,MAAM;CAIhC;AAED;;;;GAIG;AACH,wBAAsB,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAqDzF"}
package/dist/scaffold.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { promises as fs } from 'node:fs';
2
2
  import path from 'node:path';
3
- import { appComponentTemplate, clientTemplate, dbTemplate, entryClientTemplate, envExampleTemplate, envTemplate, gitignoreTemplate, homePageTemplate, packageJsonTemplate, schemaTemplate, serverTemplate, tasksEntityTemplate, themeTemplate, tsconfigTemplate, vertzConfigTemplate, } from './templates/index.js';
3
+ import { appComponentTemplate, bunfigTemplate, bunPluginShimTemplate, clientTemplate, dbTemplate, entryClientTemplate, envExampleTemplate, envTemplate, gitignoreTemplate, homePageTemplate, packageJsonTemplate, schemaTemplate, serverTemplate, tasksEntityTemplate, themeTemplate, tsconfigTemplate, vertzConfigTemplate, } from './templates/index.js';
4
4
  /**
5
5
  * Error thrown when the project directory already exists
6
6
  */
@@ -49,6 +49,8 @@ export async function scaffold(parentDir, options) {
49
49
  writeFile(projectDir, '.env', envTemplate()),
50
50
  writeFile(projectDir, '.env.example', envExampleTemplate()),
51
51
  writeFile(projectDir, '.gitignore', gitignoreTemplate()),
52
+ writeFile(projectDir, 'bunfig.toml', bunfigTemplate()),
53
+ writeFile(projectDir, 'bun-plugin-shim.ts', bunPluginShimTemplate()),
52
54
  // API source files
53
55
  writeFile(apiDir, 'server.ts', serverTemplate()),
54
56
  writeFile(apiDir, 'schema.ts', schemaTemplate()),
@@ -1,5 +1,5 @@
1
1
  import { describe, expect, it } from 'vitest';
2
- import { appComponentTemplate, clientTemplate, dbTemplate, entryClientTemplate, envExampleTemplate, envTemplate, gitignoreTemplate, homePageTemplate, packageJsonTemplate, schemaTemplate, serverTemplate, tasksEntityTemplate, themeTemplate, tsconfigTemplate, vertzConfigTemplate, } from '../index.js';
2
+ import { appComponentTemplate, bunfigTemplate, bunPluginShimTemplate, clientTemplate, dbTemplate, entryClientTemplate, envExampleTemplate, envTemplate, gitignoreTemplate, homePageTemplate, packageJsonTemplate, schemaTemplate, serverTemplate, tasksEntityTemplate, themeTemplate, tsconfigTemplate, vertzConfigTemplate, } from '../index.js';
3
3
  describe('templates', () => {
4
4
  describe('packageJsonTemplate', () => {
5
5
  it('returns valid JSON', () => {
@@ -24,6 +24,7 @@ describe('templates', () => {
24
24
  const pkg = JSON.parse(result);
25
25
  expect(pkg.devDependencies['@vertz/cli']).toBeDefined();
26
26
  expect(pkg.devDependencies['@vertz/ui-compiler']).toBeDefined();
27
+ expect(pkg.devDependencies['@vertz/ui-server']).toBeDefined();
27
28
  expect(pkg.devDependencies['bun-types']).toBeDefined();
28
29
  });
29
30
  it('includes #generated imports map', () => {
@@ -84,6 +85,23 @@ describe('templates', () => {
84
85
  expect(envExampleTemplate()).toContain('PORT=3000');
85
86
  });
86
87
  });
88
+ describe('bunfigTemplate', () => {
89
+ it('registers bun-plugin-shim.ts under [serve.static]', () => {
90
+ const result = bunfigTemplate();
91
+ expect(result).toContain('[serve.static]');
92
+ expect(result).toContain('bun-plugin-shim.ts');
93
+ });
94
+ });
95
+ describe('bunPluginShimTemplate', () => {
96
+ it('imports createVertzBunPlugin from @vertz/ui-server/bun-plugin', () => {
97
+ const result = bunPluginShimTemplate();
98
+ expect(result).toContain("from '@vertz/ui-server/bun-plugin'");
99
+ expect(result).toContain('createVertzBunPlugin');
100
+ });
101
+ it('exports plugin as default', () => {
102
+ expect(bunPluginShimTemplate()).toContain('export default plugin');
103
+ });
104
+ });
87
105
  describe('gitignoreTemplate', () => {
88
106
  it('includes standard entries', () => {
89
107
  const result = gitignoreTemplate();
@@ -184,6 +202,8 @@ describe('templates', () => {
184
202
  envTemplate,
185
203
  envExampleTemplate,
186
204
  gitignoreTemplate,
205
+ bunfigTemplate,
206
+ bunPluginShimTemplate,
187
207
  serverTemplate,
188
208
  schemaTemplate,
189
209
  dbTemplate,
@@ -18,6 +18,14 @@ export declare function envTemplate(): string;
18
18
  * .env.example template
19
19
  */
20
20
  export declare function envExampleTemplate(): string;
21
+ /**
22
+ * bunfig.toml template — registers Vertz compiler plugin for Bun's dev server
23
+ */
24
+ export declare function bunfigTemplate(): string;
25
+ /**
26
+ * bun-plugin-shim.ts — bridges bunfig.toml plugin format with createVertzBunPlugin
27
+ */
28
+ export declare function bunPluginShimTemplate(): string;
21
29
  /**
22
30
  * .gitignore template
23
31
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CA8B/D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAoBzC;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAa5C;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAGpC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAG3C;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CA6B1C;AAID;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAoBvC;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAavC;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,MAAM,CASnC;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAe5C;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAOvC;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAgD7C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAW5C;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAWtC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAyGzC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CA+B/D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAoBzC;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAa5C;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAGpC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAG3C;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAIvC;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAc9C;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CA6B1C;AAID;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAoBvC;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAavC;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,MAAM,CASnC;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAe5C;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAOvC;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAgD7C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAW5C;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAWtC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAyGzC"}
@@ -26,6 +26,7 @@ export function packageJsonTemplate(projectName) {
26
26
  devDependencies: {
27
27
  '@vertz/cli': '^0.2.0',
28
28
  '@vertz/ui-compiler': '^0.2.0',
29
+ '@vertz/ui-server': '^0.2.0',
29
30
  'bun-types': '^1.0.0',
30
31
  typescript: '^5.8.0',
31
32
  },
@@ -86,6 +87,32 @@ export function envExampleTemplate() {
86
87
  return `PORT=3000
87
88
  `;
88
89
  }
90
+ /**
91
+ * bunfig.toml template — registers Vertz compiler plugin for Bun's dev server
92
+ */
93
+ export function bunfigTemplate() {
94
+ return `[serve.static]
95
+ plugins = ["./bun-plugin-shim.ts"]
96
+ `;
97
+ }
98
+ /**
99
+ * bun-plugin-shim.ts — bridges bunfig.toml plugin format with createVertzBunPlugin
100
+ */
101
+ export function bunPluginShimTemplate() {
102
+ return `/**
103
+ * Thin shim that wraps @vertz/ui-server/bun-plugin for bunfig.toml consumption.
104
+ *
105
+ * bunfig.toml \`[serve.static] plugins\` requires a default export of type BunPlugin.
106
+ * The @vertz/ui-server/bun-plugin package exports a factory function (createVertzBunPlugin)
107
+ * as a named export — this shim bridges the two.
108
+ */
109
+ import { createVertzBunPlugin } from '@vertz/ui-server/bun-plugin';
110
+
111
+ const { plugin } = createVertzBunPlugin();
112
+
113
+ export default plugin;
114
+ `;
115
+ }
89
116
  /**
90
117
  * .gitignore template
91
118
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertz/create-vertz-app",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Create a new Vertz application",