Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JS] Tests fail with node 23. #1995

Closed
5 tasks
yesudeep opened this issue Feb 15, 2025 · 3 comments · Fixed by #1962
Closed
5 tasks

[JS] Tests fail with node 23. #1995

yesudeep opened this issue Feb 15, 2025 · 3 comments · Fixed by #1962
Assignees
Labels
bug Something isn't working js

Comments

@yesudeep
Copy link
Contributor

yesudeep commented Feb 15, 2025

Describe the bug
JS unit tests fail with node version 23.

To Reproduce

zsh❯ nvm use 23
Now using node v23.8.0 (npm v10.9.2)

Fri Feb 14 2025  7:11PM (PST-0800) [email protected] on Darwin 24.3.0 arm64 
genkit on  yesudeep/fix/biome [$!?]  Yesudeep Mangalapilly [[email protected]] via  v23.8.0 
zsh❯ pnpm test:js

> genkit@ test:js /Users/yesudeep/code/github.com/firebase/genkit
> cd js && pnpm i && pnpm test:all

Scope: all 47 workspace projects
Lockfile is up to date, resolution step is skipped
Already up to date
Done in 535ms

> @ test:all /Users/yesudeep/code/github.com/firebase/genkit/js
> pnpm -r --workspace-concurrency 0 -F "./(ai|core|plugins|genkit)/**" test && pnpm test:esm

Scope: 17 of 47 workspace projects
core test$ node --import tsx --test tests/*_test.ts
│ /Users/yesudeep/code/github.com/firebase/genkit/js/core/src/error.ts:18
│ import { httpStatusCode, StatusName } from './statusTypes.js';
│                          ^
│ SyntaxError: The requested module './statusTypes.js' does not provide an export named 'StatusName'
│     at ModuleJob._instantiate (node:internal/modules/esm/module_job:181:21)
│     at async ModuleJob.run (node:internal/modules/esm/module_job:264:5)
│     at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:583:26)
│     at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:98:5)
│ Node.js v23.8.0
│ ✖ tests/action_test.ts (291.508291ms)
│ ▶ LazyPromise
│   ✔ call its function lazily (0.314625ms)
│ ✔ LazyPromise (0.659208ms)
│ /Users/yesudeep/code/github.com/firebase/genkit/js/core/src/error.ts:18
│ import { httpStatusCode, StatusName } from './statusTypes.js';
│                          ^
│ SyntaxError: The requested module './statusTypes.js' does not provide an export named 'StatusName'
│     at ModuleJob._instantiate (node:internal/modules/esm/module_job:181:21)
│     at async ModuleJob.run (node:internal/modules/esm/module_job:264:5)
│     at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:583:26)
│     at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:98:5)
│ Node.js v23.8.0
│ ✖ tests/context_test.ts (295.025375ms)
│ /Users/yesudeep/code/github.com/firebase/genkit/js/core/src/error.ts:18
│ import { httpStatusCode, StatusName } from './statusTypes.js';
│                          ^
│ SyntaxError: The requested module './statusTypes.js' does not provide an export named 'StatusName'
│     at ModuleJob._instantiate (node:internal/modules/esm/module_job:181:21)
│     at async ModuleJob.run (node:internal/modules/esm/module_job:264:5)
│     at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:583:26)
│     at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:98:5)
│ Node.js v23.8.0
│ ✖ tests/flow_test.ts (272.461917ms)
│ /Users/yesudeep/code/github.com/firebase/genkit/js/core/src/error.ts:18
│ import { httpStatusCode, StatusName } from './statusTypes.js';
│                          ^
│ SyntaxError: The requested module './statusTypes.js' does not provide an export named 'StatusName'
│     at ModuleJob._instantiate (node:internal/modules/esm/module_job:181:21)
│     at async ModuleJob.run (node:internal/modules/esm/module_job:264:5)
│     at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:583:26)
│     at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:98:5)
│ Node.js v23.8.0
│ ✖ tests/registry_test.ts (287.117916ms)
│ /Users/yesudeep/code/github.com/firebase/genkit/js/core/src/error.ts:18
│ import { httpStatusCode, StatusName } from './statusTypes.js';
│                          ^
│ SyntaxError: The requested module './statusTypes.js' does not provide an export named 'StatusName'
│     at ModuleJob._instantiate (node:internal/modules/esm/module_job:181:21)
│     at async ModuleJob.run (node:internal/modules/esm/module_job:264:5)
│     at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:583:26)
│     at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:98:5)
│ Node.js v23.8.0
│ ✖ tests/schema_test.ts (232.552917ms)
│ ℹ tests 6
│ ℹ suites 1
│ ℹ pass 1
│ ℹ fail 5
│ ℹ cancelled 0
│ ℹ skipped 0
│ ℹ todo 0
│ ℹ duration_ms 301.629875
│ ✖ failing tests:
│ test at tests/action_test.ts:1:1
│ ✖ tests/action_test.ts (291.508291ms)
│   'test failed'
│ test at tests/context_test.ts:1:1
│ ✖ tests/context_test.ts (295.025375ms)
│   'test failed'
│ test at tests/flow_test.ts:1:1
│ ✖ tests/flow_test.ts (272.461917ms)
│   'test failed'
│ test at tests/registry_test.ts:1:1
│ ✖ tests/registry_test.ts (287.117916ms)
│   'test failed'
│ test at tests/schema_test.ts:1:1
│ ✖ tests/schema_test.ts (232.552917ms)
│   'test failed'
└─ Failed in 339ms at /Users/yesudeep/code/github.com/firebase/genkit/js/core
/Users/yesudeep/code/github.com/firebase/genkit/js/core:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @genkit-ai/[email protected] test: `node --import tsx --test tests/*_test.ts`
Exit status 1
 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.

Expected behavior
Tests should pass.

Screenshots
Image

Runtime (please complete the following information):

  • OS: macOS, Linux
  • Version: Sequoia 15.3.1 arm64

** Node version

zsh❯ node --version
v23.8.0

Additional context

@yesudeep yesudeep added bug Something isn't working js labels Feb 15, 2025
yesudeep added a commit that referenced this issue Feb 15, 2025
…nd Google style #1987

This speeds up formatting by 4-12x and fixes several formatting related
issues whether they have to do with the commit message, source code, or
license headers. This means faster CI and pre-commits.

ISSUE: #1987
ISSUE: #1995

CHANGELOG:
- [ ] Update `pnpm run format` to use biomejs
- [ ] Update `pnpm run format:check` to use biomejs
- [ ] Use `bin/add_license` to add license headers.
- [ ] Exclude the `py/` and `go/` runtimes from the formatter.
- [ ] Fix Import attributes cannot be used with a type-only import error
- [ ] Update all the TypeScript files to use Google-style formatting.
- [ ] Re-enable pre-commit formatting for TypeScript.
- [ ] Update the JavaScript GitHub action workflows so that JS
  tests run on node version 20-23.

BENCHMARKS:

```
zsh❯ hyperfine -i "pnpm run format:biome" "pnpm run format:prettier"
Benchmark 1: pnpm run format:biome
  Time (mean ± σ):     453.6 ms ±   5.6 ms    [User: 679.3 ms, System: 92.5 ms]
  Range (min … max):   447.9 ms … 465.3 ms    10 runs

  Warning: Ignoring non-zero exit code.

Benchmark 2: pnpm run format:prettier
  Time (mean ± σ):      5.715 s ±  0.285 s    [User: 9.578 s, System: 0.739 s]
  Range (min … max):    5.506 s …  6.426 s    10 runs

Summary
  pnpm run format:biome ran
   12.60 ± 0.65 times faster than pnpm run format:prettier
```

A sample run follows:

```
zsh❯ pnpm run format

> genkit@ format /Users/yesudeep/code/github.com/firebase/genkit
> pnpm dlx @biomejs/biome format --write . && (tsx scripts/copyright.ts)

Formatted 663 files in 86ms. Fixed 217 files.
Checking copyright in sources...
Updated copyright headers in 0 files
```

REFERENCES:

The configuration for the formatting is more or less based on the Google
TypeScript formatting guidelines at:

- [ ] https://google.github.io/styleguide/tsguide.html#string-literals
- [ ] https://google.github.io/styleguide/jsguide.html
- [ ] https://google.github.io/styleguide/tsguide.html#arrow-function-bodies
- [ ] https://google.github.io/styleguide/tsguide.html#automatic-semicolon-insertion
yesudeep added a commit that referenced this issue Feb 15, 2025
…nd Google style #1987 #1995

This speeds up formatting by 4-12x and fixes several formatting related
issues whether they have to do with the commit message, source code, or
license headers. This means faster CI and pre-commits.

ISSUE: #1987
ISSUE: #1995

CHANGELOG:
- [ ] Update `pnpm run format` to use biomejs
- [ ] Update `pnpm run format:check` to use biomejs
- [ ] Use `bin/add_license` to add license headers.
- [ ] Exclude the `py/` and `go/` runtimes from the formatter.
- [ ] Fix Import attributes cannot be used with a type-only import error
- [ ] Update all the TypeScript files to use Google-style formatting.
- [ ] Re-enable pre-commit formatting for TypeScript.
- [ ] Update the JavaScript GitHub action workflows so that JS
  tests run on node version 20-23.

BENCHMARKS:

```
zsh❯ hyperfine -i "pnpm run format:biome" "pnpm run format:prettier"
Benchmark 1: pnpm run format:biome
  Time (mean ± σ):     453.6 ms ±   5.6 ms    [User: 679.3 ms, System: 92.5 ms]
  Range (min … max):   447.9 ms … 465.3 ms    10 runs

  Warning: Ignoring non-zero exit code.

Benchmark 2: pnpm run format:prettier
  Time (mean ± σ):      5.715 s ±  0.285 s    [User: 9.578 s, System: 0.739 s]
  Range (min … max):    5.506 s …  6.426 s    10 runs

Summary
  pnpm run format:biome ran
   12.60 ± 0.65 times faster than pnpm run format:prettier
```

A sample run follows:

```
zsh❯ pnpm run format

> genkit@ format /Users/yesudeep/code/github.com/firebase/genkit
> pnpm dlx @biomejs/biome format --write . && (tsx scripts/copyright.ts)

Formatted 663 files in 86ms. Fixed 217 files.
Checking copyright in sources...
Updated copyright headers in 0 files
```

REFERENCES:

The configuration for the formatting is more or less based on the Google
TypeScript formatting guidelines at:

- [ ] https://google.github.io/styleguide/tsguide.html#string-literals
- [ ] https://google.github.io/styleguide/jsguide.html
- [ ] https://google.github.io/styleguide/tsguide.html#arrow-function-bodies
- [ ] https://google.github.io/styleguide/tsguide.html#automatic-semicolon-insertion
yesudeep added a commit that referenced this issue Feb 15, 2025
…nd Google style #1987 #1995

This speeds up formatting by 4-12x and fixes several formatting related
issues whether they have to do with the commit message, source code, or
license headers. This means faster CI and pre-commits.

Also updates GitHub actions configuration to run tests for these node
versions:
- 20
- 21
- 22
- 23 (temporarily disabled since it is failing #1995)

ISSUE: #1987
ISSUE: #1995

CHANGELOG:
- [ ] Update `pnpm run format` to use biomejs
- [ ] Update `pnpm run format:check` to use biomejs
- [ ] Use `bin/add_license` to add license headers.
- [ ] Exclude the `py/` and `go/` runtimes from the formatter.
- [ ] Fix Import attributes cannot be used with a type-only import error
- [ ] Update all the TypeScript files to use Google-style formatting.
- [ ] Re-enable pre-commit formatting for TypeScript.
- [ ] Update the JavaScript GitHub action workflows so that JS
  tests run on node version 20-23.

BENCHMARKS:

```
zsh❯ hyperfine -i "pnpm run format:biome" "pnpm run format:prettier"
Benchmark 1: pnpm run format:biome
  Time (mean ± σ):     453.6 ms ±   5.6 ms    [User: 679.3 ms, System: 92.5 ms]
  Range (min … max):   447.9 ms … 465.3 ms    10 runs

  Warning: Ignoring non-zero exit code.

Benchmark 2: pnpm run format:prettier
  Time (mean ± σ):      5.715 s ±  0.285 s    [User: 9.578 s, System: 0.739 s]
  Range (min … max):    5.506 s …  6.426 s    10 runs

Summary
  pnpm run format:biome ran
   12.60 ± 0.65 times faster than pnpm run format:prettier
```

A sample run follows:

```
zsh❯ pnpm run format

> genkit@ format /Users/yesudeep/code/github.com/firebase/genkit
> pnpm dlx @biomejs/biome format --write . && (tsx scripts/copyright.ts)

Formatted 663 files in 86ms. Fixed 217 files.
Checking copyright in sources...
Updated copyright headers in 0 files
```

REFERENCES:

The configuration for the formatting is more or less based on the Google
TypeScript formatting guidelines at:

- [ ] https://google.github.io/styleguide/tsguide.html#string-literals
- [ ] https://google.github.io/styleguide/jsguide.html
- [ ] https://google.github.io/styleguide/tsguide.html#arrow-function-bodies
- [ ] https://google.github.io/styleguide/tsguide.html#automatic-semicolon-insertion
yesudeep added a commit that referenced this issue Feb 15, 2025
…nd Google style #1987 #1995

This speeds up formatting by 4-12x and fixes several formatting related
issues whether they have to do with the commit message, source code, or
license headers. This means faster CI and pre-commits.

Also updates GitHub actions configuration to run tests for these node
versions:
- 20
- 21
- 22
- 23 (temporarily disabled since it is failing #1995)

ISSUE: #1987
ISSUE: #1995

CHANGELOG:
- [ ] Update `pnpm run format` to use biomejs
- [ ] Update `pnpm run format:check` to use biomejs
- [ ] Use `bin/add_license` to add license headers.
- [ ] Exclude the `py/` and `go/` runtimes from the formatter.
- [ ] Fix Import attributes cannot be used with a type-only import error
- [ ] Update all the TypeScript files to use Google-style formatting.
- [ ] Re-enable pre-commit formatting for TypeScript.
- [ ] Update the JavaScript GitHub action workflows so that JS
  tests run on node version 20-23.
- [ ] Update `bin/setup` to default to node 22.

BENCHMARKS:

```
zsh❯ hyperfine -i "pnpm run format:biome" "pnpm run format:prettier"
Benchmark 1: pnpm run format:biome
  Time (mean ± σ):     453.6 ms ±   5.6 ms    [User: 679.3 ms, System: 92.5 ms]
  Range (min … max):   447.9 ms … 465.3 ms    10 runs

  Warning: Ignoring non-zero exit code.

Benchmark 2: pnpm run format:prettier
  Time (mean ± σ):      5.715 s ±  0.285 s    [User: 9.578 s, System: 0.739 s]
  Range (min … max):    5.506 s …  6.426 s    10 runs

Summary
  pnpm run format:biome ran
   12.60 ± 0.65 times faster than pnpm run format:prettier
```

A sample run follows:

```
zsh❯ pnpm run format

> genkit@ format /Users/yesudeep/code/github.com/firebase/genkit
> pnpm dlx @biomejs/biome format --write . && (tsx scripts/copyright.ts)

Formatted 663 files in 86ms. Fixed 217 files.
Checking copyright in sources...
Updated copyright headers in 0 files
```

REFERENCES:

The configuration for the formatting is more or less based on the Google
TypeScript formatting guidelines at:

- [ ] https://google.github.io/styleguide/tsguide.html#string-literals
- [ ] https://google.github.io/styleguide/jsguide.html
- [ ] https://google.github.io/styleguide/tsguide.html#arrow-function-bodies
- [ ] https://google.github.io/styleguide/tsguide.html#automatic-semicolon-insertion
yesudeep added a commit to google/dotprompt that referenced this issue Feb 15, 2025
ISSUE: firebase/genkit#1995

CHANGELOG:
- [ ] Update biome configuration to respect editorconfig and ignore some
  more directories.
- [ ] Fix some lint in TypeScript files.
- [ ] Update .gitignore to exclude .cache dir.
- [ ] Update workflows to use node version 20-23.
- [ ] Update `bin/setup` to use node version 22 as default on eng
  workstations.
- [ ] Adds additional script commands to run lint and format checks.
- [ ] Clean up copyright headers in GitHub action configuration.
yesudeep added a commit to google/dotprompt that referenced this issue Feb 15, 2025
ISSUE: firebase/genkit#1995

CHANGELOG:
- [ ] Update biome configuration to respect editorconfig and ignore some
  more directories.
- [ ] Fix some lint in TypeScript files.
- [ ] Update .gitignore to exclude .cache dir.
- [ ] Update workflows to use node version 20-23.
- [ ] Update `bin/setup` to use node version 22 as default on eng
  workstations.
- [ ] Adds additional script commands to run lint and format checks.
- [ ] Clean up copyright headers in GitHub action configuration.
yesudeep added a commit to google/dotprompt that referenced this issue Feb 15, 2025
ISSUE: firebase/genkit#1995

CHANGELOG:
- [x] Update biome configuration to respect editorconfig and ignore some
  more directories.
- [x] Fix some lint in TypeScript files.
- [x] Update .gitignore to exclude .cache dir.
- [x] Update workflows to use node version 20-23.
- [x] Update `bin/setup` to use node version 22 as default on eng
  workstations.
- [x] Adds additional script commands to run lint and format checks.
- [x] Clean up copyright headers in GitHub action configuration.
yesudeep added a commit that referenced this issue Feb 15, 2025
…nd Google style #1987 #1995

This speeds up formatting by 4-12x and fixes several formatting related
issues whether they have to do with the commit message, source code, or
license headers. This means faster CI and pre-commits.

Also updates GitHub actions configuration to run tests for these node
versions:
- 20
- 21
- 22
- 23 (temporarily disabled since it is failing #1995)

ISSUE: #1987
ISSUE: #1995

CHANGELOG:
- [ ] Update `pnpm run format` to use biomejs
- [ ] Update `pnpm run format:check` to use biomejs
- [ ] Use `bin/add_license` to add license headers.
- [ ] Exclude the `py/` and `go/` runtimes from the formatter.
- [ ] Fix Import attributes cannot be used with a type-only import error
- [ ] Update all the TypeScript files to use Google-style formatting.
- [ ] Re-enable pre-commit formatting for TypeScript.
- [ ] Update the JavaScript GitHub action workflows so that JS
  tests run on node version 20-23.
- [ ] Update `bin/setup` to default to node 22.

BENCHMARKS:

```
zsh❯ hyperfine -i "pnpm run format:biome" "pnpm run format:prettier"
Benchmark 1: pnpm run format:biome
  Time (mean ± σ):     453.6 ms ±   5.6 ms    [User: 679.3 ms, System: 92.5 ms]
  Range (min … max):   447.9 ms … 465.3 ms    10 runs

  Warning: Ignoring non-zero exit code.

Benchmark 2: pnpm run format:prettier
  Time (mean ± σ):      5.715 s ±  0.285 s    [User: 9.578 s, System: 0.739 s]
  Range (min … max):    5.506 s …  6.426 s    10 runs

Summary
  pnpm run format:biome ran
   12.60 ± 0.65 times faster than pnpm run format:prettier
```

A sample run follows:

```
zsh❯ pnpm run format

> genkit@ format /Users/yesudeep/code/github.com/firebase/genkit
> pnpm dlx @biomejs/biome format --write . && (tsx scripts/copyright.ts)

Formatted 663 files in 86ms. Fixed 217 files.
Checking copyright in sources...
Updated copyright headers in 0 files
```

REFERENCES:

The configuration for the formatting is more or less based on the Google
TypeScript formatting guidelines at:

- [ ] https://google.github.io/styleguide/tsguide.html#string-literals
- [ ] https://google.github.io/styleguide/jsguide.html
- [ ] https://google.github.io/styleguide/tsguide.html#arrow-function-bodies
- [ ] https://google.github.io/styleguide/tsguide.html#automatic-semicolon-insertion
yesudeep added a commit that referenced this issue Feb 15, 2025
This speeds up formatting by 4-12x and fixes several formatting related
issues whether they have to do with the commit message, source code, or
license headers. This means faster CI and pre-commits.

Also updates GitHub actions configuration to run tests for these node
versions:
- 20
- 21
- 22
- 23 (temporarily disabled since it is failing #1995)

ISSUE: #1987
ISSUE: #1995

CHANGELOG:
- [ ] Update `pnpm run format` to use biomejs
- [ ] Update `pnpm run format:check` to use biomejs
- [ ] Use `bin/add_license` to add license headers.
- [ ] Exclude the `py/` and `go/` runtimes from the formatter.
- [ ] Fix Import attributes cannot be used with a type-only import error
- [ ] Update all the TypeScript files to use Google-style formatting.
- [ ] Re-enable pre-commit formatting for TypeScript.
- [ ] Update the JavaScript GitHub action workflows so that JS
  tests run on node version 20-23.
- [ ] Update `bin/setup` to default to node 22.

BENCHMARKS:

```
zsh❯ hyperfine -i "pnpm run format:biome" "pnpm run format:prettier"
Benchmark 1: pnpm run format:biome
  Time (mean ± σ):     453.6 ms ±   5.6 ms    [User: 679.3 ms, System: 92.5 ms]
  Range (min … max):   447.9 ms … 465.3 ms    10 runs

  Warning: Ignoring non-zero exit code.

Benchmark 2: pnpm run format:prettier
  Time (mean ± σ):      5.715 s ±  0.285 s    [User: 9.578 s, System: 0.739 s]
  Range (min … max):    5.506 s …  6.426 s    10 runs

Summary
  pnpm run format:biome ran
   12.60 ± 0.65 times faster than pnpm run format:prettier
```

A sample run follows:

```
zsh❯ pnpm run format

> genkit@ format /Users/yesudeep/code/github.com/firebase/genkit
> pnpm dlx @biomejs/biome format --write . && (tsx scripts/copyright.ts)

Formatted 663 files in 86ms. Fixed 217 files.
Checking copyright in sources...
Updated copyright headers in 0 files
```

REFERENCES:

The configuration for the formatting is more or less based on the Google
TypeScript formatting guidelines at:

- [ ] https://google.github.io/styleguide/tsguide.html#string-literals
- [ ] https://google.github.io/styleguide/jsguide.html
- [ ] https://google.github.io/styleguide/tsguide.html#arrow-function-bodies
- [ ] https://google.github.io/styleguide/tsguide.html#automatic-semicolon-insertion
@yesudeep
Copy link
Contributor Author

@hugomurillomtz please enable testing on node version 23 when this is fixed.

#1988 currently doesn't enable it.

@pavelgj
Copy link
Collaborator

pavelgj commented Feb 15, 2025

I believe I have these errors cleaned up as part of
#1962

yesudeep added a commit to google/dotprompt that referenced this issue Feb 15, 2025
ISSUE: firebase/genkit#1995

CHANGELOG:
- [x] Update biome configuration to respect editorconfig and ignore some
  more directories.
- [x] Fix some lint in TypeScript files.
- [x] Update .gitignore to exclude .cache dir.
- [x] Update workflows to use node version 20-23.
- [x] Update `bin/setup` to use node version 22 as default on eng
  workstations.
- [x] Adds additional script commands to run lint and format checks.
- [x] Clean up copyright headers in GitHub action configuration.
yesudeep added a commit that referenced this issue Feb 15, 2025
This speeds up formatting by 4-12x and fixes several formatting related
issues whether they have to do with the commit message, source code, or
license headers. This means faster CI and pre-commits.

Also updates GitHub actions configuration to run tests for these node
versions:
- 20
- 21
- 22
- 23 (temporarily disabled since it is failing #1995)

ISSUE: #1987
ISSUE: #1995

CHANGELOG:
- [ ] Update `pnpm run format` to use biomejs
- [ ] Update `pnpm run format:check` to use biomejs
- [ ] Use `bin/add_license` to add license headers.
- [ ] Exclude the `py/` and `go/` runtimes from the formatter.
- [ ] Fix Import attributes cannot be used with a type-only import error
- [ ] Update all the TypeScript files to use Google-style formatting.
- [ ] Re-enable pre-commit formatting for TypeScript.
- [ ] Update the JavaScript GitHub action workflows so that JS
  tests run on node version 20-23.
- [ ] Update `bin/setup` to default to node 22.

BENCHMARKS:

```
zsh❯ hyperfine -i "pnpm run format:biome" "pnpm run format:prettier"
Benchmark 1: pnpm run format:biome
  Time (mean ± σ):     453.6 ms ±   5.6 ms    [User: 679.3 ms, System: 92.5 ms]
  Range (min … max):   447.9 ms … 465.3 ms    10 runs

  Warning: Ignoring non-zero exit code.

Benchmark 2: pnpm run format:prettier
  Time (mean ± σ):      5.715 s ±  0.285 s    [User: 9.578 s, System: 0.739 s]
  Range (min … max):    5.506 s …  6.426 s    10 runs

Summary
  pnpm run format:biome ran
   12.60 ± 0.65 times faster than pnpm run format:prettier
```

A sample run follows:

```
zsh❯ pnpm run format

> genkit@ format /Users/yesudeep/code/github.com/firebase/genkit
> pnpm dlx @biomejs/biome format --write . && (tsx scripts/copyright.ts)

Formatted 663 files in 86ms. Fixed 217 files.
Checking copyright in sources...
Updated copyright headers in 0 files
```

REFERENCES:

The configuration for the formatting is more or less based on the Google
TypeScript formatting guidelines at:

- [ ] https://google.github.io/styleguide/tsguide.html#string-literals
- [ ] https://google.github.io/styleguide/jsguide.html
- [ ] https://google.github.io/styleguide/tsguide.html#arrow-function-bodies
- [ ] https://google.github.io/styleguide/tsguide.html#automatic-semicolon-insertion
yesudeep added a commit that referenced this issue Feb 15, 2025
…1995

ISSUE: #1995

CHANGELOG:
- [ ] Update biome configuration to use arrow parens always.
- [ ] Update github workflows to test on node versions 20 through 22.
- [ ] We will add version #23 post fixes.
- [ ] Set node 22 to be the default for our eng workstations in the
  setup script for now.
yesudeep added a commit that referenced this issue Feb 15, 2025
…1995

ISSUE: #1995

CHANGELOG:
- [ ] Update biome configuration to use arrow parens always.
- [ ] Update github workflows to test on node versions 20 through 22.
- [ ] We will add version #23 post fixes.
- [ ] Set node 22 to be the default for our eng workstations in the
  setup script for now.
yesudeep added a commit that referenced this issue Feb 15, 2025
…1995

ISSUE: #1995

CHANGELOG:
- [ ] Update biome configuration to use arrow parens always.
- [ ] Update github workflows to test on node versions 20 through 22.
- [ ] We will add version #23 post fixes.
- [ ] Set node 22 to be the default for our eng workstations in the
  setup script for now.
yesudeep added a commit to google/dotprompt that referenced this issue Feb 15, 2025
ISSUE: firebase/genkit#1995

CHANGELOG:
- [x] Update biome configuration to respect editorconfig and ignore some
  more directories.
- [x] Fix some lint in TypeScript files.
- [x] Update .gitignore to exclude .cache dir.
- [x] Update workflows to use node version 20-23.
- [x] Update `bin/setup` to use node version 22 as default on eng
  workstations.
- [x] Adds additional script commands to run lint and format checks.
- [x] Clean up copyright headers in GitHub action configuration.
yesudeep added a commit to google/dotprompt that referenced this issue Feb 15, 2025
ISSUE: firebase/genkit#1995

CHANGELOG:
- [x] Update biome configuration to respect editorconfig and ignore some
  more directories.
- [x] Fix some lint in TypeScript files.
- [x] Update .gitignore to exclude .cache dir.
- [x] Update workflows to use node version 20-23.
- [x] Update `bin/setup` to use node version 22 as default on eng
  workstations.
- [x] Adds additional script commands to run lint and format checks.
- [x] Clean up copyright headers in GitHub action configuration.
yesudeep added a commit that referenced this issue Feb 16, 2025
…1995

ISSUE: #1995

CHANGELOG:
- [ ] Update biome configuration to use arrow parens always.
- [ ] Update github workflows to test on node versions 20 through 22.
- [ ] We will add version #23 post fixes.
- [ ] Set node 22 to be the default for our eng workstations in the
  setup script for now.
yesudeep added a commit to google/dotprompt that referenced this issue Feb 16, 2025
ISSUE: firebase/genkit#1995

CHANGELOG:
- [x] Update biome configuration to respect editorconfig and ignore some
  more directories.
- [x] Fix some lint in TypeScript files.
- [x] Update .gitignore to exclude .cache dir.
- [x] Update workflows to use node version 20-23.
- [x] Update `bin/setup` to use node version 22 as default on eng
  workstations.
- [x] Adds additional script commands to run lint and format checks.
- [x] Clean up copyright headers in GitHub action configuration.
yesudeep added a commit to google/dotprompt that referenced this issue Feb 16, 2025
ISSUE: firebase/genkit#1995

CHANGELOG:
- [x] Update biome configuration to respect editorconfig and ignore some
  more directories.
- [x] Fix some lint in TypeScript files.
- [x] Update .gitignore to exclude .cache dir.
- [x] Update workflows to use node version 20-23.
- [x] Update `bin/setup` to use node version 22 as default on eng
  workstations.
- [x] Adds additional script commands to run lint and format checks.
- [x] Clean up copyright headers in GitHub action configuration.
yesudeep added a commit that referenced this issue Feb 16, 2025
…1995

ISSUE: #1995

CHANGELOG:
- [ ] Update biome configuration to use arrow parens always.
- [ ] Update github workflows to test on node versions 20 through 22.
- [ ] We will add version #23 post fixes.
- [ ] Set node 22 to be the default for our eng workstations in the
  setup script for now.
yesudeep added a commit that referenced this issue Feb 16, 2025
…1995

ISSUE: #1995

CHANGELOG:
- [x] Update biome configuration to use arrow function arg parens always.
- [x] Update github workflows to test on node versions 20 through 22.
- [x] We will add version #23 post fixes.
- [x] Set node 22 to be the default for our eng workstations in the
  setup script for now.

The configuration for the formatting is more or less based on the Google
TypeScript formatting guidelines at:

- [x]  https://google.github.io/styleguide/tsguide.html#string-literals
- [x]  https://google.github.io/styleguide/jsguide.html
- [x]  https://google.github.io/styleguide/tsguide.html#arrow-function-bodies
- [x]  https://google.github.io/styleguide/tsguide.html#automatic-semicolon-insertion
@hugomurillomtz
Copy link

@hugomurillomtz please enable testing on node version 23 when this is fixed.

#1988 currently doesn't enable it.

@yesudeep, I think you meant @hugoaguirre

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working js
Projects
Status: Done
3 participants