diff --git a/.changeset/lazy-cameras-share.md b/.changeset/lazy-cameras-share.md new file mode 100644 index 0000000..b139ff5 --- /dev/null +++ b/.changeset/lazy-cameras-share.md @@ -0,0 +1,5 @@ +--- +"@effect/build-utils": patch +--- + +reduce bundle size diff --git a/.vscode/settings.json b/.vscode/settings.json index df0aa40..e50843c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -24,7 +24,7 @@ }, "eslint.validate": ["markdown", "javascript", "typescript"], "editor.codeActionsOnSave": { - "source.fixAll.eslint": true + "source.fixAll.eslint": "explicit" }, "editor.quickSuggestions": { "other": true, @@ -38,7 +38,7 @@ "editor.tabCompletion": "off", "editor.suggest.localityBonus": true, "editor.suggestSelection": "recentlyUsed", - "editor.wordBasedSuggestions": true, + "editor.wordBasedSuggestions": "matchingDocuments", "editor.parameterHints.enabled": true, "files.watcherExclude": { "**/target": true diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 055e8ec..fc75529 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1017,96 +1017,104 @@ packages: requiresBuild: true optional: true - /@rollup/rollup-android-arm-eabi@4.6.1: - resolution: {integrity: sha512-0WQ0ouLejaUCRsL93GD4uft3rOmB8qoQMU05Kb8CmMtMBe7XUDLAltxVZI1q6byNqEtU7N1ZX1Vw5lIpgulLQA==} + /@rollup/rollup-android-arm-eabi@4.9.0: + resolution: {integrity: sha512-+1ge/xmaJpm1KVBuIH38Z94zj9fBD+hp+/5WLaHgyY8XLq1ibxk/zj6dTXaqM2cAbYKq8jYlhHd6k05If1W5xA==} cpu: [arm] os: [android] requiresBuild: true dev: true optional: true - /@rollup/rollup-android-arm64@4.6.1: - resolution: {integrity: sha512-1TKm25Rn20vr5aTGGZqo6E4mzPicCUD79k17EgTLAsXc1zysyi4xXKACfUbwyANEPAEIxkzwue6JZ+stYzWUTA==} + /@rollup/rollup-android-arm64@4.9.0: + resolution: {integrity: sha512-im6hUEyQ7ZfoZdNvtwgEJvBWZYauC9KVKq1w58LG2Zfz6zMd8gRrbN+xCVoqA2hv/v6fm9lp5LFGJ3za8EQH3A==} cpu: [arm64] os: [android] requiresBuild: true dev: true optional: true - /@rollup/rollup-darwin-arm64@4.6.1: - resolution: {integrity: sha512-cEXJQY/ZqMACb+nxzDeX9IPLAg7S94xouJJCNVE5BJM8JUEP4HeTF+ti3cmxWeSJo+5D+o8Tc0UAWUkfENdeyw==} + /@rollup/rollup-darwin-arm64@4.9.0: + resolution: {integrity: sha512-u7aTMskN6Dmg1lCT0QJ+tINRt+ntUrvVkhbPfFz4bCwRZvjItx2nJtwJnJRlKMMaQCHRjrNqHRDYvE4mBm3DlQ==} cpu: [arm64] os: [darwin] requiresBuild: true dev: true optional: true - /@rollup/rollup-darwin-x64@4.6.1: - resolution: {integrity: sha512-LoSU9Xu56isrkV2jLldcKspJ7sSXmZWkAxg7sW/RfF7GS4F5/v4EiqKSMCFbZtDu2Nc1gxxFdQdKwkKS4rwxNg==} + /@rollup/rollup-darwin-x64@4.9.0: + resolution: {integrity: sha512-8FvEl3w2ExmpcOmX5RJD0yqXcVSOqAJJUJ29Lca29Ik+3zPS1yFimr2fr5JSZ4Z5gt8/d7WqycpgkX9nocijSw==} cpu: [x64] os: [darwin] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm-gnueabihf@4.6.1: - resolution: {integrity: sha512-EfI3hzYAy5vFNDqpXsNxXcgRDcFHUWSx5nnRSCKwXuQlI5J9dD84g2Usw81n3FLBNsGCegKGwwTVsSKK9cooSQ==} + /@rollup/rollup-linux-arm-gnueabihf@4.9.0: + resolution: {integrity: sha512-lHoKYaRwd4gge+IpqJHCY+8Vc3hhdJfU6ukFnnrJasEBUvVlydP8PuwndbWfGkdgSvZhHfSEw6urrlBj0TSSfg==} cpu: [arm] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm64-gnu@4.6.1: - resolution: {integrity: sha512-9lhc4UZstsegbNLhH0Zu6TqvDfmhGzuCWtcTFXY10VjLLUe4Mr0Ye2L3rrtHaDd/J5+tFMEuo5LTCSCMXWfUKw==} + /@rollup/rollup-linux-arm64-gnu@4.9.0: + resolution: {integrity: sha512-JbEPfhndYeWHfOSeh4DOFvNXrj7ls9S/2omijVsao+LBPTPayT1uKcK3dHW3MwDJ7KO11t9m2cVTqXnTKpeaiw==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm64-musl@4.6.1: - resolution: {integrity: sha512-FfoOK1yP5ksX3wwZ4Zk1NgyGHZyuRhf99j64I5oEmirV8EFT7+OhUZEnP+x17lcP/QHJNWGsoJwrz4PJ9fBEXw==} + /@rollup/rollup-linux-arm64-musl@4.9.0: + resolution: {integrity: sha512-ahqcSXLlcV2XUBM3/f/C6cRoh7NxYA/W7Yzuv4bDU1YscTFw7ay4LmD7l6OS8EMhTNvcrWGkEettL1Bhjf+B+w==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-x64-gnu@4.6.1: - resolution: {integrity: sha512-DNGZvZDO5YF7jN5fX8ZqmGLjZEXIJRdJEdTFMhiyXqyXubBa0WVLDWSNlQ5JR2PNgDbEV1VQowhVRUh+74D+RA==} + /@rollup/rollup-linux-riscv64-gnu@4.9.0: + resolution: {integrity: sha512-uwvOYNtLw8gVtrExKhdFsYHA/kotURUmZYlinH2VcQxNCQJeJXnkmWgw2hI9Xgzhgu7J9QvWiq9TtTVwWMDa+w==} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-x64-gnu@4.9.0: + resolution: {integrity: sha512-m6pkSwcZZD2LCFHZX/zW2aLIISyzWLU3hrLLzQKMI12+OLEzgruTovAxY5sCZJkipklaZqPy/2bEEBNjp+Y7xg==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-x64-musl@4.6.1: - resolution: {integrity: sha512-RkJVNVRM+piYy87HrKmhbexCHg3A6Z6MU0W9GHnJwBQNBeyhCJG9KDce4SAMdicQnpURggSvtbGo9xAWOfSvIQ==} + /@rollup/rollup-linux-x64-musl@4.9.0: + resolution: {integrity: sha512-VFAC1RDRSbU3iOF98X42KaVicAfKf0m0OvIu8dbnqhTe26Kh6Ym9JrDulz7Hbk7/9zGc41JkV02g+p3BivOdAg==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-arm64-msvc@4.6.1: - resolution: {integrity: sha512-v2FVT6xfnnmTe3W9bJXl6r5KwJglMK/iRlkKiIFfO6ysKs0rDgz7Cwwf3tjldxQUrHL9INT/1r4VA0n9L/F1vQ==} + /@rollup/rollup-win32-arm64-msvc@4.9.0: + resolution: {integrity: sha512-9jPgMvTKXARz4inw6jezMLA2ihDBvgIU9Ml01hjdVpOcMKyxFBJrn83KVQINnbeqDv0+HdO1c09hgZ8N0s820Q==} cpu: [arm64] os: [win32] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-ia32-msvc@4.6.1: - resolution: {integrity: sha512-YEeOjxRyEjqcWphH9dyLbzgkF8wZSKAKUkldRY6dgNR5oKs2LZazqGB41cWJ4Iqqcy9/zqYgmzBkRoVz3Q9MLw==} + /@rollup/rollup-win32-ia32-msvc@4.9.0: + resolution: {integrity: sha512-WE4pT2kTXQN2bAv40Uog0AsV7/s9nT9HBWXAou8+++MBCnY51QS02KYtm6dQxxosKi1VIz/wZIrTQO5UP2EW+Q==} cpu: [ia32] os: [win32] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-x64-msvc@4.6.1: - resolution: {integrity: sha512-0zfTlFAIhgz8V2G8STq8toAjsYYA6eci1hnXuyOTUFnymrtJwnS6uGKiv3v5UrPZkBlamLvrLV2iiaeqCKzb0A==} + /@rollup/rollup-win32-x64-msvc@4.9.0: + resolution: {integrity: sha512-aPP5Q5AqNGuT0tnuEkK/g4mnt3ZhheiXrDIiSVIHN9mcN21OyXDVbEMqmXPE7e2OplNLDkcvV+ZoGJa2ZImFgw==} cpu: [x64] os: [win32] requiresBuild: true @@ -4165,23 +4173,24 @@ packages: glob: 10.3.10 dev: true - /rollup@4.6.1: - resolution: {integrity: sha512-jZHaZotEHQaHLgKr8JnQiDT1rmatjgKlMekyksz+yk9jt/8z9quNjnKNRoaM0wd9DC2QKXjmWWuDYtM3jfF8pQ==} + /rollup@4.9.0: + resolution: {integrity: sha512-bUHW/9N21z64gw8s6tP4c88P382Bq/L5uZDowHlHx6s/QWpjJXivIAbEw6LZthgSvlEizZBfLC4OAvWe7aoF7A==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.6.1 - '@rollup/rollup-android-arm64': 4.6.1 - '@rollup/rollup-darwin-arm64': 4.6.1 - '@rollup/rollup-darwin-x64': 4.6.1 - '@rollup/rollup-linux-arm-gnueabihf': 4.6.1 - '@rollup/rollup-linux-arm64-gnu': 4.6.1 - '@rollup/rollup-linux-arm64-musl': 4.6.1 - '@rollup/rollup-linux-x64-gnu': 4.6.1 - '@rollup/rollup-linux-x64-musl': 4.6.1 - '@rollup/rollup-win32-arm64-msvc': 4.6.1 - '@rollup/rollup-win32-ia32-msvc': 4.6.1 - '@rollup/rollup-win32-x64-msvc': 4.6.1 + '@rollup/rollup-android-arm-eabi': 4.9.0 + '@rollup/rollup-android-arm64': 4.9.0 + '@rollup/rollup-darwin-arm64': 4.9.0 + '@rollup/rollup-darwin-x64': 4.9.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.9.0 + '@rollup/rollup-linux-arm64-gnu': 4.9.0 + '@rollup/rollup-linux-arm64-musl': 4.9.0 + '@rollup/rollup-linux-riscv64-gnu': 4.9.0 + '@rollup/rollup-linux-x64-gnu': 4.9.0 + '@rollup/rollup-linux-x64-musl': 4.9.0 + '@rollup/rollup-win32-arm64-msvc': 4.9.0 + '@rollup/rollup-win32-ia32-msvc': 4.9.0 + '@rollup/rollup-win32-x64-msvc': 4.9.0 fsevents: 2.3.3 dev: true @@ -4703,7 +4712,7 @@ packages: joycon: 3.1.1 postcss-load-config: 4.0.2(ts-node@10.9.1) resolve-from: 5.0.0 - rollup: 4.6.1 + rollup: 4.9.0 source-map: 0.8.0-beta.0 sucrase: 3.34.0 tree-kill: 1.2.2 @@ -4931,7 +4940,7 @@ packages: '@types/node': 20.10.1 esbuild: 0.19.8 postcss: 8.4.31 - rollup: 4.6.1 + rollup: 4.9.0 optionalDependencies: fsevents: 2.3.3 dev: true diff --git a/src/FsUtils.ts b/src/FsUtils.ts index 96334f4..09dcb22 100644 --- a/src/FsUtils.ts +++ b/src/FsUtils.ts @@ -1,6 +1,8 @@ import * as FileSystem from "@effect/platform-node/FileSystem" import * as Path from "@effect/platform-node/Path" -import { Context, Effect, Layer } from "effect" +import * as Context from "effect/Context" +import * as Effect from "effect/Effect" +import * as Layer from "effect/Layer" import * as Glob from "glob" const make = Effect.gen(function*(_) { diff --git a/src/PackV1.ts b/src/PackV1.ts index 9fc417c..f063b74 100644 --- a/src/PackV1.ts +++ b/src/PackV1.ts @@ -1,5 +1,8 @@ import * as FileSystem from "@effect/platform-node/FileSystem" -import { Effect, Layer, pipe, ReadonlyArray } from "effect" +import * as Effect from "effect/Effect" +import { pipe } from "effect/Function" +import * as Layer from "effect/Layer" +import * as ReadonlyArray from "effect/ReadonlyArray" import { posix } from "node:path" import { FsUtils, FsUtilsLive } from "./FsUtils" import type { PackageJson } from "./PackageContext" diff --git a/src/PackV2.ts b/src/PackV2.ts index e170d57..8d5e751 100644 --- a/src/PackV2.ts +++ b/src/PackV2.ts @@ -1,12 +1,10 @@ import { FileSystem, Path } from "@effect/platform-node" -import { - Effect, - Layer, - Order, - ReadonlyArray, - ReadonlyRecord, - String, -} from "effect" +import * as Effect from "effect/Effect" +import * as Layer from "effect/Layer" +import * as Order from "effect/Order" +import * as ReadonlyArray from "effect/ReadonlyArray" +import * as ReadonlyRecord from "effect/ReadonlyRecord" +import * as String from "effect/String" import { FsUtils, FsUtilsLive } from "./FsUtils" import type { PackageJson } from "./PackageContext" import { PackageContext, PackageContextLive } from "./PackageContext" diff --git a/src/PackageContext.ts b/src/PackageContext.ts index 859b3c9..16d0895 100644 --- a/src/PackageContext.ts +++ b/src/PackageContext.ts @@ -1,6 +1,8 @@ import * as FileSystem from "@effect/platform-node/FileSystem" import * as Schema from "@effect/schema/Schema" -import { Context, Effect, Layer } from "effect" +import * as Context from "effect/Context" +import * as Effect from "effect/Effect" +import * as Layer from "effect/Layer" const effectConfigDefaults = { generateExports: { diff --git a/src/PrepareV1.ts b/src/PrepareV1.ts index 0b234d2..d472a7a 100644 --- a/src/PrepareV1.ts +++ b/src/PrepareV1.ts @@ -1,6 +1,10 @@ -import { FileSystem, Path } from "@effect/platform-node" -import { Schema } from "@effect/schema" -import { Effect, Layer, Option, ReadonlyArray } from "effect" +import * as FileSystem from "@effect/platform-node/FileSystem" +import * as Path from "@effect/platform-node/Path" +import * as Schema from "@effect/schema/Schema" +import * as Effect from "effect/Effect" +import * as Layer from "effect/Layer" +import * as Option from "effect/Option" +import * as ReadonlyArray from "effect/ReadonlyArray" import { FsUtils, FsUtilsLive } from "./FsUtils" const defaultGitignoreTemplate = `coverage/ diff --git a/src/PrepareV2.ts b/src/PrepareV2.ts index 4dab841..ce0b450 100644 --- a/src/PrepareV2.ts +++ b/src/PrepareV2.ts @@ -1,5 +1,7 @@ -import { FileSystem, Path } from "@effect/platform-node" -import { Effect, Layer } from "effect" +import * as FileSystem from "@effect/platform-node/FileSystem" +import * as Path from "@effect/platform-node/Path" +import * as Effect from "effect/Effect" +import * as Layer from "effect/Layer" import { FsUtils, FsUtilsLive } from "./FsUtils" import { PackageJson } from "./PackageContext" diff --git a/src/main.ts b/src/main.ts index de59202..806113b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -3,7 +3,7 @@ import * as Command from "@effect/cli/Command" import * as NodeContext from "@effect/platform-node/NodeContext" import { runMain } from "@effect/platform-node/Runtime" -import { Effect } from "effect" +import * as Effect from "effect/Effect" import * as PackV1 from "./PackV1" import * as PackV2 from "./PackV2" import * as PrepareV1 from "./PrepareV1" diff --git a/tsconfig.json b/tsconfig.json index d7a86cd..61d124e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,8 +2,8 @@ "compilerOptions": { "esModuleInterop": true, "exactOptionalPropertyTypes": true, - "outDir": "dist", "target": "ES2021", + "noEmit": true, "module": "commonjs", "moduleResolution": "node", "lib": ["es6"],