turbo-ignore 0.2.0 → 0.3.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/index.js → index.js} +0 -0
- package/package.json +1 -3
- package/.turbo/turbo-build.log +0 -13
- package/.turbo/turbo-check-types.log +0 -5
- package/.turbo/turbo-lint.log +0 -6
- package/.turbo/turbo-test.log +0 -17
- package/README.md +0 -11
- package/__tests__/ignore.test.ts +0 -29
- package/dist/package.json +0 -38
- package/jest.config.js +0 -7
- package/src/getComparison.ts +0 -17
- package/src/index.ts +0 -116
- package/tsconfig.json +0 -6
- package/tsup.config.ts +0 -8
- package/yarn-error.log +0 -71
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "turbo-ignore",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"homepage": "https://turborepo.org",
|
|
6
6
|
"keywords": [],
|
|
@@ -18,9 +18,7 @@
|
|
|
18
18
|
"bin": "index.js",
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"typescript": "^4.7.4",
|
|
21
|
-
"turbo-utils": "0.0.0",
|
|
22
21
|
"tsup": "^5.12.1",
|
|
23
|
-
"tsconfig": "0.0.0",
|
|
24
22
|
"ts-jest": "^27.1.1",
|
|
25
23
|
"jest": "^27.4.3",
|
|
26
24
|
"eslint": "^8.20.0",
|
package/.turbo/turbo-build.log
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
[35mturbo-ignore:build[0m: cache hit, replaying output [2m22f77e7f2d7f142a[0m
|
|
2
|
-
[35mturbo-ignore:build: [0m
|
|
3
|
-
[35mturbo-ignore:build: [0m> turbo-ignore@0.0.39 build /Users/knickman/Developer/vercel/development/turborepo/packages/turbo-ignore
|
|
4
|
-
[35mturbo-ignore:build: [0m> tsup index.js --format=cjs && cp ./package.json ./dist/package.json "--cool"
|
|
5
|
-
[35mturbo-ignore:build: [0m
|
|
6
|
-
[35mturbo-ignore:build: [0mCLI Building entry: index.js
|
|
7
|
-
[35mturbo-ignore:build: [0mCLI tsup v5.12.6
|
|
8
|
-
[35mturbo-ignore:build: [0mCLI Target: node12
|
|
9
|
-
[35mturbo-ignore:build: [0mCJS Build start
|
|
10
|
-
[35mturbo-ignore:build: [0mCJS ⚡️ Build success in 32ms
|
|
11
|
-
[35mturbo-ignore:build: [0mCJS dist/index.js 136.58 KB
|
|
12
|
-
[35mturbo-ignore:build: [0mcp: --cool is not a directory
|
|
13
|
-
[35mturbo-ignore:build: [0m ELIFECYCLE Command failed with exit code 1.
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
[33mturbo-ignore:check-types[0m: cache hit, replaying output [2mcc6ee767690bb4b9[0m
|
|
2
|
-
[33mturbo-ignore:check-types: [0m
|
|
3
|
-
[33mturbo-ignore:check-types: [0m> turbo-ignore@0.1.0 check-types /Users/knickman/Developer/vercel/development/turborepo/packages/turbo-ignore
|
|
4
|
-
[33mturbo-ignore:check-types: [0m> tsc --noEmit
|
|
5
|
-
[33mturbo-ignore:check-types: [0m
|
package/.turbo/turbo-lint.log
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
[32mturbo-ignore:lint[0m: cache hit, replaying output [2mf9501944cf35e2b0[0m
|
|
2
|
-
[32mturbo-ignore:lint: [0m
|
|
3
|
-
[32mturbo-ignore:lint: [0m> turbo-ignore@0.1.0 lint /Users/knickman/Developer/vercel/development/turborepo/packages/turbo-ignore
|
|
4
|
-
[32mturbo-ignore:lint: [0m> eslint src/**/*.ts
|
|
5
|
-
[32mturbo-ignore:lint: [0m
|
|
6
|
-
[32mturbo-ignore:lint: [0mWarning: React version was set to "detect" in eslint-plugin-react settings, but the "react" package is not installed. Assuming latest React version for linting.
|
package/.turbo/turbo-test.log
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
[34mturbo-ignore:test[0m: cache hit, replaying output [2m9a464a91e0c65822[0m
|
|
2
|
-
[34mturbo-ignore:test: [0m
|
|
3
|
-
[34mturbo-ignore:test: [0m> turbo-ignore@0.1.0 test /Users/knickman/Developer/vercel/development/turborepo/packages/turbo-ignore
|
|
4
|
-
[34mturbo-ignore:test: [0m> jest
|
|
5
|
-
[34mturbo-ignore:test: [0m
|
|
6
|
-
[34mturbo-ignore:test: [0mPASS __tests__/ignore.test.ts
|
|
7
|
-
[34mturbo-ignore:test: [0m turbo-ignore
|
|
8
|
-
[34mturbo-ignore:test: [0m getComparison()
|
|
9
|
-
[34mturbo-ignore:test: [0m ✓ uses headRelative comparison when not running Vercel CI (2 ms)
|
|
10
|
-
[34mturbo-ignore:test: [0m ✓ returns null when running in Vercel CI with no VERCEL_GIT_PREVIOUS_SHA (1 ms)
|
|
11
|
-
[34mturbo-ignore:test: [0m ✓ used previousDeploy when running in Vercel CI with VERCEL_GIT_PREVIOUS_SHA
|
|
12
|
-
[34mturbo-ignore:test: [0m
|
|
13
|
-
[34mturbo-ignore:test: [0mTest Suites: 1 passed, 1 total
|
|
14
|
-
[34mturbo-ignore:test: [0mTests: 3 passed, 3 total
|
|
15
|
-
[34mturbo-ignore:test: [0mSnapshots: 2 passed, 2 total
|
|
16
|
-
[34mturbo-ignore:test: [0mTime: 1.022 s
|
|
17
|
-
[34mturbo-ignore:test: [0mRan all test suites.
|
package/README.md
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# `turbo-ignore`
|
|
2
|
-
|
|
3
|
-
To get started, use the following command as your [Ignored Build Step](https://vercel.com/docs/concepts/projects/overview#ignored-build-step):
|
|
4
|
-
|
|
5
|
-
```sh
|
|
6
|
-
$ npx turbo-ignore
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
This uses `turbo` to automatically determine if the current app has new changes that need to be deployed.
|
|
10
|
-
|
|
11
|
-
For more information about Turborepo, [visit turborepo.org](https://turborepo.org) and follow us on Twitter ([@turborepo](https://twitter.com/turborepo))!
|
package/__tests__/ignore.test.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { getComparison } from "../src/getComparison";
|
|
2
|
-
|
|
3
|
-
describe("turbo-ignore", () => {
|
|
4
|
-
describe("getComparison()", () => {
|
|
5
|
-
it("uses headRelative comparison when not running Vercel CI", async () => {
|
|
6
|
-
expect(getComparison()).toMatchInlineSnapshot(`
|
|
7
|
-
Object {
|
|
8
|
-
"ref": "HEAD^",
|
|
9
|
-
"type": "headRelative",
|
|
10
|
-
}
|
|
11
|
-
`);
|
|
12
|
-
});
|
|
13
|
-
it("returns null when running in Vercel CI with no VERCEL_GIT_PREVIOUS_SHA", async () => {
|
|
14
|
-
process.env.VERCEL = "1";
|
|
15
|
-
expect(getComparison()).toBeNull();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it("used previousDeploy when running in Vercel CI with VERCEL_GIT_PREVIOUS_SHA", async () => {
|
|
19
|
-
process.env.VERCEL = "1";
|
|
20
|
-
process.env.VERCEL_GIT_PREVIOUS_SHA = "mygitsha";
|
|
21
|
-
expect(getComparison()).toMatchInlineSnapshot(`
|
|
22
|
-
Object {
|
|
23
|
-
"ref": "mygitsha",
|
|
24
|
-
"type": "previousDeploy",
|
|
25
|
-
}
|
|
26
|
-
`);
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
});
|
package/dist/package.json
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "turbo-ignore",
|
|
3
|
-
"version": "0.2.0",
|
|
4
|
-
"description": "",
|
|
5
|
-
"homepage": "https://turborepo.org",
|
|
6
|
-
"keywords": [],
|
|
7
|
-
"author": "Jared Palmer",
|
|
8
|
-
"license": "MPL-2.0",
|
|
9
|
-
"repository": {
|
|
10
|
-
"type": "git",
|
|
11
|
-
"url": "https://github.com/vercel/turborepo",
|
|
12
|
-
"directory": "packages/turbo-ignore"
|
|
13
|
-
},
|
|
14
|
-
"bugs": {
|
|
15
|
-
"url": "https://github.com/vercel/turborepo/issues"
|
|
16
|
-
},
|
|
17
|
-
"main": "index.js",
|
|
18
|
-
"bin": "index.js",
|
|
19
|
-
"scripts": {
|
|
20
|
-
"build": "tsup && cp ./package.json ./dist/package.json",
|
|
21
|
-
"release": "pnpm build && cd dist && pnpm publish",
|
|
22
|
-
"test": "jest",
|
|
23
|
-
"lint": "eslint src/**/*.ts",
|
|
24
|
-
"check-types": "tsc --noEmit"
|
|
25
|
-
},
|
|
26
|
-
"devDependencies": {
|
|
27
|
-
"typescript": "^4.7.4",
|
|
28
|
-
"turbo-utils": "workspace:*",
|
|
29
|
-
"tsup": "^5.12.1",
|
|
30
|
-
"tsconfig": "workspace:*",
|
|
31
|
-
"ts-jest": "^27.1.1",
|
|
32
|
-
"jest": "^27.4.3",
|
|
33
|
-
"eslint": "^8.20.0",
|
|
34
|
-
"@types/node": "^16.11.12",
|
|
35
|
-
"@types/jest": "^27.4.0",
|
|
36
|
-
"@manypkg/find-root": "^1.1.0"
|
|
37
|
-
}
|
|
38
|
-
}
|
package/jest.config.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
|
|
2
|
-
module.exports = {
|
|
3
|
-
preset: "ts-jest/presets/js-with-ts",
|
|
4
|
-
testEnvironment: "node",
|
|
5
|
-
modulePathIgnorePatterns: ["<rootDir>/node_modules", "<rootDir>/dist"],
|
|
6
|
-
transformIgnorePatterns: ["/node_modules/(?!(ansi-regex)/)"],
|
|
7
|
-
};
|
package/src/getComparison.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export function getComparison(): {
|
|
2
|
-
ref: string;
|
|
3
|
-
type: "previousDeploy" | "headRelative";
|
|
4
|
-
} | null {
|
|
5
|
-
if (process.env.VERCEL === "1") {
|
|
6
|
-
if (process.env.VERCEL_GIT_PREVIOUS_SHA) {
|
|
7
|
-
// use the commit SHA of the last successful deployment for this project / branch
|
|
8
|
-
return {
|
|
9
|
-
ref: process.env.VERCEL_GIT_PREVIOUS_SHA,
|
|
10
|
-
type: "previousDeploy",
|
|
11
|
-
};
|
|
12
|
-
} else {
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return { ref: "HEAD^", type: "headRelative" };
|
|
17
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { exec } from "child_process";
|
|
4
|
-
import { getTurboRoot, getScopeFromPath, getScopeFromArgs } from "turbo-utils";
|
|
5
|
-
import { getComparison } from "./getComparison";
|
|
6
|
-
|
|
7
|
-
console.log(
|
|
8
|
-
"\u226B Using Turborepo to determine if this project is affected by the commit..."
|
|
9
|
-
);
|
|
10
|
-
|
|
11
|
-
// check for TURBO_FORCE and bail early if it's set
|
|
12
|
-
if (process.env.TURBO_FORCE === "true") {
|
|
13
|
-
console.log(
|
|
14
|
-
"\u226B `TURBO_FORCE` detected, skipping check and proceeding with build."
|
|
15
|
-
);
|
|
16
|
-
process.exit(1);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// find the monorepo root
|
|
20
|
-
const root = getTurboRoot();
|
|
21
|
-
if (!root) {
|
|
22
|
-
console.error(
|
|
23
|
-
"Error: workspace root not found. turbo-ignore inferencing failed, proceeding with build."
|
|
24
|
-
);
|
|
25
|
-
console.error("");
|
|
26
|
-
process.exit(1);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// Find the scope of the project
|
|
30
|
-
const argsScope = getScopeFromArgs({ args: process.argv.slice(2) });
|
|
31
|
-
const pathScope = getScopeFromPath({ cwd: process.cwd() });
|
|
32
|
-
const { context, scope } = argsScope.scope ? argsScope : pathScope;
|
|
33
|
-
if (!scope) {
|
|
34
|
-
console.error(
|
|
35
|
-
"Error: app scope not found. turbo-ignore inferencing failed, proceeding with build."
|
|
36
|
-
);
|
|
37
|
-
if (!pathScope.scope) {
|
|
38
|
-
console.error(
|
|
39
|
-
'Error: the package.json is missing the "name" field.\nSet this field or pass the --scope flag to turbo-ignore.'
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
console.error("");
|
|
43
|
-
process.exit(1);
|
|
44
|
-
}
|
|
45
|
-
if (context.path) {
|
|
46
|
-
console.log(`\u226B Inferred \`${scope}\` as scope from "${context.path}"`);
|
|
47
|
-
} else {
|
|
48
|
-
console.log(`\u226B Inferred \`${scope}\` as scope from arguments`);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// Get the start of the comparison (previous deployment when available, or previous commit by default)
|
|
52
|
-
const comparison = getComparison();
|
|
53
|
-
if (!comparison) {
|
|
54
|
-
// This is either the first deploy of the project, or the first deploy for the branch, either way - build it.
|
|
55
|
-
console.log(
|
|
56
|
-
`\u226B No previous deployments found for this project${
|
|
57
|
-
process.env.VERCEL === "1"
|
|
58
|
-
? ` on "${process.env.VERCEL_GIT_COMMIT_REF}.`
|
|
59
|
-
: "."
|
|
60
|
-
}"`
|
|
61
|
-
);
|
|
62
|
-
console.log(`\u226B Proceeding with build...`);
|
|
63
|
-
process.exit(1);
|
|
64
|
-
}
|
|
65
|
-
if (comparison.type === "previousDeploy") {
|
|
66
|
-
console.log("\u226B Found previous deployment for project");
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// Build, and execute the command
|
|
70
|
-
const command = `npx turbo run build --filter=${scope}...[${comparison.ref}] --dry=json`;
|
|
71
|
-
console.log(`\u226B Analyzing results of \`${command}\`...`);
|
|
72
|
-
exec(
|
|
73
|
-
command,
|
|
74
|
-
{
|
|
75
|
-
cwd: root,
|
|
76
|
-
},
|
|
77
|
-
(error, stdout) => {
|
|
78
|
-
if (error) {
|
|
79
|
-
console.error(`exec error: ${error}`);
|
|
80
|
-
console.error(`\u226B Proceeding with build to be safe...`);
|
|
81
|
-
process.exit(1);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
try {
|
|
85
|
-
const parsed = JSON.parse(stdout);
|
|
86
|
-
if (parsed == null) {
|
|
87
|
-
console.error(
|
|
88
|
-
`\u226B Failed to parse JSON output from \`${command}\`.`
|
|
89
|
-
);
|
|
90
|
-
console.error(`\u226B Proceeding with build to be safe...`);
|
|
91
|
-
process.exit(1);
|
|
92
|
-
}
|
|
93
|
-
const { packages } = parsed;
|
|
94
|
-
if (packages && packages.length > 0) {
|
|
95
|
-
console.log(
|
|
96
|
-
`\u226B The commit affects this project and/or its ${
|
|
97
|
-
packages.length - 1
|
|
98
|
-
} dependencies`
|
|
99
|
-
);
|
|
100
|
-
console.log(`\u226B Proceeding with build...`);
|
|
101
|
-
process.exit(1);
|
|
102
|
-
} else {
|
|
103
|
-
console.log(
|
|
104
|
-
"\u226B This project and its dependencies are not affected"
|
|
105
|
-
);
|
|
106
|
-
console.log("\u226B Ignoring the change");
|
|
107
|
-
process.exit(0);
|
|
108
|
-
}
|
|
109
|
-
} catch (e) {
|
|
110
|
-
console.error(`\u226B Failed to parse JSON output from \`${command}\`.`);
|
|
111
|
-
console.error(e);
|
|
112
|
-
console.error(`\u226B Proceeding with build to be safe...`);
|
|
113
|
-
process.exit(1);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
);
|
package/tsconfig.json
DELETED
package/tsup.config.ts
DELETED
package/yarn-error.log
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
Arguments:
|
|
2
|
-
/Users/knickman/.nvm/versions/node/v16.15.1/bin/node /Users/knickman/.nvm/versions/node/v16.15.1/bin/yarn jest
|
|
3
|
-
|
|
4
|
-
PATH:
|
|
5
|
-
/opt/homebrew/bin:/opt/homebrew/sbin:/Users/knickman/.nvm/versions/node/v16.15.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Library/Apple/usr/bin
|
|
6
|
-
|
|
7
|
-
Yarn version:
|
|
8
|
-
1.22.19
|
|
9
|
-
|
|
10
|
-
Node version:
|
|
11
|
-
16.15.1
|
|
12
|
-
|
|
13
|
-
Platform:
|
|
14
|
-
darwin arm64
|
|
15
|
-
|
|
16
|
-
Trace:
|
|
17
|
-
Error: Failed to replace env in config: ${NPM_TOKEN}
|
|
18
|
-
at /Users/knickman/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:94933:13
|
|
19
|
-
at String.replace (<anonymous>)
|
|
20
|
-
at envReplace (/Users/knickman/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:94928:16)
|
|
21
|
-
at Function.normalizeConfig (/Users/knickman/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:31938:69)
|
|
22
|
-
at NpmRegistry.<anonymous> (/Users/knickman/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:31968:34)
|
|
23
|
-
at Generator.next (<anonymous>)
|
|
24
|
-
at step (/Users/knickman/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:310:30)
|
|
25
|
-
at /Users/knickman/.nvm/versions/node/v16.15.1/lib/node_modules/yarn/lib/cli.js:321:13
|
|
26
|
-
|
|
27
|
-
npm manifest:
|
|
28
|
-
{
|
|
29
|
-
"name": "turbo-ignore",
|
|
30
|
-
"version": "0.1.0",
|
|
31
|
-
"description": "",
|
|
32
|
-
"homepage": "https://turborepo.org",
|
|
33
|
-
"keywords": [],
|
|
34
|
-
"author": "Jared Palmer",
|
|
35
|
-
"license": "MPL-2.0",
|
|
36
|
-
"repository": {
|
|
37
|
-
"type": "git",
|
|
38
|
-
"url": "https://github.com/vercel/turborepo",
|
|
39
|
-
"directory": "packages/turbo-ignore"
|
|
40
|
-
},
|
|
41
|
-
"bugs": {
|
|
42
|
-
"url": "https://github.com/vercel/turborepo/issues"
|
|
43
|
-
},
|
|
44
|
-
"main": "index.js",
|
|
45
|
-
"bin": "index.js",
|
|
46
|
-
"scripts": {
|
|
47
|
-
"build": "tsup && cp ./package.json ./dist/package.json",
|
|
48
|
-
"release": "pnpm build && cd dist && pnpm publish",
|
|
49
|
-
"test": "pnpm lint && pnpm types && jest",
|
|
50
|
-
"lint": "eslint src/**/*.ts",
|
|
51
|
-
"types": "tsc --noEmit"
|
|
52
|
-
},
|
|
53
|
-
"devDependencies": {
|
|
54
|
-
"@manypkg/find-root": "^1.1.0",
|
|
55
|
-
"@types/jest": "^27.4.0",
|
|
56
|
-
"@types/node": "^16.11.12",
|
|
57
|
-
"esbuild": "^0.14.38",
|
|
58
|
-
"eslint": "^8.20.0",
|
|
59
|
-
"jest": "^27.4.3",
|
|
60
|
-
"ts-jest": "^27.1.1",
|
|
61
|
-
"tsup": "^5.12.1",
|
|
62
|
-
"turbo-utils": "workspace:*",
|
|
63
|
-
"typescript": "^4.7.4"
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
yarn manifest:
|
|
68
|
-
No manifest
|
|
69
|
-
|
|
70
|
-
Lockfile:
|
|
71
|
-
No lockfile
|