@uniweb/templates 0.1.2 → 0.1.4
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
CHANGED
|
@@ -158,6 +158,38 @@ This `"foundation": "file:../foundation"` entry is essential because:
|
|
|
158
158
|
- Foundation: `"name": "foundation"` (not `{{projectName}}-foundation`)
|
|
159
159
|
- Site: `"name": "site"` (not `{{projectName}}-site`)
|
|
160
160
|
|
|
161
|
+
### Root package.json Requirements
|
|
162
|
+
|
|
163
|
+
The root `package.json.hbs` must include workspace configuration for both npm and pnpm:
|
|
164
|
+
|
|
165
|
+
```json
|
|
166
|
+
{
|
|
167
|
+
"name": "{{projectName}}",
|
|
168
|
+
"version": "0.1.0",
|
|
169
|
+
"private": true,
|
|
170
|
+
"type": "module",
|
|
171
|
+
"scripts": {
|
|
172
|
+
"dev": "pnpm --filter site dev",
|
|
173
|
+
"dev:runtime": "VITE_FOUNDATION_MODE=runtime pnpm --filter site dev",
|
|
174
|
+
"build": "pnpm -r build",
|
|
175
|
+
"preview": "pnpm --filter site preview"
|
|
176
|
+
},
|
|
177
|
+
"workspaces": [
|
|
178
|
+
"site",
|
|
179
|
+
"foundation",
|
|
180
|
+
"sites/*",
|
|
181
|
+
"foundations/*"
|
|
182
|
+
],
|
|
183
|
+
"pnpm": {
|
|
184
|
+
"onlyBuiltDependencies": ["esbuild", "sharp"]
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**Required fields:**
|
|
190
|
+
- `workspaces` - Enables npm workspace linking (required for `file:` dependencies to work)
|
|
191
|
+
- `pnpm.onlyBuiltDependencies` - Prevents pnpm from rebuilding native modules on every install
|
|
192
|
+
|
|
161
193
|
This matches how the CLI's built-in templates work and ensures the workspace linking functions correctly.
|
|
162
194
|
|
|
163
195
|
### Workspace Configuration
|
|
@@ -236,10 +268,11 @@ Key testing points:
|
|
|
236
268
|
|
|
237
269
|
- [ ] Create `templates/<name>/template.json` with required `name` field
|
|
238
270
|
- [ ] Create `templates/<name>/template/` directory structure
|
|
271
|
+
- [ ] Include root `package.json.hbs` with `workspaces` array and `pnpm.onlyBuiltDependencies`
|
|
272
|
+
- [ ] Include `pnpm-workspace.yaml` with workspace packages
|
|
239
273
|
- [ ] Include both `foundation/` and `site/` packages
|
|
240
|
-
- [ ] Add `"foundation": "
|
|
274
|
+
- [ ] Add `"foundation": "file:../foundation"` to site's dependencies (not `workspace:*`)
|
|
241
275
|
- [ ] Use fixed names: `"name": "foundation"` and `"name": "site"`
|
|
242
|
-
- [ ] Include `pnpm-workspace.yaml` with workspace packages
|
|
243
276
|
- [ ] Add `.hbs` extension to files needing variable substitution
|
|
244
277
|
- [ ] Include sample content in `site/pages/`
|
|
245
278
|
- [ ] Create meaningful component metadata in `foundation/src/components/*/meta.js`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniweb/templates",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Template processing engine and official templates for Uniweb",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -29,4 +29,4 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"handlebars": "^4.7.8"
|
|
31
31
|
}
|
|
32
|
-
}
|
|
32
|
+
}
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "{{projectName}}",
|
|
3
|
+
"version": "0.1.0",
|
|
3
4
|
"private": true,
|
|
4
5
|
"type": "module",
|
|
5
6
|
"scripts": {
|
|
6
7
|
"dev": "pnpm --filter site dev",
|
|
7
|
-
"dev:runtime": "pnpm --filter site dev
|
|
8
|
-
"build": "pnpm
|
|
9
|
-
"build:foundation": "pnpm --filter foundation build",
|
|
10
|
-
"build:site": "pnpm --filter site build",
|
|
8
|
+
"dev:runtime": "VITE_FOUNDATION_MODE=runtime pnpm --filter site dev",
|
|
9
|
+
"build": "pnpm -r build",
|
|
11
10
|
"preview": "pnpm --filter site preview"
|
|
11
|
+
},
|
|
12
|
+
"workspaces": [
|
|
13
|
+
"site",
|
|
14
|
+
"foundation",
|
|
15
|
+
"sites/*",
|
|
16
|
+
"foundations/*"
|
|
17
|
+
],
|
|
18
|
+
"pnpm": {
|
|
19
|
+
"onlyBuiltDependencies": ["esbuild", "sharp"]
|
|
12
20
|
}
|
|
13
21
|
}
|