diff --git a/.github/.kodiak.toml b/.github/.kodiak.toml index 0209e106eb7..b1efccec660 100644 --- a/.github/.kodiak.toml +++ b/.github/.kodiak.toml @@ -5,4 +5,4 @@ versions = ["minor", "patch"] usernames = ["renovate"] [approve] -auto_approve_usernames = ["renovate"] \ No newline at end of file +auto_approve_usernames = ["renovate"] diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 204585a4853..afe255883bc 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -12,7 +12,9 @@ Explain the **motivation** for making this change. What existing problem does th For us to review and ship your PR efficiently, please perform the following steps: -- [ ] Open a [bug/issue](https://github.com/netlify/cli/issues/new/choose) before writing your code ๐งโ๐ป. This ensures we can discuss the changes and get feedback from everyone that should be involved. If you\`re fixing a typo or something that\`s on fire ๐ฅ (e.g. incident related), you can skip this step. +- [ ] Open a [bug/issue](https://github.com/netlify/cli/issues/new/choose) before writing your code ๐งโ๐ป. This ensures we + can discuss the changes and get feedback from everyone that should be involved. If you\`re fixing a typo or + something that\`s on fire ๐ฅ (e.g. incident related), you can skip this step. - [ ] Read the [contribution guidelines](../CONTRIBUTING.md) ๐. This ensures your code follows our style guide and passes our tests. - [ ] Update or add tests (if any source code was changed or added) ๐งช diff --git a/.oxfmtrc.json b/.oxfmtrc.json new file mode 100644 index 00000000000..ebc46166bea --- /dev/null +++ b/.oxfmtrc.json @@ -0,0 +1,10 @@ +{ + "$schema": "./node_modules/oxfmt/configuration_schema.json", + "semi": false, + "singleQuote": true, + "printWidth": 120, + "proseWrap": "always", + "trailingComma": "all", + "sortPackageJson": false, + "ignorePatterns": ["node_modules", "CHANGELOG.md", "docs/**", "**/package-lock.json"] +} diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 9e0e8f4e5a6..00000000000 --- a/.prettierignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -src/**/*.js -src/**/*.d.ts diff --git a/.prettierrc.json b/.prettierrc.json deleted file mode 100644 index ad48f6cec4f..00000000000 --- a/.prettierrc.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "semi": false, - "singleQuote": true, - "printWidth": 120, - "proseWrap": "always", - "trailingComma": "all" -} diff --git a/CLAUDE.md b/CLAUDE.md index 9fda070ae3e..8875a43ee3f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -5,11 +5,13 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ## Development Commands ### Build and Development + - `npm run build` - Compiles TypeScript using `tsc --project tsconfig.build.json` - `npm run dev` - Runs TypeScript compiler in watch mode - `npm run clean` - Removes the `dist/` directory ### Testing + - `npm test` - Runs the full test suite (unit, integration, and e2e tests) - `npm run test:unit` - Runs unit tests only with `vitest run tests/unit/` - `npm run test:integration` - Runs integration tests with `vitest run --retry=3 tests/integration/` @@ -20,14 +22,16 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co - `npm run test:init` - Sets up test dependencies for various fixtures (Hugo, Next.js, monorepo) ### Code Quality + - `npm run lint` - Runs ESLint with cache - `npm run lint:fix` - Runs ESLint and automatically fixes issues -- `npm run format` - Formats code with Prettier +- `npm run format` - Formats code with oxfmt - `npm run format:check` - Checks code formatting without modifying files - `npm run typecheck` - Runs TypeScript type checking - `npm run typecheck:watch` - Runs TypeScript type checking in watch mode ### Running the CLI Locally + - `./bin/run.js [command]` - Runs the CLI locally - `DEBUG=true ./bin/run.js [command]` - Runs with stack traces enabled for debugging - `npm run start -- [command]` - Alternative way to run CLI locally @@ -35,11 +39,15 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ## Architecture ### Core Structure -The Netlify CLI is built with **Commander.js** for CLI interface, **@netlify/js-client** for API interactions, and **TypeScript** with modular architecture. The system uses a registry pattern for managing Functions and Edge Functions, with sophisticated local development server capabilities. + +The Netlify CLI is built with **Commander.js** for CLI interface, **@netlify/js-client** for API interactions, and +**TypeScript** with modular architecture. The system uses a registry pattern for managing Functions and Edge Functions, +with sophisticated local development server capabilities. ### Key Architectural Patterns #### Command Architecture + - All commands extend `BaseCommand` class (`src/commands/base-command.ts`) which provides: - Consistent config loading and API client setup - Site information management and linking @@ -49,6 +57,7 @@ The Netlify CLI is built with **Commander.js** for CLI interface, **@netlify/js- - Each command supports both interactive prompts and non-interactive flag-based operation #### Registry Pattern for Runtime Management + - **FunctionsRegistry** (`src/lib/functions/registry.ts`): Manages Netlify Functions lifecycle - Supports multiple runtimes (JavaScript/TypeScript, Go, Rust) - Handles hot reloading and file watching @@ -58,7 +67,9 @@ The Netlify CLI is built with **Commander.js** for CLI interface, **@netlify/js- - Handles Edge Function deployment and local serving #### Development Server Architecture (`netlify dev`) + The dev server (`src/commands/dev/dev.ts`) orchestrates multiple subsystems: + - **Proxy Server**: Routes requests between static files, functions, and edge functions - **Functions Server**: Executes Netlify Functions locally with runtime-specific handlers - **Edge Functions Proxy**: Serves Edge Functions via Deno runtime @@ -66,6 +77,7 @@ The dev server (`src/commands/dev/dev.ts`) orchestrates multiple subsystems: - **Live Tunneling**: Provides public URLs for local development via Netlify's tunnel service #### Config System + - Uses `@netlify/config` for configuration resolution and normalization - Supports `netlify.toml` files with environment-specific overrides - Integrates with Netlify's build plugins system @@ -74,12 +86,14 @@ The dev server (`src/commands/dev/dev.ts`) orchestrates multiple subsystems: ### Key Libraries and Their Roles #### Core Infrastructure + - `src/lib/api.ts` - Netlify API client wrapper with authentication - `src/lib/build.ts` - Build system integration and config caching - `src/lib/settings.ts` - Project and global settings management - `src/utils/command-helpers.ts` - Shared utilities for CLI commands (logging, error handling, prompts) #### Function Runtime System + - `src/lib/functions/runtimes/` - Runtime-specific builders and executors - `js/` - JavaScript/TypeScript function handling with `zip-it-and-ship-it` - `go/` - Go function compilation and execution @@ -87,17 +101,20 @@ The dev server (`src/commands/dev/dev.ts`) orchestrates multiple subsystems: - `src/lib/functions/server.ts` - Local function server with request/response handling #### Development Tools + - `src/utils/dev.ts` - Development server utilities and environment setup - `src/utils/proxy-server.ts` - HTTP proxy for routing dev server requests - `src/utils/detect-server-settings.ts` - Framework detection and port management #### Deployment System + - `src/utils/deploy/` - Site deployment orchestration - File hashing, diffing, and upload optimization - Build artifact management and caching - Progress tracking and status reporting ### Testing Architecture + - **Unit Tests** (`tests/unit/`): Test individual modules and utilities - **Integration Tests** (`tests/integration/`): Test full command workflows using fixtures - **E2E Tests**: Test complete user scenarios with real Netlify API interactions @@ -106,7 +123,9 @@ The dev server (`src/commands/dev/dev.ts`) orchestrates multiple subsystems: ### Important Implementation Details #### Environment Variable Handling + Environment variables are loaded from multiple sources with specific precedence: + 1. Process environment 2. `.env` files (multiple variants supported) 3. Netlify site settings (shared, project-specific) @@ -114,22 +133,28 @@ Environment variables are loaded from multiple sources with specific precedence: 5. Build-time configuration #### Function URL Routing + Functions are accessible via standardized URL patterns: + - `/.netlify/functions/[function-name]` - Standard functions - `/.netlify/builders/[function-name]` - On-demand builders - Custom paths supported via function configuration #### Build Plugin Integration + The CLI integrates with Netlify's build plugin system, allowing plugins to: + - Modify build configuration - Add custom build steps - Integrate with the development server - Provide additional CLI commands ### Development Setup Requirements + - Node.js 22.13.0+ required - Git LFS must be installed for full test suite - Some integration tests require Netlify Auth Token (`NETLIFY_AUTH_TOKEN`) or login via `./bin/run.js login` ### Coding Style: + - Never write comments on what the code does, make the code clean and self explanatory instead diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 73b70570546..fad7632a356 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -2,17 +2,14 @@ ## Our Pledge -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making +participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, +disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, +religion, or sexual identity and orientation. ## Our Standards -Examples of behavior that contributes to creating a positive environment -include: +Examples of behavior that contributes to creating a positive environment include: - Using welcoming and inclusive language - Being respectful of differing viewpoints and experiences @@ -22,53 +19,42 @@ include: Examples of unacceptable behavior by participants include: -- The use of sexualized language or imagery and unwelcome sexual attention or - advances +- The use of sexualized language or imagery and unwelcome sexual attention or advances - Trolling, insulting/derogatory comments, and personal or political attacks - Public or private harassment -- Publishing others' private information, such as a physical or electronic - address, without explicit permission -- Other conduct which could reasonably be considered inappropriate in a - professional setting +- Publishing others' private information, such as a physical or electronic address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take +appropriate and fair corrective action in response to any instances of unacceptable behavior. -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, +issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the +project or its community. Examples of representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed representative at an online or offline +event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at david@netlify.com. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at +david@netlify.com. All complaints will be reviewed and investigated and will result in a response that is deemed +necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to +the reporter of an incident. Further details of specific enforcement policies may be posted separately. -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent +repercussions as determined by other members of the project's leadership. ## Attribution -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at +[http://contributor-covenant.org/version/1/4][version] [homepage]: http://contributor-covenant.org [version]: http://contributor-covenant.org/version/1/4/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b23b6fde72a..b9579c8a46f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -66,8 +66,8 @@ npm run watch Make sure everything is correctly set up by running those tests first. -We recommend you set up your IDE or text editor to run ESLint and Prettier automatically on file save. Otherwise, you -can run them manually using: +We recommend you set up your IDE or text editor to run ESLint and oxfmt automatically on file save. Otherwise, you can +run them manually using: ```bash npm run format diff --git a/bin/run.js b/bin/run.js index 16b04a73ebc..1d69460a1ab 100755 --- a/bin/run.js +++ b/bin/run.js @@ -15,7 +15,7 @@ const UPDATE_BOXEN_OPTIONS = { padding: 1, margin: 1, textAlignment: 'center', - borderStyle: 'round', + borderStyle: 'round', borderColor: NETLIFY_CYAN_HEX, float: 'center', // This is an intentional half-width space to work around a unicode padding math bug in boxen diff --git a/functions-templates/typescript/scheduled-function/{{name}}.mts b/functions-templates/typescript/scheduled-function/{{name}}.mts index 8613ce21de7..dc76ca59d5a 100644 --- a/functions-templates/typescript/scheduled-function/{{name}}.mts +++ b/functions-templates/typescript/scheduled-function/{{name}}.mts @@ -1,11 +1,11 @@ -import type { Config } from "@netlify/functions" +import type { Config } from '@netlify/functions' export default async (req: Request) => { - const { next_run } = await req.json() + const { next_run } = await req.json() - console.log("Received event! Next invocation at:", next_run) + console.log('Received event! Next invocation at:', next_run) } export const config: Config = { - schedule: "@hourly" + schedule: '@hourly', } diff --git a/layout.html b/layout.html index 601e33be959..424adc67901 100644 --- a/layout.html +++ b/layout.html @@ -1,4 +1,4 @@ - +
diff --git a/package-lock.json b/package-lock.json index 2268e69d495..c6ff4b18bc6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -162,9 +162,9 @@ "memfs": "^4.56.10", "nock": "^14.0.10", "npm-run-all2": "^8.0.4", + "oxfmt": "0.61.0", "p-timeout": "^7.0.0", "picomatch": "^4.0.4", - "prettier": "^2.8.8", "serialize-javascript": "^7.0.5", "strip-ansi": "^7.1.2", "temp-dir": "^3.0.0", @@ -6772,6 +6772,329 @@ "node": ">=14" } }, + "node_modules/@oxfmt/binding-android-arm-eabi": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-android-arm-eabi/-/binding-android-arm-eabi-0.61.0.tgz", + "integrity": "sha512-BaS+1OVvg9sr+Xav0+KdWedQRcAzrdoEcwMZeqoc2F6ieC1s/t5eM35YQoRPQ7vAqkZ+p3tbQb1r9I9mrV5oGA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-android-arm64": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-android-arm64/-/binding-android-arm64-0.61.0.tgz", + "integrity": "sha512-of8atAV0M1egGcVOMbgZCvc10sFOP3ayQBNQV5h5G3fNq8gACdEswfFk9bzGrdbM23rtg0Coxi7np7oPLcueNw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-darwin-arm64": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-darwin-arm64/-/binding-darwin-arm64-0.61.0.tgz", + "integrity": "sha512-7l8+5ov4BGwtAcmpzvEik/TG3bciwyw/S3e6j5GKH7pcQqcgCVxD3AuJeP6upto+SOTBKQ4wrrdbMt0gq8fHSQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-darwin-x64": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-darwin-x64/-/binding-darwin-x64-0.61.0.tgz", + "integrity": "sha512-Fnz4dDDXBb7udk+DmwelNjxbD6yptyxwCqwCH2ebo4RVLxVsRfFsn/AHJC49KIltPrVokamGv4SSOsiV50DTxQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-freebsd-x64": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-freebsd-x64/-/binding-freebsd-x64-0.61.0.tgz", + "integrity": "sha512-mddOebKNCP+AucmzfNsk3jgbr681qAUvgMqi865GW5gWLJ/AnzXbvjQRrny0e++NAN8aphav/aRSrfFxNsNjpA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-arm-gnueabihf": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-0.61.0.tgz", + "integrity": "sha512-svx59iYL+DbaZGZUIoice4W0CjRXGExnbz7Re+awIb60rVxBS2KrU7Hnlx+nZYanLGLpjneUEgo/VFEKkSZAyQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-arm-musleabihf": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-0.61.0.tgz", + "integrity": "sha512-BYK9MPJPCf6d+fLKMTruThmEyCtHzQ1zLcsrTlUVkmnoXIaHAbfpeLYQwX1tkjs7W11dyzoi6HFvKcdnvX1zNg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-arm64-gnu": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.61.0.tgz", + "integrity": "sha512-QUaCNLq2/EC6G5ljOuFanl9Lgw6ZWp4co7rs4+KOMUzbGfA4Lq58FHRjjF9sVIG+93XSbo343MxFATrOU1qctA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-arm64-musl": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.61.0.tgz", + "integrity": "sha512-S6uvJ6MXnRXl+zTs0CARNDvkE+cymj0EVWEKKsyKnlLlqTyQJBjw5s4D2pSIOZc+S46cy4STefzcr/sm0VzVPA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-ppc64-gnu": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-0.61.0.tgz", + "integrity": "sha512-6VDlRcytvZG6UlSIdAFKDLbppo9tvPxrWzle6vHldYFMeuDPQEfMKrkwezp7FaBq1wik9ra554ZZeRPsyIkFpg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-riscv64-gnu": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-0.61.0.tgz", + "integrity": "sha512-KkBTYbzExpbmn15XjKPLu2fRV2PVlq+KWt+brad5rwIa03vdYoaDRWiS7raHII/dCTR6Ro4UpYUCH4t6lif4WQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-riscv64-musl": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-0.61.0.tgz", + "integrity": "sha512-69tzIq7sJLVB9dxYYtvMzcSSsnZHSO+U2U19O2RqDqgj6+Q4O7HjSXdaszbcgqzhsUwzSH7z5kWvk8nmf6BHTg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-s390x-gnu": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-0.61.0.tgz", + "integrity": "sha512-Oqi/N0OvtOVXsPKAOOhKgGH3msRYF8BLJaNBbWiupRiKoKVyc8JRKPCfarkQJC+RgP9U8raUKLe+bNwd0HUMiA==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-x64-gnu": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.61.0.tgz", + "integrity": "sha512-3TKwv/ed4uwJSemAA8P9XcoqETpjQI4waquF9UilhA9Mn/dhr1PdUEXWlL74mtc6ZNfmKPA9+NEJm01nRF8CVA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-x64-musl": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-x64-musl/-/binding-linux-x64-musl-0.61.0.tgz", + "integrity": "sha512-uFso4u4nLkVSlMCpgjyvWV60Gt7GvDQHnk1mmRxHIkZTMB0ljpUKwCD9FYGgN9H97x2wYl0UwEjgRZaPIuhEhw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-openharmony-arm64": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-openharmony-arm64/-/binding-openharmony-arm64-0.61.0.tgz", + "integrity": "sha512-keGLkzeOvkMpNmPp4hffXWpfoSsY6e1K8++KXD4mSSfxdvM8q9QUDsYY689TB1k6Co832DZn1MnaaVx6cIBMWQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-win32-arm64-msvc": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.61.0.tgz", + "integrity": "sha512-VzsAISkFxmNhJ5LBDEL9VuH6tJsVJMtqYit2LyIUf/HLnsCe4Pg9SMOjjVQzGWt0bnpyfJ94CrqTqcpNZzK+ug==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-win32-ia32-msvc": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-0.61.0.tgz", + "integrity": "sha512-xv4t7yzwJoYaLB6Zv28B3W+j7brEjsyv50rLTAQgmxJzddce9fAMCxed8dSAkbWES0zz2J29nYK5FaTuD2YBHg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-win32-x64-msvc": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.61.0.tgz", + "integrity": "sha512-6EZXFkqOwxdDYjIn3TSNnPk3ST5E5GiYd4FiM6UF/mCL/LZSfr6D6UygTfW3R1PCQP2quCKpCEGRlij8E3VYbg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, "node_modules/@parcel/watcher": { "version": "2.5.1", "hasInstallScript": true, @@ -18065,6 +18388,68 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/oxfmt": { + "version": "0.61.0", + "resolved": "https://registry.npmjs.org/oxfmt/-/oxfmt-0.61.0.tgz", + "integrity": "sha512-DxdHBEMYpcEnHoUHjjOigUqV2TYKsvxLwUPXnVYBjgFdqrcQ/91OtwubtZ2PUodCs3sStI8R5Qw3fKNGK4e8wQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinypool": "2.1.0" + }, + "bin": { + "oxfmt": "bin/oxfmt" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "optionalDependencies": { + "@oxfmt/binding-android-arm-eabi": "0.61.0", + "@oxfmt/binding-android-arm64": "0.61.0", + "@oxfmt/binding-darwin-arm64": "0.61.0", + "@oxfmt/binding-darwin-x64": "0.61.0", + "@oxfmt/binding-freebsd-x64": "0.61.0", + "@oxfmt/binding-linux-arm-gnueabihf": "0.61.0", + "@oxfmt/binding-linux-arm-musleabihf": "0.61.0", + "@oxfmt/binding-linux-arm64-gnu": "0.61.0", + "@oxfmt/binding-linux-arm64-musl": "0.61.0", + "@oxfmt/binding-linux-ppc64-gnu": "0.61.0", + "@oxfmt/binding-linux-riscv64-gnu": "0.61.0", + "@oxfmt/binding-linux-riscv64-musl": "0.61.0", + "@oxfmt/binding-linux-s390x-gnu": "0.61.0", + "@oxfmt/binding-linux-x64-gnu": "0.61.0", + "@oxfmt/binding-linux-x64-musl": "0.61.0", + "@oxfmt/binding-openharmony-arm64": "0.61.0", + "@oxfmt/binding-win32-arm64-msvc": "0.61.0", + "@oxfmt/binding-win32-ia32-msvc": "0.61.0", + "@oxfmt/binding-win32-x64-msvc": "0.61.0" + }, + "peerDependencies": { + "svelte": "^5.0.0", + "vite-plus": "*" + }, + "peerDependenciesMeta": { + "svelte": { + "optional": true + }, + "vite-plus": { + "optional": true + } + } + }, + "node_modules/oxfmt/node_modules/tinypool": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-2.1.0.tgz", + "integrity": "sha512-Pugqs6M0m7Lv1I7FtxN4aoyToKg1C4tu+/381vH35y8oENM/Ai7f7C4StcoK4/+BSw9ebcS8jRiVrORFKCALLw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^20.0.0 || >=22.0.0" + } + }, "node_modules/p-event": { "version": "6.0.1", "license": "MIT", @@ -18843,20 +19228,6 @@ "node": ">= 0.8.0" } }, - "node_modules/prettier": { - "version": "2.8.8", - "dev": true, - "license": "MIT", - "bin": { - "prettier": "bin-prettier.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, "node_modules/pretty-ms": { "version": "9.3.0", "license": "MIT", diff --git a/package.json b/package.json index f6c78faff4f..56c7c9e847d 100644 --- a/package.json +++ b/package.json @@ -30,13 +30,12 @@ "url": "https://github.com/netlify/cli/issues" }, "scripts": { - "_format": "prettier --loglevel=warn \"{src,tools,scripts,tests,e2e,.github}/**/*.{mjs,cjs,js,mts,md,yml,json,html,ts}\" \"*.{mjs,cjs,js,mts,yml,json,html,ts}\" \".*.{mjs,cjs,js,yml,json,html,ts}\" \"!CHANGELOG.md\" \"!**/*/package-lock.json\" \"!.github/**/*.md\"", "build": "node ./node_modules/typescript-native/bin/tsc --project tsconfig.build.json", "clean": "rm -rf dist/", "dev": "node ./node_modules/typescript-native/bin/tsc --project tsconfig.build.json --watch", "docs": "npm run --prefix=site build", - "format": "npm run _format -- --write", - "format:check": "npm run _format -- --check", + "format": "oxfmt --write", + "format:check": "oxfmt --check", "lint": "eslint --cache", "lint:fix": "npm run lint -- --fix", "start": "node ./bin/run.js", @@ -203,9 +202,9 @@ "memfs": "^4.56.10", "nock": "^14.0.10", "npm-run-all2": "^8.0.4", + "oxfmt": "0.61.0", "p-timeout": "^7.0.0", "picomatch": "^4.0.4", - "prettier": "^2.8.8", "serialize-javascript": "^7.0.5", "strip-ansi": "^7.1.2", "temp-dir": "^3.0.0", diff --git a/renovate.json5 b/renovate.json5 index 4416b8b8ca4..07281ec5dd0 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -1,55 +1,55 @@ { - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": ["github>netlify/renovate-config:esm"], - "ignorePresets": [":prHourlyLimit2"], - "semanticCommits": "enabled", - "dependencyDashboard": true, - "constraints": { + $schema: 'https://docs.renovatebot.com/renovate-schema.json', + extends: ['github>netlify/renovate-config:esm'], + ignorePresets: [':prHourlyLimit2'], + semanticCommits: 'enabled', + dependencyDashboard: true, + constraints: { // Use npm@10 due to https://github.com/npm/cli/issues/8489 and https://github.com/npm/cli/issues/8767 - "npm": '^10.0.0', + npm: '^10.0.0', }, - "postUpdateOptions": ["npmDedupe"], - "packageRules": [ + postUpdateOptions: ['npmDedupe'], + packageRules: [ { - "description": "Open PRs immediately for @netlify/ packages without a schedule", - "matchPackagePatterns": ["^@netlify/"], - "schedule": ["at any time"] + description: 'Open PRs immediately for @netlify/ packages without a schedule', + matchPackagePatterns: ['^@netlify/'], + schedule: ['at any time'], }, { - "matchFileNames": ["site/package.json"], - "semanticCommitType": "chore", - "addLabels": ["website"], - "semanticCommitScope": "website", - "additionalBranchPrefix": "website-" + matchFileNames: ['site/package.json'], + semanticCommitType: 'chore', + addLabels: ['website'], + semanticCommitScope: 'website', + additionalBranchPrefix: 'website-', }, // Reduce noise by grouping `site/package.json` non-major updates together { - "matchFileNames": ["site/package.json"], - "matchUpdateTypes": ["minor", "patch", "pin", "digest"], - "groupName": "website non-major dependencies" + matchFileNames: ['site/package.json'], + matchUpdateTypes: ['minor', 'patch', 'pin', 'digest'], + groupName: 'website non-major dependencies', }, { - "matchFileNames": ["tests/**/package.json"], - "semanticCommitType": "chore", - "addLabels": ["tests"], - "semanticCommitScope": "tests", - "additionalBranchPrefix": "tests-" + matchFileNames: ['tests/**/package.json'], + semanticCommitType: 'chore', + addLabels: ['tests'], + semanticCommitScope: 'tests', + additionalBranchPrefix: 'tests-', }, { - "matchFileNames": ["src/**/package.json"], - "semanticCommitType": "fix", - "addLabels": ["templates"], - "semanticCommitScope": "templates", - "additionalBranchPrefix": "templates-" + matchFileNames: ['src/**/package.json'], + semanticCommitType: 'fix', + addLabels: ['templates'], + semanticCommitScope: 'templates', + additionalBranchPrefix: 'templates-', }, { - "matchFileNames": ["tests/**/package.json"], - "extends": [":pinAllExceptPeerDependencies"] + matchFileNames: ['tests/**/package.json'], + extends: [':pinAllExceptPeerDependencies'], }, { - "description": "Pin get-port to v5 (https://github.com/netlify/cli/pull/6531)", - "matchPackageNames": ["get-port"], - "allowedVersions": "<6" - } - ] + description: 'Pin get-port to v5 (https://github.com/netlify/cli/pull/6531)', + matchPackageNames: ['get-port'], + allowedVersions: '<6', + }, + ], } diff --git a/site/netlify.toml b/site/netlify.toml index 4a17efcf571..b1b1d371fca 100644 --- a/site/netlify.toml +++ b/site/netlify.toml @@ -1,58 +1,58 @@ [build] - command = "pushd .. && npm ci --no-verify && popd && npm run build" - publish = "dist" +command = "pushd .. && npm ci --no-verify && popd && npm run build" +publish = "dist" [functions] - node_bundler = "esbuild" +node_bundler = "esbuild" ##################### # Redirect Rules # ##################### [[redirects]] - # Telemetry link - from = "/telemetry/*" - to = "/.netlify/functions/telemetry" - status = 200 - force = true -[[redirects]] - # Bugsnag link - from = "/report-error" - to = "/.netlify/functions/error-reporting" - status = 200 - force = true -[[redirects]] - # Old CLI download links. - from = "/download/latest/mac" - to = "https://github.com/netlify/netlifyctl/releases/download/v0.4.0/netlifyctl-darwin-amd64-0.4.0.tar.gz" - status = 302 - force = false -[[redirects]] - # Old CLI download links. - from = "/download/latest/linux" - to = "https://github.com/netlify/netlifyctl/releases/download/v0.4.0/netlifyctl-linux-amd64-0.4.0.tar.gz" - status = 302 - force = false -[[redirects]] - # Old CLI download links. - from = "/download/latest/windows" - to = "https://github.com/netlify/netlifyctl/releases/download/v0.4.0/netlifyctl-windows-amd64-0.4.0.zip" - status = 302 - force = false -[[redirects]] - # Old CLI download links. - from = "/download/latest/source-zip" - to = "https://github.com/netlify/netlifyctl/archive/v0.4.0.zip" - status = 302 - force = false -[[redirects]] - # Old CLI download links. - from = "/download/latest/source-tar" - to = "https://github.com/netlify/netlifyctl/archive/v0.4.0.tar.gz" - status = 302 - force = false -[[redirects]] - # Old database command - from = "/commands/db/" - to = "/commands/database/" - status = 301 - force = false +# Telemetry link +from = "/telemetry/*" +to = "/.netlify/functions/telemetry" +status = 200 +force = true +[[redirects]] +# Bugsnag link +from = "/report-error" +to = "/.netlify/functions/error-reporting" +status = 200 +force = true +[[redirects]] +# Old CLI download links. +from = "/download/latest/mac" +to = "https://github.com/netlify/netlifyctl/releases/download/v0.4.0/netlifyctl-darwin-amd64-0.4.0.tar.gz" +status = 302 +force = false +[[redirects]] +# Old CLI download links. +from = "/download/latest/linux" +to = "https://github.com/netlify/netlifyctl/releases/download/v0.4.0/netlifyctl-linux-amd64-0.4.0.tar.gz" +status = 302 +force = false +[[redirects]] +# Old CLI download links. +from = "/download/latest/windows" +to = "https://github.com/netlify/netlifyctl/releases/download/v0.4.0/netlifyctl-windows-amd64-0.4.0.zip" +status = 302 +force = false +[[redirects]] +# Old CLI download links. +from = "/download/latest/source-zip" +to = "https://github.com/netlify/netlifyctl/archive/v0.4.0.zip" +status = 302 +force = false +[[redirects]] +# Old CLI download links. +from = "/download/latest/source-tar" +to = "https://github.com/netlify/netlifyctl/archive/v0.4.0.tar.gz" +status = 302 +force = false +[[redirects]] +# Old database command +from = "/commands/db/" +to = "/commands/database/" +status = 301 +force = false diff --git a/site/netlify/functions/error-reporting.ts b/site/netlify/functions/error-reporting.ts index 4b5d6629a79..c8729fac083 100755 --- a/site/netlify/functions/error-reporting.ts +++ b/site/netlify/functions/error-reporting.ts @@ -52,8 +52,7 @@ const toError = ({ // file:///C:/Users/jane/AppData/Roaming/npm/node_modules/netlify-cli/dist/utils/x.js. // Stripping everything up to the last `node_modules` makes the same frame identical // across machines and install layouts (npm, npx, pnpm) so Bugsnag groups on it. -const normalizeFrameFile = (file: string): string => - file.replace(/^.*node_modules[/\\]/, '').replace(/\\/g, '/') +const normalizeFrameFile = (file: string): string => file.replace(/^.*node_modules[/\\]/, '').replace(/\\/g, '/') export const handler: Handler = async ({ body }) => { try { diff --git a/site/scripts/util/generate-command-data.js b/site/scripts/util/generate-command-data.js index 168a71bb78f..a03ae6f01a4 100644 --- a/site/scripts/util/generate-command-data.js +++ b/site/scripts/util/generate-command-data.js @@ -34,17 +34,19 @@ const parseCommand = function (command) { } }, {}) - const isTopLevel = command.parent?.name() === "netlify" + const isTopLevel = command.parent?.name() === 'netlify' return { parent: !isTopLevel ? command.parent?.name() : undefined, name: command.name(), description: command.description(), commands: [ - ...command.commands.filter(cmd => !cmd._hidden).map(cmd => parseCommand(cmd)), + ...command.commands.filter((cmd) => !cmd._hidden).map((cmd) => parseCommand(cmd)), ...(isTopLevel - ? commands.filter((cmd) => cmd.name().startsWith(`${command.name()}:`) && !cmd._hidden).map(cmd => parseCommand(cmd)) - : []) + ? commands + .filter((cmd) => cmd.name().startsWith(`${command.name()}:`) && !cmd._hidden) + .map((cmd) => parseCommand(cmd)) + : []), ], examples: command.examples.length !== 0 && command.examples, args: args.length !== 0 && args, diff --git a/site/src/content.config.ts b/site/src/content.config.ts index d9ee8c9d1c9..9cfdab0958b 100644 --- a/site/src/content.config.ts +++ b/site/src/content.config.ts @@ -1,7 +1,7 @@ -import { defineCollection } from 'astro:content'; -import { docsLoader } from '@astrojs/starlight/loaders'; -import { docsSchema } from '@astrojs/starlight/schema'; +import { defineCollection } from 'astro:content' +import { docsLoader } from '@astrojs/starlight/loaders' +import { docsSchema } from '@astrojs/starlight/schema' export const collections = { - docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }), -}; + docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }), +} diff --git a/site/src/fonts/font-face.css b/site/src/fonts/font-face.css index 35c86c2be63..65c20c29049 100644 --- a/site/src/fonts/font-face.css +++ b/site/src/fonts/font-face.css @@ -3,8 +3,9 @@ src: url('./pacaembuvar-latin-nohint.woff2') format('woff2'); font-weight: 100 1000; font-display: swap; - unicode-range: U+0-FF, U+131, U+152, U+153, U+2BB, U+2BC, U+2C6, U+2DA, U+2DC, U+2000-206F, U+2074, U+20AC, U+2122, - U+2191, U+2193, U+2212, U+2215; + unicode-range: + U+0-FF, U+131, U+152, U+153, U+2BB, U+2BC, U+2C6, U+2DA, U+2DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, + U+2212, U+2215; } @font-face { @@ -12,8 +13,9 @@ src: url('./mulishvar-latin-nohint.woff2') format('woff2'); font-weight: 100 1000; font-display: swap; - unicode-range: U+0-FF, U+131, U+152, U+153, U+2BB, U+2BC, U+2C6, U+2DA, U+2DC, U+2000-206F, U+2074, U+20AC, U+2122, - U+2191, U+2193, U+2212, U+2215; + unicode-range: + U+0-FF, U+131, U+152, U+153, U+2BB, U+2BC, U+2C6, U+2DA, U+2DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, + U+2212, U+2215; } @font-face { @@ -22,6 +24,7 @@ font-weight: 200 900; font-style: italic; font-display: swap; - unicode-range: U+0-FF, U+131, U+152, U+153, U+2BB, U+2BC, U+2C6, U+2DA, U+2DC, U+2000-206F, U+2074, U+20AC, U+2122, - U+2191, U+2193, U+2212, U+2215; + unicode-range: + U+0-FF, U+131, U+152, U+153, U+2BB, U+2BC, U+2C6, U+2DA, U+2DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, + U+2212, U+2215; } diff --git a/site/src/styles/custom.css b/site/src/styles/custom.css index a35830679f1..5405ad86b9b 100644 --- a/site/src/styles/custom.css +++ b/site/src/styles/custom.css @@ -7,8 +7,9 @@ ::backdrop { /* All variables below are selectively copied from netlify/docs: https://github.com/netlify/docs/blob/main/docs/.vuepress/theme/styles/variables.css */ - --fontFamilyHeading: Pacaembu, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, - 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; + --fontFamilyHeading: + Pacaembu, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', + 'Segoe UI Emoji', 'Segoe UI Symbol'; --fontFamilyMono: 'Roboto Mono', 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', Courier, monospace; /* Color Palette: Neutral colors */ @@ -46,8 +47,9 @@ /* Adjust Starlight's theme defaults */ --sl-nav-pad-y: 0; - --sl-font-system: Mulishvar, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, - Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol; + --sl-font-system: + Mulishvar, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, + Segoe UI Emoji, Segoe UI Symbol; --sl-font-mono: var(--fontFamilyMono); --sl-color-bg: var(--colorBg); --sl-color-bg-nav: var(--sl-color-bg); @@ -76,7 +78,7 @@ & .right-sidebar a[aria-current='true'], & .right-sidebar a[aria-current='true']:hover, - & .sidebar [open]>summary>.group-label>.large { + & .sidebar [open] > summary > .group-label > .large { background: transparent; color: var(--colorText); } @@ -87,7 +89,7 @@ & .sidebar details a:hover, & .sidebar .large:hover, - & .sidebar [open]>summary>.group-label>.large:hover, + & .sidebar [open] > summary > .group-label > .large:hover, & .sidebar a.large[aria-current='page'], & .right-sidebar a:hover { color: var(--colorSidebarActiveLink); @@ -199,7 +201,7 @@ a { } /* Bump font size of first paragraph */ -.main-pane .sl-markdown-content>p:first-of-type:not(.netlify-panel) { +.main-pane .sl-markdown-content > p:first-of-type:not(.netlify-panel) { font-size: var(--mediumText); } @@ -222,7 +224,7 @@ a { } /* Remove border in between main heading and content */ -.content-panel+.content-panel { +.content-panel + .content-panel { border-top-width: 0; } @@ -252,7 +254,7 @@ a { } /* Align top-level links to caret */ -.sidebar .top-level>li>a { +.sidebar .top-level > li > a { --sl-icon-size: 1.25rem; --sl-icon-caret-size: 4.16; /* caret icon width is 4.16 at the original icon size of 16x16 */ @@ -268,7 +270,7 @@ a { } /* Second level sidebar links */ -.sidebar details ul>li { +.sidebar details ul > li { border-inline-start: 0; padding-inline-start: 2.5rem; @@ -278,7 +280,7 @@ a { } /* Second-level items with accordion (`summary`) */ -.sidebar ul ul>li:has(summary) { +.sidebar ul ul > li:has(summary) { margin-inline-start: -1rem; & .large { @@ -301,7 +303,7 @@ a { /* Starlight's current sidebar HTML markup contains whitespace in between tags, reduce default value a bit (not 0 to stay on the safe side re:upstream changes) */ -.sidebar .top-level>li>a.external-link:after { +.sidebar .top-level > li > a.external-link:after { margin-left: 0.125em; } @@ -382,10 +384,9 @@ details summary { /* Medium screens (Starlight breakpoint) */ @media (min-width: 50rem) { - /* Increase default margin in between top-level sidebar items with collapsible sub-items, very bespoke to the current sidebar structure */ - .top-level>li+li>details { + .top-level > li + li > details { margin-top: 1rem; } @@ -395,7 +396,7 @@ details summary { } } -.tab>a { +.tab > a { border-color: var(--colorBorder) !important; &[aria-selected='true'] { diff --git a/src/commands/clone/clone.ts b/src/commands/clone/clone.ts index 10e0a272efd..7d09289d1c7 100644 --- a/src/commands/clone/clone.ts +++ b/src/commands/clone/clone.ts @@ -25,7 +25,7 @@ const cloneRepo = async (repoUrl: string, targetDir: string, debug: boolean): Pr try { await runGit(['clone', repoUrl, targetDir], !debug) } catch (error) { - throw new Error(`Failed to clone repository: ${error instanceof Error ? error.message : error?.toString() ?? ''}`) + throw new Error(`Failed to clone repository: ${error instanceof Error ? error.message : (error?.toString() ?? '')}`) } } diff --git a/src/commands/types.d.ts b/src/commands/types.d.ts index bcd3d73f8aa..49028851860 100644 --- a/src/commands/types.d.ts +++ b/src/commands/types.d.ts @@ -14,7 +14,7 @@ export type NetlifySite = { configPath?: string siteId?: string get id(): string | undefined - set id(id: string): void + set id(id: string) } /** @@ -29,7 +29,7 @@ export type NetlifyOptions = { scheme?: string host?: string pathPrefix?: string - }, + } repositoryRoot: string /** Absolute path of the netlify configuration file */ configFilePath: string diff --git a/src/lib/api.ts b/src/lib/api.ts index 22666fb3352..751031572fa 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -9,7 +9,7 @@ export const cancelDeploy = async ({ api, deployId }: { api: NetlifyAPI; deployI } catch (error) { warn( `Failed canceling deploy with id ${deployId}: ${ - error instanceof Error ? error.message : error?.toString() ?? '' + error instanceof Error ? error.message : (error?.toString() ?? '') }`, ) } diff --git a/src/utils/deploy/hash-fns.ts b/src/utils/deploy/hash-fns.ts index c9edc6379a3..c7e441da785 100644 --- a/src/utils/deploy/hash-fns.ts +++ b/src/utils/deploy/hash-fns.ts @@ -188,14 +188,14 @@ const hashFns = async ( .filter((func) => Boolean( func.displayName || - func.generator || - func.routes || - func.buildData || - func.priority || - func.trafficRules || - func.region || - func.memory || - func.vcpu, + func.generator || + func.routes || + func.buildData || + func.priority || + func.trafficRules || + func.region || + func.memory || + func.vcpu, ), ) .reduce( diff --git a/src/utils/get-repo-data.ts b/src/utils/get-repo-data.ts index 3e619ce482c..b3aeab41b89 100644 --- a/src/utils/get-repo-data.ts +++ b/src/utils/get-repo-data.ts @@ -70,12 +70,12 @@ const getRepoData = async ({ repo, url, branch, - provider: host != null ? PROVIDERS[host] ?? host : host, + provider: host != null ? (PROVIDERS[host] ?? host) : host, httpsUrl: `https://${host}/${repo}`, } } catch (error) { return { - error: error instanceof Error ? error.message : error?.toString() ?? 'Failed to get repo data', + error: error instanceof Error ? error.message : (error?.toString() ?? 'Failed to get repo data'), } } } diff --git a/src/utils/live-tunnel.ts b/src/utils/live-tunnel.ts index 6da618754d2..e0139d5ebc8 100644 --- a/src/utils/live-tunnel.ts +++ b/src/utils/live-tunnel.ts @@ -191,7 +191,7 @@ export const getLiveTunnelSlug = (state: LocalState, override?: string) => { } catch (error) { log( `${NETLIFYDEVERR} Could not read or write local state file: ${ - error instanceof Error ? error.message : error?.toString() ?? '' + error instanceof Error ? error.message : (error?.toString() ?? '') }`, ) } diff --git a/src/utils/shell.ts b/src/utils/shell.ts index a0da60bb303..0be071980d7 100644 --- a/src/utils/shell.ts +++ b/src/utils/shell.ts @@ -58,7 +58,10 @@ const isMissingCommandMessage = ({ command, output }: { command: string; output: const createStripAnsiControlCharsStream = (): Transform => new Transform({ transform(chunk, _encoding, callback) { - callback(null, stripVTControlCharacters(typeof chunk === 'string' ? chunk : (chunk as unknown)?.toString() ?? '')) + callback( + null, + stripVTControlCharacters(typeof chunk === 'string' ? chunk : ((chunk as unknown)?.toString() ?? '')), + ) }, }) diff --git a/tests/integration/__fixtures__/dev-server-with-header-matching-edge-functions/netlify.toml b/tests/integration/__fixtures__/dev-server-with-header-matching-edge-functions/netlify.toml index eec6a99eae6..9fd45163ef5 100644 --- a/tests/integration/__fixtures__/dev-server-with-header-matching-edge-functions/netlify.toml +++ b/tests/integration/__fixtures__/dev-server-with-header-matching-edge-functions/netlify.toml @@ -1,2 +1,2 @@ [build] -publish = "public" \ No newline at end of file +publish = "public" diff --git a/tests/integration/__fixtures__/dev-server-with-header-matching-edge-functions/public/index.html b/tests/integration/__fixtures__/dev-server-with-header-matching-edge-functions/public/index.html index 4a3cf2488c1..297392be14a 100644 --- a/tests/integration/__fixtures__/dev-server-with-header-matching-edge-functions/public/index.html +++ b/tests/integration/__fixtures__/dev-server-with-header-matching-edge-functions/public/index.html @@ -1,4 +1,4 @@ - +