Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit e752d24

Browse files
authored
add missing dtslint.json (#4)
1 parent 3b7bd3e commit e752d24

File tree

4 files changed

+35
-251
lines changed

4 files changed

+35
-251
lines changed

.changeset/slimy-cougars-stare.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@effect/dtslint": patch
3+
---
4+
5+
add missing dtslint.json

dist/index.js

Lines changed: 0 additions & 193 deletions
This file was deleted.

dist/package.json

Lines changed: 0 additions & 26 deletions
This file was deleted.

scripts/copy-package-json.ts

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,38 @@
1-
import { Effect, pipe, ReadonlyRecord } from "effect"
1+
import { Console, Effect, identity } from "effect"
22
import * as path from "node:path"
33
import * as FileSystem from "./FileSystem"
44

5-
const excludeEffectPackages = (deps: Record<string, string>): Record<string, string> => {
6-
return ReadonlyRecord.filter(deps, (_, k) => !k.startsWith("@effect"))
7-
}
5+
const moveJson = (from: string, to: string, modify: (json: any) => any) =>
6+
Console.log(`moving ${from} to ${to}`).pipe(
7+
Effect.flatMap(() => FileSystem.readJsonFile(from)),
8+
Effect.map(modify),
9+
Effect.flatMap((json) => FileSystem.writeFile(to, JSON.stringify(json, null, 2)))
10+
)
811

9-
const read = pipe(
10-
FileSystem.readJsonFile("package.json"),
11-
Effect.map((json: any) => ({
12-
name: json.name,
13-
version: json.version,
14-
description: json.description,
15-
main: "index.js",
16-
bin: "index.js",
17-
engines: json.engines,
18-
dependencies: excludeEffectPackages(json.dependencies),
19-
peerDependencies: excludeEffectPackages(json.peerDependencies),
20-
repository: json.repository,
21-
author: json.author,
22-
license: json.license,
23-
bugs: json.bugs,
24-
homepage: json.homepage,
25-
tags: json.tags,
26-
keywords: json.keywords
27-
}))
28-
)
29-
30-
const pathTo = path.join("dist", "package.json")
12+
const packageJson = moveJson("package.json", path.join("dist", "package.json"), (json: any) => ({
13+
name: json.name,
14+
version: json.version,
15+
description: json.description,
16+
main: "index.js",
17+
bin: "index.js",
18+
engines: json.engines,
19+
dependencies: json.dependencies,
20+
peerDependencies: json.peerDependencies,
21+
repository: json.repository,
22+
author: json.author,
23+
license: json.license,
24+
bugs: json.bugs,
25+
homepage: json.homepage,
26+
tags: json.tags,
27+
keywords: json.keywords
28+
}))
3129

32-
const write = (pkg: object) => FileSystem.writeFile(pathTo, JSON.stringify(pkg, null, 2))
33-
34-
const program = pipe(
35-
Effect.sync(() => console.log(`copying package.json to ${pathTo}...`)),
36-
Effect.flatMap(() => read),
37-
Effect.flatMap(write)
30+
const dtslintJson = moveJson(
31+
path.join("src", "dtslint.json"),
32+
path.join("dist", "dtslint.json"),
33+
identity
3834
)
3935

36+
const program = packageJson.pipe(Effect.flatMap(() => dtslintJson))
37+
4038
Effect.runPromise(program)

0 commit comments

Comments
 (0)