From 3c9eb1914a1fd20896676c93915a476afd592956 Mon Sep 17 00:00:00 2001 From: cswimr Date: Sun, 9 Feb 2025 16:50:27 -0600 Subject: [PATCH] finish package file & format --- bun.lock | 3 +++ package.json | 21 ++++++++++++++++++++- renovate.json | 4 +--- src/enums/hash-format.ts | 4 ++-- src/parser.ts | 22 +++++++++++----------- src/provider.ts | 2 +- tsconfig.json | 5 +---- typedoc.json | 10 +++------- 8 files changed, 42 insertions(+), 29 deletions(-) diff --git a/bun.lock b/bun.lock index b756402..996625e 100644 --- a/bun.lock +++ b/bun.lock @@ -15,6 +15,7 @@ "@typhonjs-typedoc/typedoc-theme-dmt": "0.3.1", "eslint": "9.20.0", "eslint-config-standard": "17.1.0", + "prettier": "^3.5.0", "typedoc": "0.27.7", "typedoc-plugin-coverage": "3.4.1", "typedoc-plugin-markdown": "4.4.1", @@ -493,6 +494,8 @@ "prelude-ls": ["prelude-ls@1.2.1", "", {}, "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g=="], + "prettier": ["prettier@3.5.0", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-quyMrVt6svPS7CjQ9gKb3GLEX/rl3BCL2oa/QkNcXv4YNVBC9olt3s+H7ukto06q7B1Qz46PbrKLO34PR6vXcA=="], + "punycode": ["punycode@2.3.1", "", {}, "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg=="], "punycode.js": ["punycode.js@2.3.1", "", {}, "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA=="], diff --git a/package.json b/package.json index 2c5e4d6..9d65bce 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,27 @@ { "name": "packwizjs", "module": "src/parser.ts", + "version": "1.0.0", "type": "module", + "description": "A simple library for parsing Packwiz TOML files", + "author": { + "name": "cswimr", + "email": "seaswimmerthefsh@gmail.com" + }, + "repository": { + "url": "https://c.csw.im/GalacticFactory/PackwizJS", + "type": "git", + "directory": "src" + }, + "homepage": "https://packwizjs.csw.im", + "license": "MIT", + "files": [ + "src" + ], + "readme": "README.md", "scripts": { - "docs": "typedoc --options typedoc.json" + "docs": "typedoc --options typedoc.json", + "format": "prettier --write '**/*.{ts,json,md}'" }, "devDependencies": { "@getmeli/cli": "1.2.0", @@ -12,6 +30,7 @@ "@typhonjs-typedoc/typedoc-theme-dmt": "0.3.1", "eslint": "9.20.0", "eslint-config-standard": "17.1.0", + "prettier": "^3.5.0", "typedoc": "0.27.7", "typedoc-plugin-coverage": "3.4.1", "typedoc-plugin-markdown": "4.4.1" diff --git a/renovate.json b/renovate.json index 59a5406..de8083a 100644 --- a/renovate.json +++ b/renovate.json @@ -1,6 +1,4 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "local>cc/renovate-config" - ] + "extends": ["local>cc/renovate-config"] } diff --git a/src/enums/hash-format.ts b/src/enums/hash-format.ts index 93ca847..8554e0b 100644 --- a/src/enums/hash-format.ts +++ b/src/enums/hash-format.ts @@ -11,8 +11,8 @@ export enum HashFormat { */ "sha512" = "sha512", /** - * SHA-1 hash format. - */ + * SHA-1 hash format. + */ "sha1" = "sha1", /** * MD5 hash format. diff --git a/src/parser.ts b/src/parser.ts index 8fcea83..58a4b12 100644 --- a/src/parser.ts +++ b/src/parser.ts @@ -15,7 +15,7 @@ import * as semver from "semver"; */ export interface Metafile { /** - * A human-readable name for the file. + * A human-readable name for the file. */ name: string; /** @@ -23,9 +23,9 @@ export interface Metafile { */ filename: string; /** - * Whether the file is for the client or server. - * Consuming applications should respect this! - */ + * Whether the file is for the client or server. + * Consuming applications should respect this! + */ side: Side; /** * The provider to use to download / update the file. @@ -34,8 +34,8 @@ export interface Metafile { */ provider: UrlProvider; /** - * Whether the file is optional. - * If true, the end user should be prompted to download the file. + * Whether the file is optional. + * If true, the end user should be prompted to download the file. */ isOptional: boolean; /** @@ -44,8 +44,8 @@ export interface Metafile { */ isDefault: boolean; /** - * The description of the file. - * This should be shown to end users. + * The description of the file. + * This should be shown to end users. */ description?: string; } @@ -181,7 +181,7 @@ export interface PackwizVersions { */ minecraft: string; /** - * The version of [Fabric](https://fabricmc.net/) that the pack targets. + * The version of [Fabric](https://fabricmc.net/) that the pack targets. */ fabric?: string; /** @@ -189,8 +189,8 @@ export interface PackwizVersions { */ forge?: string; /** - * The version of [NeoForge](https://neoforged.net/) that the pack targets. - */ + * The version of [NeoForge](https://neoforged.net/) that the pack targets. + */ neoforge?: string; /** * The version of [Quilt](https://quiltmc.org/) that the pack targets. diff --git a/src/provider.ts b/src/provider.ts index 82e8ad0..1525776 100644 --- a/src/provider.ts +++ b/src/provider.ts @@ -15,7 +15,7 @@ export class UrlProvider { public hash: string, public hashFormat: HashFormat, public url: Resource, - ) { } + ) {} } /** diff --git a/tsconfig.json b/tsconfig.json index 8b73555..2bb153e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,10 +1,7 @@ { "compilerOptions": { // Enable latest features - "lib": [ - "ESNext", - "DOM" - ], + "lib": ["ESNext", "DOM"], "target": "ESNext", "module": "ESNext", "moduleDetection": "force", diff --git a/typedoc.json b/typedoc.json index 4db4038..d82073c 100644 --- a/typedoc.json +++ b/typedoc.json @@ -1,7 +1,5 @@ { - "entryPoints": [ - "src/**/*.ts" - ], + "entryPoints": ["src/**/*.ts"], "outputs": [ { "name": "html", @@ -17,9 +15,7 @@ } ], "githubPages": false, - "exclude": [ - "**/*+(test|spec).ts" - ], + "exclude": ["**/*+(test|spec).ts"], "theme": "default-modern", "dmtFavicon": "https://c.csw.im/favicon.ico", "dmtLinksIcon": [ @@ -31,7 +27,7 @@ ], "dmtNavigation": { "moduleIcon": true, - "style": "compact", + "style": "compact" }, "sourceLinkTemplate": "https://c.csw.im/GalacticFactory/PackwizJS/src/commit/{gitRevision}/{path}#L{line}", "coverageLabel": "Documentation Coverage",