@regardio/dev 1.14.2 → 1.15.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.
@@ -1 +1 @@
1
- {"version":3,"file":"clean.d.ts","sourceRoot":"","sources":["../../../src/bin/exec/clean.ts"],"names":[],"mappings":";AAaA,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAQpE"}
1
+ {"version":3,"file":"clean.d.ts","sourceRoot":"","sources":["../../../src/bin/exec/clean.ts"],"names":[],"mappings":";AAcA,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAQpE"}
@@ -2,6 +2,7 @@
2
2
  import { spawn } from 'node:child_process';
3
3
  import { createRequire } from 'node:module';
4
4
  import path from 'node:path';
5
+ import { fileURLToPath } from 'node:url';
5
6
  export function resolveRimrafBin(require) {
6
7
  const pkgPath = require.resolve('rimraf/package.json');
7
8
  const pkg = require(pkgPath);
@@ -11,12 +12,14 @@ export function resolveRimrafBin(require) {
11
12
  const normalized = binRel.startsWith('./') ? binRel.slice(2) : binRel;
12
13
  return path.join(path.dirname(pkgPath), normalized);
13
14
  }
14
- const require = createRequire(import.meta.url);
15
- const bin = resolveRimrafBin(require);
16
- if (!bin) {
17
- console.error('Unable to locate rimraf binary from package.json bin field');
18
- process.exit(1);
15
+ if (process.argv[1] === fileURLToPath(import.meta.url)) {
16
+ const require = createRequire(import.meta.url);
17
+ const bin = resolveRimrafBin(require);
18
+ if (!bin) {
19
+ console.error('Unable to locate rimraf binary from package.json bin field');
20
+ process.exit(1);
21
+ }
22
+ const args = process.argv.slice(2);
23
+ const child = spawn(process.execPath, [bin, ...args], { stdio: 'inherit' });
24
+ child.on('exit', (code) => process.exit(code ?? 0));
19
25
  }
20
- const args = process.argv.slice(2);
21
- const child = spawn(process.execPath, [bin, ...args], { stdio: 'inherit' });
22
- child.on('exit', (code) => process.exit(code ?? 0));
@@ -3,12 +3,7 @@ import { existsSync, readFileSync } from 'node:fs';
3
3
  import { join } from 'node:path';
4
4
  import { branchExists, git, gitRead, runQualityChecks, runScript } from './utils.js';
5
5
  const args = process.argv.slice(2);
6
- const message = args.join(' ');
7
- if (!message) {
8
- console.error('Usage: flow-release "message"');
9
- console.error('Example: flow-release "Add new vitest configs"');
10
- process.exit(1);
11
- }
6
+ const message = args.join(' ') || 'auto-fix formatting';
12
7
  const currentBranch = gitRead('branch', '--show-current');
13
8
  if (currentBranch !== 'main') {
14
9
  console.error(`Must be on the main branch to release. Currently on: ${currentBranch}`);
@@ -64,5 +59,4 @@ git('push', 'origin', 'staging');
64
59
  git('checkout', 'main');
65
60
  git('push', 'origin', 'main');
66
61
  console.log('\n✅ Changes deployed to staging');
67
- console.log(` "${message}"`);
68
62
  console.log('Run flow-ship <patch|minor|major> when ready to promote to production.');
@@ -6,7 +6,7 @@ const require = createRequire(import.meta.url);
6
6
  const packageDir = dirname(require.resolve('markdownlint-cli2'));
7
7
  const bin = join(packageDir, 'markdownlint-cli2-bin.mjs');
8
8
  const DEFAULT_GLOBS = ['**/*.md', '**/*.mdx'];
9
- const DEFAULT_EXCLUSIONS = ['!**/.changeset/**', '!**/node_modules/**', '!**/dist/**'];
9
+ const DEFAULT_EXCLUSIONS = ['!**/dist/**', '!**/node_modules/**'];
10
10
  const rawArgs = process.argv.slice(2);
11
11
  const fixFlag = rawArgs.includes('--fix');
12
12
  const userGlobs = rawArgs.filter((arg) => arg !== '--fix');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://www.schemastore.org/package.json",
3
3
  "name": "@regardio/dev",
4
- "version": "1.14.2",
4
+ "version": "1.15.0",
5
5
  "private": false,
6
6
  "description": "Regardio developer tooling for testing, linting, and build workflows",
7
7
  "keywords": [
@@ -98,7 +98,7 @@
98
98
  "@testing-library/jest-dom": "6.9.1",
99
99
  "@testing-library/react": "16.3.2",
100
100
  "@total-typescript/ts-reset": "0.6.1",
101
- "@types/node": "25.3.0",
101
+ "@types/node": "25.3.1",
102
102
  "@vitest/coverage-v8": "4.0.18",
103
103
  "@vitest/ui": "4.0.18",
104
104
  "husky": "9.1.7",
@@ -107,6 +107,7 @@
107
107
  "npm-run-all": "4.1.5",
108
108
  "postcss": "8.5.6",
109
109
  "rimraf": "6.1.3",
110
+ "rollup": "4.59.0",
110
111
  "sort-package-json": "3.6.1",
111
112
  "tsx": "4.21.0",
112
113
  "typescript": "5.9.3",
@@ -123,8 +124,5 @@
123
124
  },
124
125
  "engines": {
125
126
  "node": ">=18"
126
- },
127
- "publishConfig": {
128
- "access": "public"
129
127
  }
130
128
  }
@@ -6,6 +6,7 @@
6
6
  import { spawn } from 'node:child_process';
7
7
  import { createRequire } from 'node:module';
8
8
  import path from 'node:path';
9
+ import { fileURLToPath } from 'node:url';
9
10
 
10
11
  /**
11
12
  * Resolve the absolute path to the rimraf binary from its package.json bin field.
@@ -21,13 +22,15 @@ export function resolveRimrafBin(require: NodeRequire): string | null {
21
22
  return path.join(path.dirname(pkgPath), normalized);
22
23
  }
23
24
 
24
- const require = createRequire(import.meta.url);
25
- const bin = resolveRimrafBin(require);
26
- if (!bin) {
27
- console.error('Unable to locate rimraf binary from package.json bin field');
28
- process.exit(1);
29
- }
25
+ if (process.argv[1] === fileURLToPath(import.meta.url)) {
26
+ const require = createRequire(import.meta.url);
27
+ const bin = resolveRimrafBin(require);
28
+ if (!bin) {
29
+ console.error('Unable to locate rimraf binary from package.json bin field');
30
+ process.exit(1);
31
+ }
30
32
 
31
- const args = process.argv.slice(2);
32
- const child = spawn(process.execPath, [bin, ...args], { stdio: 'inherit' });
33
- child.on('exit', (code) => process.exit(code ?? 0));
33
+ const args = process.argv.slice(2);
34
+ const child = spawn(process.execPath, [bin, ...args], { stdio: 'inherit' });
35
+ child.on('exit', (code) => process.exit(code ?? 0));
36
+ }
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * flow-release: Deploy changes to staging following the GitLab workflow.
4
4
  *
5
- * Usage: flow-release "message"
5
+ * Usage: flow-release [message]
6
6
  *
7
7
  * GitLab workflow:
8
8
  * main → staging (staging deploy, no version bump yet)
@@ -24,13 +24,7 @@ import { join } from 'node:path';
24
24
  import { branchExists, git, gitRead, runQualityChecks, runScript } from './utils.js';
25
25
 
26
26
  const args = process.argv.slice(2);
27
- const message = args.join(' ');
28
-
29
- if (!message) {
30
- console.error('Usage: flow-release "message"');
31
- console.error('Example: flow-release "Add new vitest configs"');
32
- process.exit(1);
33
- }
27
+ const message = args.join(' ') || 'auto-fix formatting';
34
28
 
35
29
  // ---------------------------------------------------------------------------
36
30
  // Guard: must be on main
@@ -126,5 +120,4 @@ git('checkout', 'main');
126
120
  git('push', 'origin', 'main');
127
121
 
128
122
  console.log('\n✅ Changes deployed to staging');
129
- console.log(` "${message}"`);
130
123
  console.log('Run flow-ship <patch|minor|major> when ready to promote to production.');
@@ -4,7 +4,7 @@
4
4
  * Usage: lint-md [--fix] [globs...]
5
5
  *
6
6
  * Default globs (if none provided): "**\/*.md" "**\/*.mdx"
7
- * Default exclusions (always added): "!**\/.changeset/**" "!**\/node_modules/**" "!**\/dist/**"
7
+ * Default exclusions (always added): "!**\/dist/**" "!**\/node_modules/**"
8
8
  */
9
9
  import { spawn } from 'node:child_process';
10
10
  import { createRequire } from 'node:module';
@@ -15,7 +15,7 @@ const packageDir = dirname(require.resolve('markdownlint-cli2'));
15
15
  const bin = join(packageDir, 'markdownlint-cli2-bin.mjs');
16
16
 
17
17
  const DEFAULT_GLOBS = ['**/*.md', '**/*.mdx'];
18
- const DEFAULT_EXCLUSIONS = ['!**/.changeset/**', '!**/node_modules/**', '!**/dist/**'];
18
+ const DEFAULT_EXCLUSIONS = ['!**/dist/**', '!**/node_modules/**'];
19
19
 
20
20
  const rawArgs = process.argv.slice(2);
21
21
  const fixFlag = rawArgs.includes('--fix');
@@ -5,5 +5,5 @@
5
5
  },
6
6
  "frontMatter": "(^---\\s*$[^]*?^---\\s*$)(\\r\\n|\\r|\\n|$)",
7
7
  "globs": ["**/*.md", "**/*.mdoc", "**/*.mdx"],
8
- "ignores": [".changeset/**", "**/node_modules/**", "**/dist/**"]
8
+ "ignores": ["**/node_modules/**", "**/dist/**"]
9
9
  }
@@ -58,22 +58,28 @@ jobs:
58
58
  env:
59
59
  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
60
60
  run: |
61
+ IS_PRIVATE=$(node -p "require('./package.json').private ?? false")
61
62
  PACKAGE_NAME=$(node -p "require('./package.json').name")
62
63
  CURRENT_VERSION=$(node -p "require('./package.json').version")
63
- PUBLISHED_VERSION=$(npm view "$PACKAGE_NAME" version 2>/dev/null || echo 'NOT_FOUND')
64
64
  echo "package_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT
65
65
  echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
66
- if [ "$PUBLISHED_VERSION" = "NOT_FOUND" ]; then
67
- echo "::error::Package $PACKAGE_NAME not found on npm. First publish must be done locally."
68
- echo "::error::Run: pnpm build && npm publish --access public"
69
- exit 1
70
- elif [ "$PUBLISHED_VERSION" != "$CURRENT_VERSION" ]; then
71
- echo "Publishing $PACKAGE_NAME@$CURRENT_VERSION (npm has $PUBLISHED_VERSION)"
72
- npm publish --access public --provenance
73
- echo "published=true" >> $GITHUB_OUTPUT
74
- else
75
- echo "Version $CURRENT_VERSION already published, skipping"
66
+ if [ "$IS_PRIVATE" = "true" ]; then
67
+ echo "Package $PACKAGE_NAME is private, skipping npm publish"
76
68
  echo "published=false" >> $GITHUB_OUTPUT
69
+ else
70
+ PUBLISHED_VERSION=$(npm view "$PACKAGE_NAME" version 2>/dev/null || echo 'NOT_FOUND')
71
+ if [ "$PUBLISHED_VERSION" = "NOT_FOUND" ]; then
72
+ echo "::error::Package $PACKAGE_NAME not found on npm. First publish must be done locally."
73
+ echo "::error::Run: pnpm build && npm publish --access public"
74
+ exit 1
75
+ elif [ "$PUBLISHED_VERSION" != "$CURRENT_VERSION" ]; then
76
+ echo "Publishing $PACKAGE_NAME@$CURRENT_VERSION (npm has $PUBLISHED_VERSION)"
77
+ npm publish --access public --provenance
78
+ echo "published=true" >> $GITHUB_OUTPUT
79
+ else
80
+ echo "Version $CURRENT_VERSION already published, skipping"
81
+ echo "published=false" >> $GITHUB_OUTPUT
82
+ fi
77
83
  fi
78
84
 
79
85
  - name: Extract changelog entry
@@ -1,11 +0,0 @@
1
- {
2
- "$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3
- "access": "public",
4
- "baseBranch": "main",
5
- "changelog": ["@changesets/changelog-github", { "repo": "regardio/REPO_NAME" }],
6
- "commit": false,
7
- "fixed": [],
8
- "ignore": [],
9
- "linked": [],
10
- "updateInternalDependencies": "patch"
11
- }
@@ -1,8 +0,0 @@
1
- # Changesets
2
-
3
- Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4
- with multi-package repos, or single-package repos to help you version and publish your code. You can
5
- find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6
-
7
- We have a quick list of common questions to get you started engaging with this project in
8
- [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)