@somewhatabstract/x 0.1.0 โ†’ 0.2.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.
Files changed (40) hide show
  1. package/README.md +9 -37
  2. package/dist/x.mjs +13 -20
  3. package/package.json +6 -3
  4. package/.changeset/README.md +0 -8
  5. package/.changeset/config.json +0 -11
  6. package/.github/codeql/codeql-config.yml +0 -5
  7. package/.github/dependabot.yml +0 -28
  8. package/.github/workflows/codeql-analysis.yml +0 -71
  9. package/.github/workflows/dependabot-pr-approval.yml +0 -36
  10. package/.github/workflows/nodejs.yml +0 -129
  11. package/.github/workflows/release.yml +0 -95
  12. package/.vscode/settings.json +0 -19
  13. package/CHANGELOG.md +0 -23
  14. package/CODE_OF_CONDUCT.md +0 -76
  15. package/CONTRIBUTING.md +0 -70
  16. package/biome.json +0 -39
  17. package/src/__tests__/build-environment.test.ts +0 -285
  18. package/src/__tests__/discover-packages.test.ts +0 -196
  19. package/src/__tests__/errors.test.ts +0 -59
  20. package/src/__tests__/execute-script.test.ts +0 -1042
  21. package/src/__tests__/find-matching-bins.test.ts +0 -506
  22. package/src/__tests__/find-workspace-root.test.ts +0 -73
  23. package/src/__tests__/is-node-executable.test.ts +0 -125
  24. package/src/__tests__/resolve-bin-path.test.ts +0 -344
  25. package/src/__tests__/x-impl.test.ts +0 -314
  26. package/src/__tests__/x.test.ts +0 -236
  27. package/src/bin/x.ts +0 -57
  28. package/src/build-environment.ts +0 -98
  29. package/src/discover-packages.ts +0 -35
  30. package/src/errors.ts +0 -10
  31. package/src/execute-script.ts +0 -56
  32. package/src/find-matching-bins.ts +0 -72
  33. package/src/find-workspace-root.ts +0 -24
  34. package/src/is-node-executable.ts +0 -16
  35. package/src/resolve-bin-path.ts +0 -48
  36. package/src/x-impl.ts +0 -96
  37. package/tsconfig-types.json +0 -5
  38. package/tsconfig.json +0 -21
  39. package/tsdown.config.ts +0 -24
  40. package/vitest.config.ts +0 -10
package/README.md CHANGED
@@ -1,12 +1,13 @@
1
1
  # x
2
2
 
3
- Execute any bin defined by any package in a monorepo without needing to install that package.
3
+ Execute any bin defined by any package within a monorepo without needing to install that package at the root.
4
4
 
5
5
  ## Overview
6
6
 
7
7
  `x` is a tool for monorepos that allows you to execute binary scripts from any package in your workspace without installing them globally or in your current package. It automatically discovers all packages in your workspace and finds the matching bin script.
8
8
 
9
9
  **Supports multiple package managers:**
10
+
10
11
  - ๐Ÿ“ฆ npm workspaces
11
12
  - ๐Ÿงถ Yarn (classic and modern)
12
13
  - ๐Ÿ“Œ pnpm workspaces
@@ -28,32 +29,16 @@ yarn global add @somewhatabstract/x
28
29
 
29
30
  ```bash
30
31
  # Execute a bin script from any package in the workspace
31
- x <script-name> [...args]
32
+ x <script-name> [-- <args...>]
32
33
 
33
34
  # Preview what would be executed (dry-run mode)
34
35
  x --dry-run <script-name>
35
36
 
36
- # Pass arguments to the script
37
- x tsc --noEmit
38
- x eslint src/ --fix
39
- x jest --watch
37
+ # Pass arguments to the script (use `--` when args might look like x's own options)
38
+ x my-script -- --flag value
40
39
  ```
41
40
 
42
- ### Examples
43
-
44
- ```bash
45
- # Run TypeScript compiler from any package that provides it
46
- x tsc --noEmit
47
-
48
- # Run ESLint from any package in the workspace
49
- x eslint src/
50
-
51
- # Preview which jest binary would be executed
52
- x --dry-run jest
53
-
54
- # Run a custom script with arguments
55
- x my-custom-script arg1 arg2
56
- ```
41
+ This only executes bin scripts defined by packages in your workspace, not their dependencies. The bin must be an executable file with a shebang (on Unix-like systems) or a directly runnable file (on Windows), or a JS script that can be executed with Node.js.
57
42
 
58
43
  ## Features
59
44
 
@@ -71,7 +56,9 @@ x my-custom-script arg1 arg2
71
56
  1. **Workspace Detection**: Uses `@manypkg/find-root` to find the workspace root (supports npm, Yarn, pnpm, Lerna, Bun, Rush)
72
57
  2. **Package Discovery**: Uses `@manypkg/get-packages` to discover all packages in the workspace
73
58
  3. **Bin Matching**: Searches through package.json files to find bins matching your requested script name
74
- 4. **Execution**: Executes the matched script directly via the OS (on Unix-like systems this requires an executable file with a shebang; on Windows the bin must be a directly runnable file such as a `.exe`, `.cmd`, or `.bat`)
59
+ 4. **Execution**: Executes the matched script either directly via the OS or via Node.js:
60
+ - **Direct OS execution**: On Unix-like systems this requires an executable file with a shebang; on Windows the bin must be a directly runnable file such as a `.exe`, `.cmd`, or `.bat`.
61
+ - **Node.js execution**: If the bin is a JS file, it is executed with Node.js.
75
62
 
76
63
  ## Requirements
77
64
 
@@ -113,21 +100,6 @@ pnpm build
113
100
  ./dist/x.mjs <script-name>
114
101
  ```
115
102
 
116
- ## Architecture
117
-
118
- The implementation follows a modular design with separate concerns:
119
-
120
- - `errors.ts` - Custom error types for user-friendly messages
121
- - `find-workspace-root.ts` - Workspace root detection using @manypkg/find-root
122
- - `discover-packages.ts` - Package discovery via @manypkg/get-packages
123
- - `find-matching-bins.ts` - Bin script matching logic
124
- - `execute-script.ts` - Direct script execution
125
- - `build-environment.ts` - npm/pnpm environment variable construction
126
- - `resolve-bin-path.ts` - Bin path resolution with security validation (path traversal protection)
127
- - `x-impl.ts` - Main orchestration logic
128
- - `bin/x.ts` - CLI entry point with yargs
129
-
130
103
  ## License
131
104
 
132
105
  MIT
133
-
package/dist/x.mjs CHANGED
@@ -7,7 +7,6 @@ import * as fs from "node:fs/promises";
7
7
  import * as path$1 from "node:path";
8
8
  import path from "node:path";
9
9
  import { findRoot } from "@manypkg/find-root";
10
-
11
10
  //#region src/errors.ts
12
11
  /**
13
12
  * Error class for known/expected errors that should be displayed to the user
@@ -19,7 +18,6 @@ var HandledError = class extends Error {
19
18
  this.name = "HandledError";
20
19
  }
21
20
  };
22
-
23
21
  //#endregion
24
22
  //#region src/discover-packages.ts
25
23
  /**
@@ -42,7 +40,6 @@ async function discoverPackages(workspaceRoot) {
42
40
  throw new HandledError(`Failed to discover packages`, { cause: error });
43
41
  }
44
42
  }
45
-
46
43
  //#endregion
47
44
  //#region src/build-environment.ts
48
45
  /**
@@ -93,7 +90,6 @@ async function buildEnvironment(workspaceRoot, currentEnv) {
93
90
  }
94
91
  return env;
95
92
  }
96
-
97
93
  //#endregion
98
94
  //#region src/is-node-executable.ts
99
95
  /**
@@ -108,7 +104,6 @@ function isNodeExecutable(binPath) {
108
104
  const lower = binPath.toLowerCase();
109
105
  return lower.endsWith(".js") || lower.endsWith(".mjs") || lower.endsWith(".cjs");
110
106
  }
111
-
112
107
  //#endregion
113
108
  //#region src/execute-script.ts
114
109
  /**
@@ -138,7 +133,6 @@ async function executeScript(bin, args, workspaceRoot) {
138
133
  });
139
134
  });
140
135
  }
141
-
142
136
  //#endregion
143
137
  //#region src/resolve-bin-path.ts
144
138
  /**
@@ -162,7 +156,6 @@ function resolveBinPath(pkg, bin, binName) {
162
156
  if (resolvedBinPath !== packageDir && !resolvedBinPath.startsWith(packageDir + path.sep)) return null;
163
157
  return resolvedBinPath;
164
158
  }
165
-
166
159
  //#endregion
167
160
  //#region src/find-matching-bins.ts
168
161
  /**
@@ -192,7 +185,6 @@ async function findMatchingBins(packages, binName) {
192
185
  }
193
186
  return matches;
194
187
  }
195
-
196
188
  //#endregion
197
189
  //#region src/find-workspace-root.ts
198
190
  /**
@@ -210,7 +202,6 @@ async function findWorkspaceRoot(startDir = process.cwd()) {
210
202
  throw new HandledError("Could not find workspace root. Make sure you're in a monorepo workspace.", { cause: error });
211
203
  }
212
204
  }
213
-
214
205
  //#endregion
215
206
  //#region src/x-impl.ts
216
207
  /**
@@ -255,33 +246,35 @@ async function xImpl(scriptName, args = [], options = {}) {
255
246
  throw error;
256
247
  }
257
248
  }
258
-
259
249
  //#endregion
260
250
  //#region src/bin/x.ts
261
- const argv = yargs(hideBin(process.argv)).usage("Usage: $0 <script-name> [...args]").command("$0 <script-name> [args..]", "Execute a bin script from any package in the workspace", (yargs) => {
251
+ const rawArgs = hideBin(process.argv);
252
+ const argv = yargs(rawArgs).usage("Usage: $0 <script-name> [...args]").command("$0 <script-name>", "Execute a bin script from any package in the workspace", (yargs) => {
262
253
  return yargs.positional("script-name", {
263
254
  describe: "Name of the bin script to execute",
264
255
  type: "string",
265
256
  demandOption: true
266
- }).positional("args", {
267
- describe: "Arguments to pass to the script",
268
- type: "string",
269
- array: true,
270
- default: []
271
257
  });
272
258
  }).option("dry-run", {
273
259
  alias: "d",
274
260
  describe: "Show what would be executed without running it",
275
261
  type: "boolean",
276
262
  default: false
277
- }).help().alias("help", "h").version().alias("version", "v").example("$0 tsc --noEmit", "Run TypeScript compiler from any package").example("$0 eslint src/", "Run ESLint from any package that provides it").example("$0 --dry-run jest", "Preview which jest would be executed").strict().parseSync();
263
+ }).help().alias("help", "h").version().alias("version", "v").example("$0 tsc --noEmit", "Run TypeScript compiler from any package").example("$0 eslint src/", "Run ESLint from any package that provides it").example("$0 --dry-run jest", "Preview which jest would be executed").parserConfiguration({ "unknown-options-as-args": true }).parseSync();
278
264
  const scriptName = argv["script-name"];
279
- xImpl(scriptName, argv._ || [], { dryRun: argv["dry-run"] }).then((result) => {
265
+ const args = argv._ || [];
266
+ const options = { dryRun: argv["dry-run"] };
267
+ if (!rawArgs.includes("--")) {
268
+ if (args.filter((arg) => typeof arg === "string" && arg.startsWith("-")).length > 0) {
269
+ console.warn(`Tip: To pass flags to "${scriptName}", use '--' to separate them:`);
270
+ console.warn(` x ${scriptName} -- ${args.join(" ")}`);
271
+ }
272
+ }
273
+ xImpl(scriptName, args, options).then((result) => {
280
274
  process.exit(result.exitCode);
281
275
  }).catch((error) => {
282
276
  console.error("Unexpected error:", error);
283
277
  process.exit(1);
284
278
  });
285
-
286
279
  //#endregion
287
- export { };
280
+ export {};
package/package.json CHANGED
@@ -8,8 +8,11 @@
8
8
  "bin": {
9
9
  "x": "./dist/x.mjs"
10
10
  },
11
+ "files": [
12
+ "dist"
13
+ ],
11
14
  "type": "module",
12
- "version": "0.1.0",
15
+ "version": "0.2.0",
13
16
  "description": "Execute any bin defined by any package in a monorepo without needing to install that package",
14
17
  "bugs": {
15
18
  "url": "https://github.com/somewhatabstract/x/issues"
@@ -24,13 +27,13 @@
24
27
  "yarn": "please-use-pnpm"
25
28
  },
26
29
  "devDependencies": {
27
- "@biomejs/biome": "^2.4.3",
30
+ "@biomejs/biome": "^2.4.6",
28
31
  "@changesets/cli": "^2.29.8",
29
32
  "@codecov/rollup-plugin": "^1.9.1",
30
33
  "@types/node": "^20.19.29",
31
34
  "@types/yargs": "^17.0.35",
32
35
  "@vitest/coverage-v8": "^4.0.17",
33
- "tsdown": "0.20.3",
36
+ "tsdown": "0.21.6",
34
37
  "typescript": "^5.9.3",
35
38
  "vitest": "^4.0.17"
36
39
  },
@@ -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)
@@ -1,11 +0,0 @@
1
- {
2
- "$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3
- "changelog": "@changesets/cli/changelog",
4
- "commit": false,
5
- "fixed": [],
6
- "linked": [],
7
- "access": "restricted",
8
- "baseBranch": "main",
9
- "updateInternalDependencies": "patch",
10
- "ignore": []
11
- }
@@ -1,5 +0,0 @@
1
- name: X CodeQL config
2
- paths:
3
- - "src"
4
- paths-ignore:
5
- - src/__tests__
@@ -1,28 +0,0 @@
1
- # To get started with Dependabot version updates, you'll need to specify which
2
- # package ecosystems to update and where the package manifests are located.
3
- # Please see the documentation for all configuration options:
4
- # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5
-
6
- version: 2
7
- updates:
8
- - package-ecosystem: npm
9
- directory: "/"
10
- schedule:
11
- interval: weekly
12
- day: saturday
13
- time: "09:00"
14
- timezone: America/Chicago
15
- open-pull-requests-limit: 10
16
- reviewers:
17
- - somewhatabstract
18
-
19
- - package-ecosystem: github-actions
20
- directory: "/"
21
- schedule:
22
- interval: weekly
23
- day: saturday
24
- time: "09:00"
25
- timezone: America/Chicago
26
- open-pull-requests-limit: 10
27
- reviewers:
28
- - somewhatabstract
@@ -1,71 +0,0 @@
1
- # For most projects, this workflow file will not need changing; you simply need
2
- # to commit it to your repository.
3
- #
4
- # You may wish to alter this file to override the set of languages analyzed,
5
- # or to provide custom queries or build logic.
6
- #
7
- # ******** NOTE ********
8
- # We have attempted to detect the languages in your repository. Please check
9
- # the `language` matrix defined below to confirm you have the correct set of
10
- # supported CodeQL languages.
11
- #
12
- name: "CodeQL"
13
-
14
- on:
15
- push:
16
- branches: [main]
17
- pull_request:
18
- # The branches below must be a subset of the branches above
19
- branches: [main]
20
- schedule:
21
- - cron: "16 7 * * 2"
22
-
23
- jobs:
24
- analyze:
25
- name: Analyze
26
- runs-on: ubuntu-latest
27
- permissions:
28
- actions: read
29
- contents: read
30
- security-events: write
31
-
32
- strategy:
33
- fail-fast: false
34
- matrix:
35
- language: ["javascript"]
36
- # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
37
- # Learn more:
38
- # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
39
-
40
- steps:
41
- - name: Checkout repository
42
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
43
-
44
- # Initializes the CodeQL tools for scanning.
45
- - name: Initialize CodeQL
46
- uses: github/codeql-action/init@710e2945787622b429f8982cacb154faa182de18
47
- with:
48
- languages: ${{ matrix.language }}
49
- # If you wish to specify custom queries, you can do so here or in a config file.
50
- # By default, queries listed here will override any specified in a config file.
51
- # Prefix the list here with "+" to use these queries and those in the config file.
52
- # queries: ./path/to/local/query, your-org/your-repo/queries@main
53
-
54
- # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
55
- # If this step fails, then you should remove it and run the build manually (see below)
56
- - name: Autobuild
57
- uses: github/codeql-action/autobuild@710e2945787622b429f8982cacb154faa182de18
58
-
59
- # โ„น๏ธ Command-line programs to run using the OS shell.
60
- # ๐Ÿ“š https://git.io/JvXDl
61
-
62
- # โœ๏ธ If the Autobuild fails above, remove it and uncomment the following three lines
63
- # and modify them (or add more) to build your code if your project
64
- # uses a compiled language
65
-
66
- #- run: |
67
- # make bootstrap
68
- # make release
69
-
70
- - name: Perform CodeQL Analysis
71
- uses: github/codeql-action/analyze@710e2945787622b429f8982cacb154faa182de18
@@ -1,36 +0,0 @@
1
- name: Dependabot Pull Request Approve and Merge
2
-
3
- on: pull_request_target
4
-
5
- permissions:
6
- pull-requests: write
7
- contents: write
8
-
9
- jobs:
10
- dependabot:
11
- runs-on: ubuntu-latest
12
- # Checking the actor will prevent your Action run failing on non-Dependabot
13
- # PRs but also ensures that it only does work for Dependabot PRs.
14
- if: ${{ github.actor == 'dependabot[bot]' }}
15
- steps:
16
- # This first step will fail if there's no metadata and so the approval
17
- # will not occur.
18
- - name: Dependabot metadata
19
- id: dependabot-metadata
20
- uses: dependabot/fetch-metadata@21025c705c08248db411dc16f3619e6b5f9ea21a
21
- with:
22
- github-token: "${{ secrets.GITHUB_TOKEN }}"
23
- # Here the PR gets approved.
24
- - name: Approve a PR
25
- run: gh pr review --approve "$PR_URL"
26
- env:
27
- PR_URL: ${{ github.event.pull_request.html_url }}
28
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29
- # Finally, this sets the PR to allow auto-merging for patch and minor
30
- # updates if all checks pass
31
- - name: Enable auto-merge for Dependabot PRs
32
- if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
33
- run: gh pr merge --auto --squash "$PR_URL"
34
- env:
35
- PR_URL: ${{ github.event.pull_request.html_url }}
36
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -1,129 +0,0 @@
1
- name: Node CI
2
-
3
- on:
4
- pull_request:
5
- # ready_for_review is useful for when a PR is converted from "draft" to "not
6
- # draft".
7
- types: [edited, opened, synchronize, ready_for_review, reopened]
8
-
9
- push:
10
- branches:
11
- - main
12
-
13
- jobs:
14
- lint:
15
- name: Lint and static types check
16
- env:
17
- CI: true
18
- runs-on: ${{ matrix.os }}
19
- strategy:
20
- matrix:
21
- os: [ubuntu-latest]
22
- node-version: [20.x]
23
- steps:
24
- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
25
-
26
- - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061
27
- name: Install pnpm
28
- with:
29
- run_install: false
30
- package_json_file: "package.json"
31
-
32
- - name: Use Node.js ${{ matrix.node-version }}
33
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238
34
- with:
35
- node-version: ${{ matrix.node-version }}
36
- cache: "pnpm"
37
- cache-dependency-path: "pnpm-lock.yaml"
38
-
39
- - name: Install Dependencies
40
- shell: bash
41
- run: pnpm install --frozen-lockfile
42
-
43
- - name: Lint
44
- run: pnpm lint
45
-
46
- - name: Static Types
47
- run: pnpm typecheck
48
-
49
- - name: Changesets check
50
- uses: Khan/actions@973e081efd07f23c4e521e7f4c6b15c9257ee924
51
- if: |
52
- github.actor != 'dependabot[bot]' &&
53
- github.actor != 'dependabot-preview[bot]' &&
54
- github.event_name == 'pull_request'
55
- with:
56
- exclude: .github/,.storybook/
57
-
58
- coverage:
59
- name: Update test coverage
60
- env:
61
- CI: true
62
- runs-on: ${{ matrix.os }}
63
- strategy:
64
- matrix:
65
- os: [ubuntu-latest]
66
- node-version: [20.x]
67
- steps:
68
- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
69
-
70
- - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061
71
- name: Install pnpm
72
- with:
73
- run_install: false
74
- package_json_file: "package.json"
75
-
76
- - name: Use Node.js ${{ matrix.node-version }}
77
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238
78
- with:
79
- node-version: ${{ matrix.node-version }}
80
- cache: "pnpm"
81
- cache-dependency-path: "pnpm-lock.yaml"
82
-
83
- - name: Install Dependencies
84
- shell: bash
85
- run: pnpm install --frozen-lockfile
86
-
87
- - name: Run tests with coverage
88
- run: pnpm coverage
89
- - name: Upload coverage
90
- uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de
91
- env:
92
- CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
93
-
94
- build:
95
- needs: [coverage, lint]
96
- name: Build
97
- env:
98
- CI: true
99
- runs-on: ${{ matrix.os }}
100
- strategy:
101
- matrix:
102
- os: [ubuntu-latest]
103
- node-version: [20.x]
104
- steps:
105
- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
106
-
107
- - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061
108
- name: Install pnpm
109
- with:
110
- run_install: false
111
- package_json_file: "package.json"
112
-
113
- - name: Use Node.js ${{ matrix.node-version }}
114
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238
115
- with:
116
- node-version: ${{ matrix.node-version }}
117
- cache: "pnpm"
118
- cache-dependency-path: "pnpm-lock.yaml"
119
-
120
- - name: Install Dependencies
121
- shell: bash
122
- run: pnpm install --frozen-lockfile
123
-
124
- - name: Run build
125
- env:
126
- # We only want to upload bundle analysis for a PR once,
127
- # so we only provide a token for the ubuntu-latest job.
128
- CODECOV_TOKEN: ${{ matrix.os == 'ubuntu-latest' && secrets.CODECOV_TOKEN || '' }}
129
- run: pnpm build
@@ -1,95 +0,0 @@
1
- name: Release
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
-
8
- # This workflow will run changesets depending on two different scenarios:
9
- #
10
- # 1. If we are landing a specific commit into main (Author PR), then
11
- # changesets will check if there are changes verifying the Markdown files
12
- # generated automatically:
13
- #
14
- # a) There are new versions and there's NO Release PR, then the changesets
15
- # action will create a new Release PR.
16
- #
17
- # b) There's a Release PR, then the changesets action will update the
18
- # existing Release PR with the new commit.
19
- #
20
- # NOTE: (in both cases, changesets will modify the new version in
21
- # package.json for each package, and will remove the MD files as part of the
22
- # Release PR).
23
- #
24
- # 2. If we are landing the Release PR into main, then the changesets action
25
- # will publish the changes to npm.
26
- #
27
- # For more info about this workflow, see:
28
- # https://github.com/changesets/action#usage
29
- jobs:
30
- release:
31
- name: Release
32
- runs-on: ubuntu-latest
33
- permissions:
34
- id-token: write # For provenance and trusted publishing
35
- contents: write # For creating release PRs
36
- pull-requests: write # For creating release PRs
37
- steps:
38
- - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
39
- with:
40
- fetch-depth: 0
41
- persist-credentials: false
42
-
43
- - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061
44
- name: Install pnpm
45
- with:
46
- run_install: false
47
- package_json_file: package.json
48
-
49
- - name: Use Node.js 20.x
50
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238
51
- with:
52
- node-version: 20.x
53
- cache: pnpm
54
- cache-dependency-path: pnpm-lock.yaml
55
-
56
- - name: Install Dependencies
57
- shell: bash
58
- run: pnpm install --frozen-lockfile
59
-
60
- - name: โฌ†๏ธ Upgrade npm for OIDC support
61
- shell: bash
62
- run: |
63
- # npm trusted publishing requires npm CLI v11.5.1+
64
- # Node.js 20 shipped with npm 9.x, so we likely need to upgrade
65
-
66
- # First, let's check the current npm version, and if it's already
67
- # sufficient, we can skip the upgrade step.
68
- CURRENT_NPM_VERSION=$(npm --version)
69
- REQUIRED_NPM_VERSION="11.5.1"
70
-
71
- # This sorts the version numbers using `sort -V` and then takes
72
- # the lowest version.
73
- LOWEST_NPM_VERSION=$(printf '%s\n' "$REQUIRED_NPM_VERSION" "$CURRENT_NPM_VERSION" | sort -V | head -n1)
74
-
75
- # If the lowest version is the same as the required version, then we
76
- # don't need to upgrade as that means our current version is newer.
77
- if [ "$LOWEST_NPM_VERSION" = "$REQUIRED_NPM_VERSION" ]; then
78
- echo "โœ… npm is already at version $CURRENT_NPM_VERSION"
79
- else
80
- npm install -g npm@latest && echo "โœ… npm upgraded to $(npm --version)"
81
- fi
82
-
83
- - name: Create Release Pull Request or Publish to npm
84
- id: changesets
85
- uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf
86
- with:
87
- publish: pnpm publish:ci
88
- env:
89
- # We use a Personal Access Token here rather than the GITHUB_TOKEN
90
- # so that it will trigger our other actions. The token has to be on
91
- # the account of someone with appropriate access levels and given the
92
- # repo scope.
93
- GITHUB_TOKEN: ${{ secrets.BOT_PA_TOKEN }}
94
- # This is used for the bundle analysis
95
- CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
@@ -1,19 +0,0 @@
1
- {
2
- "editor.formatOnSave": true,
3
- "editor.defaultFormatter": "biomejs.biome",
4
- "editor.codeActionsOnSave": {
5
- "source.fixAll.biome": "explicit"
6
- },
7
- "[javascript]": {
8
- "editor.defaultFormatter": "biomejs.biome"
9
- },
10
- "[typescript]": {
11
- "editor.defaultFormatter": "biomejs.biome"
12
- },
13
- "[typescriptreact]": {
14
- "editor.defaultFormatter": "biomejs.biome"
15
- },
16
- "[json]": {
17
- "editor.defaultFormatter": "biomejs.biome"
18
- }
19
- }
package/CHANGELOG.md DELETED
@@ -1,23 +0,0 @@
1
- # @somewhatabstract/x
2
-
3
- ## 0.1.0
4
-
5
- ### Minor Changes
6
-
7
- - 2f64864: Implement monorepo script execution tool with multi-package-manager support
8
-
9
- - Add support for npm, Yarn, pnpm, Lerna, Bun, and Rush workspaces
10
- - Implement direct script execution without interpreter detection
11
- - Add dry-run mode for previewing execution
12
- - Comprehensive test coverage
13
-
14
- - 2f64864: Support Node-executable script files (.js, .mjs, .cjs)
15
-
16
- Bin scripts with `.js`, `.mjs`, or `.cjs` extensions are now automatically
17
- invoked via the Node executable, matching npm/pnpm behavior. Previously, only
18
- files with a shebang and executable permissions were supported.
19
-
20
- ### Patch Changes
21
-
22
- - 2f64864: Add test coverage for all source files including the CLI entry point
23
- - 2f64864: Add Biome for linting and code formatting.