create-barq 0.2.0-next.0 → 0.2.0-next.1

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.js CHANGED
@@ -4,7 +4,7 @@ import { createInterface } from "node:readline/promises";
4
4
  import { stdin, stdout } from "node:process";
5
5
  import { cpSync, existsSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
6
6
  import { fileURLToPath } from "node:url";
7
- //#region src/scaffold.ts
7
+ // src/scaffold.ts
8
8
  /**
9
9
  * Copying a template into a directory, with nothing interactive in it.
10
10
  *
@@ -60,8 +60,7 @@ function scaffold(options) {
60
60
  manifest.name = options.packageName;
61
61
  writeFileSync(manifestPath, `${JSON.stringify(manifest, null, 2)}\n`);
62
62
  }
63
- //#endregion
64
- //#region src/templates.ts
63
+ // src/templates.ts
65
64
  const TEMPLATES = [
66
65
  {
67
66
  name: "full-stack",
@@ -95,8 +94,7 @@ const DEFAULT_TEMPLATE = "full-stack";
95
94
  function findTemplate(name) {
96
95
  return TEMPLATES.find((template) => template.name === name);
97
96
  }
98
- //#endregion
99
- //#region src/index.ts
97
+ // src/index.ts
100
98
  /**
101
99
  * `bun create barq my-app` / `npm create barq@latest my-app`.
102
100
  *
@@ -200,5 +198,4 @@ main().catch((error) => {
200
198
  stdout.write(`\n${error instanceof Error ? error.message : String(error)}\n`);
201
199
  process.exitCode = 1;
202
200
  });
203
- //#endregion
204
201
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-barq",
3
- "version": "0.2.0-next.0",
3
+ "version": "0.2.0-next.1",
4
4
  "description": "Scaffold a barq project from the full-stack, SPA or minimal template",
5
5
  "keywords": [
6
6
  "barq",
@@ -34,9 +34,9 @@
34
34
  "test": "bun test"
35
35
  },
36
36
  "devDependencies": {
37
- "@types/bun": "^1.4.3",
37
+ "@types/bun": "^1.4.4",
38
38
  "typescript": "^7.0.2",
39
- "vite": "^8.3.4"
39
+ "vite": "^8.3.8"
40
40
  },
41
41
  "engines": {
42
42
  "node": "^20.19.0 || >=22.12.0"
@@ -0,0 +1,51 @@
1
+ # Working in this project
2
+
3
+ This is a barq application: a JSX framework where a component function runs
4
+ once and only the DOM nodes that read a changed signal update. It is not React
5
+ and not Solid, so read the authoring skill before writing components.
6
+
7
+ ## Skills
8
+
9
+ Installed with the packages, under `node_modules`:
10
+
11
+ - `node_modules/@barqjs/core/skills/barq/SKILL.md`: how to write barq (props
12
+ as values, signals, the two-function `createEffect`, stores, control flow,
13
+ async). Read it before writing or reviewing application code.
14
+ - `node_modules/@barqjs/core/skills/diagnostics/SKILL.md`: one section per
15
+ runtime `[CODE]`, with the repair.
16
+ - `node_modules/@barqjs/compiler/skills/compiler-diagnostics/SKILL.md`: one
17
+ section per build-time `BARQ0NN` code, with the repair.
18
+ - `node_modules/@barqjs/diagnostics/skills/agent-loops/SKILL.md`: capturing a
19
+ run as evidence for cost and responsiveness findings. Present when
20
+ `@barqjs/diagnostics` is installed.
21
+
22
+ ## Rule
23
+
24
+ When a console or build message carries a `[CODE]` or a `BARQ0NN`, open the
25
+ skill section for that code before changing code. The console entry's `in`
26
+ line is the component path and its `at` line is `file:line:col`. Repair the
27
+ cause; a suppression comment or `untrack` leaves the defect in place.
28
+
29
+ ## Commands
30
+
31
+ ```bash
32
+ npm run dev # the Vite dev server, http://localhost:5173
33
+ npm run build # production build into dist/client and dist/server
34
+ npm run preview # the built server, through vite preview
35
+ npm start # bun dist/server/serve.js
36
+ npm run typecheck # tsc --noEmit
37
+ npm run check # barq check: the compiler's findings, no build needed
38
+ ```
39
+
40
+ Run `npm run check` and `npm run typecheck` after a change, and `npm run build`
41
+ before calling it done. `npx barq check --json` gives the findings as JSON, and
42
+ `npx barq check --fix` applies the repairs that are one spelling. Diagnostics print
43
+ in the browser console, and server-side ones in the terminal of `npm run dev`.
44
+
45
+ ## Layout
46
+
47
+ - `src/routes`: one file per route. `__root.tsx` is the document and the
48
+ layout, and `api/health.ts` is an API route.
49
+ - `src/data/greeting.ts`: a server function. A file that exports server
50
+ functions exports nothing else (`BARQ012`).
51
+ - `src/routeTree.gen.ts`: written by the build. Commit it, do not edit it.
@@ -7,20 +7,22 @@
7
7
  "build": "vite build",
8
8
  "preview": "vite preview",
9
9
  "start": "bun dist/server/serve.js",
10
- "typecheck": "tsc --noEmit"
10
+ "typecheck": "tsc --noEmit",
11
+ "check": "barq check src"
11
12
  },
12
13
  "dependencies": {
13
- "@barqjs/core": "^0.2.0-next.0",
14
- "@barqjs/css": "^0.2.0-next.0",
15
- "@barqjs/router": "^0.2.0-next.0",
16
- "@barqjs/server": "^0.2.0-next.0",
17
- "@barqjs/start": "^0.2.0-next.0",
18
- "@barqjs/web": "^0.2.0-next.0"
14
+ "@barqjs/core": "^0.2.0-next.1",
15
+ "@barqjs/css": "^0.2.0-next.1",
16
+ "@barqjs/router": "^0.2.0-next.1",
17
+ "@barqjs/server": "^0.2.0-next.1",
18
+ "@barqjs/start": "^0.2.0-next.1",
19
+ "@barqjs/web": "^0.2.0-next.1"
19
20
  },
20
21
  "devDependencies": {
21
- "@barqjs/vite": "^0.2.0-next.0",
22
- "@types/bun": "^1.4.3",
22
+ "@barqjs/cli": "^0.2.0-next.1",
23
+ "@barqjs/vite": "^0.2.0-next.1",
24
+ "@types/bun": "^1.4.4",
23
25
  "typescript": "^7.0.2",
24
- "vite": "^8.3.4"
26
+ "vite": "^8.3.8"
25
27
  }
26
28
  }
@@ -0,0 +1,48 @@
1
+ # Working in this project
2
+
3
+ This is a barq application: a JSX framework where a component function runs
4
+ once and only the DOM nodes that read a changed signal update. It is not React
5
+ and not Solid, so read the authoring skill before writing components.
6
+
7
+ ## Skills
8
+
9
+ Installed with the packages, under `node_modules`:
10
+
11
+ - `node_modules/@barqjs/core/skills/barq/SKILL.md`: how to write barq (props
12
+ as values, signals, the two-function `createEffect`, stores, control flow,
13
+ async). Read it before writing or reviewing application code.
14
+ - `node_modules/@barqjs/core/skills/diagnostics/SKILL.md`: one section per
15
+ runtime `[CODE]`, with the repair.
16
+ - `node_modules/@barqjs/compiler/skills/compiler-diagnostics/SKILL.md`: one
17
+ section per build-time `BARQ0NN` code, with the repair.
18
+ - `node_modules/@barqjs/diagnostics/skills/agent-loops/SKILL.md`: capturing a
19
+ run as evidence for cost and responsiveness findings. Present when
20
+ `@barqjs/diagnostics` is installed.
21
+
22
+ ## Rule
23
+
24
+ When a console or build message carries a `[CODE]` or a `BARQ0NN`, open the
25
+ skill section for that code before changing code. The console entry's `in`
26
+ line is the component path and its `at` line is `file:line:col`. Repair the
27
+ cause; a suppression comment or `untrack` leaves the defect in place.
28
+
29
+ ## Commands
30
+
31
+ ```bash
32
+ npm run dev # the Vite dev server, http://localhost:5173
33
+ npm run build # production build into dist
34
+ npm run preview # serve the build
35
+ npm run typecheck # tsc --noEmit
36
+ npm run check # barq check: the compiler's findings, no build needed
37
+ ```
38
+
39
+ Run `npm run check` and `npm run typecheck` after a change, and `npm run build`
40
+ before calling it done. `npx barq check --json` gives the findings as JSON, and
41
+ `npx barq check --fix` applies the repairs that are one spelling. Diagnostics print
42
+ in the browser console and the terminal of `npm run dev`.
43
+
44
+ ## Layout
45
+
46
+ - `index.html`: the document.
47
+ - `src/main.tsx`: `render(() => <App />, root)`.
48
+ - `src/App.tsx`: the root component.
@@ -6,16 +6,18 @@
6
6
  "dev": "vite",
7
7
  "build": "vite build",
8
8
  "preview": "vite preview",
9
- "typecheck": "tsc --noEmit"
9
+ "typecheck": "tsc --noEmit",
10
+ "check": "barq check src"
10
11
  },
11
12
  "dependencies": {
12
- "@barqjs/core": "^0.2.0-next.0",
13
- "@barqjs/css": "^0.2.0-next.0",
14
- "@barqjs/web": "^0.2.0-next.0"
13
+ "@barqjs/core": "^0.2.0-next.1",
14
+ "@barqjs/css": "^0.2.0-next.1",
15
+ "@barqjs/web": "^0.2.0-next.1"
15
16
  },
16
17
  "devDependencies": {
17
- "@barqjs/vite": "^0.2.0-next.0",
18
+ "@barqjs/cli": "^0.2.0-next.1",
19
+ "@barqjs/vite": "^0.2.0-next.1",
18
20
  "typescript": "^7.0.2",
19
- "vite": "^8.3.4"
21
+ "vite": "^8.3.8"
20
22
  }
21
23
  }
@@ -0,0 +1,52 @@
1
+ # Working in this project
2
+
3
+ This is a barq application: a JSX framework where a component function runs
4
+ once and only the DOM nodes that read a changed signal update. It is not React
5
+ and not Solid, so read the authoring skill before writing components.
6
+
7
+ ## Skills
8
+
9
+ Installed with the packages, under `node_modules`:
10
+
11
+ - `node_modules/@barqjs/core/skills/barq/SKILL.md`: how to write barq (props
12
+ as values, signals, the two-function `createEffect`, stores, control flow,
13
+ async). Read it before writing or reviewing application code.
14
+ - `node_modules/@barqjs/core/skills/diagnostics/SKILL.md`: one section per
15
+ runtime `[CODE]`, with the repair.
16
+ - `node_modules/@barqjs/compiler/skills/compiler-diagnostics/SKILL.md`: one
17
+ section per build-time `BARQ0NN` code, with the repair.
18
+ - `node_modules/@barqjs/diagnostics/skills/agent-loops/SKILL.md`: capturing a
19
+ run as evidence for cost and responsiveness findings. Present when
20
+ `@barqjs/diagnostics` is installed.
21
+
22
+ ## Rule
23
+
24
+ When a console or build message carries a `[CODE]` or a `BARQ0NN`, open the
25
+ skill section for that code before changing code. The console entry's `in`
26
+ line is the component path and its `at` line is `file:line:col`. Repair the
27
+ cause; a suppression comment or `untrack` leaves the defect in place.
28
+
29
+ ## Commands
30
+
31
+ ```bash
32
+ npm run dev # the Vite dev server, http://localhost:5173
33
+ npm run build # production build into dist/client and dist/server
34
+ npm run preview # the built server, through vite preview
35
+ npm start # bun dist/server/serve.js
36
+ npm run typecheck # tsc --noEmit
37
+ npm run check # barq check: the compiler's findings, no build needed
38
+ ```
39
+
40
+ Run `npm run check` and `npm run typecheck` after a change, and `npm run build`
41
+ before calling it done. `npx barq check --json` gives the findings as JSON, and
42
+ `npx barq check --fix` applies the repairs that are one spelling. Diagnostics print
43
+ in the browser console, and server-side ones in the terminal of `npm run dev`.
44
+
45
+ ## Layout
46
+
47
+ - `index.html`: the document.
48
+ - `src/main.tsx`: the client entry.
49
+ - `src/routes`: one file per route. `__root.tsx` is the layout.
50
+ - `src/data/greeting.ts`: a server function. A file that exports server
51
+ functions exports nothing else (`BARQ012`).
52
+ - `src/routeTree.gen.ts`: written by the build. Commit it, do not edit it.
@@ -7,20 +7,22 @@
7
7
  "build": "vite build",
8
8
  "preview": "vite preview",
9
9
  "start": "bun dist/server/serve.js",
10
- "typecheck": "tsc --noEmit"
10
+ "typecheck": "tsc --noEmit",
11
+ "check": "barq check src"
11
12
  },
12
13
  "dependencies": {
13
- "@barqjs/core": "^0.2.0-next.0",
14
- "@barqjs/css": "^0.2.0-next.0",
15
- "@barqjs/router": "^0.2.0-next.0",
16
- "@barqjs/server": "^0.2.0-next.0",
17
- "@barqjs/start": "^0.2.0-next.0",
18
- "@barqjs/web": "^0.2.0-next.0"
14
+ "@barqjs/core": "^0.2.0-next.1",
15
+ "@barqjs/css": "^0.2.0-next.1",
16
+ "@barqjs/router": "^0.2.0-next.1",
17
+ "@barqjs/server": "^0.2.0-next.1",
18
+ "@barqjs/start": "^0.2.0-next.1",
19
+ "@barqjs/web": "^0.2.0-next.1"
19
20
  },
20
21
  "devDependencies": {
21
- "@barqjs/vite": "^0.2.0-next.0",
22
- "@types/bun": "^1.4.3",
22
+ "@barqjs/cli": "^0.2.0-next.1",
23
+ "@barqjs/vite": "^0.2.0-next.1",
24
+ "@types/bun": "^1.4.4",
23
25
  "typescript": "^7.0.2",
24
- "vite": "^8.3.4"
26
+ "vite": "^8.3.8"
25
27
  }
26
28
  }