turbo-ignore 0.0.4 → 0.0.7

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/index.js CHANGED
@@ -1,8 +1,42 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  const { exec } = require('child_process');
4
+ const fs = require('fs');
5
+ const path = require('path');
6
+
7
+ function searchUp(pathName, cwd) {
8
+ const root = path.parse(cwd).root;
9
+
10
+ let found = false;
11
+
12
+ while (!found && cwd !== root) {
13
+ if (fs.existsSync(path.join(cwd, pathName))) {
14
+ found = true;
15
+ break;
16
+ }
17
+
18
+ cwd = path.dirname(cwd);
19
+ }
20
+
21
+ if (found) {
22
+ return cwd;
23
+ }
24
+
25
+ return null;
26
+ }
27
+
28
+ const root = searchUp('turbo.json', process.cwd());
29
+
30
+ if (!root) {
31
+ console.error('turbo.json not found');
32
+ process.exit(1);
33
+ }
34
+
4
35
  exec(
5
36
  `npx turbo@canary run build --scope=${process.argv[2]} --since=HEAD^ --dry=json`,
37
+ {
38
+ cwd: root,
39
+ },
6
40
  (error, stdout, stderr) => {
7
41
  if (error) {
8
42
  console.error(`exec error: ${error}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "turbo-ignore",
3
- "version": "0.0.4",
3
+ "version": "0.0.7",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": "index.js",
package/.pnpm-debug.log DELETED
@@ -1,16 +0,0 @@
1
- {
2
- "0 debug pnpm:scope": {
3
- "selected": 1,
4
- "workspacePrefix": "/Users/jared/dev/vercel/my-repo"
5
- },
6
- "1 error pnpm": {
7
- "code": "ERR_PNPM_GIT_NOT_UNCLEAN",
8
- "hint": "If you want to disable Git checks on publish, set the \"git-checks\" setting to \"false\", or run again with \"--no-git-checks\".",
9
- "err": {
10
- "name": "pnpm",
11
- "message": "Unclean working tree. Commit or stash changes first.",
12
- "code": "ERR_PNPM_GIT_NOT_UNCLEAN",
13
- "stack": "pnpm: Unclean working tree. Commit or stash changes first.\n at Object.handler [as publish] (/Users/jared/Library/pnpm/nodejs/16.13.2/pnpm-global/5/node_modules/.pnpm/pnpm@7.0.0-alpha.2/node_modules/pnpm/dist/pnpm.cjs:176935:17)\n at processTicksAndRejections (internal/process/task_queues.js:95:5)\n at async /Users/jared/Library/pnpm/nodejs/16.13.2/pnpm-global/5/node_modules/.pnpm/pnpm@7.0.0-alpha.2/node_modules/pnpm/dist/pnpm.cjs:182014:21\n at async run (/Users/jared/Library/pnpm/nodejs/16.13.2/pnpm-global/5/node_modules/.pnpm/pnpm@7.0.0-alpha.2/node_modules/pnpm/dist/pnpm.cjs:181988:34)\n at async runPnpm (/Users/jared/Library/pnpm/nodejs/16.13.2/pnpm-global/5/node_modules/.pnpm/pnpm@7.0.0-alpha.2/node_modules/pnpm/dist/pnpm.cjs:182207:5)\n at async /Users/jared/Library/pnpm/nodejs/16.13.2/pnpm-global/5/node_modules/.pnpm/pnpm@7.0.0-alpha.2/node_modules/pnpm/dist/pnpm.cjs:182199:7"
14
- }
15
- }
16
- }