@asd14/vblocks 8.2.0 → 8.3.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/.sh41/skills/use-vblocks/SKILL.md +19 -17
- package/README.md +16 -13
- package/defaults/webpack.config.js +15 -4
- package/docs/REFERENCE.md +1 -1
- package/package.json +10 -9
- package/template/_common/plumbing/package.json +1 -1
|
@@ -19,8 +19,8 @@ Next.js does.
|
|
|
19
19
|
together -->
|
|
20
20
|
|
|
21
21
|
- An app needs only `src/index.tsx` and `src/index.html`
|
|
22
|
-
- VBlocks supports SWC, PostCSS, CSS Modules, MDX, React Refresh and
|
|
23
|
-
files
|
|
22
|
+
- VBlocks supports SWC, PostCSS, CSS Modules, MDX with GFM, React Refresh and
|
|
23
|
+
`.env` files
|
|
24
24
|
- Several apps can share one `package.json` and `node_modules/`
|
|
25
25
|
- In development, the Agentation toolbar sends UI annotations to an agent
|
|
26
26
|
|
|
@@ -52,6 +52,8 @@ together -->
|
|
|
52
52
|
`import {{text}} from "{{./note.txt}}?raw"`
|
|
53
53
|
- Import a Markdown or MDX file as a component:\
|
|
54
54
|
`import {{Intro}} from "{{./intro.mdx}}"`
|
|
55
|
+
- Replace the element MDX renders for a tag, eg. each GFM pipe table:\
|
|
56
|
+
`<Intro components={{ table: Table }} />`
|
|
55
57
|
|
|
56
58
|
## Index
|
|
57
59
|
|
|
@@ -61,7 +63,7 @@ recomputes the lines and the counts after each edit of the docs -->
|
|
|
61
63
|
Paths are relative to the package root: the VBlocks repo, or
|
|
62
64
|
`node_modules/@asd14/vblocks/` in the project folder.
|
|
63
65
|
|
|
64
|
-
**`README.md`**,
|
|
66
|
+
**`README.md`**, 638 lines:
|
|
65
67
|
|
|
66
68
|
- "## Quick Start" L:72-120
|
|
67
69
|
- "### Keep several apps in one project" L:124-167
|
|
@@ -69,20 +71,20 @@ Paths are relative to the package root: the VBlocks repo, or
|
|
|
69
71
|
- "### Import from `src/` with `@self`" L:195-216
|
|
70
72
|
- "### Use CSS Modules" L:218-243
|
|
71
73
|
- "### Import a file as text" L:245-256
|
|
72
|
-
- "### Write a page in Markdown or MDX" L:258-
|
|
73
|
-
- "#### `code` meta as props" L:
|
|
74
|
-
- "### Pick the browsers" L:
|
|
75
|
-
- "### Replace a config" L:
|
|
76
|
-
- "### Extend a config" L:
|
|
77
|
-
- "#### PostCSS" L:
|
|
78
|
-
- "#### Webpack" L:
|
|
79
|
-
- "### Style with Tailwind" L:
|
|
80
|
-
- "### Send UI annotations to an AI agent" L:
|
|
81
|
-
- "### Open the page from another device" L:
|
|
82
|
-
- "### Build a single HTML file" L:
|
|
83
|
-
- "### Add VBlocks to an existing project" L:
|
|
84
|
-
- "## More docs" L:
|
|
85
|
-
- "## Develop" L:
|
|
74
|
+
- "### Write a page in Markdown or MDX" L:258-324
|
|
75
|
+
- "#### `code` meta as props" L:278-324
|
|
76
|
+
- "### Pick the browsers" L:326-343
|
|
77
|
+
- "### Replace a config" L:345-399
|
|
78
|
+
- "### Extend a config" L:401-464
|
|
79
|
+
- "#### PostCSS" L:408-444
|
|
80
|
+
- "#### Webpack" L:446-464
|
|
81
|
+
- "### Style with Tailwind" L:466-521
|
|
82
|
+
- "### Send UI annotations to an AI agent" L:523-541
|
|
83
|
+
- "### Open the page from another device" L:543-550
|
|
84
|
+
- "### Build a single HTML file" L:552-563
|
|
85
|
+
- "### Add VBlocks to an existing project" L:565-602
|
|
86
|
+
- "## More docs" L:604-613
|
|
87
|
+
- "## Develop" L:615-634
|
|
86
88
|
|
|
87
89
|
**`docs/REFERENCE.md`**, 631 lines:
|
|
88
90
|
|
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ everything set up.
|
|
|
20
20
|
|
|
21
21
|
**🔋 Maximal support**
|
|
22
22
|
|
|
23
|
-
- SWC, PostCSS, CSS Modules, MDX, React Refresh, `.env` files
|
|
23
|
+
- SWC, PostCSS, CSS Modules, MDX with GFM, React Refresh, `.env` files
|
|
24
24
|
|
|
25
25
|
**📦 Several apps, one install**
|
|
26
26
|
|
|
@@ -72,7 +72,7 @@ everything set up.
|
|
|
72
72
|
## Quick Start
|
|
73
73
|
|
|
74
74
|
> [!IMPORTANT]\
|
|
75
|
-
> VBlocks needs Node `^22.22.3`, `^24.15.0` or `>=26.
|
|
75
|
+
> VBlocks needs Node `^22.22.3`, `^24.15.0` or `>=26.13`.
|
|
76
76
|
|
|
77
77
|
<!--
|
|
78
78
|
Using "scaffold", the field's word for what `init` does, eg. Yeoman and
|
|
@@ -265,11 +265,14 @@ import Intro from "./intro.mdx"
|
|
|
265
265
|
const App = () => <Intro />
|
|
266
266
|
```
|
|
267
267
|
|
|
268
|
-
|
|
269
|
-
|
|
268
|
+
VBlocks reads GFM (GitHub Flavored Markdown) with
|
|
269
|
+
[remark-gfm](https://github.com/remarkjs/remark-gfm). A page can use tables,
|
|
270
|
+
strikethrough, task lists, autolinks and footnotes.
|
|
271
|
+
|
|
272
|
+
Pass `components` to replace the element MDX renders for a tag, eg. each table:
|
|
270
273
|
|
|
271
274
|
```tsx
|
|
272
|
-
<Intro components={{
|
|
275
|
+
<Intro components={{ table: Table }} />
|
|
273
276
|
```
|
|
274
277
|
|
|
275
278
|
#### `code` meta as props
|
|
@@ -617,18 +620,18 @@ vblocks/
|
|
|
617
620
|
├── defaults/ # the configs that eject prints
|
|
618
621
|
├── template/ # the templates of init
|
|
619
622
|
├── test/
|
|
620
|
-
│ ├── mdx-code-meta/ # an MDX page with code meta, built and run in Node
|
|
623
|
+
│ ├── mdx-code-meta/ # an MDX page with code meta and a pipe table, built and run in Node
|
|
621
624
|
│ └── verify-templates/ # typechecks, builds and serves each template
|
|
622
625
|
└── types/ # client.d.ts
|
|
623
626
|
```
|
|
624
627
|
|
|
625
|
-
| Script | Does
|
|
626
|
-
| :--------------------------------------- |
|
|
627
|
-
| `npm run lint` | Runs ESLint
|
|
628
|
-
| `npm run typecheck` | Typechecks the code and the client types
|
|
629
|
-
| `npm run integration-test` | Runs both integration tests
|
|
630
|
-
| `npm run integration-test:templates` | Typechecks, builds and serves every template `vblocks init` writes
|
|
631
|
-
| `npm run integration-test:mdx-code-meta` | Builds an MDX page and checks
|
|
628
|
+
| Script | Does |
|
|
629
|
+
| :--------------------------------------- | :--------------------------------------------------------------------------- |
|
|
630
|
+
| `npm run lint` | Runs ESLint |
|
|
631
|
+
| `npm run typecheck` | Typechecks the code and the client types |
|
|
632
|
+
| `npm run integration-test` | Runs both integration tests |
|
|
633
|
+
| `npm run integration-test:templates` | Typechecks, builds and serves every template `vblocks init` writes |
|
|
634
|
+
| `npm run integration-test:mdx-code-meta` | Builds an MDX page and checks what its `code` and `table` components receive |
|
|
632
635
|
|
|
633
636
|
## License
|
|
634
637
|
|
|
@@ -12,6 +12,7 @@ import HtmlWebPackPlugin from "html-webpack-plugin"
|
|
|
12
12
|
import MiniCssExtractPlugin from "mini-css-extract-plugin"
|
|
13
13
|
import postcss from "postcss"
|
|
14
14
|
import rehypeMdxCodeProps from "rehype-mdx-code-props"
|
|
15
|
+
import remarkGfm from "remark-gfm"
|
|
15
16
|
import { BundleAnalyzerPlugin } from "webpack-bundle-analyzer"
|
|
16
17
|
|
|
17
18
|
const logger = buildLogger({ namespace: "vblocks", level: "info" })
|
|
@@ -420,10 +421,20 @@ const getWebpackConfig = (
|
|
|
420
421
|
{
|
|
421
422
|
loader: require.resolve("@mdx-js/loader"),
|
|
422
423
|
options: {
|
|
423
|
-
//
|
|
424
|
-
//
|
|
425
|
-
|
|
426
|
-
rehypePlugins: [
|
|
424
|
+
// remark-gfm adds tables, strikethrough, task lists, autolinks
|
|
425
|
+
// and footnotes to the CommonMark that MDX reads
|
|
426
|
+
remarkPlugins: [remarkGfm],
|
|
427
|
+
rehypePlugins: [
|
|
428
|
+
[
|
|
429
|
+
// The meta of a code block, eg. `file="src/app.tsx"`,
|
|
430
|
+
// becomes props of the `code` component.
|
|
431
|
+
rehypeMdxCodeProps,
|
|
432
|
+
{
|
|
433
|
+
// `tagName: "code"` replaces the default, `pre`
|
|
434
|
+
tagName: "code",
|
|
435
|
+
},
|
|
436
|
+
],
|
|
437
|
+
],
|
|
427
438
|
},
|
|
428
439
|
},
|
|
429
440
|
],
|
package/docs/REFERENCE.md
CHANGED
|
@@ -326,7 +326,7 @@ npx vblocks eject webpack > webpack.config.js
|
|
|
326
326
|
| Files | Loaders, in the order they run, or the output |
|
|
327
327
|
| :-------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------ |
|
|
328
328
|
| `*.ts`, `*.tsx`, outside `node_modules` | `swc-loader`, with [`.swcrc`](#swcrc) |
|
|
329
|
-
| `*.md`, `*.mdx`, outside `node_modules` | `@mdx-js/loader`, with `rehype-mdx-code-props`, then `swc-loader`
|
|
329
|
+
| `*.md`, `*.mdx`, outside `node_modules` | `@mdx-js/loader`, with `remark-gfm` and `rehype-mdx-code-props`, then `swc-loader` |
|
|
330
330
|
| `*.css` | `postcss-loader`, with [`postcss.config.js`](#postcssconfigjs), then `css-loader`, then the loader of `mini-css-extract-plugin` |
|
|
331
331
|
| `*.module.css` | the same, and `css-loader` renames each class to a unique name, see [Use CSS Modules](../README.md#use-css-modules) |
|
|
332
332
|
| `*.jpg`, `*.gif`, `*.png`, `*.svg` | a data URL up to 10 KiB, a file above it. With `--single-file`, a data URL |
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@asd14/vblocks",
|
|
4
|
-
"version": "8.
|
|
4
|
+
"version": "8.3.0",
|
|
5
5
|
"description": "Zero-config React builds of an SPA (single-page application), as a folder or a single HTML file",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"react",
|
|
@@ -79,21 +79,22 @@
|
|
|
79
79
|
"html-webpack-plugin": "^5.6.8",
|
|
80
80
|
"mini-css-extract-plugin": "^2.10.2",
|
|
81
81
|
"postcss": "^8.5.33",
|
|
82
|
-
"postcss-loader": "^8.2.
|
|
82
|
+
"postcss-loader": "^8.2.2",
|
|
83
83
|
"postcss-preset-env": "^11.6.3",
|
|
84
84
|
"react-refresh": "^0.19.0",
|
|
85
85
|
"rehype-mdx-code-props": "^3.0.1",
|
|
86
|
+
"remark-gfm": "^4.0.1",
|
|
86
87
|
"swc-loader": "^0.2.7",
|
|
87
|
-
"webpack": "^5.
|
|
88
|
+
"webpack": "^5.113.0",
|
|
88
89
|
"webpack-bundle-analyzer": "^5.4.3",
|
|
89
90
|
"webpack-cli": "^7.3.1",
|
|
90
91
|
"webpack-dev-server": "^6.1.0"
|
|
91
92
|
},
|
|
92
93
|
"devDependencies": {
|
|
93
|
-
"@asd14/eslint-config": "^17.
|
|
94
|
-
"@asd14/prettier-config": "^1.
|
|
95
|
-
"@asd14/semantic-release-config": "^
|
|
96
|
-
"@asd14/ts-config": "^2.
|
|
94
|
+
"@asd14/eslint-config": "^17.1.0",
|
|
95
|
+
"@asd14/prettier-config": "^1.6.0",
|
|
96
|
+
"@asd14/semantic-release-config": "^2.0.0",
|
|
97
|
+
"@asd14/ts-config": "^2.1.0",
|
|
97
98
|
"@commitlint/cli": "^21.2.4",
|
|
98
99
|
"@commitlint/config-conventional": "^21.2.4",
|
|
99
100
|
"@tailwindcss/postcss": "^4.3.5",
|
|
@@ -105,7 +106,7 @@
|
|
|
105
106
|
"agentation": "^3.1.2",
|
|
106
107
|
"eslint": "^9.39.5",
|
|
107
108
|
"prettier": "^3.10.1",
|
|
108
|
-
"semantic-release": "^
|
|
109
|
+
"semantic-release": "^26.0.1",
|
|
109
110
|
"tailwindcss": "^4.3.5",
|
|
110
111
|
"typescript": "^6.0.3"
|
|
111
112
|
},
|
|
@@ -114,6 +115,6 @@
|
|
|
114
115
|
"react-dom": "^18 || ^19"
|
|
115
116
|
},
|
|
116
117
|
"engines": {
|
|
117
|
-
"node": "^22.22.3 || ^24.15.0 || >=26.
|
|
118
|
+
"node": "^22.22.3 || ^24.15.0 || >=26.13"
|
|
118
119
|
}
|
|
119
120
|
}
|