Skip to content

Commit

Permalink
Create version 1.0.1 for public release (#3)
Browse files Browse the repository at this point in the history
Context:

The initial 1.0.0 release revealed some problems in the build process:

- The `dist` directory included two copies of the source code; one
  directly inside `dist/` and the other in `dist/src`.
- The `dist` directory mistakenly included the `test` directory.
- When installed as a package, the code in `node_modules` could not be
  navigated using TypeScript-enabled editor features because there was
  no `tsconfig.json` in the root directory.

Changes:

The installed package is now structured as follows:

- `dist/`: Contains a compiled JavaScript version of the package's `src`
  directory, along with type definitions and mappings.
- `src/`: Contains the original TypeScript source code.
- `LICENSE.md`
- `package.json`
- `README.md`
- `tsconfig.build.json`: Included to help document the built package.
- `tsconfig.json`: Included so that editors can navigate the TypeScript
  source code, since most imports use path aliases.

This new structure solves the issues outlined in the Context section.
  • Loading branch information
lukearndt authored Sep 27, 2024
1 parent 0a0eac5 commit 9ab017a
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
dist/
node_modules/
2 changes: 0 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@
.prettierrc.js
jest.config.ts
test/
tsconfig.build.json
tsconfig.json
4 changes: 2 additions & 2 deletions package-lock.json

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

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@
"format-check": "prettier -c .",
"lint": "npm run eslint && npm run format",
"lint-check": "npm run eslint-check && npm run format-check",
"test": "jest"
"test": "jest",
"verify": "npm run lint-check && npm run test && npm run build"
},
"types": "dist/index.d.ts",
"version": "1.0.0"
"version": "1.0.1"
}
8 changes: 4 additions & 4 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"compilerOptions": {
"alwaysStrict": true,
"baseUrl": ".",
"rootDir": "./src",
"baseUrl": "./src",
"declaration": true,
"declarationMap": true,
"esModuleInterop": true,
"module": "commonjs",
"noErrorTruncation": true,
"outDir": "./dist",
"paths": {
"@": ["src/index"],
"@/*": ["src/*"]
"@": ["./index"],
"@/*": ["./*"]
},
"sourceMap": true,
"strict": true,
"target": "ES2019"
},
"exclude": ["node_modules", "test"],
"include": ["src"]
}
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@
"strict": true,
"target": "ES2019"
},
"exclude": ["node_modules"],
"include": ["src", "test"]
"exclude": ["dist", "node_modules"]
}

0 comments on commit 9ab017a

Please sign in to comment.