Conversation
8a3987b to
aa22c01
Compare
4a1bd8a to
62a7383
Compare
|
Chromium major version is behind target branch (145.0.7632.120 vs 146.0.7680.32). Please rebase. |
62a7383 to
89f5fbf
Compare
|
A Storybook has been deployed to preview UI for the latest push |
|
[puLL-Merge] - brave/brave-core@34222 DescriptionThis PR migrates the Possible Issues
Security HotspotsNone identified. ChangesChanges
sequenceDiagram
participant User
participant npm as npm run test:scripts
participant ts as testScripts.ts
participant tsc as tsc --project build/commands
participant eslint as eslint --quiet build/commands
participant jest as jest build/commands
User->>npm: npm run test:scripts
npm->>ts: node ./build/commands/scripts/testScripts.ts
ts->>tsc: execSync("tsc --project build/commands")
tsc-->>ts: success/fail
ts->>eslint: execSync("eslint --quiet build/commands")
eslint-->>ts: success/fail
ts->>jest: execSync("jest build/commands")
jest-->>ts: success/fail
ts-->>User: exit code
|
d355a3f to
e42e197
Compare
c1dd8a9 to
0ff3562
Compare
|
Released in v1.89.89 |
Migrate
build/commandscode to ESM to allow.js/.tsimports to work correctly in any direction. This allows for gradual migration to.tswhile keeping.jsfiles around.Few notes on migration:
import.meta.*cannot be used reliably with Jest. I tried different versions and approaches, eventually came up with a.cjsmodule that still uses__dirName, but can be imported into ESM and CommonJS modules without issues. I also considered rewriting Jest tests into built-in Node test runner, but since I was able to make Jest work, this was abandoned.tscaccepts bothfile.js/file.tsin imports and passes a compiler check without errors, but Node requires an import of a real file (type stripping is based on a file type). This means an incorrect import will passtest:scripts, but fail on real execution (see related discussion). An eslint rule was added to enforce that.require()calls replaced with async/global imports depending on context.Resolves brave/brave-browser#53172