Updated to match latest svelte-create options

This commit is contained in:
Nik
2023-01-19 13:11:16 +11:00
parent f53d6c4e9b
commit 68852963e3
6 changed files with 25 additions and 50 deletions

View File

@@ -9,8 +9,8 @@
"package": "node ./scripts/pre-build.js && npm run build:jss && svelte-kit sync && svelte-package && node ./scripts/post-build.js",
"publish": "npm publish ./package",
"preview": "vite preview",
"check": "svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --ignore-path .prettierignore --check --plugin-search-dir=. . && eslint --fix --ignore-path .gitignore .",
"format": "prettier --ignore-path .prettierignore --write --plugin-search-dir=. .",
"test": "vitest",
@@ -18,18 +18,18 @@
"build:jss": "node ./scripts/generate-jss.js"
},
"devDependencies": {
"@sveltejs/adapter-auto": "^1.0.0",
"@sveltejs/kit": "^1.0.11",
"@sveltejs/adapter-auto": "^1.0.2",
"@sveltejs/kit": "^1.1.3",
"@sveltejs/package": "1.0.2",
"@tailwindcss/forms": "^0.5.3",
"@testing-library/dom": "^8.19.1",
"@testing-library/dom": "^8.20.0",
"@testing-library/svelte": "^3.2.2",
"@typescript-eslint/eslint-plugin": "^5.48.1",
"@typescript-eslint/parser": "^5.48.1",
"@typescript-eslint/eslint-plugin": "^5.48.2",
"@typescript-eslint/parser": "^5.48.2",
"autoprefixer": "^10.4.13",
"c8": "^7.12.0",
"edit-package-json": "^0.8.7",
"eslint": "^8.31.0",
"eslint": "^8.32.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-svelte3": "^4.0.0",
"highlight.js": "^11.7.0",
@@ -38,7 +38,7 @@
"postcss-import": "^15.1.0",
"postcss-js": "^4.0.0",
"postcss-load-config": "^4.0.1",
"prettier": "^2.8.2",
"prettier": "^2.8.3",
"prettier-plugin-svelte": "^2.9.0",
"sveld": "^0.18.0",
"svelte": "^3.55.1",
@@ -50,7 +50,7 @@
"typescript": "^4.9.4",
"vite": "^4.0.4",
"vite-plugin-sveld": "^1.1.0",
"vitest": "^0.27.1"
"vitest": "^0.27.2"
},
"type": "module",
"types": "index.d.ts",

View File

@@ -3,7 +3,7 @@ import { describe, it, expect } from 'vitest';
import SvgIcon from '$lib/components/SvgIcon/SvgIcon.svelte';
describe('SggIcon.svelte', () => {
describe('SvgIcon.svelte', () => {
it('Renders with minimal props', async () => {
const { getByTestId } = render(SvgIcon);
expect(getByTestId('svg-icon')).toBeTruthy();
@@ -11,7 +11,7 @@ describe('SggIcon.svelte', () => {
it('Renders with all props', async () => {
const { getByTestId } = render(SvgIcon, {
name: 'image',
name: 'placeholder',
x: '0px',
y: '0px',
viewBox: '0 0 512 512',

View File

@@ -1,6 +1,6 @@
<script lang="ts">
import { storeFramework } from '$docs/stores';
import { TabGroup, Tab, Alert } from '@skeletonlabs/skeleton';
import { TabGroup, Tab } from '@skeletonlabs/skeleton';
import CodeBlock from '$lib/utilities/CodeBlock/CodeBlock.svelte';
// ******** TEMPORARY FIX ********

View File

@@ -1,5 +1,5 @@
import adapter from '@sveltejs/adapter-auto';
import preprocess from 'svelte-preprocess';
import { vitePreprocess } from '@sveltejs/kit/vite';
import path from 'path';
/** @type {import('@sveltejs/kit').Config} */
@@ -7,7 +7,7 @@ const config = {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: [
preprocess({
vitePreprocess({
postcss: true
})
],

View File

@@ -1,37 +1,13 @@
{
"extends": "./.svelte-kit/tsconfig.json",
"include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.svelte"], // remove: "src/**/*.js",
"exclude": ["node_modules/*", "package/*", "build/*"],
"compilerOptions": {
"declaration": true,
// "moduleResolution": "NodeNext", // causing issues, disabling for now (ex: SvgIcon component)
"module": "es2020",
"lib": ["es2020", "DOM", "ES2021.String"],
"target": "es2020",
/**
svelte-preprocess cannot figure out whether you have a value or a type, so tell TypeScript
to enforce using \`import type\` instead of \`import\` for Types.
*/
"importsNotUsedAsValues": "error",
/**
TypeScript doesn't know about import usages in the template because it only sees the
script of a Svelte file. Therefore preserve all value imports. Requires TS 4.5 or higher.
*/
"preserveValueImports": true,
"isolatedModules": true,
"resolveJsonModule": true,
/**
To have warnings/errors of the Svelte compiler at the correct position,
enable source maps by default.
*/
"sourceMap": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"allowJs": true,
"checkJs": true,
"strict": true,
"outDir": "package"
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true
}
}

View File

@@ -1,17 +1,16 @@
import { sveltekit } from '@sveltejs/kit/vite';
import type { UserConfig } from 'vite';
import { configDefaults } from 'vitest/config';
import sveld from 'vite-plugin-sveld';
// Import package.json version
import { readFileSync } from 'fs';
import { fileURLToPath } from 'url';
const file = fileURLToPath(new URL('package.json', import.meta.url));
const json = readFileSync(file, 'utf8');
const json = readFileSync('package.json', 'utf8');
const pkg = JSON.parse(json);
/** @type {import('vite').UserConfig} */
const config = {
plugins: [sveltekit({ hot: !process.env.VITEST }), sveld()],
const config: UserConfig = {
plugins: [sveltekit(), sveld()],
define: {
__PACKAGE__: pkg
},