Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vercel/turborepo
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.5.3
Choose a base ref
...
head repository: vercel/turborepo
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.5.4
Choose a head ref
  • 20 commits
  • 85 files changed
  • 10 contributors

Commits on Sep 23, 2022

  1. Drop log line breaking JSON dry-run output when remote caching is ena…

    …bled (#2067)
    
    We shouldn't be writing directly to stdout/stderr, that breaks output for json-based commands, as well as doesn't honor any ui configuration we have in place.
    
    Fixes #2062
    Greg Soltis authored Sep 23, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d48fcdf View commit details
  2. Use fmt.Sprintf where appropriate in logs (#2068)

    The log api takes either argument pairs or a stacktrace as its varargs, but it doesn't do string formatting. Make sure we do the string formatting where we need to.
    Greg Soltis authored Sep 23, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a829fd6 View commit details

Commits on Sep 25, 2022

  1. Fix typo (#2074)

    morinokami authored Sep 25, 2022
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7e560b2 View commit details

Commits on Sep 26, 2022

  1. Add path types for cache. (#2059)

    As prework for merging cache-to-tar, this ensures that we know what types of paths we're dealing with at (almost) every step in the cache process.
    
    It also makes the first argument to `Put` (previously unused) and `Fetch` the anchor of the enumerated list of files being saved or restored.
    nathanhammond authored Sep 26, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    45ff205 View commit details
  2. fix(deps): update dependency ts-json-schema-generator to v1.1.1 (#2071)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Sep 26, 2022
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    af0af10 View commit details
  3. Fix: Docs Edit This Page Button not working (#2076)

    Co-authored-by: Thomas Knickman <tom.knickman@vercel.com>
    fmcalado and tknickman authored Sep 26, 2022
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    817ed0b View commit details
  4. chore(docs): sections for globalDependencies and globalEnv (#2080)

    Co-authored-by: Thomas Knickman <tom.knickman@vercel.com>
    QuiiBz and tknickman authored Sep 26, 2022
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f9535b2 View commit details
  5. Add single-package mode and integration tests (#1979)

     * Add a `--single-package` flag to `turbo run` allows running in a repository with a single package, and does not require `turbo.json`. For sample behavior, see new files under `cli/integration_tests/single_package*`
     * Add some single-package integration tests via `prysk`. 
     * Add a `Makefile` target to bootstrap a testbed directory from an integration test. For example: `make testbed-single_package` updates the `testbed` directory to match the setup for the `single_package` integration test. There is a matching entry in `launch.json` to debug a `turbo` invocation in `testbed`.
    Greg Soltis authored Sep 26, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c097b79 View commit details
  6. fix(prune) respect dir permissions during prune (#2066)

    * respect dir permissions during prune, fixes #1872
    
    * close file in test
    
    * use typed path joins, use scoped errors
    
    * Fix test expectation for windows file permissions
    
    * Actually fixup windows tests
    chris-olszewski authored Sep 26, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d5c18b6 View commit details
  7. Fix typo in docs (#2086)

    Just a tiny fix for a tiny typo.
    davemaier authored Sep 26, 2022
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f961cc6 View commit details

Commits on Sep 27, 2022

  1. Path casts (#2077)

    @gsoltis (correctly! as proven by this PR) has a vendetta against casts.
    
    This PR removes _most_ casts to `turbopath.*` in the repository with explicit exceptions for strings and `t.TempDir()`.
    
    The regex used to identify casts, of which, 100% have been manually reviewed:
    `turbopath\.(Absolute|Anchored|Relative)(Unix|System)Path\(`
    
    Of the remaining 13 that do not fall into the above `"string"` or `t.TempDir()` exceptions, 7 fall outside of the `fs` package:
    `turbopath\.(Absolute|Anchored|Relative)(Unix|System)Path\((?!("|t\.TempDir))`
    
    ```
    7 results - 4 files
    
    cli/internal/cache/cache_http.go:
      280  		// FIXME: THIS IS A BUG.
      281: 		restoredName := turbopath.AnchoredUnixPath(hdr.Name)
      282  		files = append(files, restoredName.ToSystemPath())
    
    cli/internal/hashing/package_deps_hash_test.go:
      20  	cwd, _ := os.Getwd()
      21: 	root := turbopath.AbsoluteSystemPath(filepath.VolumeName(cwd) + string(os.PathSeparator))
      22: 	checking := turbopath.AbsoluteSystemPath(cwd)
      23  
    
      32  			for _, file := range files {
      33: 				fileName := turbopath.RelativeSystemPath(file.Name())
      34  				if strings.Index(fileName.ToString(), fmt.Sprintf("%02d-", id)) == 0 {
      35: 					return turbopath.AbsoluteSystemPath(fixtureDirectory.Join(fileName))
      36  				}
    
    cli/internal/lockfile/berry_lockfile.go:
      305  		if isPatch && !strings.HasPrefix(patchPath, "~") && !_builtinRegexp.MatchString(patchPath) {
      306: 			patches = append(patches, turbopath.AnchoredUnixPath(patchPath))
      307  		}
    
    cli/internal/lockfile/pnpm_lockfile.go:
      251  	for _, patch := range p.PatchedDependencies {
      252: 		patches[i] = turbopath.AnchoredUnixPath(patch.Path)
      253  		i++
    ```
    
    Of these 7:
    - One is a bug resolved by cache-to-tar.
    - Four are in a single test utility function. That should get cleaned up but is very low priority.
    - Two are in application code for `berry` and `pnpm` patches. I'll pass that off to @chris-olszewski since I'm not 100% certain that I can safely slap `turbopath.AnchoredUnixPathFromUpstream()` on them.
    nathanhammond authored Sep 27, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f3f6aee View commit details
  2. fix(prune): place workspace configuration file in json directory (#2030)

    Fix for issue that @mattpocock discovered.
    
    This places the workspace definition file into the `json` directory and `full` directory instead of the `out` directory. This reflects the new documentation in #2013
    chris-olszewski authored Sep 27, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3c0003a View commit details
  3. chore(deps): update nextjs monorepo to v12.3.1 (#2035)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Sep 27, 2022
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a82f464 View commit details
  4. Turn down logging for the daemon (#2085)

    Co-authored-by: Thomas Knickman <tom.knickman@vercel.com>
    Greg Soltis and tknickman authored Sep 27, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    03941ce View commit details
  5. fix(docs): overflow on  <Callout /> (#2082)

    Co-authored-by: Thomas Knickman <tom.knickman@vercel.com>
    QuiiBz and tknickman authored Sep 27, 2022
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5ac1a0c View commit details
  6. chore(deps): update dependency autoprefixer to v10.4.12 (#2007)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    Co-authored-by: Thomas Knickman <tom.knickman@vercel.com>
    renovate[bot] and tknickman authored Sep 27, 2022
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    516a18b View commit details
  7. Update command line reference for prune (#2087)

    Resolves some comments on #534 requesting a docs update.
    chris-olszewski authored Sep 27, 2022
    1

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    61c2098 View commit details
  8. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c4e69f1 View commit details
  9. Copy the full SHA
    02620b8 View commit details
  10. 1
    Copy the full SHA
    656864a View commit details
Showing with 1,455 additions and 679 deletions.
  1. +9 −0 .vscode/launch.json
  2. +1 −0 cli/.gitignore
  3. +10 −0 cli/Makefile
  4. +1 −1 cli/cmd/turbo/version.go
  5. +1 −1 cli/integration_tests/logged_in.sh
  6. +7 −2 cli/integration_tests/setup.sh
  7. +11 −0 cli/integration_tests/setup_git.sh
  8. +35 −0 cli/integration_tests/single_package/dry-run.t
  9. +15 −0 cli/integration_tests/single_package/graph.t
  10. +4 −0 cli/integration_tests/single_package/my-pkg/.gitignore
  11. +6 −0 cli/integration_tests/single_package/my-pkg/package.json
  12. +8 −0 cli/integration_tests/single_package/my-pkg/turbo.json
  13. +30 −0 cli/integration_tests/single_package/run.t
  14. +6 −0 cli/integration_tests/single_package/setup.sh
  15. +58 −0 cli/integration_tests/single_package_deps/dry-run.t
  16. +16 −0 cli/integration_tests/single_package_deps/graph.t
  17. +4 −0 cli/integration_tests/single_package_deps/my-pkg/.gitignore
  18. +7 −0 cli/integration_tests/single_package_deps/my-pkg/package.json
  19. +12 −0 cli/integration_tests/single_package_deps/my-pkg/turbo.json
  20. +40 −0 cli/integration_tests/single_package_deps/run.t
  21. +6 −0 cli/integration_tests/single_package_deps/setup.sh
  22. +33 −0 cli/integration_tests/single_package_no_config/dry-run.t
  23. +15 −0 cli/integration_tests/single_package_no_config/graph.t
  24. +2 −0 cli/integration_tests/single_package_no_config/my-pkg/.gitignore
  25. +6 −0 cli/integration_tests/single_package_no_config/my-pkg/package.json
  26. +32 −0 cli/integration_tests/single_package_no_config/run.t
  27. +6 −0 cli/integration_tests/single_package_no_config/setup.sh
  28. +11 −9 cli/internal/cache/async_cache.go
  29. +15 −17 cli/internal/cache/cache.go
  30. +25 −24 cli/internal/cache/cache_fs.go
  31. +63 −106 cli/internal/cache/cache_fs_test.go
  32. +18 −17 cli/internal/cache/cache_http.go
  33. +15 −8 cli/internal/cache/cache_http_test.go
  34. +7 −5 cli/internal/cache/cache_noop.go
  35. +10 −9 cli/internal/cache/cache_test.go
  36. +79 −79 cli/internal/context/context.go
  37. +2 −2 cli/internal/daemon/daemon.go
  38. +2 −1 cli/internal/daemon/lifecycle.go
  39. +8 −3 cli/internal/fs/copy_file.go
  40. +29 −12 cli/internal/fs/copy_file_test.go
  41. +5 −0 cli/internal/fs/path.go
  42. +46 −1 cli/internal/fs/turbo_json.go
  43. +1 −1 cli/internal/globwatcher/globwatcher.go
  44. +10 −10 cli/internal/hashing/package_deps_hash_test.go
  45. +1 −1 cli/internal/lockfile/berry_lockfile.go
  46. +7 −7 cli/internal/lockfile/berry_lockfile_test.go
  47. +2 −2 cli/internal/lockfile/lockfile.go
  48. +28 −20 cli/internal/lockfile/pnpm_lockfile.go
  49. +13 −9 cli/internal/lockfile/pnpm_lockfile_test.go
  50. +1 −1 cli/internal/lockfile/yarn_lockfile.go
  51. +1 −1 cli/internal/login/link.go
  52. +4 −1 cli/internal/nodes/packagetask.go
  53. +7 −0 cli/internal/packagemanager/fixtures/package.json
  54. +3 −0 cli/internal/packagemanager/fixtures/pnpm-workspace.yaml
  55. +3 −3 cli/internal/packagemanager/packagemanager_test.go
  56. +55 −27 cli/internal/packagemanager/pnpm.go
  57. +2 −28 cli/internal/packagemanager/pnpm6.go
  58. +19 −5 cli/internal/prune/prune.go
  59. +199 −68 cli/internal/run/run.go
  60. +8 −7 cli/internal/runcache/runcache.go
  61. +11 −8 cli/internal/scope/filter/filter_test.go
  62. +8 −8 cli/internal/scope/scope_test.go
  63. +31 −32 cli/internal/taskhash/taskhash_test.go
  64. +37 −7 cli/internal/turbopath/absolute_system_path.go
  65. +84 −0 cli/internal/turbopath/absolute_system_path_test.go
  66. +25 −1 cli/internal/turbopath/anchored_system_path.go
  67. +0 −6 cli/internal/turbopath/anchored_unix_path.go
  68. +15 −0 cli/internal/util/task_id.go
  69. +1 −1 docs/components/Callout.tsx
  70. +3 −3 docs/package.json
  71. +1 −1 docs/pages/docs/getting-started/create-new.mdx
  72. +1 −1 docs/pages/docs/handbook/deploying-with-docker.mdx
  73. +1 −1 docs/pages/docs/reference/command-line-reference.mdx
  74. +21 −3 docs/pages/docs/reference/configuration.mdx
  75. +1 −1 docs/theme.config.js
  76. +1 −1 packages/create-turbo/package.json
  77. +1 −1 packages/create-turbo/templates/_shared_ts/apps/docs/package.json
  78. +1 −1 packages/create-turbo/templates/_shared_ts/apps/web/package.json
  79. +1 −1 packages/create-turbo/templates/pnpm/apps/docs/package.json
  80. +1 −1 packages/create-turbo/templates/pnpm/apps/web/package.json
  81. +1 −1 packages/turbo-codemod/package.json
  82. +1 −1 packages/turbo-types/package.json
  83. +7 −7 packages/turbo/package.json
  84. +120 −103 pnpm-lock.yaml
  85. +1 −1 version.txt
9 changes: 9 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -103,6 +103,15 @@
"program": "${workspaceRoot}/cli/cmd/turbo",
"cwd": "${workspaceRoot}",
"args": ["run", "build", "--force"]
},
{
"name": "Testbed",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceRoot}/cli/cmd/turbo",
"cwd": "${workspaceRoot}/cli/testbed",
"args": ["run", "build", "--single-package"]
}
]
}
1 change: 1 addition & 0 deletions cli/.gitignore
Original file line number Diff line number Diff line change
@@ -11,3 +11,4 @@

/scripts/turbo-*
/.cram_env
testbed
10 changes: 10 additions & 0 deletions cli/Makefile
Original file line number Diff line number Diff line change
@@ -179,3 +179,13 @@ INTEGRATION_TEST_FILES = $(shell find integration_tests -name "*.t")

integration-tests: $(CRAM_ENV)/bin/prysk turbo $(INTEGRATION_TEST_FILES)
$(CRAM_ENV)/bin/prysk --shell=`which bash` $(INTEGRATION_TEST_FILES)

# use target testbed-<some directory under integration_tests> to set up the testbed directory
.PHONY=testbed-%
testbed-%:
$(eval $@_TEST := $(@:testbed-%=%))
@echo "testbed setup $($@_TEST)"
rm -rf testbed
mkdir -p testbed
./integration_tests/$($@_TEST)/setup.sh testbed

2 changes: 1 addition & 1 deletion cli/cmd/turbo/version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package main

const turboVersion = "1.5.3"
const turboVersion = "1.5.4"
2 changes: 1 addition & 1 deletion cli/integration_tests/logged_in.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash

read -r -d '' CONFIG <<- EOF
{
9 changes: 7 additions & 2 deletions cli/integration_tests/setup.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
#!/bin/sh
TURBO=${TESTDIR}/../turbo
#!/usr/bin/env bash

DIR=${TESTDIR}
while [ $(basename $DIR) != "cli" ]; do
DIR=$(dirname $DIR)
done
TURBO=${DIR}/turbo
11 changes: 11 additions & 0 deletions cli/integration_tests/setup_git.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

TARGET_DIR=$1
git init ${TARGET_DIR} --quiet
GIT_ARGS="--git-dir=${TARGET_DIR}/.git --work-tree=${TARGET_DIR}"
git ${GIT_ARGS} config user.email "turbo-test@example.com"
git ${GIT_ARGS} config user.name "Turbo Test"
echo "script-shell=$(which bash)" > ${TARGET_DIR}/.npmrc
npm --prefix=${TARGET_DIR} install --silent
git ${GIT_ARGS} add .
git ${GIT_ARGS} commit -m "Initial" --quiet
35 changes: 35 additions & 0 deletions cli/integration_tests/single_package/dry-run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Setup
$ . ${TESTDIR}/../setup.sh
$ . ${TESTDIR}/setup.sh $(pwd)

Check
$ ${TURBO} run build --dry --single-package

Tasks to Run
build
Task = build
Hash = e491d0044f4b9b90
Cached (Local) = false
Cached (Remote) = false
Command = echo 'building' > foo
Outputs = foo
Log File = .turbo/turbo-build.log
Dependencies =
Dependendents =

$ ${TURBO} run build --dry=json --single-package
{
"tasks": [
{
"task": "build",
"hash": "e491d0044f4b9b90",
"command": "echo 'building' \u003e foo",
"outputs": [
"foo"
],
"logFile": ".turbo/turbo-build.log",
"dependencies": [],
"dependents": []
}
]
}
15 changes: 15 additions & 0 deletions cli/integration_tests/single_package/graph.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Setup
$ . ${TESTDIR}/../setup.sh
$ . ${TESTDIR}/setup.sh $(pwd)

Graph
$ ${TURBO} run build --single-package --graph

digraph {
\tcompound = "true" (esc)
\tnewrank = "true" (esc)
\tsubgraph "root" { (esc)
\t\t"[root] build" -> "[root] ___ROOT___" (esc)
\t} (esc)
}

4 changes: 4 additions & 0 deletions cli/integration_tests/single_package/my-pkg/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
.turbo
foo
.npmrc
6 changes: 6 additions & 0 deletions cli/integration_tests/single_package/my-pkg/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "my-pkg",
"scripts": {
"build": "echo 'building' > foo"
}
}
8 changes: 8 additions & 0 deletions cli/integration_tests/single_package/my-pkg/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://turborepo.org/schema.json",
"pipeline": {
"build": {
"outputs": ["foo"]
}
}
}
30 changes: 30 additions & 0 deletions cli/integration_tests/single_package/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Setup
$ . ${TESTDIR}/../setup.sh
$ . ${TESTDIR}/setup.sh $(pwd)

Check
$ ${TURBO} run build --single-package
\xe2\x80\xa2 Running build (esc)
build: cache miss, executing e491d0044f4b9b90
build:
build: > build
build: > echo 'building' > foo
build:

Tasks: 1 successful, 1 total
Cached: 0 cached, 1 total
Time:\s*[\.0-9]+m?s (re)

Run a second time, verify caching works because there is a config
$ ${TURBO} run build --single-package
\xe2\x80\xa2 Running build (esc)
build: cache hit, replaying output e491d0044f4b9b90
build:
build: > build
build: > echo 'building' > foo
build:

Tasks: 1 successful, 1 total
Cached: 1 cached, 1 total
Time:\s*[\.0-9]+m?s >>> FULL TURBO (re)

6 changes: 6 additions & 0 deletions cli/integration_tests/single_package/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]})
TARGET_DIR=$1
cp -a ${SCRIPT_DIR}/my-pkg/. ${TARGET_DIR}/
${SCRIPT_DIR}/../setup_git.sh ${TARGET_DIR}
58 changes: 58 additions & 0 deletions cli/integration_tests/single_package_deps/dry-run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Setup
$ . ${TESTDIR}/../setup.sh
$ . ${TESTDIR}/setup.sh $(pwd)

Check
$ ${TURBO} run test --dry --single-package

Tasks to Run
build
Task = build
Hash = 6218abb18f5176f5
Cached (Local) = false
Cached (Remote) = false
Command = echo 'building' > foo
Outputs = foo
Log File = .turbo/turbo-build.log
Dependencies =
Dependendents = test
test
Task = test
Hash = de6f1fc6a43f96b9
Cached (Local) = false
Cached (Remote) = false
Command = [[ ( -f foo ) && $(cat foo) == 'building' ]]
Outputs =
Log File = .turbo/turbo-test.log
Dependencies = build
Dependendents =

$ ${TURBO} run test --dry=json --single-package
{
"tasks": [
{
"task": "build",
"hash": "6218abb18f5176f5",
"command": "echo 'building' \u003e foo",
"outputs": [
"foo"
],
"logFile": ".turbo/turbo-build.log",
"dependencies": [],
"dependents": [
"test"
]
},
{
"task": "test",
"hash": "de6f1fc6a43f96b9",
"command": "[[ ( -f foo ) \u0026\u0026 $(cat foo) == 'building' ]]",
"outputs": [],
"logFile": ".turbo/turbo-test.log",
"dependencies": [
"build"
],
"dependents": []
}
]
}
16 changes: 16 additions & 0 deletions cli/integration_tests/single_package_deps/graph.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Setup
$ . ${TESTDIR}/../setup.sh
$ . ${TESTDIR}/setup.sh $(pwd)

Graph
$ ${TURBO} run test --single-package --graph

digraph {
\tcompound = "true" (esc)
\tnewrank = "true" (esc)
\tsubgraph "root" { (esc)
\t\t"[root] build" -> "[root] ___ROOT___" (esc)
\t\t"[root] test" -> "[root] build" (esc)
\t} (esc)
}

4 changes: 4 additions & 0 deletions cli/integration_tests/single_package_deps/my-pkg/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
.turbo
foo
.npmrc
7 changes: 7 additions & 0 deletions cli/integration_tests/single_package_deps/my-pkg/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "my-pkg",
"scripts": {
"build": "echo 'building' > foo",
"test": "[[ ( -f foo ) && $(cat foo) == 'building' ]]"
}
}
12 changes: 12 additions & 0 deletions cli/integration_tests/single_package_deps/my-pkg/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://turborepo.org/schema.json",
"pipeline": {
"build": {
"outputs": ["foo"]
},
"test": {
"outputs": [],
"dependsOn": ["build"]
}
}
}
40 changes: 40 additions & 0 deletions cli/integration_tests/single_package_deps/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Setup
$ . ${TESTDIR}/../setup.sh
$ . ${TESTDIR}/setup.sh $(pwd)

Check
$ ${TURBO} run test --single-package
\xe2\x80\xa2 Running test (esc)
build: cache miss, executing 6218abb18f5176f5
build:
build: > build
build: > echo 'building' > foo
build:
test: cache miss, executing de6f1fc6a43f96b9
test:
test: > test
test: > [[ ( -f foo ) && $(cat foo) == 'building' ]]
test:

Tasks: 2 successful, 2 total
Cached: 0 cached, 2 total
Time:\s*[\.0-9]+m?s (re)

Run a second time, verify caching works because there is a config
$ ${TURBO} run test --single-package
\xe2\x80\xa2 Running test (esc)
build: cache hit, replaying output 6218abb18f5176f5
build:
build: > build
build: > echo 'building' > foo
build:
test: cache hit, replaying output de6f1fc6a43f96b9
test:
test: > test
test: > [[ ( -f foo ) && $(cat foo) == 'building' ]]
test:

Tasks: 2 successful, 2 total
Cached: 2 cached, 2 total
Time:\s*[\.0-9]+m?s >>> FULL TURBO (re)

6 changes: 6 additions & 0 deletions cli/integration_tests/single_package_deps/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]})
TARGET_DIR=$1
cp -a ${SCRIPT_DIR}/my-pkg/. ${TARGET_DIR}/
${SCRIPT_DIR}/../setup_git.sh ${TARGET_DIR}
33 changes: 33 additions & 0 deletions cli/integration_tests/single_package_no_config/dry-run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Setup
$ . ${TESTDIR}/../setup.sh
$ . ${TESTDIR}/setup.sh $(pwd)

Check
$ ${TURBO} run build --dry --single-package

Tasks to Run
build
Task = build
Hash = c207d64157b1635a
Cached (Local) = false
Cached (Remote) = false
Command = echo 'building'
Outputs =
Log File = .turbo/turbo-build.log
Dependencies =
Dependendents =

$ ${TURBO} run build --dry=json --single-package
{
"tasks": [
{
"task": "build",
"hash": "c207d64157b1635a",
"command": "echo 'building'",
"outputs": null,
"logFile": ".turbo/turbo-build.log",
"dependencies": [],
"dependents": []
}
]
}
15 changes: 15 additions & 0 deletions cli/integration_tests/single_package_no_config/graph.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Setup
$ . ${TESTDIR}/../setup.sh
$ . ${TESTDIR}/setup.sh $(pwd)

Graph
$ ${TURBO} run build --single-package --graph

digraph {
\tcompound = "true" (esc)
\tnewrank = "true" (esc)
\tsubgraph "root" { (esc)
\t\t"[root] build" -> "[root] ___ROOT___" (esc)
\t} (esc)
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "my-pkg",
"scripts": {
"build": "echo 'building'"
}
}
Loading