-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e4d278e
commit 5dcfd13
Showing
7 changed files
with
77 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,54 @@ Setup | |
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh | ||
Clear name field | ||
$ jq '.name = ""' apps/my-app/package.json > package.json.new | ||
$ mv apps/my-app/package.json apps/my-app/package.json.old | ||
$ mv package.json.new apps/my-app/package.json | ||
Build should fail due to missing name field | ||
$ ${TURBO} build 1> ERR | ||
[1] | ||
$ grep -F --quiet 'x package.json must have a name field:' ERR | ||
|
||
Restore name field | ||
$ mv apps/my-app/package.json.old apps/my-app/package.json | ||
|
||
Clear add invalid packageManager field | ||
$ jq '.packageManager = "[email protected]"' package.json > package.json.new | ||
$ mv package.json.new package.json | ||
|
||
Build should fail due to invalid packageManager field (sed removes the square brackets) | ||
$ ${TURBO} build 2>&1 | sed 's/\[\([^]]*\)\]/\\1/g' | ||
invalid_package_manager_field | ||
|
||
x could not resolve workspaces | ||
`-> could not parse the packageManager field in package.json, expected to | ||
match regular expression (?P<manager>bun|npm|pnpm|yarn)@(?P<version>\d+ | ||
\.\d+\.\d+(-.+)?) | ||
,-\1 | ||
5 | }, | ||
6 | "packageManager": "[email protected]", | ||
: ^^^^^^^|^^^^^^ | ||
: `-- invalid `packageManager` field | ||
7 | "workspaces": [ | ||
`---- | ||
|
||
|
||
Add invalid packageManager field that passes the regex. | ||
$ jq '.packageManager = "npm@0.3.211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"' package.json > package.json.new | ||
$ mv package.json.new package.json | ||
|
||
$ ${TURBO} build 2>&1 | sed 's/\[\([^]]*\)\]/\(\1)/g' | ||
invalid_semantic_version | ||
|
||
x could not resolve workspaces | ||
`-> invalid semantic version: Failed to parse an integer component of a | ||
semver string: number too large to fit in target type | ||
,-\(.*/package.json:5:1\) (re) | ||
5 | }, | ||
6 | "packageManager": "npm@0.3.211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111", | ||
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
: `-- version found here | ||
7 | "workspaces": [ | ||
`---- | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,22 @@ | ||
Setup | ||
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh | ||
|
||
We write into a file because prysk doesn't play well | ||
with the square brackets miette uses for source file paths | ||
$ ${TURBO} something > tmp.log 2>&1 | ||
[1] | ||
$ grep --quiet -E "root task //#something \(turbo run build\) looks like it invokes turbo and" tmp.log | ||
$ grep --quiet -E "might cause a loop" tmp.log | ||
$ grep --quiet -E "task found here" tmp.log | ||
$ grep --quiet -E "\"something\": \"turbo run build\"" tmp.log | ||
sed replaces the square brackets with parentheses so prysk can parse the file path | ||
$ ${TURBO} something 2>&1 | sed 's/\[\([^]]*\)\]/\(\1)/g' | ||
\xe2\x80\xa2 Packages in scope: //, another, my-app, util (esc) | ||
\xe2\x80\xa2 Running something in 4 packages (esc) | ||
\xe2\x80\xa2 Remote caching disabled (esc) | ||
x root task //#something (turbo run build) looks like it invokes turbo and | ||
| might cause a loop | ||
,-\(.*/package.json:3:1\) (re) | ||
3 | "scripts": { | ||
4 | "something": "turbo run build" | ||
: ^^^^^^^^|^^^^^^^^ | ||
: `-- task found here | ||
5 | }, | ||
`---- | ||
|
||
|
||
|
||
|
||
|