forked from podman-desktop/podman-desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: introduce a svelte ui package (podman-desktop#6172)
* feat: introduce a svelte ui package the renderer package has a dependency to this new module we could publish the ui-svelte package so other components could reuse components defined there for now, there is no component being defined but stay tuned 🎉 Signed-off-by: Florent Benoit <[email protected]>
- Loading branch information
Showing
10 changed files
with
255 additions
and
6 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.svelte-kit |
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,59 @@ | ||
{ | ||
"name": "@podman-desktop/ui-svelte", | ||
"version": "0.0.1", | ||
"type": "module", | ||
"license": "Apache-2.0", | ||
"scripts": { | ||
"build": "svelte-package", | ||
"watch": "svelte-package -w", | ||
"test": "vitest run --coverage --passWithNoTests", | ||
"test:watch": "vitest watch --coverage --passWithNoTests", | ||
"svelte:check": "svelte-check --tsconfig ./tsconfig.json", | ||
"publish:next": "yarn publish --registry=https://registry.npmjs.org/ --no-git-tag-version --new-version 0.0.1-\"$(date +%s)\"" | ||
}, | ||
"files": [ | ||
"dist", | ||
"!dist/**/*.spec.*" | ||
], | ||
"exports": { | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"svelte": "./dist/index.js" | ||
} | ||
}, | ||
"peerDependencies": { | ||
"svelte": "^4.0.0", | ||
"svelte-fa": "^4.0.0" | ||
}, | ||
"dependencies": { | ||
"@fortawesome/fontawesome-free": "^6.5.1", | ||
"@fortawesome/free-brands-svg-icons": "^6.5.1", | ||
"@fortawesome/free-regular-svg-icons": "^6.5.1", | ||
"@fortawesome/free-solid-svg-icons": "^6.5.1", | ||
"svelte-fa": "^4.0.2" | ||
}, | ||
"devDependencies": { | ||
"@sveltejs/package": "^2.2.6", | ||
"@sveltejs/vite-plugin-svelte": "3.0.2", | ||
"@testing-library/dom": "^9.3.4", | ||
"@testing-library/jest-dom": "^6.4.2", | ||
"@testing-library/svelte": "^4.1.0", | ||
"@testing-library/user-event": "^14.5.2", | ||
"@tsconfig/svelte": "^5.0.2", | ||
"@typescript-eslint/eslint-plugin": "7.0.0", | ||
"autoprefixer": "^10.4.17", | ||
"eslint-plugin-svelte": "^2.35.1", | ||
"jsdom": "^24.0.0", | ||
"postcss": "^8.4.35", | ||
"postcss-load-config": "^5.0.3", | ||
"svelte": "4.2.12", | ||
"svelte-check": "^3.6.4", | ||
"svelte-eslint-parser": "^0.33.1", | ||
"svelte-preprocess": "^5.1.3", | ||
"tailwindcss": "^3.4.1", | ||
"tslib": "^2.6.2", | ||
"typescript": "^5.3.3", | ||
"vite": "^5.1.4", | ||
"vitest": "^1.3.1" | ||
} | ||
} |
Empty file.
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,33 @@ | ||
/********************************************************************** | ||
* Copyright (C) 2024 Red Hat, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
***********************************************************************/ | ||
|
||
import sveltePreprocess from 'svelte-preprocess'; | ||
import { dirname, join } from 'path'; | ||
import { fileURLToPath } from 'url'; | ||
|
||
const __dirname = dirname(fileURLToPath(import.meta.url)); | ||
|
||
export default { | ||
// Consult https://github.com/sveltejs/svelte-preprocess | ||
// for more information about preprocessors | ||
preprocess: sveltePreprocess({ | ||
postcss: { | ||
configFilePath: join(__dirname, 'postcss.config.cjs'), | ||
}, | ||
}), | ||
}; |
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,23 @@ | ||
{ | ||
"extends": "@tsconfig/svelte/tsconfig.json", | ||
"compilerOptions": { | ||
"target": "esnext", | ||
"module": "esnext", | ||
"strict": true, | ||
"resolveJsonModule": true, | ||
"preserveValueImports": false, | ||
"baseUrl": ".", | ||
"paths": { | ||
"/@/*": ["./src/*"] | ||
}, | ||
/** | ||
* Typecheck JS in `.svelte` and `.js` files by default. | ||
* Disable checkJs if you'd like to use dynamic types in JS. | ||
* Note that setting allowJs false does not prevent the use | ||
* of JS in `.svelte` files. | ||
*/ | ||
"allowJs": true, | ||
"checkJs": true | ||
}, | ||
"include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.svelte"] | ||
} |
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,72 @@ | ||
/********************************************************************** | ||
* Copyright (C) 2024 Red Hat, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
***********************************************************************/ | ||
|
||
/* eslint-env node */ | ||
import { join } from 'path'; | ||
import * as path from 'path'; | ||
import { svelte } from '@sveltejs/vite-plugin-svelte'; | ||
import { defineConfig } from 'vite'; | ||
import { fileURLToPath } from 'url'; | ||
import { coverageConfig } from '../../vitest-shared-extensions.config'; | ||
|
||
let filename = fileURLToPath(import.meta.url); | ||
const PACKAGE_ROOT = path.dirname(filename); | ||
const PACKAGE_NAME = 'ui'; | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig({ | ||
mode: process.env.MODE, | ||
root: PACKAGE_ROOT, | ||
resolve: { | ||
alias: { | ||
'/@/': join(PACKAGE_ROOT, 'src') + '/', | ||
}, | ||
}, | ||
plugins: [svelte({ hot: !process.env.VITEST })], | ||
test: { | ||
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], | ||
globals: true, | ||
environment: 'jsdom', | ||
alias: [ | ||
// https://github.com/vitest-dev/vitest/issues/2834 | ||
{ find: /^svelte$/, replacement: 'svelte/internal' }, | ||
], | ||
deps: { | ||
inline: ['moment'], | ||
}, | ||
...coverageConfig(PACKAGE_ROOT, PACKAGE_NAME), | ||
}, | ||
base: '', | ||
server: { | ||
fs: { | ||
strict: true, | ||
}, | ||
}, | ||
build: { | ||
sourcemap: true, | ||
outDir: 'dist', | ||
assetsDir: '.', | ||
lib: { | ||
entry: 'src/lib/index.ts', | ||
formats: ['es'], | ||
}, | ||
|
||
emptyOutDir: true, | ||
reportCompressedSize: false, | ||
}, | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3383,6 +3383,17 @@ | |
p-map "^4.0.0" | ||
webpack-sources "^3.2.2" | ||
|
||
"@sveltejs/package@^2.2.6": | ||
version "2.2.7" | ||
resolved "https://registry.yarnpkg.com/@sveltejs/package/-/package-2.2.7.tgz#5c2c247d8807f6d683dcd9d51a609860f35cb31b" | ||
integrity sha512-/vvmrQO2mMvROdM/iGRHtRn+ValnK9xzB50pqRcX0IvoeVoTq7uhYf+KifrZTluBA+km6AX/WXRXajrgrgbmvw== | ||
dependencies: | ||
chokidar "^3.6.0" | ||
kleur "^4.1.5" | ||
sade "^1.8.1" | ||
semver "^7.5.4" | ||
svelte2tsx "~0.7.0" | ||
|
||
"@sveltejs/vite-plugin-svelte-inspector@^2.0.0": | ||
version "2.0.0" | ||
resolved "https://registry.yarnpkg.com/@sveltejs/vite-plugin-svelte-inspector/-/vite-plugin-svelte-inspector-2.0.0.tgz#365afaa0dd63517838ce4686a3dc3982be348a9b" | ||
|
@@ -6920,6 +6931,11 @@ decompress-response@^6.0.0: | |
dependencies: | ||
mimic-response "^3.1.0" | ||
|
||
dedent-js@^1.0.1: | ||
version "1.0.1" | ||
resolved "https://registry.yarnpkg.com/dedent-js/-/dedent-js-1.0.1.tgz#bee5fb7c9e727d85dffa24590d10ec1ab1255305" | ||
integrity sha512-OUepMozQULMLUmhxS95Vudo0jb0UchLimi3+pQ2plj61Fcy8axbP9hbiD4Sz6DPqn6XG3kfmziVfQ1rSys5AJQ== | ||
|
||
deep-eql@^4.1.3: | ||
version "4.1.3" | ||
resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.1.3.tgz#7c7775513092f7df98d8df9996dd085eb668cc6d" | ||
|
@@ -12624,7 +12640,7 @@ parseurl@~1.3.2, parseurl@~1.3.3: | |
resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" | ||
integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== | ||
|
||
pascal-case@^3.1.2: | ||
pascal-case@^3.1.1, pascal-case@^3.1.2: | ||
version "3.1.2" | ||
resolved "https://registry.yarnpkg.com/pascal-case/-/pascal-case-3.1.2.tgz#b48e0ef2b98e205e7c1dae747d0b1508237660eb" | ||
integrity sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g== | ||
|
@@ -14178,7 +14194,7 @@ rw@1: | |
resolved "https://registry.yarnpkg.com/rw/-/rw-1.3.3.tgz#3f862dfa91ab766b14885ef4d01124bfda074fb4" | ||
integrity sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ== | ||
|
||
sade@^1.7.3, sade@^1.7.4: | ||
sade@^1.7.3, sade@^1.7.4, sade@^1.8.1: | ||
version "1.8.1" | ||
resolved "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz" | ||
integrity sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A== | ||
|
@@ -15213,6 +15229,14 @@ [email protected]: | |
resolved "https://registry.yarnpkg.com/svelte-steps/-/svelte-steps-2.4.1.tgz#64e055735818e81454e1ca5be8b7b9fe23a8b239" | ||
integrity sha512-2Xq2lLcGJf3PaEY46f1w5s+/O+tLl4U2V+Z+sCeoUm/kEPFXeZP/aFr2JVKwdzSlXCT+raz75xqXtnZrPWJ0zA== | ||
|
||
svelte2tsx@~0.7.0: | ||
version "0.7.2" | ||
resolved "https://registry.yarnpkg.com/svelte2tsx/-/svelte2tsx-0.7.2.tgz#8ed8ce17097c1b04f69689cf0f37ead1acb8fc07" | ||
integrity sha512-gtKJPzGt8OARDILafwyTeM2Xh/t5nCN+/Kjr2SlfVDqct5G4t/e8jaY6e0cxjLOyiVYJTGQrjmghrMyH6jAHnQ== | ||
dependencies: | ||
dedent-js "^1.0.1" | ||
pascal-case "^3.1.1" | ||
|
||
[email protected]: | ||
version "4.2.12" | ||
resolved "https://registry.yarnpkg.com/svelte/-/svelte-4.2.12.tgz#13d98d2274d24d3ad216c8fdc801511171c70bb1" | ||
|