Skip to content

Commit

Permalink
upgrade svelte-package to v2
Browse files Browse the repository at this point in the history
update other deps too
import { Slider, Toggle } from 'svelte-zoo'
try fix test.yml release job
  • Loading branch information
janosh committed Mar 2, 2023
1 parent 5325c2b commit 6b70850
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 134 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run: |
npm install
npm run package
npm login
npm publish ./package
npm login --auth-type=legacy
npm publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ node_modules
# production build
.svelte-kit
build
package
dist
55 changes: 36 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,41 @@
"license": "MIT",
"version": "0.1.7",
"type": "module",
"svelte": "Masonry.svelte",
"svelte": "./dist/index.js",
"bugs": "https://github.com/janosh/svelte-bricks/issues",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"package": "svelte-package",
"serve": "vite build && vite preview",
"check": "svelte-check --ignore package",
"check": "svelte-check --ignore dist",
"test": "vitest test",
"changelog": "npx auto-changelog --package --output changelog.md --hide-credit --commit-limit false"
},
"dependencies": {
"svelte": "^3.55.1"
},
"devDependencies": {
"@sveltejs/adapter-static": "^1.0.4",
"@sveltejs/kit": "^1.1.1",
"@sveltejs/package": "1.0.2",
"@typescript-eslint/eslint-plugin": "^5.48.1",
"@typescript-eslint/parser": "^5.48.1",
"eslint": "^8.32.0",
"@sveltejs/adapter-static": "^2.0.1",
"@sveltejs/kit": "^1.9.2",
"@sveltejs/package": "^2.0.2",
"@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0",
"eslint": "^8.35.0",
"eslint-plugin-svelte3": "^4.0.0",
"jsdom": "^21.0.0",
"jsdom": "^21.1.0",
"mdsvex": "^0.10.6",
"prettier": "^2.8.3",
"prettier": "^2.8.4",
"prettier-plugin-svelte": "^2.9.0",
"svelte": "^3.55.1",
"svelte-check": "^3.0.2",
"svelte-preprocess": "^5.0.0",
"svelte-check": "^3.0.4",
"svelte-preprocess": "^5.0.1",
"svelte-toc": "^0.5.2",
"svelte-zoo": "^0.2.1",
"svelte2tsx": "^0.6.0",
"typescript": "^4.9.4",
"vite": "^4.0.4",
"vitest": "^0.27.1"
"svelte-zoo": "^0.3.4",
"svelte2tsx": "^0.6.2",
"typescript": "^4.9.5",
"vite": "^4.1.4",
"vitest": "^0.29.2"
},
"keywords": [
"svelte",
Expand All @@ -49,5 +51,20 @@
],
"publishConfig": {
"access": "public"
}
},
"exports": {
"./Masonry.svelte": {
"types": "./dist/Masonry.svelte.d.ts",
"svelte": "./dist/Masonry.svelte",
"default": "./dist/Masonry.svelte"
},
".": {
"types": "./dist/index.d.ts",
"svelte": "./dist/index.js",
"default": "./dist/index.js"
}
},
"files": [
"dist"
]
}
2 changes: 0 additions & 2 deletions src/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
export { default, default as Masonry } from './Masonry.svelte'

export const repo_url = `https://github.com/janosh/svelte-bricks`
4 changes: 2 additions & 2 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script lang="ts">
import { page } from '$app/stores'
import { repo_url } from '$lib'
import { repository } from '$root/package.json'
import { GitHubCorner } from 'svelte-zoo'
import '../app.css'
</script>

<GitHubCorner
href={repo_url}
href={repository}
--zoo-github-corner-color="var(--page-bg)"
--zoo-github-corner-bg="white"
/>
Expand Down
5 changes: 3 additions & 2 deletions src/routes/fetch-images-example/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script lang="ts">
import Masonry, { repo_url } from '$lib'
import Masonry from '$lib'
import { repository } from '$root/package.json'
type File = {
name: string
Expand All @@ -22,7 +23,7 @@
}
}
const example_code_url = `${repo_url}/blob/main/src/routes/fetch-images-example.svelte`
const example_code_url = `${repository}/blob/-/src/routes/fetch-images-example/+page.svelte`
</script>

<p>
Expand Down
4 changes: 2 additions & 2 deletions src/site/Example.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { Masonry } from '$lib'
import { Toggle } from 'svelte-zoo'
import { Box, Slider } from '.'
import { Slider, Toggle } from 'svelte-zoo'
import { Box } from '.'
let nItems = 30
$: indices = [...Array(nItems).keys()]
Expand Down
32 changes: 0 additions & 32 deletions src/site/Slider.svelte

This file was deleted.

67 changes: 0 additions & 67 deletions src/site/Toggle.svelte

This file was deleted.

1 change: 0 additions & 1 deletion src/site/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ export { default as Box } from './Box.svelte'
export { default as Collapsible } from './Collapsible.svelte'
export { default as Example } from './Example.svelte'
export { default as Header } from './Header.svx'
export { default as Slider } from './Slider.svelte'
2 changes: 1 addition & 1 deletion svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default {

alias: {
$root: `.`,
$site: `./src/site`,
$site: `src/site`,
},
},
}
5 changes: 2 additions & 3 deletions tests/readme.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { readFileSync } from 'fs'
import src from '$lib/Masonry.svelte?raw'
import { expect, test } from 'vitest'
import readme from '../readme.md?raw'

const readme = readFileSync(`readme.md`, `utf8`)
const component = `Masonry.svelte`
const src = readFileSync(`src/lib/${component}`, `utf8`)

test(`readme documents all props and their correct types and defaults`, () => {
for (const [idx, line] of src.split(`\n`).entries()) {
Expand Down

0 comments on commit 6b70850

Please sign in to comment.