-
-
Notifications
You must be signed in to change notification settings - Fork 7
Fix build errors in Svelte libraries #144
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
Open
gmjgeek
wants to merge
6
commits into
sillsdev:main
Choose a base branch
from
gmjgeek:svelte-library-refactor
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
10e55ab
feat(svelte): extract library and add SvelteKit demo app
7bdbaec
fix: address type errors in svelte demo
b8a2990
chore: add publishConfig to svelte-daisyui package.json
befcc91
fix: correct nx-release-publish packageRoot for svelte-daisyui package
22e23db
fix: correct packaging errors in state-management-svelte
f6e37dd
fix: move isField function to state-management-core
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
3 changes: 2 additions & 1 deletion
3
components/language-chooser/common/find-language/languageSearcher.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
4 changes: 2 additions & 2 deletions
4
components/language-chooser/common/find-language/languageTagUtils.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
2 changes: 1 addition & 1 deletion
2
components/language-chooser/common/find-language/matchingSubstringDemarcation.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
2 changes: 1 addition & 1 deletion
2
components/language-chooser/common/find-language/regionsAndScripts.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
2 changes: 1 addition & 1 deletion
2
components/language-chooser/common/find-language/searchForLanguage.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,5 +1,5 @@ | ||
| import Fuse from "fuse.js"; | ||
| import { | ||
| import type { | ||
| ICustomizableLanguageDetails, | ||
| ILanguage, | ||
| IOrthography, | ||
|
|
||
3 changes: 2 additions & 1 deletion
3
components/language-chooser/common/find-language/searchResultModifiers.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
14 changes: 0 additions & 14 deletions
14
components/language-chooser/svelte/language-chooser-svelte-daisyui/index.html
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
components/language-chooser/svelte/language-chooser-svelte-daisyui/index.ts
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
2 changes: 2 additions & 0 deletions
2
components/language-chooser/svelte/language-chooser-svelte-daisyui/src/lib/index.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 |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { default as LanguageChooser } from "./LanguageChooser.svelte"; | ||
| export { default as LanguageChooserModal } from "./LanguageChooserModal.svelte"; |
8 changes: 0 additions & 8 deletions
8
components/language-chooser/svelte/language-chooser-svelte-daisyui/src/main.ts
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 |
|---|---|---|
|
|
@@ -27,7 +27,6 @@ | |
| "./**/*.jsx", | ||
| "./**/*.ts", | ||
| "./**/*.tsx", | ||
| "./**/*.svelte", | ||
| "../index.ts" | ||
| "./**/*.svelte" | ||
| ] | ||
| } | ||
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
30 changes: 30 additions & 0 deletions
30
components/language-chooser/svelte/language-chooser-svelte-demo/package.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,30 @@ | ||
| { | ||
| "name": "@ethnolib/language-chooser-svelte-demo", | ||
| "version": "0.1.0", | ||
| "private": true, | ||
| "type": "module", | ||
| "scripts": { | ||
| "dev": "vite dev", | ||
| "build": "vite build", | ||
| "preview": "vite preview", | ||
| "check": "svelte-check --tsconfig ./tsconfig.json" | ||
| }, | ||
| "dependencies": { | ||
| "@ethnolib/find-language": "0.3.0", | ||
| "@ethnolib/language-chooser-svelte-daisyui": "*" | ||
| }, | ||
| "devDependencies": { | ||
| "@sveltejs/adapter-static": "^3.0.8", | ||
| "@sveltejs/kit": "^2.20.7", | ||
| "@sveltejs/vite-plugin-svelte": "^4.0.0", | ||
| "@tailwindcss/typography": "^0.5.16", | ||
| "autoprefixer": "^10.4.21", | ||
| "daisyui": "^5.1.12", | ||
| "postcss": "^8.5.6", | ||
| "svelte": "^5.38.6", | ||
| "svelte-check": "^4.0.5", | ||
| "tailwindcss": "^3.4.17", | ||
| "vite": "^5.0.8" | ||
| }, | ||
| "nx": {} | ||
| } |
6 changes: 6 additions & 0 deletions
6
components/language-chooser/svelte/language-chooser-svelte-demo/postcss.config.js
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,6 @@ | ||
| export default { | ||
| plugins: { | ||
| tailwindcss: {}, | ||
| autoprefixer: {}, | ||
| }, | ||
| }; |
21 changes: 21 additions & 0 deletions
21
components/language-chooser/svelte/language-chooser-svelte-demo/project.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,21 @@ | ||
| { | ||
| "name": "@ethnolib/language-chooser-svelte-demo", | ||
| "$schema": "../../../../node_modules/nx/schemas/project-schema.json", | ||
| "projectType": "application", | ||
| "targets": { | ||
| "dev": { | ||
| "executor": "nx:run-commands", | ||
| "options": { | ||
| "command": "npm run dev", | ||
| "cwd": "{projectRoot}" | ||
| } | ||
| }, | ||
| "build": { | ||
| "executor": "nx:run-commands", | ||
| "options": { | ||
| "command": "npm run build", | ||
| "cwd": "{projectRoot}" | ||
| } | ||
| } | ||
| } | ||
| } |
3 changes: 3 additions & 0 deletions
3
components/language-chooser/svelte/language-chooser-svelte-demo/src/app.css
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 @@ | ||
| @tailwind base; | ||
| @tailwind components; | ||
| @tailwind utilities; |
12 changes: 12 additions & 0 deletions
12
components/language-chooser/svelte/language-chooser-svelte-demo/src/app.html
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,12 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="utf-8" /> | ||
| <link rel="icon" href="%sveltekit.assets%/favicon.png" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
| %sveltekit.head% | ||
| </head> | ||
| <body data-sveltekit-preload-data="hover"> | ||
| <div style="display: contents">%sveltekit.body%</div> | ||
| </body> | ||
| </html> |
8 changes: 8 additions & 0 deletions
8
components/language-chooser/svelte/language-chooser-svelte-demo/src/routes/+layout.svelte
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,8 @@ | ||
| <script lang="ts"> | ||
| import "../app.css"; | ||
| import type { Snippet } from "svelte"; | ||
|
|
||
| const { children }: { children: Snippet } = $props(); | ||
| </script> | ||
|
|
||
| {@render children()} |
5 changes: 1 addition & 4 deletions
5
...age-chooser-svelte-daisyui/src/App.svelte → ...ooser-svelte-demo/src/routes/+page.svelte
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
12 changes: 12 additions & 0 deletions
12
components/language-chooser/svelte/language-chooser-svelte-demo/svelte.config.js
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,12 @@ | ||
| import adapter from "@sveltejs/adapter-static"; | ||
| import { vitePreprocess } from "@sveltejs/vite-plugin-svelte"; | ||
|
|
||
| export default { | ||
| preprocess: vitePreprocess(), | ||
| compilerOptions: { | ||
| runes: true, | ||
| }, | ||
| kit: { | ||
| adapter: adapter({ fallback: "200.html" }), | ||
| }, | ||
| }; |
17 changes: 17 additions & 0 deletions
17
components/language-chooser/svelte/language-chooser-svelte-demo/tailwind.config.js
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 daisyui from "daisyui"; | ||
| import typography from "@tailwindcss/typography"; | ||
|
|
||
| /** @type {import('tailwindcss').Config} */ | ||
| export default { | ||
| content: [ | ||
| "./src/**/*.{html,js,svelte,ts}", | ||
| "../language-chooser-svelte-daisyui/src/lib/**/*.svelte", | ||
| ], | ||
| theme: { | ||
| extend: {}, | ||
| }, | ||
| plugins: [daisyui, typography], | ||
| daisyui: { | ||
| themes: ["light", "dark", "cupcake"], | ||
| }, | ||
| }; |
7 changes: 7 additions & 0 deletions
7
components/language-chooser/svelte/language-chooser-svelte-demo/tsconfig.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,7 @@ | ||
| { | ||
| "extends": "./.svelte-kit/tsconfig.json", | ||
| "compilerOptions": { | ||
| "strict": true, | ||
| "skipLibCheck": true | ||
| } | ||
| } |
27 changes: 27 additions & 0 deletions
27
components/language-chooser/svelte/language-chooser-svelte-demo/vite.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 |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import { sveltekit } from "@sveltejs/kit/vite"; | ||
| import { defineConfig } from "vite"; | ||
| import { nxViteTsPaths } from "@nx/vite/plugins/nx-tsconfig-paths.plugin"; | ||
|
|
||
| export default defineConfig({ | ||
| plugins: [nxViteTsPaths(), sveltekit()], | ||
| cacheDir: | ||
| "../../../../node_modules/.vite/components/language-chooser/svelte/language-chooser-svelte-demo", | ||
| ssr: { | ||
| // Process workspace packages through Vite (not externalized to Node.js) | ||
| // so that .svelte.ts files are compiled by the Svelte compiler and | ||
| // TypeScript source files are handled correctly. | ||
| // Process workspace packages and their CJS transitive deps through Vite | ||
| // rather than externalizing them to Node.js. This ensures .svelte.ts files | ||
| // are compiled by the Svelte compiler, TypeScript source is transformed, and | ||
| // CJS deps (lodash, fuse.js) are converted to ESM for named imports. | ||
| noExternal: [ | ||
| "@ethnolib/find-language", | ||
| "@ethnolib/language-chooser-controller", | ||
| "@ethnolib/language-chooser-svelte-daisyui", | ||
| "@ethnolib/state-management-svelte", | ||
| "@ethnolib/state-management-core", | ||
| "lodash", | ||
| "fuse.js", | ||
| ], | ||
| }, | ||
| }); |
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
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.