sdc-build-wp 5.6.2 → 5.6.6

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/.stylelintrc.json CHANGED
@@ -1,14 +1,12 @@
1
1
  {
2
- "plugins": [
3
- "@stylistic/stylelint-plugin"
4
- ],
2
+ "plugins": ["@stylistic/stylelint-plugin", "stylelint-use-logical"],
5
3
  "rules": {
6
4
  "@stylistic/indentation": "tab",
7
5
  "@stylistic/max-empty-lines": 1,
8
6
  "rule-empty-line-before": [
9
7
  "always",
10
8
  {
11
- "ignore": [ "after-comment" ]
9
+ "ignore": ["after-comment"]
12
10
  }
13
11
  ],
14
12
  "@stylistic/block-opening-brace-space-before": "always-multi-line",
@@ -21,6 +19,23 @@
21
19
  "color-named": "never",
22
20
  "shorthand-property-no-redundant-values": true,
23
21
  "@stylistic/number-leading-zero": "always",
24
- "@stylistic/no-eol-whitespace": true
22
+ "@stylistic/no-eol-whitespace": true,
23
+ "csstools/use-logical": [
24
+ "always",
25
+ {
26
+ "except": [
27
+ "width",
28
+ "height",
29
+ "min-width",
30
+ "max-width",
31
+ "min-height",
32
+ "max-height",
33
+ "top",
34
+ "right",
35
+ "bottom",
36
+ "left"
37
+ ]
38
+ }
39
+ ]
25
40
  }
26
41
  }
package/lib/release.js ADDED
@@ -0,0 +1,82 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { execSync } from 'node:child_process';
4
+ import { readFileSync, writeFileSync } from 'node:fs';
5
+ import { resolve, dirname } from 'node:path';
6
+ import { fileURLToPath } from 'node:url';
7
+ import * as readline from 'node:readline';
8
+
9
+ const __dirname = dirname(fileURLToPath(import.meta.url));
10
+ const packagePath = resolve(__dirname, '../package.json');
11
+
12
+ const cliArgs = process.argv.slice(2);
13
+ const bumpType = cliArgs.find((arg) => ['patch', 'minor', 'major'].includes(arg)) || 'patch';
14
+ const forcePush = cliArgs.includes('--push') || cliArgs.includes('--yes');
15
+ const skipPush = cliArgs.includes('--no-push');
16
+
17
+ if (!['patch', 'minor', 'major'].includes(bumpType)) {
18
+ console.error(`Invalid bump type: "${bumpType}". Must be patch, minor, or major.`);
19
+ process.exit(1);
20
+ }
21
+
22
+ const pkg = JSON.parse(readFileSync(packagePath, 'utf8'));
23
+ const [major, minor, patch] = pkg.version.split('.').map(Number);
24
+
25
+ let nextVersion;
26
+ if (bumpType === 'major') {
27
+ nextVersion = `${major + 1}.0.0`;
28
+ } else if (bumpType === 'minor') {
29
+ nextVersion = `${major}.${minor + 1}.0`;
30
+ } else {
31
+ nextVersion = `${major}.${minor}.${patch + 1}`;
32
+ }
33
+
34
+ pkg.version = nextVersion;
35
+ writeFileSync(packagePath, JSON.stringify(pkg, null, '\t') + '\n');
36
+
37
+ console.log(`Bumped version: ${major}.${minor}.${patch} → ${nextVersion}`);
38
+
39
+ execSync('npm install', { stdio: 'inherit' });
40
+
41
+ execSync('git add package.json package-lock.json', { stdio: 'inherit' });
42
+ execSync(`git commit -m "Version bump"`, { stdio: 'inherit' });
43
+ execSync(`git tag -a v${nextVersion} -m "v${nextVersion}"`, { stdio: 'inherit' });
44
+
45
+ console.log(`Tagged commit as v${nextVersion}`);
46
+
47
+ const currentBranch = execSync('git rev-parse --abbrev-ref HEAD', { encoding: 'utf8' }).trim();
48
+ const branchRef = currentBranch === 'HEAD'
49
+ ? process.env.GITHUB_REF_NAME || process.env.BRANCH_NAME || ''
50
+ : currentBranch;
51
+
52
+ function pushRelease() {
53
+ if (branchRef) {
54
+ execSync(`git push origin HEAD:${branchRef}`, { stdio: 'inherit' });
55
+ } else {
56
+ execSync('git push', { stdio: 'inherit' });
57
+ }
58
+ execSync(`git push origin refs/tags/v${nextVersion}`, { stdio: 'inherit' });
59
+ console.log(`Pushed branch and release tag v${nextVersion}.`);
60
+ }
61
+
62
+ if (skipPush) {
63
+ console.log('Skipped push.');
64
+ process.exit(0);
65
+ }
66
+
67
+ const isNonInteractive = !process.stdin.isTTY || !process.stdout.isTTY || process.env.CI === 'true';
68
+
69
+ if (forcePush || isNonInteractive) {
70
+ pushRelease();
71
+ process.exit(0);
72
+ }
73
+
74
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
75
+ rl.question('Push branch and release tag to origin? [y/N] ', (answer) => {
76
+ rl.close();
77
+ if (answer.trim().toLowerCase() === 'y') {
78
+ pushRelease();
79
+ } else {
80
+ console.log('Skipped push.');
81
+ }
82
+ });
package/lib/tui.js CHANGED
@@ -142,6 +142,7 @@ class TUI {
142
142
  this._activePrompt = null;
143
143
  this._mouseDataHandler = null;
144
144
  this._isInitialLoading = false;
145
+ this._renderScheduled = false;
145
146
  }
146
147
 
147
148
  init() {
@@ -361,9 +362,17 @@ class TUI {
361
362
  }
362
363
 
363
364
  render() {
364
- if (this.isInitialized && this.app) {
365
- this.app.rerender(React.createElement(TUIRoot, { tui: this }));
365
+ if (!this.isInitialized || !this.app) {
366
+ return;
367
+ }
368
+ if (this._renderScheduled) {
369
+ return;
366
370
  }
371
+ this._renderScheduled = true;
372
+ setImmediate(() => {
373
+ this._renderScheduled = false;
374
+ this.app.rerender(React.createElement(TUIRoot, { tui: this }));
375
+ });
367
376
  }
368
377
 
369
378
  hasPrompt() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sdc-build-wp",
3
- "version": "5.6.2",
3
+ "version": "5.6.6",
4
4
  "description": "Custom WordPress build process.",
5
5
  "engines": {
6
6
  "node": ">=22"
@@ -16,36 +16,41 @@
16
16
  },
17
17
  "type": "module",
18
18
  "scripts": {
19
- "test": "echo \"Skipping tests.\""
19
+ "test": "echo \"Skipping tests.\"",
20
+ "release": "node lib/release.js patch",
21
+ "release:patch": "npm run release",
22
+ "release:minor": "node lib/release.js minor",
23
+ "release:major": "node lib/release.js major"
20
24
  },
21
25
  "bin": {
22
26
  "sdc-build-wp": "./index.js"
23
27
  },
24
28
  "dependencies": {
25
29
  "@mishieck/ink-titled-box": "^0.4.2",
26
- "@stylistic/eslint-plugin": "^5.6.1",
27
- "@stylistic/stylelint-plugin": "^4.0.0",
28
- "@typescript-eslint/eslint-plugin": "^8.48.1",
29
- "@typescript-eslint/parser": "^8.48.1",
30
- "@wordpress/scripts": "^31.4.0",
30
+ "@stylistic/eslint-plugin": "^5.10.0",
31
+ "@stylistic/stylelint-plugin": "^5.0.1",
32
+ "@typescript-eslint/eslint-plugin": "^8.57.0",
33
+ "@typescript-eslint/parser": "^8.57.1",
34
+ "@wordpress/scripts": "^31.6.0",
31
35
  "ajv": "^8.18.0",
32
- "autoprefixer": "^10.4.24",
36
+ "autoprefixer": "^10.4.27",
33
37
  "browser-sync": "^3.0.4",
34
38
  "chokidar": "^5.0.0",
35
- "esbuild": "^0.27.3",
36
- "eslint": "^9.39.1",
39
+ "esbuild": "^0.27.4",
40
+ "eslint": "^10.0.3",
37
41
  "ink": "^6.8.0",
38
42
  "ink-spinner": "^5.0.0",
39
- "postcss": "^8.5.6",
43
+ "postcss": "^8.5.8",
40
44
  "postcss-scss": "^4.0.9",
41
- "postcss-sort-media-queries": "^5.2.0",
45
+ "postcss-sort-media-queries": "^6.3.2",
42
46
  "prettier": "^3.8.1",
43
47
  "react": "^19.2.4",
44
48
  "react-dom": "^19.2.4",
45
- "sass": "^1.97.3",
49
+ "sass": "^1.98.0",
46
50
  "sharp": "^0.34.5",
47
- "stylelint": "^16.26.1",
48
- "svgo": "^4.0.0",
51
+ "stylelint": "^17.4.0",
52
+ "stylelint-use-logical": "^2.1.3",
53
+ "svgo": "^4.0.1",
49
54
  "tail": "^2.2.6",
50
55
  "yargs": "^18.0.0"
51
56
  }