Skip Typescript compilation on packaging
This commit is contained in:
parent
252c812125
commit
f70f670ed3
7
.githooks/pre-push
Normal file
7
.githooks/pre-push
Normal file
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
pnpm install --frozen-lockfile
|
||||
pnpm lint
|
||||
pnpm check
|
||||
18
.github/workflows/ci.yml
vendored
18
.github/workflows/ci.yml
vendored
@ -24,3 +24,21 @@ jobs:
|
||||
run: pnpm lint
|
||||
- name: Run check
|
||||
run: pnpm check
|
||||
|
||||
release:
|
||||
needs: [lint]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Publish
|
||||
if: github.ref == 'refs/heads/main'
|
||||
run: |
|
||||
cd package
|
||||
pnpm publish --no-git-checks --tag alpha
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
- uses: EndBug/add-and-commit@v9
|
||||
if: github.ref == 'refs/heads/main'
|
||||
with:
|
||||
message: "Bump package version [skip ci]"
|
||||
default_author: github_actions
|
||||
|
||||
50
.github/workflows/release.yml
vendored
50
.github/workflows/release.yml
vendored
@ -1,50 +0,0 @@
|
||||
name: Release
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- uses: pnpm/action-setup@v2.1.0
|
||||
with:
|
||||
version: 6.32.0
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '18'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
||||
- name: Cache pnpm modules
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.pnpm-store
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: Package
|
||||
run: |
|
||||
pnpm version patch --commit-hooks false --git-tag-version false
|
||||
pnpm package
|
||||
|
||||
- name: Publish
|
||||
run: |
|
||||
cd package
|
||||
pnpm publish --no-git-checks --tag alpha
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
- uses: EndBug/add-and-commit@v9
|
||||
with:
|
||||
message: 'Bump package version [skip ci]'
|
||||
default_author: github_actions
|
||||
29
.npmignore
Normal file
29
.npmignore
Normal file
@ -0,0 +1,29 @@
|
||||
.DS_Store
|
||||
node_modules/
|
||||
build/
|
||||
.svelte-kit/
|
||||
package/
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
.vercel
|
||||
generated/
|
||||
.githooks/
|
||||
.github/
|
||||
.idea/
|
||||
.vscode/
|
||||
docs/
|
||||
generated/
|
||||
locales/
|
||||
.eslintrc.cjs
|
||||
.gitignore
|
||||
.gitmodules
|
||||
.npmignore
|
||||
.npmrc
|
||||
.prettierignore
|
||||
.prettierrc
|
||||
postcss.config.cjs
|
||||
mdsvex.config.js
|
||||
svelte.config.js
|
||||
tsconfig.json
|
||||
pnpm-lock.yaml
|
||||
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
@ -11,6 +11,7 @@
|
||||
"gitlens.hovers.enabled": false,
|
||||
"svelte.enable-ts-plugin": true,
|
||||
"svelte.ask-to-enable-ts-plugin": false,
|
||||
"svelte.plugin.svelte.useNewTransformation": true,
|
||||
"yaml.schemas": {
|
||||
"https://json.schemastore.org/github-workflow.json": "file:///Users/sha/Code/Modrinth/knossos/.github/workflows/deploy.yml"
|
||||
},
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
import IconChat from 'virtual:icons/heroicons-outline/chat-alt-2'
|
||||
import { onMount } from 'svelte'
|
||||
|
||||
let headerElement
|
||||
let headerElement: HTMLElement
|
||||
|
||||
onMount(() => {
|
||||
let lastScrollTop: number
|
||||
|
||||
1
docs/global.d.ts
vendored
1
docs/global.d.ts
vendored
@ -2,6 +2,7 @@
|
||||
|
||||
declare module '$assets/images/*'
|
||||
declare module '$locales/*'
|
||||
declare module 'insane'
|
||||
|
||||
declare module '*.svg' {
|
||||
export { SvelteComponentDev as default } from 'svelte/internal'
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
$page.url.pathname.replace('/', '') || 'index'
|
||||
}.md`
|
||||
|
||||
let api
|
||||
let api = { props: [], events: [], slots: [] }
|
||||
if ($page.url.pathname.includes('components')) {
|
||||
if (import.meta.env.DEV) {
|
||||
import(`../../src/components/${title}.svelte?raw&sveld`).then(
|
||||
|
||||
@ -2,7 +2,7 @@ import { ComponentParser } from 'sveld'
|
||||
import * as svelte from 'svelte/compiler'
|
||||
import fs from 'fs/promises'
|
||||
import path from 'path'
|
||||
import { preprocess } from '../../src/config/svelte.config.js'
|
||||
import { preprocess } from '../../src/config/svelte.js'
|
||||
|
||||
export default function sveld() {
|
||||
return {
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
<a class="link" href="#issues"><IconIssues /> Issues</a>
|
||||
<a class="link" href="#source"><IconCode /> Source</a>
|
||||
<a class="link" href="#wiki"><IconWiki /> Wiki</a>
|
||||
<a class="link" href="#issues"><IconIssues /> Discord chat</a>
|
||||
<a class="link" href="#issues"><IconIssues /> Discord chat</a>
|
||||
<a class="link" href="#source"><IconCode /> Source link</a>
|
||||
</div>
|
||||
```
|
||||
|
||||
@ -4,11 +4,11 @@
|
||||
<script lang="ts">
|
||||
import { Field, FileUpload } from 'omorphia'
|
||||
|
||||
let file: File
|
||||
let file: File
|
||||
</script>
|
||||
|
||||
<Field label="Upload image">
|
||||
<FileUpload accept="image/*" constrained bind:file />
|
||||
<FileUpload accept="image/*" constrained bind:file />
|
||||
</Field>
|
||||
|
||||
File name: {file?.name}
|
||||
@ -20,11 +20,11 @@ File name: {file?.name}
|
||||
<script lang="ts">
|
||||
import { Field, FileUpload } from 'omorphia'
|
||||
|
||||
let files: File[] = []
|
||||
let files: File[] = []
|
||||
</script>
|
||||
|
||||
<Field label="Upload file">
|
||||
<FileUpload accept="*" multiple bind:files />
|
||||
<FileUpload accept="*" multiple bind:files />
|
||||
</Field>
|
||||
|
||||
Count: {files.length}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<script lang="ts">
|
||||
import { Modal, Button } from 'omorphia'
|
||||
import IconArrowRight from 'virtual:icons/heroicons-outline/arrow-right'
|
||||
import IconCheck from 'virtual:icons/heroicons-outline/check'
|
||||
import IconCheck from 'virtual:icons/heroicons-outline/check'
|
||||
</script>
|
||||
|
||||
<Modal title="Example modal" danger let:trigger>
|
||||
@ -12,7 +12,7 @@
|
||||
<Button color="primary" slot="button"><IconArrowRight /> Continue</Button>
|
||||
</Modal>
|
||||
|
||||
<Modal let:trigger size='sm'>
|
||||
<Modal let:trigger size="sm">
|
||||
<Button on:click={trigger} slot="trigger">Confirm modal</Button>
|
||||
|
||||
Are you sure you want to delete this gallery image?
|
||||
|
||||
@ -3,7 +3,11 @@
|
||||
import { ModalDeletion, Button } from 'omorphia'
|
||||
</script>
|
||||
|
||||
<ModalDeletion type="account" key="venashial" let:trigger on:deletion={() => console.log('Do something...')}>
|
||||
<ModalDeletion
|
||||
type="account"
|
||||
key="venashial"
|
||||
let:trigger
|
||||
on:deletion={() => console.log('Do something...')}>
|
||||
<Button slot="trigger" color="danger" on:click={trigger}>Delete account</Button>
|
||||
</ModalDeletion>
|
||||
```
|
||||
|
||||
@ -9,7 +9,7 @@ To make use of the built-in icons, styles, and plugins in omorphia, you will nee
|
||||
Add the following parts to your `svelte.config.js` file:
|
||||
|
||||
```js
|
||||
import { preprocess, plugins } from 'omorphia/config/svelte.config'
|
||||
import { preprocess, plugins } from 'omorphia/config/svelte.js'
|
||||
|
||||
/** @type {import('@sveltejs/kit').Config} */
|
||||
const config = {
|
||||
@ -32,5 +32,5 @@ Create a `postcss.config.cjs` file in the root of your project.
|
||||
Add the following line to that file:
|
||||
|
||||
```js
|
||||
module.exports = require('omorphia/config/postcss.config.cjs')
|
||||
module.exports = require('omorphia/config/postcss.cjs')
|
||||
```
|
||||
|
||||
@ -23,14 +23,16 @@ The `markdown` parser is designed for bodies of markdown text and supports image
|
||||
#### An image \n\
|
||||
'
|
||||
</script>
|
||||
|
||||
<div class="card markdown">
|
||||
{@html markdown(source)}
|
||||
{@html markdown(
|
||||
` | Syntax | Description |
|
||||
{@html markdown(
|
||||
` | Syntax | Description |
|
||||
| ----------- | ----------- |
|
||||
| Header | Title |
|
||||
| Paragraph | Text |`)}
|
||||
{@html markdown('```js\nconsole.log("test")\n```')}
|
||||
| Paragraph | Text |`
|
||||
)}
|
||||
{@html markdown('```js\nconsole.log("test")\n```')}
|
||||
</div>
|
||||
````
|
||||
|
||||
|
||||
53
package.json
53
package.json
@ -14,28 +14,6 @@
|
||||
"lint": "prettier --ignore-path .prettierignore --check --plugin-search-dir=. . && eslint --ignore-path .prettierignore .",
|
||||
"format": "prettier --ignore-path .prettierignore --write --plugin-search-dir=. ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/adapter-static": "^1.0.0-next.29",
|
||||
"@sveltejs/kit": "next",
|
||||
"@typescript-eslint/eslint-plugin": "^5.10.1",
|
||||
"@typescript-eslint/parser": "^5.10.1",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-svelte3": "^3.2.1",
|
||||
"mdsvex": "^0.10.5",
|
||||
"mdsvexamples": "^0.3.0",
|
||||
"nodemon": "^2.0.15",
|
||||
"prettier": "^2.6.2",
|
||||
"prettier-plugin-svelte": "^2.7.0",
|
||||
"sveld": "^0.13.4",
|
||||
"svelte": "^3.48.0",
|
||||
"svelte-check": "^2.2.6",
|
||||
"svelte-intl-precompile": "^0.11.1",
|
||||
"svelte-preprocess": "^4.10.1",
|
||||
"svelte2tsx": "^0.5.5",
|
||||
"tslib": "^2.3.1",
|
||||
"typescript": "~4.6.2"
|
||||
},
|
||||
"type": "module",
|
||||
"svelte": "index.js",
|
||||
"repository": {
|
||||
@ -53,6 +31,37 @@
|
||||
"url": "https://github.com/modrinth/omorphia/issues"
|
||||
},
|
||||
"homepage": "https://omorphia.modrinth.com",
|
||||
"exports": {
|
||||
".": "./src/index",
|
||||
"./utils": "./src//utils/index.ts",
|
||||
"./styles": "./src/styles.postcss",
|
||||
"./plugins": "./src/plugins/index.js",
|
||||
"./config/postcss": "./src/config/postcss.cjs",
|
||||
"./config/svelte": "./src/config/svelte.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/adapter-static": "^1.0.0-next.29",
|
||||
"@sveltejs/kit": "next",
|
||||
"@types/marked": "^4.0.3",
|
||||
"@typescript-eslint/eslint-plugin": "^5.10.1",
|
||||
"@typescript-eslint/parser": "^5.10.1",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-svelte3": "^3.2.1",
|
||||
"mdsvex": "^0.10.5",
|
||||
"mdsvexamples": "^0.3.0",
|
||||
"nodemon": "^2.0.15",
|
||||
"prettier": "^2.6.2",
|
||||
"prettier-plugin-svelte": "^2.7.0",
|
||||
"sveld": "^0.13.4",
|
||||
"svelte": "^3.48.0",
|
||||
"svelte-check": "^2.7.2",
|
||||
"svelte-intl-precompile": "^0.11.1",
|
||||
"svelte-preprocess": "^4.10.1",
|
||||
"svelte2tsx": "^0.5.5",
|
||||
"tslib": "^2.3.1",
|
||||
"typescript": "~4.6.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@iconify-json/carbon": "^1.1.1",
|
||||
"@iconify-json/fa-regular": "^1.1.1",
|
||||
|
||||
17
pnpm-lock.yaml
generated
17
pnpm-lock.yaml
generated
@ -10,6 +10,7 @@ specifiers:
|
||||
'@poppanator/sveltekit-svg': ^0.3.1
|
||||
'@sveltejs/adapter-static': ^1.0.0-next.29
|
||||
'@sveltejs/kit': next
|
||||
'@types/marked': ^4.0.3
|
||||
'@typescript-eslint/eslint-plugin': ^5.10.1
|
||||
'@typescript-eslint/parser': ^5.10.1
|
||||
cli-progress: ^3.11.1
|
||||
@ -39,7 +40,7 @@ specifiers:
|
||||
sanitize.css: ^13.0.0
|
||||
sveld: ^0.13.4
|
||||
svelte: ^3.48.0
|
||||
svelte-check: ^2.2.6
|
||||
svelte-check: ^2.7.2
|
||||
svelte-intl-precompile: ^0.11.1
|
||||
svelte-preprocess: ^4.10.1
|
||||
svelte-tiny-virtual-list: ^2.0.1
|
||||
@ -85,6 +86,7 @@ dependencies:
|
||||
devDependencies:
|
||||
'@sveltejs/adapter-static': 1.0.0-next.29
|
||||
'@sveltejs/kit': 1.0.0-next.350_svelte@3.48.0
|
||||
'@types/marked': 4.0.3
|
||||
'@typescript-eslint/eslint-plugin': 5.14.0_4p27j37cxves4nxlnqogdhp4ta
|
||||
'@typescript-eslint/parser': 5.14.0_e6rt7vlgxfprtuallp2t3cvyi4
|
||||
eslint: 7.32.0
|
||||
@ -97,7 +99,7 @@ devDependencies:
|
||||
prettier-plugin-svelte: 2.7.0_kkjbqzpydplecjtkxrgomroeru
|
||||
sveld: 0.13.4_jw3wiphoy34i6ad2hx6ga3jifa
|
||||
svelte: 3.48.0
|
||||
svelte-check: 2.4.5_2pvebpkgu3ohgo43qaf5qmcxwm
|
||||
svelte-check: 2.7.2_2pvebpkgu3ohgo43qaf5qmcxwm
|
||||
svelte-intl-precompile: 0.11.1_svelte@3.48.0
|
||||
svelte-preprocess: 4.10.4_44qe5g6fi6uxvss56imdgyaaty
|
||||
svelte2tsx: 0.5.5_c64miirrcucob5yjzfkddrmila
|
||||
@ -1143,6 +1145,10 @@ packages:
|
||||
'@types/node': 17.0.21
|
||||
dev: true
|
||||
|
||||
/@types/marked/4.0.3:
|
||||
resolution: {integrity: sha512-HnMWQkLJEf/PnxZIfbm0yGJRRZYYMhb++O9M36UCTA9z53uPvVoSlAwJr3XOpDEryb7Hwl1qAx/MV6YIW1RXxg==}
|
||||
dev: true
|
||||
|
||||
/@types/node/16.9.1:
|
||||
resolution: {integrity: sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==}
|
||||
dev: false
|
||||
@ -4866,19 +4872,18 @@ packages:
|
||||
- sugarss
|
||||
dev: true
|
||||
|
||||
/svelte-check/2.4.5_2pvebpkgu3ohgo43qaf5qmcxwm:
|
||||
resolution: {integrity: sha512-nRft8BbG2wcxyCdHDZ7X43xLcvDzua3xLwq6wzHGcAF3ka3Jyhv2rvgq0+SF9NwHLMefp9C2XkM6etzsxK/cMQ==}
|
||||
/svelte-check/2.7.2_2pvebpkgu3ohgo43qaf5qmcxwm:
|
||||
resolution: {integrity: sha512-TuVX4YtXHbRM8sVuK5Jk+mKWdm3f0d6hvAC6qCTp8yUszGZewpEBCo2V5fRWZCiz+0J4OCiDHOS+DFMxv39rJA==}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
svelte: ^3.24.0
|
||||
dependencies:
|
||||
'@jridgewell/trace-mapping': 0.3.13
|
||||
chokidar: 3.5.3
|
||||
fast-glob: 3.2.11
|
||||
import-fresh: 3.3.0
|
||||
minimist: 1.2.5
|
||||
picocolors: 1.0.0
|
||||
sade: 1.8.1
|
||||
source-map: 0.7.3
|
||||
svelte: 3.48.0
|
||||
svelte-preprocess: 4.10.4_44qe5g6fi6uxvss56imdgyaaty
|
||||
typescript: 4.6.2
|
||||
|
||||
@ -1 +1 @@
|
||||
module.exports = require('./src/config/postcss.config.cjs')
|
||||
module.exports = require('./src/config/postcss.cjs')
|
||||
|
||||
@ -18,13 +18,13 @@
|
||||
floatUp && 'avatar--float-up',
|
||||
])
|
||||
|
||||
let img
|
||||
let img: HTMLImageElement
|
||||
|
||||
onMount(() => {
|
||||
if (img && img.naturalWidth) {
|
||||
const isPixelated = () => {
|
||||
if (img.naturalWidth < 96 && img.naturalWidth > 0) {
|
||||
img.style = 'image-rendering: pixelated;'
|
||||
img.style.imageRendering = 'pixelated'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -8,8 +8,8 @@
|
||||
/** Wrap the options horizontally */
|
||||
export let wrap = false
|
||||
|
||||
const handleChange = (e, key) => {
|
||||
if (e.target.checked) {
|
||||
const handleChange = (event: any, key: string | number) => {
|
||||
if (event.target.checked) {
|
||||
if (!value) value = []
|
||||
value = [key, ...value]
|
||||
} else {
|
||||
|
||||
@ -11,8 +11,8 @@
|
||||
export let value = []
|
||||
export let options: Option[] = []
|
||||
|
||||
const handleChange = (e, key) => {
|
||||
if (e.target.checked) {
|
||||
const handleChange = (event: any, key: string | number) => {
|
||||
if (event.target.checked) {
|
||||
if (!value) value = []
|
||||
value = [key, ...value]
|
||||
} else {
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
import IconUpload from 'virtual:icons/heroicons-outline/upload'
|
||||
import IconFile from 'virtual:icons/lucide/file'
|
||||
import { t } from 'svelte-intl-precompile'
|
||||
import Button from 'omorphia/components/Button.svelte'
|
||||
import { classCombine } from 'omorphia/utils/classCombine'
|
||||
import Button from './Button.svelte'
|
||||
import { classCombine } from '../utils/classCombine'
|
||||
|
||||
export let multiple = false
|
||||
export let accept: string
|
||||
|
||||
@ -19,8 +19,11 @@
|
||||
const dispatch = createEventDispatcher()
|
||||
</script>
|
||||
|
||||
<Modal title={$t(`modal.deletion.${type}.title`)} bind:open let:trigger bind:data>
|
||||
<slot slot="trigger" name="trigger" {trigger} />
|
||||
<!-- @ts-ignore -->
|
||||
<Modal title={$t(`modal.deletion.${type}.title`)} bind:open bind:data>
|
||||
<svelte:fragment slot="trigger" let:trigger>
|
||||
<slot name="trigger" {trigger} />
|
||||
</svelte:fragment>
|
||||
|
||||
{#if type === 'account' || 'project'}
|
||||
<div class="important-banner">
|
||||
@ -35,18 +38,18 @@
|
||||
{id} />
|
||||
</Field>
|
||||
|
||||
<Button
|
||||
color="danger"
|
||||
slot="button"
|
||||
disabled={key !== data.key}
|
||||
let:close
|
||||
on:click={() => {
|
||||
close()
|
||||
dispatch('deletion')
|
||||
}}>
|
||||
<IconTrash />
|
||||
{$t(`modal.deletion.${type}.action`)}
|
||||
</Button>
|
||||
<svelte:fragment slot="button" let:close>
|
||||
<Button
|
||||
color="danger"
|
||||
disabled={key !== data.key}
|
||||
on:click={() => {
|
||||
close()
|
||||
dispatch('deletion')
|
||||
}}>
|
||||
<IconTrash />
|
||||
{$t(`modal.deletion.${type}.action`)}
|
||||
</Button>
|
||||
</svelte:fragment>
|
||||
</Modal>
|
||||
|
||||
<style lang="postcss">
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
<script lang="ts">
|
||||
import type { SvelteComponent } from 'svelte/internal'
|
||||
|
||||
export let placeholder = ''
|
||||
export let icon: SvelteComponent = undefined
|
||||
/** A Svelte component */
|
||||
export let icon: any = undefined
|
||||
export let value = ''
|
||||
export let multiline = false
|
||||
/** An ID for better accessibility */
|
||||
export let id: string = undefined
|
||||
export let fill = false
|
||||
</script>
|
||||
@ -41,14 +41,14 @@
|
||||
border: none;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
|
||||
&.has-icon {
|
||||
padding-left: 2.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
input {
|
||||
padding: 0.25rem 1rem;
|
||||
|
||||
&.has-icon {
|
||||
padding-left: 2.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
textarea {
|
||||
|
||||
1
src/plugins/index.js
Normal file
1
src/plugins/index.js
Normal file
@ -0,0 +1 @@
|
||||
export { default as Generator } from './generator/index.js'
|
||||
@ -1,3 +1,3 @@
|
||||
export function classCombine(names) {
|
||||
export function classCombine(names: string[]) {
|
||||
return names.filter((name) => name && !name.includes('undefined')).join(' ')
|
||||
}
|
||||
|
||||
@ -76,8 +76,8 @@ export function formatVersions(versionArray: string[]): string {
|
||||
return output.join(', ')
|
||||
}
|
||||
|
||||
export const getPrimary = (files) => files.find((file) => file.primary) || files[0]
|
||||
export const getPrimary = (files: any[]) => files.find((file) => file.primary) || files[0]
|
||||
|
||||
export function downloadUrl(file): string {
|
||||
export function downloadUrl(file: any): string {
|
||||
return import.meta.env.VITE_API_URL + `version_file/${file?.hashes.sha1}/download`
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@ import adapter from '@sveltejs/adapter-static'
|
||||
import examples from 'mdsvexamples/vite'
|
||||
import sveld from './docs/plugins/sveld.js'
|
||||
import path from 'path'
|
||||
import { preprocess, plugins } from './src/config/svelte.config.js'
|
||||
import { preprocess, plugins } from './src/config/svelte.js'
|
||||
import Generator from './src/plugins/generator/index.js'
|
||||
import precompileIntl from 'svelte-intl-precompile/sveltekit-plugin'
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"paths": {
|
||||
"omorphia/utils": ["package/utils"],
|
||||
"omorphia/*": ["package/*"],
|
||||
"omorphia": ["package"],
|
||||
"omorphia/utils": ["src/utils"],
|
||||
"omorphia/*": ["src/*"],
|
||||
"omorphia": ["src"],
|
||||
"$generated/*": ["generated/*"],
|
||||
"$lib": ["src"],
|
||||
"$lib/*": ["src/*"]
|
||||
@ -11,5 +11,14 @@
|
||||
"resolveJsonModule": true,
|
||||
"esModuleInterop": true
|
||||
},
|
||||
"include": [
|
||||
"./docs/**/*.js",
|
||||
"./docs/**/*.ts",
|
||||
"./docs/**/*.svelte",
|
||||
"./src/**/*.js",
|
||||
"./src/**/*.ts",
|
||||
"./src/**/*.svelte"
|
||||
],
|
||||
"exclude": ["./node_modules/**", "./.svelte-kit/**"],
|
||||
"extends": "./.svelte-kit/tsconfig.json"
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user