diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f2bb3d5..4249032 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,9 +57,6 @@ jobs: version: 8 run_install: true - - name: Build Packages - run: pnpm build - - name: Create Release Pull Request or Publish to npm id: changesets uses: changesets/action@v1 diff --git a/package.json b/package.json index c432b5b..c803572 100644 --- a/package.json +++ b/package.json @@ -2,18 +2,10 @@ "name": "@lunarclient/molang", "version": "1.0.4", "description": "Lunar Client's fork of bridge-core's molang parser", - "main": "./dist/molang.umd.js", - "module": "./dist/molang.es.js", - "types": "./dist/main.d.ts", - "exports": { - ".": { - "import": "./dist/molang.es.js", - "require": "./dist/molang.umd.js" - } - }, - "directories": { - "lib": "lib" - }, + "main": "lib/main.ts", + "files": [ + "dist" + ], "scripts": { "build": "vite build && tsc --project tsconfig.json", "test": "vitest", @@ -21,7 +13,9 @@ "bench": "vitest bench", "changeset": "changeset", "version-packages": "changeset version", - "release": "pnpm build && changeset publish" + "release": "pnpm build && changeset publish", + "prepack": "clean-package", + "postpack": "clean-package restore" }, "repository": { "type": "git", @@ -39,6 +33,10 @@ "molangjs": "^1.5.0", "typescript": "^4.2.3", "vite": "^3.1.3", - "vitest": "^0.23.4" + "vitest": "^0.23.4", + "clean-package": "^2.2.0" + }, + "clean-package": { + "extends": "@moonsworth/cleanpackage-config/base.json" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 790afcf..29f24ae 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,6 +14,9 @@ importers: '@types/node': specifier: ^13.1.2 version: 13.13.52 + clean-package: + specifier: ^2.2.0 + version: 2.2.0 molangjs: specifier: ^1.5.0 version: 1.6.4 @@ -186,6 +189,10 @@ packages: resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} engines: {node: '>=8'} + clean-package@2.2.0: + resolution: {integrity: sha512-vLv8kRqvh4smPDpqAYFPLEijTppAd/cfCz4yBcUGoVl/JKu6ZWKhlo+G/cAmwlSa29RudfBeuyiNEzas8bTwEQ==} + hasBin: true + color-convert@1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} @@ -216,6 +223,10 @@ packages: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} + dot-prop@6.0.1: + resolution: {integrity: sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==} + engines: {node: '>=10'} + enquirer@2.4.1: resolution: {integrity: sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==} engines: {node: '>=8.6'} @@ -448,6 +459,10 @@ packages: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} + is-obj@2.0.0: + resolution: {integrity: sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==} + engines: {node: '>=8'} + is-subdir@1.2.0: resolution: {integrity: sha512-2AT6j+gXe/1ueqbW6fLZJiIw3F8iXGJtt0yDrZaBhAZEG1raiTxKWU+IPqMCzQAXOUCKdA4UDMgacKH25XG2Cw==} engines: {node: '>=4'} @@ -1032,6 +1047,10 @@ snapshots: ci-info@3.9.0: {} + clean-package@2.2.0: + dependencies: + dot-prop: 6.0.1 + color-convert@1.9.3: dependencies: color-name: 1.1.3 @@ -1058,6 +1077,10 @@ snapshots: dependencies: path-type: 4.0.0 + dot-prop@6.0.1: + dependencies: + is-obj: 2.0.0 + enquirer@2.4.1: dependencies: ansi-colors: 4.1.3 @@ -1251,6 +1274,8 @@ snapshots: is-number@7.0.0: {} + is-obj@2.0.0: {} + is-subdir@1.2.0: dependencies: better-path-resolve: 1.0.0