Skip to content

Commit

Permalink
Merge branch 'main' into alexkirsz/web-101-auto-generate-option-and-v…
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra authored Aug 24, 2023
2 parents 13a68d0 + 2e680fa commit 1ae2fe9
Show file tree
Hide file tree
Showing 269 changed files with 10,520 additions and 4,206 deletions.
12 changes: 11 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,14 @@ tp-check = "check --workspace --exclude turbo --exclude turborepo-* --exclude tu
tp-clippy = "clippy --workspace --exclude turbo --exclude turborepo-* --exclude turbopath --exclude vercel-api-mock --exclude wax --exclude globwalk --exclude globwatch --exclude pidlock"

[target.'cfg(all())']
rustflags = ["--cfg", "tokio_unstable", "-Zshare-generics=y", "-Csymbol-mangling-version=v0", "-Aclippy::too_many_arguments"]
rustflags = [
"--cfg",
"tokio_unstable",
"-Zshare-generics=y",
"-Csymbol-mangling-version=v0",
"-Aclippy::too_many_arguments",
# Clippy's needless mut lint is buggy: https://github.com/rust-lang/rust-clippy/issues/11299
"-Aclippy::needless_pass_by_ref_mut",
# Clippy's partial_eq lint is buggy: https://github.com/rust-lang/rust-clippy/issues/11178
"-Aclippy::incorrect_partial_ord_impl_on_ord_type",
]
29 changes: 0 additions & 29 deletions .eslintrc.js

This file was deleted.

3 changes: 3 additions & 0 deletions .github/actions/cargo-sweep/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ["@turbo/eslint-config/library"],
};
1 change: 0 additions & 1 deletion .github/actions/cargo-sweep/dist/main/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/actions/cargo-sweep/dist/main/index.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion .github/actions/cargo-sweep/dist/post/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/actions/cargo-sweep/dist/post/index.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion .github/actions/cargo-sweep/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
"build:main": "ncc build src/main.js -o dist/main --source-map",
"build:post": "ncc build src/post.js -o dist/post --source-map",
"prepare": "pnpm run build:main && pnpm run build:post",
"lint": "eslint . --ext js,jsx,ts,tsx",
"lint": "eslint src/**/*",
"lint:prettier": "prettier -c . --cache --ignore-path=../../../.prettierignore"
},
"dependencies": {
"@actions/core": "^1.10.0",
"@actions/exec": "^1.1.1"
},
"devDependencies": {
"@turbo/eslint-config": "workspace:*",
"@vercel/ncc": "^0.36.0"
}
}
1 change: 0 additions & 1 deletion .github/actions/cargo-sweep/src/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const core = require("@actions/core");

const sweep = require("./sweep");

sweep.storeTimestamp().catch(core.setFailed);
1 change: 0 additions & 1 deletion .github/actions/cargo-sweep/src/post.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const core = require("@actions/core");

const sweep = require("./sweep");

sweep.sweep().catch(core.setFailed);
3 changes: 3 additions & 0 deletions .github/actions/next-integration-stat/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ["@turbo/eslint-config/library"],
};
2 changes: 2 additions & 0 deletions .github/actions/next-integration-stat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
"private": true,
"main": "src/index.js",
"scripts": {
"lint": "eslint src/**/*",
"pack": "ncc -t -o . build src/index.ts",
"lint:prettier": "prettier -c . --cache --ignore-path=../../../.prettierignore"
},
"devDependencies": {
"@turbo/eslint-config": "workspace:*",
"@types/node": "^18.11.18",
"@vercel/ncc": "0.34.0",
"typescript": "^4.4.4"
Expand Down
3 changes: 3 additions & 0 deletions .github/actions/turbopack-bump/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ["@turbo/eslint-config/library"],
};
2 changes: 2 additions & 0 deletions .github/actions/turbopack-bump/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
"scripts": {
"build": "ncc build src/index.ts -o dist --source-map --minify",
"prepare": "pnpm run build",
"lint": "eslint src/**/*",
"lint:prettier": "prettier -c . --cache --ignore-path=../../../.prettierignore"
},
"dependencies": {
"@actions/core": "^1.10.0",
"@actions/github": "5.1.1"
},
"devDependencies": {
"@turbo/eslint-config": "workspace:*",
"@types/node": "18.13.0",
"@vercel/ncc": "^0.36.0"
}
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ jobs:

- name: Run cargo clippy
run: |
RUSTFLAGS="-D warnings -A deprecated -Aclippy::too_many_arguments" cargo groups clippy turbopack --features rustls-tls
RUSTFLAGS="-D warnings -A deprecated -Aclippy::too_many_arguments -Aclippy::needless_pass_by_ref_mut -Aclippy::incorrect_partial_ord_impl_on_ord_type" cargo groups clippy turbopack --features rustls-tls
- name: Run ast-grep lints
run: |
Expand Down Expand Up @@ -1264,7 +1264,11 @@ jobs:
# Skip `cli` workspace for now. It has the lint task, but in GitHub CI
# we need to set up golangci-lint to make it work. Go linting is run in the "Go linting"
# job in this workflow. We can move that in here in the next step.
run: turbo run lint --filter=!cli
run: turbo run lint:prettier --filter=!cli

# workspaces are added here as their lint issues are fixed
- name: Lint check
run: turbo run lint --filter=turbo-ignore --filter=@turbo/types --filter=eslint-config-turbo

final:
name: Ok
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"typescript",
"typescriptreact"
],
"eslint.packageManager": "pnpm",
"eslint.workingDirectories": [{ "mode": "auto" }],
"debug.javascript.unmapMissingSources": true,
"go.lintTool": "golangci-lint",
"go.buildTags": "rust",
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.10.13-canary.1"
const turboVersion = "1.10.13"
33 changes: 21 additions & 12 deletions cli/internal/cmdutil/cmdutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,31 +155,40 @@ func (h *Helper) GetCmdBase(executionState *turbostate.ExecutionState) (*CmdBase
return nil, err
}
apiClientConfig := executionState.APIClientConfig
spacesAPIClientConfig := executionState.SpacesAPIClientConfig

apiClient := client.NewClient(
apiClientConfig,
logger,
h.TurboVersion,
)

spacesClient := client.NewClient(
spacesAPIClientConfig,
logger,
h.TurboVersion,
)

return &CmdBase{
UI: terminal,
UIFactory: uiFactory,
Logger: logger,
RepoRoot: repoRoot,
APIClient: apiClient,
TurboVersion: h.TurboVersion,
UI: terminal,
UIFactory: uiFactory,
Logger: logger,
RepoRoot: repoRoot,
APIClient: apiClient,
SpacesAPIClient: spacesClient,
TurboVersion: h.TurboVersion,
}, nil
}

// CmdBase encompasses configured components common to all turbo commands.
type CmdBase struct {
UI cli.Ui
UIFactory ui.Factory
Logger hclog.Logger
RepoRoot turbopath.AbsoluteSystemPath
APIClient *client.APIClient
TurboVersion string
UI cli.Ui
UIFactory ui.Factory
Logger hclog.Logger
RepoRoot turbopath.AbsoluteSystemPath
APIClient *client.APIClient
SpacesAPIClient *client.APIClient
TurboVersion string
}

// LogError prints an error to the UI
Expand Down
12 changes: 8 additions & 4 deletions cli/internal/filewatcher/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,8 @@ func (f *fsNotifyBackend) onFileAdded(name turbopath.AbsoluteSystemPath) error {
if err := f.watchRecursively(name, []string{}, synthesizeEvents); err != nil {
return errors.Wrapf(err, "failed recursive watch of %v", name)
}
} else {
if err := f.watcher.Add(name.ToString()); err != nil {
return errors.Wrapf(err, "failed adding watch to %v", name)
}
}
// Note that for symlinks and regular files, we don't add any watches, including traversing links
return nil
}

Expand Down Expand Up @@ -137,6 +134,13 @@ outer:
f.errors <- err
}
}
if eventType == FileRenamed {
// synthesize a delete event for a rename
f.events <- Event{
Path: path,
EventType: FileDeleted,
}
}
f.events <- Event{
Path: path,
EventType: eventType,
Expand Down
11 changes: 8 additions & 3 deletions cli/internal/filewatcher/backend_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (f *fseventsBackend) AddRoot(someRoot turbopath.AbsoluteSystemPath, exclude
if !isExcluded {
f.events <- Event{
Path: processedEventPath,
EventType: toFileEvent(ev.Flags),
EventType: toFileEvent(ev.Flags, processedEventPath),
}
}
}
Expand Down Expand Up @@ -192,15 +192,20 @@ func waitForEvent(events <-chan []fsevents.Event, path string, flag fsevents.Eve

var _modifiedMask = fsevents.ItemModified | fsevents.ItemInodeMetaMod | fsevents.ItemFinderInfoMod | fsevents.ItemChangeOwner | fsevents.ItemXattrMod

func toFileEvent(flags fsevents.EventFlags) FileEvent {
func toFileEvent(flags fsevents.EventFlags, path turbopath.AbsoluteSystemPath) FileEvent {
if flags&fsevents.ItemCreated != 0 {
return FileAdded
} else if flags&fsevents.ItemRemoved != 0 {
return FileDeleted
} else if flags&_modifiedMask != 0 {
return FileModified
} else if flags&fsevents.ItemRenamed != 0 {
return FileRenamed
// FSEvents sends ItemRenamed for both the old and new files,
// and does not send delete / create events
if path.Exists() {
return FileAdded
}
return FileDeleted
} else if flags&fsevents.RootChanged != 0 {
// count this as a delete, something affected the path to the root
// of the stream
Expand Down
Loading

0 comments on commit 1ae2fe9

Please sign in to comment.