@asd14/vblocks 2.1.0 → 4.0.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 +446 -254
- package/bin/vblocks.sh +437 -181
- package/package.json +16 -2
- package/src/webpack.config.js +14 -2
- package/template/{plain → _common/plumbing}/package.json +1 -1
- package/template/_common/post-init-plumbing.sh +14 -0
- package/template/xyflow/app/src/index.css +3 -0
- package/template/xyflow/post-init-app.sh +11 -0
- package/template/xyflow/package.json +0 -26
- package/template/xyflow/src/index.css +0 -1
- /package/template/_common/{src → app/src}/index.css +0 -0
- /package/template/_common/{src → app/src}/index.html +0 -0
- /package/template/_common/{tsconfig.json → app/tsconfig.json} +0 -0
- /package/template/_common/{_gitignore → plumbing/_gitignore} +0 -0
- /package/template/plain/{src → app/src}/index.tsx +0 -0
- /package/template/xyflow/{postcss.config.js → app/postcss.config.js} +0 -0
- /package/template/xyflow/{src → app/src}/index.tsx +0 -0
package/package.json
CHANGED
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@asd14/vblocks",
|
|
4
|
-
"version": "
|
|
5
|
-
"description": "
|
|
4
|
+
"version": "4.0.0",
|
|
5
|
+
"description": "Zero-config React builds, as a static site or a single HTML file",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"react",
|
|
8
|
+
"webpack",
|
|
9
|
+
"zero-config",
|
|
10
|
+
"single-file",
|
|
11
|
+
"static-site",
|
|
12
|
+
"spa",
|
|
13
|
+
"scaffolding",
|
|
14
|
+
"cli",
|
|
15
|
+
"ai-agents",
|
|
16
|
+
"swc",
|
|
17
|
+
"postcss",
|
|
18
|
+
"mdx"
|
|
19
|
+
],
|
|
6
20
|
"license": "MIT",
|
|
7
21
|
"sideEffects": false,
|
|
8
22
|
"publishConfig": {
|
package/src/webpack.config.js
CHANGED
|
@@ -148,6 +148,7 @@ const inlineAssets = compiler => {
|
|
|
148
148
|
* @property {string} robotsPath - Path to robots.txt copied to the output directory
|
|
149
149
|
* @property {string} faviconPath - Path to favicon.ico copied to the output directory
|
|
150
150
|
* @property {boolean} [single] - Build one standalone index.html, every asset inlined
|
|
151
|
+
* @property {boolean} [analyze] - Run the bundle analyzer next to the dev server
|
|
151
152
|
*/
|
|
152
153
|
|
|
153
154
|
/**
|
|
@@ -161,10 +162,14 @@ const inlineAssets = compiler => {
|
|
|
161
162
|
* @param {VBlocksProps} props
|
|
162
163
|
* @returns {WebpackConfiguration}
|
|
163
164
|
*/
|
|
164
|
-
export default (
|
|
165
|
+
export default (
|
|
166
|
+
{ entryDir, robotsPath, faviconPath, single, analyze },
|
|
167
|
+
{ mode }
|
|
168
|
+
) => {
|
|
165
169
|
const isProduction = mode === "production"
|
|
166
170
|
const isServe = process.argv[2] == "serve"
|
|
167
171
|
const isSingle = Boolean(single) && !isServe
|
|
172
|
+
const isAnalyze = Boolean(analyze) && isServe
|
|
168
173
|
const hasReactRefresh = isServe && mode === "development"
|
|
169
174
|
const swcConfig = loadSwcConfig({ hasReactRefresh })
|
|
170
175
|
const commonPostCSSConfigs = createCssModuleConfig(isProduction)
|
|
@@ -190,6 +195,9 @@ export default ({ entryDir, robotsPath, faviconPath, single }, { mode }) => {
|
|
|
190
195
|
|
|
191
196
|
mode: mode,
|
|
192
197
|
|
|
198
|
+
// Keep the summary of VBlocks on screen, `--stats` overrides it
|
|
199
|
+
stats: "errors-warnings",
|
|
200
|
+
|
|
193
201
|
output: {
|
|
194
202
|
// A standalone file opens from disk, where "/" is the filesystem root
|
|
195
203
|
publicPath: isSingle ? "" : "/",
|
|
@@ -352,6 +360,8 @@ export default ({ entryDir, robotsPath, faviconPath, single }, { mode }) => {
|
|
|
352
360
|
|
|
353
361
|
new DotenvPlugin({
|
|
354
362
|
path: paths.dotenv,
|
|
363
|
+
// Don't spam logs, an app without a .env is common
|
|
364
|
+
silent: true,
|
|
355
365
|
}),
|
|
356
366
|
|
|
357
367
|
!isSingle &&
|
|
@@ -369,9 +379,11 @@ export default ({ entryDir, robotsPath, faviconPath, single }, { mode }) => {
|
|
|
369
379
|
|
|
370
380
|
isSingle && inlineAssets,
|
|
371
381
|
|
|
372
|
-
|
|
382
|
+
isAnalyze &&
|
|
373
383
|
new BundleAnalyzerPlugin({
|
|
374
384
|
openAnalyzer: false,
|
|
385
|
+
// Two dev servers would otherwise both take 8888
|
|
386
|
+
analyzerPort: "auto",
|
|
375
387
|
}),
|
|
376
388
|
|
|
377
389
|
hasReactRefresh && new ReactRefreshWebpackPlugin(),
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
|
|
3
|
+
# Runs in the project root, after `vblocks init` copies the plumbing files.
|
|
4
|
+
# vblocks exports VB_VERSION
|
|
5
|
+
|
|
6
|
+
set -eu
|
|
7
|
+
|
|
8
|
+
# npm leaves every `.gitignore` out of the package, so the template ships
|
|
9
|
+
# `_gitignore`
|
|
10
|
+
mv -- _gitignore .gitignore
|
|
11
|
+
|
|
12
|
+
npm pkg set \
|
|
13
|
+
"name=$(basename "$PWD")" \
|
|
14
|
+
"devDependencies.@asd14/vblocks=^${VB_VERSION}"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
|
|
3
|
+
# Runs in the app folder, after `vblocks init` copies the app files. npm writes
|
|
4
|
+
# the nearest package.json, the project root's
|
|
5
|
+
|
|
6
|
+
set -eu
|
|
7
|
+
|
|
8
|
+
npm pkg set \
|
|
9
|
+
"dependencies.@xyflow/react=^12" \
|
|
10
|
+
"devDependencies.@tailwindcss/postcss=^4" \
|
|
11
|
+
"devDependencies.tailwindcss=^4"
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/package.json",
|
|
3
|
-
"name": "vblocks-app",
|
|
4
|
-
"private": true,
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"start": "vblocks serve",
|
|
8
|
-
"build": "vblocks build",
|
|
9
|
-
"build:single": "vblocks build --env single",
|
|
10
|
-
"typecheck": "tsc --noEmit"
|
|
11
|
-
},
|
|
12
|
-
"dependencies": {
|
|
13
|
-
"@xyflow/react": "^12",
|
|
14
|
-
"react": "^19",
|
|
15
|
-
"react-dom": "^19"
|
|
16
|
-
},
|
|
17
|
-
"devDependencies": {
|
|
18
|
-
"@asd14/ts-config": "^1.6.0",
|
|
19
|
-
"@asd14/vblocks": "*",
|
|
20
|
-
"@tailwindcss/postcss": "^4",
|
|
21
|
-
"@types/react": "^19",
|
|
22
|
-
"@types/react-dom": "^19",
|
|
23
|
-
"tailwindcss": "^4",
|
|
24
|
-
"typescript": "^6"
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import "tailwindcss";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|