@anydigital/eleventy-bricks 1.0.0-alpha.14 → 1.0.0-alpha.15
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 +63 -0
- package/package.json +2 -2
- package/src/do/package.json +18 -0
- package/src/eleventy.config.js +1 -1
package/README.md
CHANGED
|
@@ -569,6 +569,69 @@ mkdir -p admin
|
|
|
569
569
|
cp node_modules/@anydigital/eleventy-bricks/src/admin/index.html admin/
|
|
570
570
|
```
|
|
571
571
|
|
|
572
|
+
## Development Workflow Setup
|
|
573
|
+
|
|
574
|
+
### Using the `do` Folder Pattern
|
|
575
|
+
|
|
576
|
+
This package provides a pre-configured `do` folder setup that helps organize your development workflow using npm workspaces. The `do` folder contains scripts for building and running your Eleventy project.
|
|
577
|
+
|
|
578
|
+
**Setup:**
|
|
579
|
+
|
|
580
|
+
1. Create a `do` folder in your project root:
|
|
581
|
+
|
|
582
|
+
```bash
|
|
583
|
+
mkdir do
|
|
584
|
+
```
|
|
585
|
+
|
|
586
|
+
2. Symlink the package.json from the eleventy-bricks package:
|
|
587
|
+
|
|
588
|
+
```bash
|
|
589
|
+
ln -s node_modules/@anydigital/eleventy-bricks/src/do/package.json do/package.json
|
|
590
|
+
```
|
|
591
|
+
|
|
592
|
+
3. Configure your root `package.json` to use npm workspaces:
|
|
593
|
+
|
|
594
|
+
```json
|
|
595
|
+
{
|
|
596
|
+
"name": "my-project",
|
|
597
|
+
"workspaces": ["do"],
|
|
598
|
+
"scripts": {
|
|
599
|
+
"build": "npm -w do run build",
|
|
600
|
+
"start": "npm -w do run start"
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
```
|
|
604
|
+
|
|
605
|
+
**Usage:**
|
|
606
|
+
|
|
607
|
+
Run your Eleventy project:
|
|
608
|
+
|
|
609
|
+
```bash
|
|
610
|
+
npm start
|
|
611
|
+
```
|
|
612
|
+
|
|
613
|
+
Build for production:
|
|
614
|
+
|
|
615
|
+
```bash
|
|
616
|
+
npm run build
|
|
617
|
+
```
|
|
618
|
+
|
|
619
|
+
**Available Scripts in `do` folder:**
|
|
620
|
+
|
|
621
|
+
- `build` - Build the site with Eleventy and minify CSS with Tailwind
|
|
622
|
+
- `start` - Start Eleventy dev server with live reload and Tailwind watch mode
|
|
623
|
+
- `stage` - Clean build and serve locally for preview
|
|
624
|
+
- `11ty` - Run Eleventy commands directly
|
|
625
|
+
- `11ty:clean` - Remove the `_site` output directory
|
|
626
|
+
- `tw` - Run Tailwind CSS commands
|
|
627
|
+
|
|
628
|
+
**Benefits:**
|
|
629
|
+
|
|
630
|
+
- **Clean separation**: Keep build scripts separate from project configuration
|
|
631
|
+
- **Reusable workflows**: Update scripts by upgrading the package
|
|
632
|
+
- **Workspace isolation**: Scripts run in their own workspace context
|
|
633
|
+
- **Easy maintenance**: No need to manually maintain build scripts
|
|
634
|
+
|
|
572
635
|
## CLI Helper Commands
|
|
573
636
|
|
|
574
637
|
After installing this package, the `download-files` command becomes available:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anydigital/eleventy-bricks",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.15",
|
|
4
4
|
"description": "A collection of helpful utilities and filters for Eleventy (11ty)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"homepage": "https://github.com/anydigital/eleventy-bricks#readme",
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@11ty/eleventy": "^
|
|
43
|
+
"@11ty/eleventy": "^3.0.0"
|
|
44
44
|
},
|
|
45
45
|
"engines": {
|
|
46
46
|
"node": ">=18.0.0"
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@anydigital/eleventy-bricks-do",
|
|
3
|
+
"private": true,
|
|
4
|
+
"scripts": {
|
|
5
|
+
"build": "npm run 11ty && npm run tw -- --minify",
|
|
6
|
+
"start": "npm run 11ty -- --serve & npm run tw -- --watch",
|
|
7
|
+
|
|
8
|
+
"prerestart": "npm run 11ty:clean",
|
|
9
|
+
"stage": " npm run 11ty:clean; npm run build && serve ../_site",
|
|
10
|
+
|
|
11
|
+
"11ty": "cd ../ && NODE_OPTIONS='--preserve-symlinks' eleventy",
|
|
12
|
+
"11ty:clean": "rm -r ../_site",
|
|
13
|
+
"11ty:debug": "DEBUG=* npm run 11ty",
|
|
14
|
+
|
|
15
|
+
"tw": "tailwindcss -i ../src/_template/styles.css -o ../_site/styles.css",
|
|
16
|
+
"tw:debug": "DEBUG=* npm run tw"
|
|
17
|
+
}
|
|
18
|
+
}
|
package/src/eleventy.config.js
CHANGED
|
@@ -42,7 +42,7 @@ export default function(eleventyConfig) {
|
|
|
42
42
|
}));
|
|
43
43
|
|
|
44
44
|
/* Data */
|
|
45
|
-
eleventyConfig.addDataExtension("yml", (contents) => yaml.
|
|
45
|
+
eleventyConfig.addDataExtension("yml", (contents) => yaml.load(contents));
|
|
46
46
|
|
|
47
47
|
/* Build */
|
|
48
48
|
eleventyConfig.addPassthroughCopy({
|