Skip to content

Commit

Permalink
reduce bundle size (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-smart authored Dec 14, 2023
1 parent 2e6754c commit 390b631
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 60 deletions.
5 changes: 5 additions & 0 deletions .changeset/lazy-cameras-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/build-utils": patch
---

reduce bundle size
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"eslint.validate": ["markdown", "javascript", "typescript"],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"editor.quickSuggestions": {
"other": true,
Expand All @@ -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
Expand Down
89 changes: 49 additions & 40 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/FsUtils.ts
Original file line number Diff line number Diff line change
@@ -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*(_) {
Expand Down
5 changes: 4 additions & 1 deletion src/PackV1.ts
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
14 changes: 6 additions & 8 deletions src/PackV2.ts
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 3 additions & 1 deletion src/PackageContext.ts
Original file line number Diff line number Diff line change
@@ -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: {
Expand Down
10 changes: 7 additions & 3 deletions src/PrepareV1.ts
Original file line number Diff line number Diff line change
@@ -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/
Expand Down
6 changes: 4 additions & 2 deletions src/PrepareV2.ts
Original file line number Diff line number Diff line change
@@ -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"

Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"compilerOptions": {
"esModuleInterop": true,
"exactOptionalPropertyTypes": true,
"outDir": "dist",
"target": "ES2021",
"noEmit": true,
"module": "commonjs",
"moduleResolution": "node",
"lib": ["es6"],
Expand Down

0 comments on commit 390b631

Please sign in to comment.