mirror of
https://github.com/LukeHagar/skeleton.git
synced 2025-12-10 12:47:45 +00:00
Updated to match latest svelte-create options
This commit is contained in:
20
package.json
20
package.json
@@ -9,8 +9,8 @@
|
|||||||
"package": "node ./scripts/pre-build.js && npm run build:jss && svelte-kit sync && svelte-package && node ./scripts/post-build.js",
|
"package": "node ./scripts/pre-build.js && npm run build:jss && svelte-kit sync && svelte-package && node ./scripts/post-build.js",
|
||||||
"publish": "npm publish ./package",
|
"publish": "npm publish ./package",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"check": "svelte-check --tsconfig ./tsconfig.json",
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
||||||
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
|
"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 .",
|
"lint": "prettier --ignore-path .prettierignore --check --plugin-search-dir=. . && eslint --fix --ignore-path .gitignore .",
|
||||||
"format": "prettier --ignore-path .prettierignore --write --plugin-search-dir=. .",
|
"format": "prettier --ignore-path .prettierignore --write --plugin-search-dir=. .",
|
||||||
"test": "vitest",
|
"test": "vitest",
|
||||||
@@ -18,18 +18,18 @@
|
|||||||
"build:jss": "node ./scripts/generate-jss.js"
|
"build:jss": "node ./scripts/generate-jss.js"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sveltejs/adapter-auto": "^1.0.0",
|
"@sveltejs/adapter-auto": "^1.0.2",
|
||||||
"@sveltejs/kit": "^1.0.11",
|
"@sveltejs/kit": "^1.1.3",
|
||||||
"@sveltejs/package": "1.0.2",
|
"@sveltejs/package": "1.0.2",
|
||||||
"@tailwindcss/forms": "^0.5.3",
|
"@tailwindcss/forms": "^0.5.3",
|
||||||
"@testing-library/dom": "^8.19.1",
|
"@testing-library/dom": "^8.20.0",
|
||||||
"@testing-library/svelte": "^3.2.2",
|
"@testing-library/svelte": "^3.2.2",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.48.1",
|
"@typescript-eslint/eslint-plugin": "^5.48.2",
|
||||||
"@typescript-eslint/parser": "^5.48.1",
|
"@typescript-eslint/parser": "^5.48.2",
|
||||||
"autoprefixer": "^10.4.13",
|
"autoprefixer": "^10.4.13",
|
||||||
"c8": "^7.12.0",
|
"c8": "^7.12.0",
|
||||||
"edit-package-json": "^0.8.7",
|
"edit-package-json": "^0.8.7",
|
||||||
"eslint": "^8.31.0",
|
"eslint": "^8.32.0",
|
||||||
"eslint-config-prettier": "^8.6.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"eslint-plugin-svelte3": "^4.0.0",
|
"eslint-plugin-svelte3": "^4.0.0",
|
||||||
"highlight.js": "^11.7.0",
|
"highlight.js": "^11.7.0",
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
"postcss-import": "^15.1.0",
|
"postcss-import": "^15.1.0",
|
||||||
"postcss-js": "^4.0.0",
|
"postcss-js": "^4.0.0",
|
||||||
"postcss-load-config": "^4.0.1",
|
"postcss-load-config": "^4.0.1",
|
||||||
"prettier": "^2.8.2",
|
"prettier": "^2.8.3",
|
||||||
"prettier-plugin-svelte": "^2.9.0",
|
"prettier-plugin-svelte": "^2.9.0",
|
||||||
"sveld": "^0.18.0",
|
"sveld": "^0.18.0",
|
||||||
"svelte": "^3.55.1",
|
"svelte": "^3.55.1",
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
"typescript": "^4.9.4",
|
"typescript": "^4.9.4",
|
||||||
"vite": "^4.0.4",
|
"vite": "^4.0.4",
|
||||||
"vite-plugin-sveld": "^1.1.0",
|
"vite-plugin-sveld": "^1.1.0",
|
||||||
"vitest": "^0.27.1"
|
"vitest": "^0.27.2"
|
||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"types": "index.d.ts",
|
"types": "index.d.ts",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { describe, it, expect } from 'vitest';
|
|||||||
|
|
||||||
import SvgIcon from '$lib/components/SvgIcon/SvgIcon.svelte';
|
import SvgIcon from '$lib/components/SvgIcon/SvgIcon.svelte';
|
||||||
|
|
||||||
describe('SggIcon.svelte', () => {
|
describe('SvgIcon.svelte', () => {
|
||||||
it('Renders with minimal props', async () => {
|
it('Renders with minimal props', async () => {
|
||||||
const { getByTestId } = render(SvgIcon);
|
const { getByTestId } = render(SvgIcon);
|
||||||
expect(getByTestId('svg-icon')).toBeTruthy();
|
expect(getByTestId('svg-icon')).toBeTruthy();
|
||||||
@@ -11,7 +11,7 @@ describe('SggIcon.svelte', () => {
|
|||||||
|
|
||||||
it('Renders with all props', async () => {
|
it('Renders with all props', async () => {
|
||||||
const { getByTestId } = render(SvgIcon, {
|
const { getByTestId } = render(SvgIcon, {
|
||||||
name: 'image',
|
name: 'placeholder',
|
||||||
x: '0px',
|
x: '0px',
|
||||||
y: '0px',
|
y: '0px',
|
||||||
viewBox: '0 0 512 512',
|
viewBox: '0 0 512 512',
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { storeFramework } from '$docs/stores';
|
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';
|
import CodeBlock from '$lib/utilities/CodeBlock/CodeBlock.svelte';
|
||||||
|
|
||||||
// ******** TEMPORARY FIX ********
|
// ******** TEMPORARY FIX ********
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import adapter from '@sveltejs/adapter-auto';
|
import adapter from '@sveltejs/adapter-auto';
|
||||||
import preprocess from 'svelte-preprocess';
|
import { vitePreprocess } from '@sveltejs/kit/vite';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
/** @type {import('@sveltejs/kit').Config} */
|
/** @type {import('@sveltejs/kit').Config} */
|
||||||
@@ -7,7 +7,7 @@ const config = {
|
|||||||
// Consult https://github.com/sveltejs/svelte-preprocess
|
// Consult https://github.com/sveltejs/svelte-preprocess
|
||||||
// for more information about preprocessors
|
// for more information about preprocessors
|
||||||
preprocess: [
|
preprocess: [
|
||||||
preprocess({
|
vitePreprocess({
|
||||||
postcss: true
|
postcss: true
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,37 +1,13 @@
|
|||||||
{
|
{
|
||||||
"extends": "./.svelte-kit/tsconfig.json",
|
"extends": "./.svelte-kit/tsconfig.json",
|
||||||
"include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.svelte"], // remove: "src/**/*.js",
|
|
||||||
"exclude": ["node_modules/*", "package/*", "build/*"],
|
|
||||||
"compilerOptions": {
|
"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,
|
"allowJs": true,
|
||||||
"checkJs": true,
|
"checkJs": true,
|
||||||
"strict": true,
|
"esModuleInterop": true,
|
||||||
"outDir": "package"
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"strict": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,16 @@
|
|||||||
import { sveltekit } from '@sveltejs/kit/vite';
|
import { sveltekit } from '@sveltejs/kit/vite';
|
||||||
|
import type { UserConfig } from 'vite';
|
||||||
import { configDefaults } from 'vitest/config';
|
import { configDefaults } from 'vitest/config';
|
||||||
import sveld from 'vite-plugin-sveld';
|
import sveld from 'vite-plugin-sveld';
|
||||||
|
|
||||||
// Import package.json version
|
// Import package.json version
|
||||||
import { readFileSync } from 'fs';
|
import { readFileSync } from 'fs';
|
||||||
import { fileURLToPath } from 'url';
|
const json = readFileSync('package.json', 'utf8');
|
||||||
const file = fileURLToPath(new URL('package.json', import.meta.url));
|
|
||||||
const json = readFileSync(file, 'utf8');
|
|
||||||
const pkg = JSON.parse(json);
|
const pkg = JSON.parse(json);
|
||||||
|
|
||||||
/** @type {import('vite').UserConfig} */
|
/** @type {import('vite').UserConfig} */
|
||||||
const config = {
|
const config: UserConfig = {
|
||||||
plugins: [sveltekit({ hot: !process.env.VITEST }), sveld()],
|
plugins: [sveltekit(), sveld()],
|
||||||
define: {
|
define: {
|
||||||
__PACKAGE__: pkg
|
__PACKAGE__: pkg
|
||||||
},
|
},
|
||||||
Reference in New Issue
Block a user