Skip to content

Commit

Permalink
revert build pipeline change
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti committed Sep 20, 2022
1 parent 66ef043 commit a90601a
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 65 deletions.
39 changes: 3 additions & 36 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,10 @@
{
"name": "fp-ts",
"version": "2.13.0-rc.4",
"version": "2.13.0-rc.5",
"description": "Functional programming in TypeScript",
"main": "./lib/index.js",
"module": "./es6/index.js",
"exports": {
".": {
"require": "./lib/index.js",
"import": "./es6/index.js",
"types": "./types/index.d.ts"
},
"./*": {
"require": "./lib/*.js",
"import": "./es6/*.js",
"types": "./types/*.d.ts"
},
"./es6/*": {
"import": "./es6/*.js",
"types": "./types/*.d.ts"
},
"./lib/*": {
"require": "./lib/*.js",
"types": "./types/*.d.ts"
}
},
"types": "index.d.ts",
"typesVersions": {
"*": {
"*": [
"./types/*"
],
"lib/*": [
"./types/*"
],
"es6/*": [
"./types/*"
]
}
},
"typings": "lib/index.d.ts",
"sideEffects": false,
"scripts": {
"lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\" \"scripts/**/*.ts\"",
Expand All @@ -48,7 +15,7 @@
"test": "npm run lint && npm run prettier && npm run dtslint && npm run jest-clear-cache && npm run jest && npm run docs",
"clean": "rimraf ./dist",
"prebuild": "npm run clean",
"build": "tsc -p ./tsconfig.build-lib.json && tsc -p ./tsconfig.build-es6.json && tsc -p ./tsconfig.build-types.json && ts-node scripts/build",
"build": "tsc -p ./tsconfig.build.json && tsc -p ./tsconfig.build-es6.json && ts-node scripts/build",
"postbuild": "prettier --loglevel=silent --write \"./dist/**/*.ts\"",
"prepublishOnly": "ts-node scripts/pre-publish",
"mocha": "mocha -r ts-node/register test/*.ts",
Expand Down
31 changes: 29 additions & 2 deletions scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function makePkgJson(module: string): TE.TaskEither<Error, string> {
{
main: `../lib/${module}.js`,
module: `../es6/${module}.js`,
types: `../types/${module}.d.ts`,
typings: module === 'HKT' ? `../HKT.d.ts` : `../lib/${module}.d.ts`,
sideEffects: false
},
null,
Expand All @@ -75,10 +75,37 @@ function makePkgJson(module: string): TE.TaskEither<Error, string> {
)
}

const fixHKT = (folder: string): Build<void> =>
pipe(
(C: FileSystem) => C.mkdir(path.join(OUTPUT_FOLDER, folder, 'HKT')),
RTE.chain(
() => (C) =>
C.writeFile(
path.join(OUTPUT_FOLDER, folder, 'HKT', 'package.json'),
JSON.stringify(
{
typings: '../../HKT.d.ts'
},
null,
2
)
)
),
RTE.chain(
() => (C) =>
C.moveFile(path.join(OUTPUT_FOLDER, folder, 'HKT.js'), path.join(OUTPUT_FOLDER, folder, 'HKT', 'index.js'))
),
RTE.chain(
() => (C) => C.moveFile(path.join(OUTPUT_FOLDER, folder, 'HKT.d.ts'), path.join(OUTPUT_FOLDER, 'HKT.d.ts'))
)
)

const main: Build<void> = pipe(
copyPackageJson,
RTE.chain(() => copyFiles),
RTE.chain(() => makeModules)
RTE.chain(() => makeModules),
RTE.chain(() => fixHKT('es6')),
RTE.chain(() => fixHKT('lib'))
)

run(
Expand Down
7 changes: 2 additions & 5 deletions tsconfig.build-es6.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{
"extends": "./tsconfig.json",
"extends": "./tsconfig.build.json",
"compilerOptions": {
"noEmit": false,
"outDir": "./dist/es6",
"target": "es5",
"module": "es6"
},
"include": ["./src"]
}
}
10 changes: 0 additions & 10 deletions tsconfig.build-lib.json

This file was deleted.

9 changes: 0 additions & 9 deletions tsconfig.build-types.json

This file was deleted.

7 changes: 7 additions & 0 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": false
},
"include": ["./src"]
}
9 changes: 6 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
{
"compilerOptions": {
"noEmit": true,
"outDir": "./dist/lib",
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"esModuleInterop": true,
"lib": [],
"sourceMap": false,
"declaration": false,
"declaration": true,
"strict": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"stripInternal": true,
"noUncheckedIndexedAccess": false
"stripInternal": true
},
"include": ["./src", "./test", "./scripts", "./perf", "./dtslint"]
}

0 comments on commit a90601a

Please sign in to comment.