Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ __pycache__

# Compiled message catalogs (run `npm run i18n:compile`)
/src/messages/*.json

# Typeshed JSON copied from @microbit/micropython-microbit-stubs (run `npm run stubs`)
/src/micropython/main/typeshed.*.json
35 changes: 0 additions & 35 deletions bin/update-translations.sh

This file was deleted.

13 changes: 0 additions & 13 deletions bin/update-typeshed.sh

This file was deleted.

13 changes: 7 additions & 6 deletions docs/tech-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ In development, add strings to `lang/ui.en.json` and run `npm run i18n:compile`

Other content:

- API documentation is managed in the [type stubs repository](https://github.com/microbit-foundation/micropython-microbit-stubs/)
- API documentation is managed in the [type stubs repository](https://github.com/microbit-foundation/micropython-microbit-stubs/) and reaches the editor as the `@microbit/micropython-microbit-stubs` npm package (see below)
- Reference and Ideas content is managed in the Foundation's content management system
- Common Pyright error messages are managed [in the Foundation's Pyright fork](https://github.com/microbit-foundation/pyright/blob/microbit/packages/pyright-internal/src/localization/simplified.nls.en-us.json).

Expand All @@ -127,11 +127,12 @@ The CMS content is managed separately by the Micro:bit Educational Foundation an

#### Incorporating changes from Crowdin

For the editor's UI strings alone, the translations-download workflow runs weekly and opens a pull request; run it from the Actions tab for an earlier sync, or `npm run i18n:download` locally.
Each of the three repositories has a translations-download workflow that runs weekly and opens a pull request; run it from the Actions tab for an earlier sync, or `npm run i18n:download` locally for the editor's UI strings.

For everything at once, use [update-translations.sh](../bin/update-translations.sh). Review it first. It assumes sibling checkouts of our pyright fork and the stubs repository. Prepare them with a clean branch from the main (editor, stubs) or microbit (pyright) branches. The script downloads into all three and updates the editor with the stubs and pyright changes as well as the UI strings.
The stubs and Pyright changes reach the editor differently:

Review the changes and create PRs for each repository. Review the pyright and stubs PRs first.
- The stubs repository publishes its `typeshed.<lang>.json` to npm as `@microbit/micropython-microbit-stubs` when a GitHub release is created there. Renovate then opens a pull request here to take the new version. `npm run stubs` (part of `npm run generate`, run on install and before start, typecheck and build) copies the files into `src/micropython/main/`, which is gitignored.
- The Pyright fork's worker is built and vendored into `public/workers/` with [update-pyright.sh](../bin/update-pyright.sh), which expects a sibling checkout of the fork on its `microbit` branch.

#### Updating files in Crowdin

Expand All @@ -145,13 +146,13 @@ When considering a new language it's worth checking early whether support is ava

Steps:

1. Add the language in the stubs repository: its `i18n.config.mjs` and `scripts/build-translations.sh`.
1. Add the language to the stubs repository's `i18n.config.mjs`, run a sync there and cut a release.
2. Add the language to the editor repository:
1. Add the language to `i18n.config.mjs`.
2. Add lunr language support. See [search.ts](../src/documentation/search/search.ts).
3. Update `supportedLanguages` in [settings.tsx](../src/settings/settings.tsx). You can add the language as a preview language. In this case it will only show up on the beta deployment and will be tagged as a preview in the UI.
3. Add the language to the pyright repository: its `i18n.config.mjs` and the switch statement in `localize.ts`.
4. Run a translation sync as documented above.
4. Run a translation sync as documented above, take the stubs release and rebuild Pyright.

## Updating MicroPython

Expand Down
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@codemirror/view": "^6.26.3",
"@microbit/microbit-connection": "^1.0.0",
"@microbit/microbit-fs": "^0.10.0",
"@microbit/micropython-microbit-stubs": "^1.0.0",
"@microbit/ui": "^0.3.0",
"@microbit/ui-patterns": "^0.4.0",
"@sanity/block-content-to-react": "^3.0.0",
Expand Down Expand Up @@ -84,24 +85,26 @@
},
"scripts": {
"build": "vite build",
"prebuild": "npm run panda && npm run i18n:compile",
"prebuild": "npm run generate",
"ci": "npm run typecheck && npm run test && npm run lint && npm run i18n:tidy -- --check && npm run build",
"deploy": "website-deploy-aws",
"dev:link-ui": "rm -rf node_modules/@microbit/ui node_modules/@microbit/ui-patterns node_modules/@microbit/i18n-tools && ln -s ../../../ui/packages/ui node_modules/@microbit/ui && ln -s ../../../ui/packages/ui-patterns node_modules/@microbit/ui-patterns && ln -s ../../../ui/packages/i18n-tools node_modules/@microbit/i18n-tools && ln -sf ../@microbit/i18n-tools/bin/microbit-i18n.mjs node_modules/.bin/microbit-i18n && rm -rf styled-system node_modules/.vite && npm run panda",
"fix-licensing-headers": "node bin/fix-licensing-headers.cjs",
"generate": "npm run panda && npm run i18n:compile && npm run stubs",
"i18n:compile": "microbit-i18n compile",
"invalidate": "aws cloudfront create-invalidation --distribution-id $(printenv ${STAGE}_CLOUDFRONT_DISTRIBUTION_ID) --paths \"/*\"",
"lint": "eslint . --max-warnings 0",
"prepare": "npm run panda && npm run i18n:compile",
"prepare": "npm run generate",
"panda": "panda codegen",
"panda:watch": "panda codegen --watch",
"serve": "npx serve --no-clipboard -l 3000 -- build/",
"prestart": "npm run panda && npm run i18n:compile",
"prestart": "npm run generate",
"start": "vite dev",
"stubs": "cp node_modules/@microbit/micropython-microbit-stubs/typeshed.*.json src/micropython/main/",
"test:e2e:headless": "playwright test",
"test:e2e": "playwright test --ui",
"test": "vitest",
"pretypecheck": "npm run panda && npm run i18n:compile",
"pretypecheck": "npm run generate",
"typecheck": "tsc --noEmit",
"typecheck:watch": "tsc --noEmit --watch",
"i18n:tidy": "microbit-i18n tidy",
Expand Down
51 changes: 0 additions & 51 deletions src/micropython/main/typeshed.ca.json

This file was deleted.

51 changes: 0 additions & 51 deletions src/micropython/main/typeshed.de.json

This file was deleted.

51 changes: 0 additions & 51 deletions src/micropython/main/typeshed.en.json

This file was deleted.

51 changes: 0 additions & 51 deletions src/micropython/main/typeshed.es-ES.json

This file was deleted.

51 changes: 0 additions & 51 deletions src/micropython/main/typeshed.fr.json

This file was deleted.

51 changes: 0 additions & 51 deletions src/micropython/main/typeshed.ga-IE.json

This file was deleted.

51 changes: 0 additions & 51 deletions src/micropython/main/typeshed.ja.json

This file was deleted.

51 changes: 0 additions & 51 deletions src/micropython/main/typeshed.ko.json

This file was deleted.

51 changes: 0 additions & 51 deletions src/micropython/main/typeshed.lol.json

This file was deleted.

51 changes: 0 additions & 51 deletions src/micropython/main/typeshed.nl.json

This file was deleted.

51 changes: 0 additions & 51 deletions src/micropython/main/typeshed.pl.json

This file was deleted.

51 changes: 0 additions & 51 deletions src/micropython/main/typeshed.zh-CN.json

This file was deleted.

51 changes: 0 additions & 51 deletions src/micropython/main/typeshed.zh-TW.json

This file was deleted.

Loading