Merge pull request #328 from Coffey-Labs/i18n-scripts-typescript7
Give the i18n scripts a parser again
This commit is contained in:
Generated
+17
-1
@@ -14,7 +14,8 @@
|
||||
],
|
||||
"devDependencies": {
|
||||
"concurrently": "^9.1.2",
|
||||
"typescript": "^7.0.2"
|
||||
"typescript": "^7.0.2",
|
||||
"typescript-ast": "npm:typescript@^5.9.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.19"
|
||||
@@ -2777,6 +2778,21 @@
|
||||
"@typescript/typescript-win32-x64": "7.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/typescript-ast": {
|
||||
"name": "typescript",
|
||||
"version": "5.9.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
|
||||
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.17"
|
||||
}
|
||||
},
|
||||
"node_modules/undici-types": {
|
||||
"version": "8.9.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz",
|
||||
|
||||
+2
-1
@@ -28,6 +28,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"concurrently": "^9.1.2",
|
||||
"typescript": "^7.0.2"
|
||||
"typescript": "^7.0.2",
|
||||
"typescript-ast": "npm:typescript@^5.9.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,21 @@
|
||||
* in the file looking correct, is never looked up, and the app renders English
|
||||
* for ever. Nothing warns, because a catalogue is only ever read by key.
|
||||
*/
|
||||
import ts from "typescript";
|
||||
/*
|
||||
* The parser, not the compiler.
|
||||
*
|
||||
* TypeScript 7 is the native port: its package ships a `tsc` shim over a Go
|
||||
* binary and nothing else, so `typescript` now exports `version` and
|
||||
* `versionMajorMinor` and no compiler API at all. Every `ts.createSourceFile`
|
||||
* in this directory started throwing "Cannot read properties of undefined
|
||||
* (reading 'Latest')" the day the bump landed, and nothing noticed, because no
|
||||
* workflow runs these.
|
||||
*
|
||||
* `typescript-ast` is an npm alias for the last TypeScript that carries the JS
|
||||
* API (see package.json). It parses; `typescript` still type-checks and builds.
|
||||
* Two entries, two jobs -- not a version someone forgot to remove.
|
||||
*/
|
||||
import ts from "typescript-ast";
|
||||
import { readFileSync, globSync } from "node:fs";
|
||||
|
||||
const wanted = new Set();
|
||||
|
||||
@@ -11,7 +11,21 @@
|
||||
* exits non-zero only with --check, so CI can be told to fail on regressions
|
||||
* later, once the number is low enough for that to mean something.
|
||||
*/
|
||||
import ts from "typescript";
|
||||
/*
|
||||
* The parser, not the compiler.
|
||||
*
|
||||
* TypeScript 7 is the native port: its package ships a `tsc` shim over a Go
|
||||
* binary and nothing else, so `typescript` now exports `version` and
|
||||
* `versionMajorMinor` and no compiler API at all. Every `ts.createSourceFile`
|
||||
* in this directory started throwing "Cannot read properties of undefined
|
||||
* (reading 'Latest')" the day the bump landed, and nothing noticed, because no
|
||||
* workflow runs these.
|
||||
*
|
||||
* `typescript-ast` is an npm alias for the last TypeScript that carries the JS
|
||||
* API (see package.json). It parses; `typescript` still type-checks and builds.
|
||||
* Two entries, two jobs -- not a version someone forgot to remove.
|
||||
*/
|
||||
import ts from "typescript-ast";
|
||||
import { readFileSync, globSync } from "node:fs";
|
||||
|
||||
/** Attributes a person reads. `className` and `key` are not among them. */
|
||||
|
||||
@@ -12,7 +12,21 @@
|
||||
* node scripts/i18n-extract.mjs <file...> rewrite in place
|
||||
* node scripts/i18n-extract.mjs --dry <file...>
|
||||
*/
|
||||
import ts from "typescript";
|
||||
/*
|
||||
* The parser, not the compiler.
|
||||
*
|
||||
* TypeScript 7 is the native port: its package ships a `tsc` shim over a Go
|
||||
* binary and nothing else, so `typescript` now exports `version` and
|
||||
* `versionMajorMinor` and no compiler API at all. Every `ts.createSourceFile`
|
||||
* in this directory started throwing "Cannot read properties of undefined
|
||||
* (reading 'Latest')" the day the bump landed, and nothing noticed, because no
|
||||
* workflow runs these.
|
||||
*
|
||||
* `typescript-ast` is an npm alias for the last TypeScript that carries the JS
|
||||
* API (see package.json). It parses; `typescript` still type-checks and builds.
|
||||
* Two entries, two jobs -- not a version someone forgot to remove.
|
||||
*/
|
||||
import ts from "typescript-ast";
|
||||
import { readFileSync, writeFileSync } from "node:fs";
|
||||
|
||||
const ATTRS = new Set(["title", "aria-label", "placeholder", "alt", "label", "hint", "confirmLabel", "description"]);
|
||||
|
||||
@@ -18,7 +18,21 @@
|
||||
* string that is neither -- one no catalogue has a key for, which therefore
|
||||
* cannot be translated at all, however many languages ship.
|
||||
*/
|
||||
import ts from "typescript";
|
||||
/*
|
||||
* The parser, not the compiler.
|
||||
*
|
||||
* TypeScript 7 is the native port: its package ships a `tsc` shim over a Go
|
||||
* binary and nothing else, so `typescript` now exports `version` and
|
||||
* `versionMajorMinor` and no compiler API at all. Every `ts.createSourceFile`
|
||||
* in this directory started throwing "Cannot read properties of undefined
|
||||
* (reading 'Latest')" the day the bump landed, and nothing noticed, because no
|
||||
* workflow runs these.
|
||||
*
|
||||
* `typescript-ast` is an npm alias for the last TypeScript that carries the JS
|
||||
* API (see package.json). It parses; `typescript` still type-checks and builds.
|
||||
* Two entries, two jobs -- not a version someone forgot to remove.
|
||||
*/
|
||||
import ts from "typescript-ast";
|
||||
import { readFileSync, globSync } from "node:fs";
|
||||
|
||||
/* Where a string literal in this position is shown to somebody. */
|
||||
|
||||
@@ -9,7 +9,21 @@
|
||||
* exists is dead weight, but a call with no key is an untranslated string
|
||||
* nobody noticed.
|
||||
*/
|
||||
import ts from "typescript";
|
||||
/*
|
||||
* The parser, not the compiler.
|
||||
*
|
||||
* TypeScript 7 is the native port: its package ships a `tsc` shim over a Go
|
||||
* binary and nothing else, so `typescript` now exports `version` and
|
||||
* `versionMajorMinor` and no compiler API at all. Every `ts.createSourceFile`
|
||||
* in this directory started throwing "Cannot read properties of undefined
|
||||
* (reading 'Latest')" the day the bump landed, and nothing noticed, because no
|
||||
* workflow runs these.
|
||||
*
|
||||
* `typescript-ast` is an npm alias for the last TypeScript that carries the JS
|
||||
* API (see package.json). It parses; `typescript` still type-checks and builds.
|
||||
* Two entries, two jobs -- not a version someone forgot to remove.
|
||||
*/
|
||||
import ts from "typescript-ast";
|
||||
import { readFileSync, globSync } from "node:fs";
|
||||
|
||||
const strings = new Set();
|
||||
|
||||
Reference in New Issue
Block a user