-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
onboard localization to pnpm/mono-dev
- Loading branch information
1 parent
1644b7d
commit c446212
Showing
16 changed files
with
414,249 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"pnpm": { | ||
"patchedDependencies": { | ||
"[email protected]": "patches/[email protected]" | ||
} | ||
} | ||
} | ||
"pnpm": { | ||
"patchedDependencies": { | ||
"[email protected]": "packages/intwc/patches/[email protected]" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,11 +9,15 @@ tasks: | |
cmds: | ||
- rm -rf monaco-editor-patch | ||
- pnpm install | ||
- pnpm patch [email protected] --edit-dir monaco-editor-patch | ||
- pnpm patch monaco-editor@$(jq '.dependencies.["monaco-editor"]' package.json | tr -d '"') --edit-dir monaco-editor-patch > out | ||
- rm out | ||
- bun scripts/patch.ts | ||
- rm -r monaco-editor-patch/dev | ||
- rm -r monaco-editor-patch/min | ||
- rm -r monaco-editor-patch/min-maps | ||
- pnpm patch-commit monaco-editor-patch || true | ||
- rm -rf patches | ||
- mv ../../patches . | ||
- bun scripts/post-patch.ts | ||
- pnpm install | ||
- rm -rf monaco-editor-patch |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// @ts-ignore | ||
import fs from "node:fs"; | ||
|
||
const ROOT_PACKAGE = "../../package.json"; | ||
const rootPackageJson = JSON.parse(fs.readFileSync(ROOT_PACKAGE, "utf-8")); | ||
const packageJson = JSON.parse(fs.readFileSync("package.json", "utf-8")); | ||
const monacoEditorVersion = packageJson.dependencies["monaco-editor"]; | ||
const patchedDependencies = rootPackageJson.pnpm.patchedDependencies; | ||
|
||
let found = false | ||
|
||
for (const key in patchedDependencies) { | ||
if (key === `monaco-editor@${monacoEditorVersion}`) { | ||
found = true; | ||
const file = patchedDependencies[key]; | ||
patchedDependencies[key] = "packages/intwc/" + file; | ||
console.log("Patched", key, "to", patchedDependencies[key]); | ||
continue; | ||
} | ||
if (key.startsWith("monaco-editor@")) { | ||
console.log("Removing", key); | ||
delete patchedDependencies[key]; | ||
} | ||
} | ||
|
||
if (!found) { | ||
throw new Error("monaco-editor not found in patchedDependencies"); | ||
} | ||
|
||
fs.writeFileSync(ROOT_PACKAGE, JSON.stringify(rootPackageJson, null, 4)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.yaml | ||
*.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,31 @@ | ||
version: '3' | ||
|
||
includes: | ||
ecma: | ||
taskfile: ../mono-dev/task/ecma.yaml | ||
internal: true | ||
|
||
tasks: | ||
push: | ||
desc: Push generated files. Requires gcloud access | ||
cmds: | ||
- gcloud storage cp src/generated/*.yaml gs://ist-private/i18n/generated | ||
|
||
build: | ||
desc: Generate the localization files | ||
aliases: [b] | ||
cmds: | ||
- python scripts/generate.py | ||
|
||
check: | ||
desc: Run Linter and Formatter | ||
cmds: | ||
- task: ecma:tsc-check | ||
- task: ecma:eslint-check | ||
- task: ecma:prettier-check | ||
|
||
fix: | ||
desc: Fix issues in code | ||
cmds: | ||
- task: ecma:eslint-fix | ||
- task: ecma:prettier-fix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { config } from "mono-dev/eslint"; | ||
|
||
export default config({ | ||
ignores: [], | ||
tsconfigRootDir: import.meta.dirname, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
{ | ||
"name": "skybook-localization", | ||
"private": true, | ||
"version": "0.0.0", | ||
"type": "module", | ||
"dependencies": { | ||
"@pistonite/pure": "*", | ||
"fuse.js": "^7.0.0", | ||
"i18next": "^24.2.0", | ||
"lru-cache": "^11.0.2", | ||
"react-i18next": "^15.2.0" | ||
}, | ||
"exports": { | ||
".": "./src/index.ts" | ||
} | ||
"name": "skybook-localization", | ||
"private": true, | ||
"version": "0.0.0", | ||
"type": "module", | ||
"dependencies": { | ||
"@pistonite/pure": "catalog:", | ||
"fuse.js": "^7.0.0", | ||
"i18next": "^24.2.0", | ||
"lru-cache": "^11.0.2", | ||
"react": "catalog:", | ||
"react-i18next": "^15.2.0" | ||
}, | ||
"devDependencies": { | ||
"@modyfi/vite-plugin-yaml": "catalog:", | ||
"@types/react": "catalog:", | ||
"eslint": "catalog:", | ||
"mono-dev": "workspace:*", | ||
"typescript": "catalog:", | ||
"vite": "catalog:" | ||
}, | ||
"exports": { | ||
".": "./src/index.ts" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.