-
-
Notifications
You must be signed in to change notification settings - Fork 0
Split babel transformers into separate transform-js and transform-jsx #12
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
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
3f3fac7
Split babel transformers into separate transform-js and transform-jsx…
k0d13 4ea25fc
Remove unused dependencies: typescript-transform-paths and vite-tscon…
k0d13 812a4d3
Bump dependencies and code cleanup
k0d13 99d510a
Re-order tanstack start example plugin list
k0d13 39a388d
Fix identifier assignment in ChoiceMessage branches to ensure proper …
k0d13 01e1363
Fix transformer function to use previous value in reduce for content …
k0d13 9a320d7
Remove unused play.ts example file from plugin-babel
k0d13 9a7c99f
Refactor transformation logic in plugin-babel and plugin-unplugin to …
k0d13 06feab7
Set translation to undefined in message extraction for JS and JSX tra…
k0d13 d738e44
Add null check for initialiser in parseJSXOpeningElement to prevent e…
k0d13 7522cc6
Add removal of stale entries in indexPath method
k0d13 0d061ab
Remove debugging code
k0d13 4a0a8ed
Restore typescript as peer dependency of config
k0d13 c60d589
Refactor hydrateTranslations to use bucket parameter and improve fall…
k0d13 adea30a
Update Formatter to use templateLiteral for extension property
k0d13 b6a9d0d
Refactor Bucket definition to simplify intersection and improve reada…
k0d13 9a8cf71
Remove unreachable handling of literal values in parseJSXOpeningEleme…
k0d13 10c0656
Use Promise.allSettled to ensure all bucket workers complete before e…
k0d13 9a3a4bd
Fix null assertion on cooked for tagged templates with invalid escape…
k0d13 fa78ad7
Rename @saykit/babel-plugin to babel-plugin-saykit
k0d13 d14a495
Normalise single transformers to arrays to avoid match bypass
k0d13 0572d81
Drop `as string`
k0d13 a979684
Chores
k0d13 4c56139
Refactor transformer function signatures to use 'code' as the first p…
k0d13 d227ae2
Fix argument order in transformer extraction to use content first
k0d13 25f86fd
Fix argument order in transform function within Bucket
k0d13 9825155
Add labels for transform-js and transform-jsx packages
k0d13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,11 @@ | ||
| --- | ||
| "@saykit/react": patch | ||
| "unplugin-saykit": patch | ||
| "@saykit/transform-jsx": patch | ||
| "babel-plugin-saykit": patch | ||
| "@saykit/transform-js": patch | ||
| "@saykit/format-po": patch | ||
| "@saykit/config": patch | ||
| --- | ||
|
|
||
| Split babel transformers into separate transform-js and transform-jsx packages |
This file contains hidden or 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 hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains hidden or 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
8 changes: 5 additions & 3 deletions
8
examples/nextjs-babel/saykit.config.ts → examples/carbon/saykit.config.ts
This file contains hidden or 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,14 +1,16 @@ | ||
| import { defineConfig } from '@saykit/config'; | ||
| import createFormatter from '@saykit/format-po'; | ||
| import createPoFormatter from '@saykit/format-po'; | ||
| import createJsTransformer from '@saykit/transform-js'; | ||
|
|
||
| export default defineConfig({ | ||
| sourceLocale: 'en', | ||
| locales: ['en', 'fr'], | ||
| buckets: [ | ||
| { | ||
| include: ['src/**/*.{ts,tsx}'], | ||
| include: ['src/**/*.ts'], | ||
| output: 'src/locales/{locale}/messages.{extension}', | ||
| formatter: createFormatter(), | ||
| formatter: createPoFormatter(), | ||
| transformer: createJsTransformer(), | ||
| }, | ||
| ], | ||
| }); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,4 @@ | ||
| { | ||
| "presets": ["next/babel"], | ||
| "plugins": ["saykit"] | ||
| } |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
examples/nextjs-babel/next-env.d.ts → examples/nextjs/next-env.d.ts
This file contains hidden or 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,6 +1,6 @@ | ||
| /// <reference types="next" /> | ||
| /// <reference types="next/image-types/global" /> | ||
| import './.next/dev/types/routes.d.ts'; | ||
| import './.next/types/routes.d.ts'; | ||
|
|
||
| // NOTE: This file should not be edited | ||
| // see https://nextjs.org/docs/app/api-reference/config/typescript for more information. |
This file contains hidden or 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 hidden or 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,17 @@ | ||
| import { defineConfig } from '@saykit/config'; | ||
| import createPoFormatter from '@saykit/format-po'; | ||
| import createJsTransformer from '@saykit/transform-js'; | ||
| import createJsxTransformer from '@saykit/transform-jsx'; | ||
|
|
||
| export default defineConfig({ | ||
| sourceLocale: 'en', | ||
| locales: ['en', 'fr'], | ||
| buckets: [ | ||
| { | ||
| include: ['src/**/*.{ts,tsx}'], | ||
| output: 'src/locales/{locale}/messages.{extension}', | ||
| formatter: createPoFormatter(), | ||
| transformer: [createJsTransformer(), createJsxTransformer()], | ||
| }, | ||
| ], | ||
| }); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or 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 hidden or 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,5 @@ | ||
| { | ||
| "extends": "../../tsconfig.base.json", | ||
| "include": ["src/**/*", ".next/dev/types/**/*.ts", "next-env.d.ts"], | ||
| "compilerOptions": { "paths": { "~/*": ["./src/*"] } } | ||
| } |
This file contains hidden or 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,3 @@ | ||
| .tanstack/ | ||
| node_modules/ | ||
| src/locales/*/*.json |
This file contains hidden or 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,34 @@ | ||
| { | ||
| "name": "tanstack-start-example", | ||
| "private": true, | ||
| "type": "module", | ||
| "sideEffects": false, | ||
| "scripts": { | ||
| "check": "tsc --noEmit", | ||
| "extract": "saykit extract", | ||
| "compile": "saykit compile", | ||
| "build": "vite build && tsc --noEmit", | ||
| "dev": "vite dev" | ||
| }, | ||
| "dependencies": { | ||
| "@saykit/react": "workspace:^", | ||
| "@tanstack/react-router": "^1.168.22", | ||
| "@tanstack/react-router-devtools": "^1.166.13", | ||
| "@tanstack/react-start": "^1.167.41", | ||
| "react": "^19.2.5", | ||
| "react-dom": "^19.2.5", | ||
| "saykit": "workspace:^" | ||
| }, | ||
| "devDependencies": { | ||
| "@saykit/config": "workspace:^", | ||
| "@saykit/format-po": "workspace:^", | ||
| "@saykit/transform-js": "workspace:^", | ||
| "@saykit/transform-jsx": "workspace:^", | ||
| "@types/node": "^25.6.0", | ||
| "@types/react": "^19.2.14", | ||
| "@types/react-dom": "^19.2.3", | ||
| "@vitejs/plugin-react": "^6.0.1", | ||
| "unplugin-saykit": "workspace:^", | ||
| "vite": "^8.0.8" | ||
| } | ||
| } |
This file contains hidden or 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,17 @@ | ||
| import { defineConfig } from '@saykit/config'; | ||
| import createPoFormatter from '@saykit/format-po'; | ||
| import createJsTransformer from '@saykit/transform-js'; | ||
| import createJsxTransformer from '@saykit/transform-jsx'; | ||
|
|
||
| export default defineConfig({ | ||
| sourceLocale: 'en', | ||
| locales: ['en', 'fr'], | ||
| buckets: [ | ||
| { | ||
| include: ['src/**/*.{ts,tsx}'], | ||
| output: 'src/locales/{locale}/messages.{extension}', | ||
| formatter: createPoFormatter(), | ||
| transformer: [createJsTransformer(), createJsxTransformer()], | ||
| }, | ||
| ], | ||
| }); |
This file contains hidden or 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,11 @@ | ||
| import { Say } from 'saykit'; | ||
|
|
||
| const say = new Say({ | ||
| locales: ['en', 'fr'], | ||
| messages: { | ||
| en: await import('./locales/en/messages.json').then((m) => m.default), | ||
| fr: await import('./locales/fr/messages.json').then((m) => m.default), | ||
| }, | ||
| }); | ||
|
|
||
| export default say; |
This file contains hidden or 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,15 @@ | ||
| msgid "" | ||
| msgstr "" | ||
| "Content-Type: text/plain; charset=UTF-8\n" | ||
| "Content-Transfer-Encoding: 8bit\n" | ||
| "Language: en\n" | ||
| "X-Generator: saykit\n" | ||
|
|
||
| msgid "Count: {count}" | ||
| msgstr "Count: {count}" | ||
|
|
||
| msgid "Increment" | ||
| msgstr "Increment" | ||
|
|
||
| msgid "Reset" | ||
| msgstr "Reset" |
This file contains hidden or 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,15 @@ | ||
| msgid "" | ||
| msgstr "" | ||
| "Content-Type: text/plain; charset=UTF-8\n" | ||
| "Content-Transfer-Encoding: 8bit\n" | ||
| "Language: fr\n" | ||
| "X-Generator: saykit\n" | ||
|
|
||
| msgid "Count: {count}" | ||
| msgstr "Compteur : {count}" | ||
|
|
||
| msgid "Increment" | ||
| msgstr "Incrémenter" | ||
|
|
||
| msgid "Reset" | ||
| msgstr "Réinitialiser" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.