Fix packaging index.ts

This commit is contained in:
venashial 2022-06-21 19:08:22 -07:00
parent d856ed89ff
commit 110c389d85
3 changed files with 12 additions and 10 deletions

View File

@ -40,10 +40,12 @@ jobs:
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Bump version
run: pnpm version patch --commit-hooks false --git-tag-version false
- name: Package
run: |
pnpm version patch --commit-hooks false --git-tag-version false
pnpm package
- name: Publish
run: pnpm publish --no-git-checks --tag alpha --dry-run
run: pnpm publish --no-git-checks --tag alpha
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: EndBug/add-and-commit@v9

View File

@ -5,8 +5,7 @@
"scripts": {
"dev": "svelte-kit dev",
"build": "svelte-kit build",
"package": "svelte-kit package",
"package:watch": "svelte-kit package --watch",
"package": "sed -i \"\" 's|\\./|\\./src/|g' src/index.ts && cp src/index.ts index.js && cp src/index.ts index.d.ts",
"preview": "svelte-kit preview",
"prepare": "svelte-kit sync",
"check": "svelte-check --tsconfig ./tsconfig.json",
@ -34,7 +33,7 @@
"exports": {
".": "./src/index",
"./utils": "./src//utils/index.ts",
"./styles": "./src/styles.postcss",
"./styles.postcss": "./src/styles.postcss",
"./plugins": "./src/plugins/index.js",
"./config/postcss": "./src/config/postcss.cjs",
"./config/svelte": "./src/config/svelte.js"

View File

@ -1,4 +1,5 @@
<script lang="ts">
import { prerendering } from '$app/env'
import { page } from '$app/stores'
import { onMount } from 'svelte'
@ -28,7 +29,9 @@
$: basePath = path.slice(0, level).join('')
$: activeIndex = query
? links.findIndex((link) => ($page.url.searchParams.get(query) || '') === link.href)
? prerendering
? -1
: links.findIndex((link) => ($page.url.searchParams.get(query) || '') === link.href)
: links.findIndex((link) => path[level] === link.href || path[level] === link.href.slice(0, -1))
const linkElements: HTMLAnchorElement[] = []
@ -56,9 +59,7 @@
if (resetScroll) document.body.scrollTo(0, 0)
}}
class="navigation__link"
class:is-active={query
? ($page.url.searchParams.get(query) || '') === link.href
: path[level] === link.href || path[level] === link.href.slice(0, -1)}
class:is-active={index === activeIndex}
sveltekit:noscroll={!resetScroll || null}
bind:this={linkElements[index]}>
{link.label}