Fix packaging to correctly handle utils/
This commit is contained in:
parent
e245edc843
commit
81c039d645
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -48,13 +48,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
message: 'Bump package version [skip ci]'
|
message: 'Bump package version [skip ci]'
|
||||||
default_author: github_actions
|
default_author: github_actions
|
||||||
- name: Remove svelte.config.js # prevents `svelte-kit sync` from running
|
|
||||||
run: rm svelte.config.js
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
- name: Package
|
- name: Package
|
||||||
run: pnpm package
|
run: pnpm package
|
||||||
- name: Publish
|
- name: Publish
|
||||||
run: pnpm publish --no-git-checks --tag alpha
|
run: pnpm publish package --no-git-checks --tag alpha
|
||||||
env:
|
env:
|
||||||
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|||||||
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
@ -1,6 +1,9 @@
|
|||||||
{
|
{
|
||||||
"prettier.endOfLine": "lf",
|
"prettier.endOfLine": "lf",
|
||||||
"cSpell.words": ["unplugin"],
|
"cSpell.words": [
|
||||||
|
"undici",
|
||||||
|
"unplugin"
|
||||||
|
],
|
||||||
"gitlens.showWelcomeOnInstall": false,
|
"gitlens.showWelcomeOnInstall": false,
|
||||||
"gitlens.showWhatsNewAfterUpgrades": false,
|
"gitlens.showWhatsNewAfterUpgrades": false,
|
||||||
"gitlens.plusFeatures.enabled": false,
|
"gitlens.plusFeatures.enabled": false,
|
||||||
|
|||||||
11
package.json
11
package.json
@ -5,7 +5,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "svelte-kit dev",
|
"dev": "svelte-kit dev",
|
||||||
"build": "svelte-kit build",
|
"build": "svelte-kit build",
|
||||||
"package": "sed -i 's|\\./|\\./src/|g' src/index.ts && cp src/index.ts index.js && cp src/index.ts index.d.ts",
|
"package": "svelte-kit package",
|
||||||
"preview": "svelte-kit preview",
|
"preview": "svelte-kit preview",
|
||||||
"prepare": "svelte-kit sync",
|
"prepare": "svelte-kit sync",
|
||||||
"check": "svelte-check --tsconfig ./tsconfig.json",
|
"check": "svelte-check --tsconfig ./tsconfig.json",
|
||||||
@ -30,17 +30,10 @@
|
|||||||
"url": "https://github.com/modrinth/omorphia/issues"
|
"url": "https://github.com/modrinth/omorphia/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://omorphia.modrinth.com",
|
"homepage": "https://omorphia.modrinth.com",
|
||||||
"exports": {
|
|
||||||
".": "./index.js",
|
|
||||||
"./utils": "./src/utils/index.ts",
|
|
||||||
"./styles.postcss": "./src/styles.postcss",
|
|
||||||
"./plugins": "./src/plugins/index.js",
|
|
||||||
"./config/postcss": "./src/config/postcss.cjs",
|
|
||||||
"./config/svelte": "./src/config/svelte.js"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sveltejs/adapter-static": "^1.0.0-next.29",
|
"@sveltejs/adapter-static": "^1.0.0-next.29",
|
||||||
"@sveltejs/kit": "next",
|
"@sveltejs/kit": "next",
|
||||||
|
"@types/cli-progress": "^3.11.0",
|
||||||
"@types/marked": "^4.0.3",
|
"@types/marked": "^4.0.3",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.10.1",
|
"@typescript-eslint/eslint-plugin": "^5.10.1",
|
||||||
"@typescript-eslint/parser": "^5.10.1",
|
"@typescript-eslint/parser": "^5.10.1",
|
||||||
|
|||||||
20
pnpm-lock.yaml
generated
20
pnpm-lock.yaml
generated
@ -10,6 +10,7 @@ specifiers:
|
|||||||
'@poppanator/sveltekit-svg': ^0.3.1
|
'@poppanator/sveltekit-svg': ^0.3.1
|
||||||
'@sveltejs/adapter-static': ^1.0.0-next.29
|
'@sveltejs/adapter-static': ^1.0.0-next.29
|
||||||
'@sveltejs/kit': next
|
'@sveltejs/kit': next
|
||||||
|
'@types/cli-progress': ^3.11.0
|
||||||
'@types/marked': ^4.0.3
|
'@types/marked': ^4.0.3
|
||||||
'@typescript-eslint/eslint-plugin': ^5.10.1
|
'@typescript-eslint/eslint-plugin': ^5.10.1
|
||||||
'@typescript-eslint/parser': ^5.10.1
|
'@typescript-eslint/parser': ^5.10.1
|
||||||
@ -85,7 +86,8 @@ dependencies:
|
|||||||
|
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@sveltejs/adapter-static': 1.0.0-next.29
|
'@sveltejs/adapter-static': 1.0.0-next.29
|
||||||
'@sveltejs/kit': 1.0.0-next.350_svelte@3.48.0
|
'@sveltejs/kit': 1.0.0-next.354_svelte@3.48.0
|
||||||
|
'@types/cli-progress': 3.11.0
|
||||||
'@types/marked': 4.0.3
|
'@types/marked': 4.0.3
|
||||||
'@typescript-eslint/eslint-plugin': 5.14.0_4p27j37cxves4nxlnqogdhp4ta
|
'@typescript-eslint/eslint-plugin': 5.14.0_4p27j37cxves4nxlnqogdhp4ta
|
||||||
'@typescript-eslint/parser': 5.14.0_e6rt7vlgxfprtuallp2t3cvyi4
|
'@typescript-eslint/parser': 5.14.0_e6rt7vlgxfprtuallp2t3cvyi4
|
||||||
@ -1076,14 +1078,14 @@ packages:
|
|||||||
tiny-glob: 0.2.9
|
tiny-glob: 0.2.9
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@sveltejs/kit/1.0.0-next.350_svelte@3.48.0:
|
/@sveltejs/kit/1.0.0-next.354_svelte@3.48.0:
|
||||||
resolution: {integrity: sha512-qkZNjp7yIj6t91+wMhmMtGJH0Lb89OaKdVXUDy92CS5/4OHRTKcQPdfOKs4no/upkS3RiFb+rEpOkYqTMcPUXg==}
|
resolution: {integrity: sha512-dTfFT0c3sxztFpiw6H4bQnPd+PtHgEZG6j6ssT9sWLONfzUgWRX0S7H/WoPEjr7u65o2HNazoj8jmEq3ZTwb9g==}
|
||||||
engines: {node: '>=16.7'}
|
engines: {node: '>=16.7'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
svelte: ^3.44.0
|
svelte: ^3.44.0
|
||||||
dependencies:
|
dependencies:
|
||||||
'@sveltejs/vite-plugin-svelte': 1.0.0-next.47_svelte@3.48.0+vite@2.9.10
|
'@sveltejs/vite-plugin-svelte': 1.0.0-next.49_svelte@3.48.0+vite@2.9.10
|
||||||
chokidar: 3.5.3
|
chokidar: 3.5.3
|
||||||
sade: 1.8.1
|
sade: 1.8.1
|
||||||
svelte: 3.48.0
|
svelte: 3.48.0
|
||||||
@ -1096,8 +1098,8 @@ packages:
|
|||||||
- supports-color
|
- supports-color
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@sveltejs/vite-plugin-svelte/1.0.0-next.47_svelte@3.48.0+vite@2.9.10:
|
/@sveltejs/vite-plugin-svelte/1.0.0-next.49_svelte@3.48.0+vite@2.9.10:
|
||||||
resolution: {integrity: sha512-J6n8UN51aq/TEZGQ89/EtdXTtca3cRcTJGzi6fi+xK8LkgsHQLCZhRj+PJ+swktRSWTX9IOmQS55SqVg6bz5fA==}
|
resolution: {integrity: sha512-AKh0Ka8EDgidnxWUs8Hh2iZLZovkETkefO99XxZ4sW4WGJ7VFeBx5kH/NIIGlaNHLcrIvK3CK0HkZwC3Cici0A==}
|
||||||
engines: {node: ^14.13.1 || >= 16}
|
engines: {node: ^14.13.1 || >= 16}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
diff-match-patch: ^1.0.5
|
diff-match-patch: ^1.0.5
|
||||||
@ -1131,6 +1133,12 @@ packages:
|
|||||||
engines: {node: '>=10.13.0'}
|
engines: {node: '>=10.13.0'}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/@types/cli-progress/3.11.0:
|
||||||
|
resolution: {integrity: sha512-XhXhBv1R/q2ahF3BM7qT5HLzJNlIL0wbcGyZVjqOTqAybAnsLisd7gy1UCyIqpL+5Iv6XhlSyzjLCnI2sIdbCg==}
|
||||||
|
dependencies:
|
||||||
|
'@types/node': 17.0.21
|
||||||
|
dev: true
|
||||||
|
|
||||||
/@types/estree/0.0.39:
|
/@types/estree/0.0.39:
|
||||||
resolution: {integrity: sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==}
|
resolution: {integrity: sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import IconTrash from 'virtual:icons/heroicons-outline/trash'
|
import IconTrash from 'virtual:icons/heroicons-outline/trash'
|
||||||
import IconUpload from 'virtual:icons/heroicons-outline/upload'
|
import IconUpload from 'virtual:icons/heroicons-outline/upload'
|
||||||
|
import IconPhotograph from 'virtual:icons/heroicons-outline/photograph'
|
||||||
import IconFile from 'virtual:icons/lucide/file'
|
import IconFile from 'virtual:icons/lucide/file'
|
||||||
import { t } from 'svelte-intl-precompile'
|
import { t } from 'svelte-intl-precompile'
|
||||||
import Button from './Button.svelte'
|
import Button from './Button.svelte'
|
||||||
@ -52,7 +53,11 @@
|
|||||||
{#each files as file (file.name)}
|
{#each files as file (file.name)}
|
||||||
<div class="file">
|
<div class="file">
|
||||||
<div class="file__tab">
|
<div class="file__tab">
|
||||||
<IconFile />
|
{#if file.type.startsWith('image/')}
|
||||||
|
<IconPhotograph />
|
||||||
|
{:else}
|
||||||
|
<IconFile />
|
||||||
|
{/if}
|
||||||
<div class="file__tab__name"><b>{file.name}</b></div>
|
<div class="file__tab__name"><b>{file.name}</b></div>
|
||||||
<Button
|
<Button
|
||||||
color="tertiary"
|
color="tertiary"
|
||||||
@ -61,7 +66,12 @@
|
|||||||
}}><IconTrash /> Remove</Button>
|
}}><IconTrash /> Remove</Button>
|
||||||
</div>
|
</div>
|
||||||
{#if file.type.startsWith('image/')}
|
{#if file.type.startsWith('image/')}
|
||||||
<img class="file__preview" src={URL.createObjectURL(file)} alt="Uploaded file preview" />
|
<div class="file__preview">
|
||||||
|
<img
|
||||||
|
class="file__preview__image"
|
||||||
|
src={URL.createObjectURL(file)}
|
||||||
|
alt="Uploaded file preview" />
|
||||||
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
@ -91,9 +101,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.file {
|
.file {
|
||||||
box-shadow: var(--shadow-inset);
|
|
||||||
border-radius: var(--rounded);
|
border-radius: var(--rounded);
|
||||||
background-color: var(--color-button-bg);
|
background-color: var(--color-button-bg);
|
||||||
|
box-shadow: var(--shadow-raised-sm), var(--shadow-inset);
|
||||||
|
|
||||||
&__tab {
|
&__tab {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -101,6 +111,12 @@
|
|||||||
padding: 0.75rem 1rem;
|
padding: 0.75rem 1rem;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
|
|
||||||
|
:global(.icon) {
|
||||||
|
/* Uses `px` to make icons slightly larger */
|
||||||
|
min-width: 18px;
|
||||||
|
height: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
&__name {
|
&__name {
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@ -112,6 +128,17 @@
|
|||||||
&__preview {
|
&__preview {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-radius: var(--rounded-bottom);
|
border-radius: var(--rounded-bottom);
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
background-color: black;
|
||||||
|
|
||||||
|
&__image {
|
||||||
|
height: auto;
|
||||||
|
max-height: 22rem;
|
||||||
|
width: 100%;
|
||||||
|
object-fit: contain;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
10
src/plugins/generator/index.d.ts
vendored
10
src/plugins/generator/index.d.ts
vendored
@ -1,10 +0,0 @@
|
|||||||
export default function Generator(options: PluginOptions): {
|
|
||||||
name: string
|
|
||||||
buildStart(): Promise<void>
|
|
||||||
}
|
|
||||||
export interface PluginOptions {
|
|
||||||
projectColors: boolean
|
|
||||||
landingPage: boolean
|
|
||||||
gameVersions: boolean
|
|
||||||
tags: boolean
|
|
||||||
}
|
|
||||||
@ -12,6 +12,21 @@ const API_URL =
|
|||||||
// Time to live: 7 days
|
// Time to live: 7 days
|
||||||
const TTL = 7 * 24 * 60 * 60 * 1000
|
const TTL = 7 * 24 * 60 * 60 * 1000
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {Object} PluginResult
|
||||||
|
* @property {string} name
|
||||||
|
* @property {() => Promise<void>} buildStart
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate JSON data from the backend
|
||||||
|
* @param {Object} options Plugin options
|
||||||
|
* @param {boolean} options.projectColors
|
||||||
|
* @param {boolean} options.landingPage
|
||||||
|
* @param {boolean} options.gameVersions
|
||||||
|
* @param {boolean} options.tags
|
||||||
|
* @returns {PluginResult}
|
||||||
|
*/
|
||||||
export default function Generator(options) {
|
export default function Generator(options) {
|
||||||
return {
|
return {
|
||||||
name: 'rollup-plugin-omorphia-generator',
|
name: 'rollup-plugin-omorphia-generator',
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
export declare function gameVersions(API_URL: string): Promise<void>
|
|
||||||
@ -1 +0,0 @@
|
|||||||
export declare function landingPage(API_URL: string): Promise<void>
|
|
||||||
@ -1 +0,0 @@
|
|||||||
export declare function projectColors(API_URL: string): Promise<void>
|
|
||||||
1
src/plugins/generator/outputs/tags.d.ts
vendored
1
src/plugins/generator/outputs/tags.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
export declare function tags(API_URL: string): Promise<void>
|
|
||||||
Loading…
x
Reference in New Issue
Block a user