@times-design-system/components-wordpress 1.5.3 → 1.6.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/dist/blocks/ad-container/block.json +10 -0
- package/dist/blocks/ad-container/edit.js +17 -1
- package/dist/blocks/ad-container/render.php +14 -0
- package/dist/blocks/button/block.json +19 -5
- package/dist/blocks/button/edit.js +33 -15
- package/dist/blocks/button/render.php +24 -2
- package/dist/blocks/button/style.css +63 -0
- package/dist/blocks/chip/block.json +12 -7
- package/dist/blocks/chip/edit.js +20 -17
- package/dist/blocks/chip/render.php +14 -2
- package/dist/blocks/dialog-box/block.json +10 -0
- package/dist/blocks/dialog-box/edit.js +17 -0
- package/dist/blocks/dialog-box/render.php +16 -4
- package/dist/blocks/divider/block.json +10 -0
- package/dist/blocks/divider/edit.js +18 -2
- package/dist/blocks/divider/render.php +14 -1
- package/dist/blocks/flag/block.json +10 -0
- package/dist/blocks/flag/edit.js +27 -2
- package/dist/blocks/flag/render.php +14 -0
- package/dist/blocks/icon/block.json +10 -0
- package/dist/blocks/icon/edit.js +17 -0
- package/dist/blocks/icon/render.php +16 -4
- package/dist/blocks/icon-button/block.json +15 -0
- package/dist/blocks/icon-button/edit.js +33 -1
- package/dist/blocks/icon-button/render.php +19 -0
- package/dist/blocks/icon-button/style.css +37 -3
- package/dist/blocks/input/block.json +10 -0
- package/dist/blocks/input/edit.js +27 -1
- package/dist/blocks/input/render.php +17 -1
- package/dist/blocks/input-helper-message/block.json +10 -0
- package/dist/blocks/input-helper-message/edit.js +17 -0
- package/dist/blocks/input-helper-message/render.php +16 -4
- package/dist/blocks/link/block.json +12 -7
- package/dist/blocks/link/edit.js +21 -18
- package/dist/blocks/link/render.php +14 -2
- package/dist/blocks/tab/block.json +10 -0
- package/dist/blocks/tab/edit.js +17 -0
- package/dist/blocks/tab/render.php +16 -4
- package/dist/blocks/tab-group/block.json +10 -0
- package/dist/blocks/tab-group/edit.js +17 -0
- package/dist/blocks/tab-group/render.php +16 -4
- package/dist/blocks/text/block.json +10 -0
- package/dist/blocks/text/edit.js +18 -2
- package/dist/blocks/text/render.php +14 -1
- package/dist/blocks/toast/block.json +10 -0
- package/dist/blocks/toast/edit.js +18 -1
- package/dist/blocks/toast/render.php +14 -0
- package/dist/index.cjs +389 -148
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +389 -148
- package/dist/index.js.map +1 -1
- package/dist/utils/DATA_ATTRIBUTES_USAGE.md +377 -0
- package/dist/utils/sanitize-data-attributes.php +109 -0
- package/package.json +9 -3
- package/BLOCK_CREATION_CHECKLIST.md +0 -385
- package/BUILD.md +0 -411
- package/CHANGELOG.md +0 -85
- package/SCSS_VARIABLES_REFERENCE.md +0 -316
- package/STYLING_SYNC_GUIDE.md +0 -306
- package/TESTING.md +0 -152
- package/TRANSFORMATION_GUIDE.md +0 -908
- package/dist/blocks/button/style-resolved.css +0 -153
- package/lib/wordpress.js +0 -7
- package/rollup.config.js +0 -75
- package/scripts/build-plugin.cjs +0 -121
- package/scripts/create-block.sh +0 -141
- package/scripts/create-wordpress-block-tests.cjs +0 -438
- package/scripts/create-wordpress-block.cjs +0 -681
- package/src/blocks/ad-container/block.json +0 -29
- package/src/blocks/ad-container/edit.js +0 -42
- package/src/blocks/ad-container/index.js +0 -10
- package/src/blocks/ad-container/render.php +0 -27
- package/src/blocks/ad-container/save.js +0 -16
- package/src/blocks/ad-container/style-editor.css +0 -4
- package/src/blocks/ad-container/style.css +0 -30
- package/src/blocks/button/block.json +0 -90
- package/src/blocks/button/edit.js +0 -187
- package/src/blocks/button/index.js +0 -11
- package/src/blocks/button/render.php +0 -71
- package/src/blocks/button/save.js +0 -52
- package/src/blocks/button/style-editor.css +0 -15
- package/src/blocks/button/style-resolved.css +0 -153
- package/src/blocks/button/style.css +0 -157
- package/src/blocks/chip/block.json +0 -58
- package/src/blocks/chip/edit.js +0 -113
- package/src/blocks/chip/index.js +0 -10
- package/src/blocks/chip/render.php +0 -40
- package/src/blocks/chip/save.js +0 -36
- package/src/blocks/chip/style-editor.css +0 -5
- package/src/blocks/chip/style.css +0 -87
- package/src/blocks/dialog-box/block.json +0 -24
- package/src/blocks/dialog-box/edit.js +0 -41
- package/src/blocks/dialog-box/index.js +0 -17
- package/src/blocks/dialog-box/render.php +0 -24
- package/src/blocks/dialog-box/save.js +0 -23
- package/src/blocks/dialog-box/style.css +0 -23
- package/src/blocks/divider/block.json +0 -32
- package/src/blocks/divider/edit.js +0 -42
- package/src/blocks/divider/index.js +0 -10
- package/src/blocks/divider/render.php +0 -31
- package/src/blocks/divider/save.js +0 -18
- package/src/blocks/divider/style-editor.css +0 -4
- package/src/blocks/divider/style.css +0 -37
- package/src/blocks/flag/block.json +0 -49
- package/src/blocks/flag/edit.js +0 -82
- package/src/blocks/flag/index.js +0 -10
- package/src/blocks/flag/render.php +0 -34
- package/src/blocks/flag/save.js +0 -25
- package/src/blocks/flag/style-editor.css +0 -5
- package/src/blocks/flag/style.css +0 -54
- package/src/blocks/icon/block.json +0 -24
- package/src/blocks/icon/edit.js +0 -41
- package/src/blocks/icon/index.js +0 -17
- package/src/blocks/icon/render.php +0 -24
- package/src/blocks/icon/save.js +0 -23
- package/src/blocks/icon/style.css +0 -23
- package/src/blocks/icon-button/block.json +0 -44
- package/src/blocks/icon-button/edit.js +0 -82
- package/src/blocks/icon-button/index.js +0 -10
- package/src/blocks/icon-button/render.php +0 -46
- package/src/blocks/icon-button/save.js +0 -29
- package/src/blocks/icon-button/style-editor.css +0 -5
- package/src/blocks/icon-button/style.css +0 -31
- package/src/blocks/input/block.json +0 -48
- package/src/blocks/input/edit.js +0 -78
- package/src/blocks/input/index.js +0 -10
- package/src/blocks/input/render.php +0 -39
- package/src/blocks/input/save.js +0 -27
- package/src/blocks/input/style-editor.css +0 -8
- package/src/blocks/input/style.css +0 -53
- package/src/blocks/input-helper-message/block.json +0 -24
- package/src/blocks/input-helper-message/edit.js +0 -42
- package/src/blocks/input-helper-message/index.js +0 -17
- package/src/blocks/input-helper-message/render.php +0 -24
- package/src/blocks/input-helper-message/save.js +0 -23
- package/src/blocks/input-helper-message/style.css +0 -23
- package/src/blocks/link/block.json +0 -72
- package/src/blocks/link/edit.js +0 -151
- package/src/blocks/link/index.js +0 -10
- package/src/blocks/link/render.php +0 -44
- package/src/blocks/link/save.js +0 -46
- package/src/blocks/link/style-editor.css +0 -5
- package/src/blocks/link/style.css +0 -119
- package/src/blocks/tab/block.json +0 -24
- package/src/blocks/tab/edit.js +0 -41
- package/src/blocks/tab/index.js +0 -17
- package/src/blocks/tab/render.php +0 -24
- package/src/blocks/tab/save.js +0 -23
- package/src/blocks/tab/style.css +0 -23
- package/src/blocks/tab-group/block.json +0 -24
- package/src/blocks/tab-group/edit.js +0 -41
- package/src/blocks/tab-group/index.js +0 -17
- package/src/blocks/tab-group/render.php +0 -24
- package/src/blocks/tab-group/save.js +0 -23
- package/src/blocks/tab-group/style.css +0 -23
- package/src/blocks/text/block.json +0 -33
- package/src/blocks/text/edit.js +0 -56
- package/src/blocks/text/index.js +0 -10
- package/src/blocks/text/render.php +0 -26
- package/src/blocks/text/save.js +0 -18
- package/src/blocks/text/style-editor.css +0 -4
- package/src/blocks/text/style.css +0 -7
- package/src/blocks/toast/block.json +0 -40
- package/src/blocks/toast/edit.js +0 -85
- package/src/blocks/toast/index.js +0 -10
- package/src/blocks/toast/render.php +0 -37
- package/src/blocks/toast/save.js +0 -29
- package/src/blocks/toast/style-editor.css +0 -4
- package/src/blocks/toast/style.css +0 -67
- package/src/index.js +0 -16
- package/src/utils/classBuilder.js +0 -53
- package/tsconfig.json +0 -116
- package/vitest.config.js +0 -28
- package/vitest.config.ts +0 -28
- package/vitest.setup.ts +0 -129
package/BUILD.md
DELETED
|
@@ -1,411 +0,0 @@
|
|
|
1
|
-
# WordPress Blocks Build Guide
|
|
2
|
-
|
|
3
|
-
This document explains the build process for the Times Design System WordPress blocks package.
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
The build process transforms source components into a WordPress plugin distribution with the following steps:
|
|
8
|
-
|
|
9
|
-
1. **Clean** — Remove old builds
|
|
10
|
-
2. **Rollup Bundle** — Compile JavaScript, copy block files
|
|
11
|
-
3. **Plugin Organization** — Arrange files for WordPress
|
|
12
|
-
|
|
13
|
-
## Build Process
|
|
14
|
-
|
|
15
|
-
### Step 1: Install Dependencies
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
cd packages/components-wordpress
|
|
19
|
-
npm install
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
**Required for build**:
|
|
23
|
-
|
|
24
|
-
- `rollup` — Module bundler
|
|
25
|
-
- `@rollup/plugin-*` — Rollup plugins for various file types
|
|
26
|
-
- `rollup-plugin-copy` — Copy static files
|
|
27
|
-
- `rollup-plugin-postcss` — Process CSS
|
|
28
|
-
- `@babel/*` — JavaScript transpilation
|
|
29
|
-
- `typescript` — TypeScript support
|
|
30
|
-
|
|
31
|
-
### Step 2: Build
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
npm run build
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
This runs:
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
npm run clean # Remove old dist/
|
|
41
|
-
npm run build:rollup # Rollup bundling + copy
|
|
42
|
-
npm run build:plugin # Organize plugin structure
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
**Output**: `dist/` folder with:
|
|
46
|
-
|
|
47
|
-
```
|
|
48
|
-
dist/
|
|
49
|
-
├── plugin.php # WordPress plugin entry
|
|
50
|
-
├── block.json # Root manifest
|
|
51
|
-
├── index.js # ES module
|
|
52
|
-
├── index.cjs # CommonJS
|
|
53
|
-
├── index.css # Compiled styles
|
|
54
|
-
├── blocks/ # Block files
|
|
55
|
-
│ ├── button/
|
|
56
|
-
│ │ ├── block.json
|
|
57
|
-
│ │ ├── index.js
|
|
58
|
-
│ │ ├── edit.js
|
|
59
|
-
│ │ ├── save.js
|
|
60
|
-
│ │ ├── style.css
|
|
61
|
-
│ │ └── style-editor.css
|
|
62
|
-
│ └── [more blocks]/
|
|
63
|
-
└── utils/
|
|
64
|
-
└── classBuilder.js
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### Step 3: Development Build
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
npm run dev
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
Watches for changes and rebuilds automatically. Used during development.
|
|
74
|
-
|
|
75
|
-
## Build Configuration
|
|
76
|
-
|
|
77
|
-
### rollup.config.js
|
|
78
|
-
|
|
79
|
-
The main build configuration:
|
|
80
|
-
|
|
81
|
-
**Input**: `src/index.js`
|
|
82
|
-
|
|
83
|
-
**Outputs**:
|
|
84
|
-
|
|
85
|
-
- `dist/index.js` — ES module (for bundlers)
|
|
86
|
-
- `dist/index.cjs` — CommonJS (for Node)
|
|
87
|
-
|
|
88
|
-
**Plugins**:
|
|
89
|
-
|
|
90
|
-
1. **resolve** — Resolves node modules
|
|
91
|
-
- Handles `.js`, `.jsx`, `.ts`, `.tsx`, `.json`
|
|
92
|
-
- Uses browser resolution
|
|
93
|
-
2. **commonjs** — Converts CommonJS to ES modules
|
|
94
|
-
3. **json** — Allows importing JSON files
|
|
95
|
-
4. **typescript** — Transpiles TypeScript
|
|
96
|
-
- Outputs type declarations to `dist/`
|
|
97
|
-
5. **postcss** — Processes CSS
|
|
98
|
-
- Extracts to `dist/index.css`
|
|
99
|
-
- Minifies CSS
|
|
100
|
-
- Creates sourcemaps
|
|
101
|
-
6. **babel** — Transpiles JavaScript
|
|
102
|
-
- Supports ES6+
|
|
103
|
-
- JSX support
|
|
104
|
-
7. **copy** — Copies static files
|
|
105
|
-
- `src/blocks/**/*` → `dist/blocks/`
|
|
106
|
-
- `src/utils/**/*.js` → `dist/utils/`
|
|
107
|
-
- `src/**/*.css` → `dist/`
|
|
108
|
-
- `plugin.php` → `dist/plugin.php`
|
|
109
|
-
- `block.json` → `dist/block.json`
|
|
110
|
-
|
|
111
|
-
**External Dependencies** (not bundled):
|
|
112
|
-
|
|
113
|
-
- `@wordpress/blocks`
|
|
114
|
-
- `@wordpress/block-editor`
|
|
115
|
-
- `@wordpress/components`
|
|
116
|
-
- `@wordpress/element`
|
|
117
|
-
|
|
118
|
-
These are assumed to be available in WordPress.
|
|
119
|
-
|
|
120
|
-
### scripts/build-plugin.js
|
|
121
|
-
|
|
122
|
-
Post-build script that:
|
|
123
|
-
|
|
124
|
-
1. ✅ Verifies plugin structure
|
|
125
|
-
2. ✅ Checks all blocks have required files
|
|
126
|
-
3. ✅ Reports missing utilities
|
|
127
|
-
4. ✅ Displays build summary
|
|
128
|
-
5. ✅ Validates plugin.php exists
|
|
129
|
-
6. ✅ Verifies block.json manifests
|
|
130
|
-
|
|
131
|
-
## File Structure for Build
|
|
132
|
-
|
|
133
|
-
```
|
|
134
|
-
src/
|
|
135
|
-
├── index.js # Main entry (registers all blocks)
|
|
136
|
-
├── blocks/
|
|
137
|
-
│ ├── button/
|
|
138
|
-
│ │ ├── block.json # ← Copied to dist/blocks/button/
|
|
139
|
-
│ │ ├── index.js # ← Copied to dist/blocks/button/
|
|
140
|
-
│ │ ├── edit.js # ← Copied to dist/blocks/button/
|
|
141
|
-
│ │ ├── save.js # ← Copied to dist/blocks/button/
|
|
142
|
-
│ │ ├── style.css # ← Copied to dist/blocks/button/
|
|
143
|
-
│ │ └── style-editor.css # ← Copied to dist/blocks/button/
|
|
144
|
-
│ └── [more blocks]/
|
|
145
|
-
├── utils/
|
|
146
|
-
│ └── classBuilder.js # ← Copied to dist/utils/
|
|
147
|
-
└── [other files]
|
|
148
|
-
|
|
149
|
-
plugin.php # ← Copied to dist/
|
|
150
|
-
block.json # ← Copied to dist/
|
|
151
|
-
rollup.config.js # ← Build config (not copied)
|
|
152
|
-
package.json # ← Package info (not copied)
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
## What Gets Bundled vs Copied
|
|
156
|
-
|
|
157
|
-
### Bundled (by Rollup)
|
|
158
|
-
|
|
159
|
-
- `src/index.js` → `dist/index.js` and `dist/index.cjs`
|
|
160
|
-
- All JavaScript imports in index.js
|
|
161
|
-
- CSS (extracted to `dist/index.css`)
|
|
162
|
-
|
|
163
|
-
### Copied (by Rollup copy plugin)
|
|
164
|
-
|
|
165
|
-
- `src/blocks/**/*` → `dist/blocks/`
|
|
166
|
-
- `src/utils/**/*.js` → `dist/utils/`
|
|
167
|
-
- `plugin.php` → `dist/plugin.php`
|
|
168
|
-
- `block.json` → `dist/block.json`
|
|
169
|
-
|
|
170
|
-
## Troubleshooting Build
|
|
171
|
-
|
|
172
|
-
### Error: Cannot find module '@rollup/plugin-\*'
|
|
173
|
-
|
|
174
|
-
**Solution**: Install missing dependencies
|
|
175
|
-
|
|
176
|
-
```bash
|
|
177
|
-
npm install --save-dev @rollup/plugin-babel @rollup/plugin-typescript rollup-plugin-copy rollup-plugin-postcss
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
### Error: Block not found in dist/blocks/
|
|
181
|
-
|
|
182
|
-
**Check**:
|
|
183
|
-
|
|
184
|
-
1. Block folder exists in `src/blocks/<block-name>/`
|
|
185
|
-
2. `block.json` exists in block folder
|
|
186
|
-
3. `src/index.js` imports the block: `import './blocks/<block-name>/index.js'`
|
|
187
|
-
4. Run build again: `npm run build`
|
|
188
|
-
|
|
189
|
-
### Error: "Cannot compile CSS"
|
|
190
|
-
|
|
191
|
-
**Solution**:
|
|
192
|
-
|
|
193
|
-
1. Ensure PostCSS is installed: `npm install --save-dev rollup-plugin-postcss`
|
|
194
|
-
2. Check CSS syntax is valid
|
|
195
|
-
3. Clear dist: `npm run clean`
|
|
196
|
-
4. Rebuild: `npm run build`
|
|
197
|
-
|
|
198
|
-
### dist/blocks/ is empty
|
|
199
|
-
|
|
200
|
-
**Check**:
|
|
201
|
-
|
|
202
|
-
1. Rollup config `copy` targets are correct
|
|
203
|
-
2. Block files exist in `src/blocks/`
|
|
204
|
-
3. Rollup is using correct config: `rollup -c`
|
|
205
|
-
4. No permissions issues on dist/ folder
|
|
206
|
-
|
|
207
|
-
## Distribution
|
|
208
|
-
|
|
209
|
-
### For WordPress Plugin Users
|
|
210
|
-
|
|
211
|
-
The contents of `dist/` are ready to distribute:
|
|
212
|
-
|
|
213
|
-
```bash
|
|
214
|
-
# Zip for distribution
|
|
215
|
-
cd dist
|
|
216
|
-
zip -r times-design-system-blocks.zip .
|
|
217
|
-
|
|
218
|
-
# Or copy to WordPress
|
|
219
|
-
cp -r dist/* /path/to/wordpress/wp-content/plugins/times-design-system-blocks/
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
### For NPM Package Users
|
|
223
|
-
|
|
224
|
-
```bash
|
|
225
|
-
# Build for publishing
|
|
226
|
-
npm run build
|
|
227
|
-
|
|
228
|
-
# Publish to npm registry
|
|
229
|
-
npm publish
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
## Development Workflow
|
|
233
|
-
|
|
234
|
-
### Adding a New Block
|
|
235
|
-
|
|
236
|
-
1. Create block directory:
|
|
237
|
-
|
|
238
|
-
```bash
|
|
239
|
-
./scripts/create-block.sh myblock
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
2. Edit files in `src/blocks/myblock/`:
|
|
243
|
-
- `block.json` — Add attributes
|
|
244
|
-
- `edit.js` — Add inspector controls
|
|
245
|
-
- `save.js` — Add frontend HTML
|
|
246
|
-
- `style.css` — Add styles
|
|
247
|
-
|
|
248
|
-
3. Register in `src/index.js`:
|
|
249
|
-
|
|
250
|
-
```javascript
|
|
251
|
-
import './blocks/myblock/index.js';
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
4. Build and test:
|
|
255
|
-
```bash
|
|
256
|
-
npm run build
|
|
257
|
-
# Test in WordPress
|
|
258
|
-
```
|
|
259
|
-
|
|
260
|
-
### Modifying Existing Block
|
|
261
|
-
|
|
262
|
-
1. Edit files in `src/blocks/<block-name>/`
|
|
263
|
-
2. Save changes
|
|
264
|
-
3. If running `npm run dev`, changes auto-rebuild
|
|
265
|
-
4. If not, manually run `npm run build`
|
|
266
|
-
5. Test changes in WordPress
|
|
267
|
-
|
|
268
|
-
### Testing Before Build
|
|
269
|
-
|
|
270
|
-
```bash
|
|
271
|
-
# Validate Rollup config
|
|
272
|
-
npx rollup --help
|
|
273
|
-
|
|
274
|
-
# Test individual file compilation
|
|
275
|
-
npx rollup --input src/index.js --format esm
|
|
276
|
-
|
|
277
|
-
# Check file sizes
|
|
278
|
-
npm run build && du -sh dist/*
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
## Performance Tips
|
|
282
|
-
|
|
283
|
-
### Reduce Bundle Size
|
|
284
|
-
|
|
285
|
-
1. **Remove unused blocks**:
|
|
286
|
-
- Comment out imports in `src/index.js`
|
|
287
|
-
- Rebuild: `npm run build`
|
|
288
|
-
|
|
289
|
-
2. **Use external dependencies**:
|
|
290
|
-
- WordPress packages are external (not bundled)
|
|
291
|
-
- Keep them that way for smaller bundle
|
|
292
|
-
|
|
293
|
-
3. **Minify CSS**:
|
|
294
|
-
- PostCSS config already minifies
|
|
295
|
-
- CSS is extracted to separate file
|
|
296
|
-
|
|
297
|
-
### Build Speed
|
|
298
|
-
|
|
299
|
-
1. **Incremental build** (during dev):
|
|
300
|
-
|
|
301
|
-
```bash
|
|
302
|
-
npm run dev # Only rebuilds changed files
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
2. **Skip type checking**:
|
|
306
|
-
- In `rollup.config.js`, set `typescript: false`
|
|
307
|
-
- Only for development!
|
|
308
|
-
|
|
309
|
-
3. **Parallel builds**:
|
|
310
|
-
- Use `npm-run-all` for multiple builds in parallel
|
|
311
|
-
|
|
312
|
-
## CI/CD Integration
|
|
313
|
-
|
|
314
|
-
### GitHub Actions Example
|
|
315
|
-
|
|
316
|
-
```yaml
|
|
317
|
-
name: Build WordPress Blocks
|
|
318
|
-
|
|
319
|
-
on:
|
|
320
|
-
push:
|
|
321
|
-
branches: [main]
|
|
322
|
-
paths: ['packages/components-wordpress/**']
|
|
323
|
-
|
|
324
|
-
jobs:
|
|
325
|
-
build:
|
|
326
|
-
runs-on: ubuntu-latest
|
|
327
|
-
steps:
|
|
328
|
-
- uses: actions/checkout@v3
|
|
329
|
-
- uses: actions/setup-node@v3
|
|
330
|
-
with:
|
|
331
|
-
node-version: '18'
|
|
332
|
-
|
|
333
|
-
- name: Install dependencies
|
|
334
|
-
run: |
|
|
335
|
-
cd packages/components-wordpress
|
|
336
|
-
npm install
|
|
337
|
-
|
|
338
|
-
- name: Build
|
|
339
|
-
run: |
|
|
340
|
-
cd packages/components-wordpress
|
|
341
|
-
npm run build
|
|
342
|
-
|
|
343
|
-
- name: Verify output
|
|
344
|
-
run: |
|
|
345
|
-
test -d packages/components-wordpress/dist/blocks
|
|
346
|
-
test -f packages/components-wordpress/dist/plugin.php
|
|
347
|
-
|
|
348
|
-
- name: Upload artifact
|
|
349
|
-
uses: actions/upload-artifact@v3
|
|
350
|
-
with:
|
|
351
|
-
name: wordpress-blocks
|
|
352
|
-
path: packages/components-wordpress/dist/
|
|
353
|
-
```
|
|
354
|
-
|
|
355
|
-
## Debugging
|
|
356
|
-
|
|
357
|
-
### Enable Verbose Output
|
|
358
|
-
|
|
359
|
-
```bash
|
|
360
|
-
# Rollup verbose mode
|
|
361
|
-
npx rollup -c --verbose
|
|
362
|
-
|
|
363
|
-
# Node debug
|
|
364
|
-
DEBUG=* npm run build
|
|
365
|
-
```
|
|
366
|
-
|
|
367
|
-
### Check Generated Files
|
|
368
|
-
|
|
369
|
-
```bash
|
|
370
|
-
# List dist structure
|
|
371
|
-
tree dist/
|
|
372
|
-
|
|
373
|
-
# Check file sizes
|
|
374
|
-
ls -lh dist/**/*
|
|
375
|
-
|
|
376
|
-
# Verify block.json syntax
|
|
377
|
-
cat dist/blocks/button/block.json | jq .
|
|
378
|
-
```
|
|
379
|
-
|
|
380
|
-
### Common Issues Checklist
|
|
381
|
-
|
|
382
|
-
- [ ] All dependencies installed: `npm install`
|
|
383
|
-
- [ ] Rollup config valid: `npx rollup --help`
|
|
384
|
-
- [ ] Source files exist in `src/blocks/`
|
|
385
|
-
- [ ] `block.json` is valid JSON
|
|
386
|
-
- [ ] Imports in `src/index.js` match block folder names
|
|
387
|
-
- [ ] CSS files have valid syntax
|
|
388
|
-
- [ ] No TypeScript errors in `*.ts` files
|
|
389
|
-
- [ ] plugin.php exists in root
|
|
390
|
-
|
|
391
|
-
---
|
|
392
|
-
|
|
393
|
-
## Quick Commands Reference
|
|
394
|
-
|
|
395
|
-
```bash
|
|
396
|
-
npm run clean # Remove dist/
|
|
397
|
-
npm run build:rollup # Run Rollup bundler
|
|
398
|
-
npm run build:plugin # Run plugin organizer
|
|
399
|
-
npm run build # Full build (clean + rollup + plugin)
|
|
400
|
-
npm run dev # Watch mode for development
|
|
401
|
-
npm run test # Run tests
|
|
402
|
-
npm run prepublishOnly # Runs before npm publish
|
|
403
|
-
```
|
|
404
|
-
|
|
405
|
-
---
|
|
406
|
-
|
|
407
|
-
For more details on WordPress plugin structure, see:
|
|
408
|
-
|
|
409
|
-
- [WordPress Plugin Handbook](https://developer.wordpress.org/plugins/)
|
|
410
|
-
- [Gutenberg Blocks](https://developer.wordpress.org/block-editor/)
|
|
411
|
-
- [TRANSFORMATION_GUIDE.md](./TRANSFORMATION_GUIDE.md)
|
package/CHANGELOG.md
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
## [1.5.3](https://github.com/newsuk/times-design-system/compare/@times-design-system/components-wordpress@1.5.2...@times-design-system/components-wordpress@1.5.3) (2026-07-14)
|
|
7
|
-
|
|
8
|
-
**Note:** Version bump only for package @times-design-system/components-wordpress
|
|
9
|
-
|
|
10
|
-
## [1.5.2](https://github.com/newsuk/times-design-system/compare/@times-design-system/components-wordpress@1.5.1...@times-design-system/components-wordpress@1.5.2) (2026-06-30)
|
|
11
|
-
|
|
12
|
-
**Note:** Version bump only for package @times-design-system/components-wordpress
|
|
13
|
-
|
|
14
|
-
## [1.5.1](https://github.com/newsuk/times-design-system/compare/@times-design-system/components-wordpress@1.5.0...@times-design-system/components-wordpress@1.5.1) (2026-06-29)
|
|
15
|
-
|
|
16
|
-
**Note:** Version bump only for package @times-design-system/components-wordpress
|
|
17
|
-
|
|
18
|
-
# [1.5.0](https://github.com/newsuk/times-design-system/compare/@times-design-system/components-wordpress@1.4.0...@times-design-system/components-wordpress@1.5.0) (2026-06-26)
|
|
19
|
-
|
|
20
|
-
### Features
|
|
21
|
-
|
|
22
|
-
- **TDS-84:** refine components ([#84](https://github.com/newsuk/times-design-system/issues/84)) ([e1e8446](https://github.com/newsuk/times-design-system/commit/e1e84465e8628c0c71c4aa90482aad0dd1502f5e))
|
|
23
|
-
|
|
24
|
-
# [1.4.0](https://github.com/newsuk/times-design-system/compare/@times-design-system/components-wordpress@1.3.0...@times-design-system/components-wordpress@1.4.0) (2026-06-15)
|
|
25
|
-
|
|
26
|
-
### Features
|
|
27
|
-
|
|
28
|
-
- **TDS-90:** update storybook documentation ([#83](https://github.com/newsuk/times-design-system/issues/83)) ([6a50d92](https://github.com/newsuk/times-design-system/commit/6a50d92e3e07a7e772f584f33aa11fd7379cee69))
|
|
29
|
-
|
|
30
|
-
# [1.3.0](https://github.com/newsuk/times-design-system/compare/@times-design-system/components-wordpress@1.2.1...@times-design-system/components-wordpress@1.3.0) (2026-06-03)
|
|
31
|
-
|
|
32
|
-
### Features
|
|
33
|
-
|
|
34
|
-
- **TDS-82:** update blocks namespace ([#74](https://github.com/newsuk/times-design-system/issues/74)) ([e1086c3](https://github.com/newsuk/times-design-system/commit/e1086c38c9ab8c093c4719c37a4f70c943349abf))
|
|
35
|
-
|
|
36
|
-
## [1.2.1](https://github.com/newsuk/times-design-system/compare/@times-design-system/components-wordpress@1.2.0...@times-design-system/components-wordpress@1.2.1) (2026-05-27)
|
|
37
|
-
|
|
38
|
-
**Note:** Version bump only for package @times-design-system/components-wordpress
|
|
39
|
-
|
|
40
|
-
# [1.2.0](https://github.com/newsuk/times-design-system/compare/@times-design-system/components-wordpress@0.7.1...@times-design-system/components-wordpress@1.2.0) (2026-05-27)
|
|
41
|
-
|
|
42
|
-
### Bug Fixes
|
|
43
|
-
|
|
44
|
-
- **TDS-000:** tsconfig fix and ramp-colors-reference.csv workflow rem… ([#72](https://github.com/newsuk/times-design-system/issues/72)) ([fef4a9f](https://github.com/newsuk/times-design-system/commit/fef4a9fd802ae179cefefd8a62b0346cb2d43663))
|
|
45
|
-
|
|
46
|
-
### Features
|
|
47
|
-
|
|
48
|
-
- **TDS-82:** wp components build ([#68](https://github.com/newsuk/times-design-system/issues/68)) ([8967055](https://github.com/newsuk/times-design-system/commit/8967055af77db6df4c29eab0f028499b36f425d1))
|
|
49
|
-
|
|
50
|
-
## [0.7.1](https://github.com/newsuk/times-design-system/compare/@times-design-system/components-wordpress@0.7.0...@times-design-system/components-wordpress@0.7.1) (2026-05-26)
|
|
51
|
-
|
|
52
|
-
**Note:** Version bump only for package @times-design-system/components-wordpress
|
|
53
|
-
|
|
54
|
-
# [0.7.0](https://github.com/newsuk/times-design-system/compare/@times-design-system/components-wordpress@0.6.0...@times-design-system/components-wordpress@0.7.0) (2026-05-11)
|
|
55
|
-
|
|
56
|
-
### Features
|
|
57
|
-
|
|
58
|
-
- **TDS-76:** update theme reconciliation and publish components for … ([#65](https://github.com/newsuk/times-design-system/issues/65)) ([031e63a](https://github.com/newsuk/times-design-system/commit/031e63a9bf39218b1cf4d82bc763cac2f1c60e0a))
|
|
59
|
-
|
|
60
|
-
# [0.6.0](https://github.com/newsuk/times-design-system/compare/@times-design-system/components-wordpress@0.5.0...@times-design-system/components-wordpress@0.6.0) (2026-04-14)
|
|
61
|
-
|
|
62
|
-
### Features
|
|
63
|
-
|
|
64
|
-
- **TDS-74:** beta component development ([#49](https://github.com/newsuk/times-design-system/issues/49)) ([f98ecaa](https://github.com/newsuk/times-design-system/commit/f98ecaad96b12292d0ab4a7fae73328215d3e945))
|
|
65
|
-
|
|
66
|
-
# [0.5.0](https://github.com/newsuk/times-design-system/compare/@times-design-system/components-wordpress@0.4.0...@times-design-system/components-wordpress@0.5.0) (2026-03-23)
|
|
67
|
-
|
|
68
|
-
### Features
|
|
69
|
-
|
|
70
|
-
- **TDS-72:** repo review ([#46](https://github.com/newsuk/times-design-system/issues/46)) ([e46785a](https://github.com/newsuk/times-design-system/commit/e46785a49ab436598e508e9c934df0cea47a24e8))
|
|
71
|
-
|
|
72
|
-
# 0.4.0 (2026-02-05)
|
|
73
|
-
|
|
74
|
-
### Features
|
|
75
|
-
|
|
76
|
-
- **ci:** add npm package publishing with independent versioning ([#21](https://github.com/newsuk/times-design-system/issues/21)) ([535fd6e](https://github.com/newsuk/times-design-system/commit/535fd6e0da4af9474bbc98b2be46540d696620ad))
|
|
77
|
-
- **TDS-000:** package update ([#37](https://github.com/newsuk/times-design-system/issues/37)) ([52cdb60](https://github.com/newsuk/times-design-system/commit/52cdb60f0f9805560a59e25f70de7b5e9bb29cf1))
|
|
78
|
-
- **TDS-23:** cleanup of repo and addition of build scripts ([ce3fee9](https://github.com/newsuk/times-design-system/commit/ce3fee9225f02ce6df4ad27bf754dc4531a193a9))
|
|
79
|
-
|
|
80
|
-
# 0.1.0 (2026-01-19)
|
|
81
|
-
|
|
82
|
-
### Features
|
|
83
|
-
|
|
84
|
-
- **packages:** make all packages public for npm publishing ([a82d579](https://github.com/newsuk/times-design-system/commit/a82d5797b1b25e3d27064d64dd70c565c8c417fa))
|
|
85
|
-
- **TDS-23:** cleanup of repo and addition of build scripts ([ce3fee9](https://github.com/newsuk/times-design-system/commit/ce3fee9225f02ce6df4ad27bf754dc4531a193a9))
|