Skip to content

Commit

Permalink
chore: Build multiple modules instead of one index.js (#7)
Browse files Browse the repository at this point in the history
* chore: Build multiple modules instead of one index.js

- refactor: Move build command to build.sh
  note: this will allow multiple module build entry files

- feat: Add indexify.js script, this will generate moduleName.js files
  note: this is because tsdx.config.js override do not generate js files

- feat: Add tsdx.config.js to generate multiple esm, cjs modules

- refactor: Move index file out from module folders
  refer jaredpalmer/tsdx#175 (comment)

Important note:
Base on the comment tsdx do not support multiple entry

* chore: Update size-limit checker for all modules

* doc: Update CHANGELOG.md and README.md

Co-authored-by: Wilson Lim <[email protected]>
  • Loading branch information
wilsonshakespeare and Wilson Lim authored Feb 11, 2021
1 parent 65e46f0 commit 32b7ed0
Show file tree
Hide file tree
Showing 14 changed files with 142 additions and 18,552 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
tsconfigRootDir: __dirname,
project: ['./tsconfig.lint.json'],
},
ignorePatterns: ['.eslintrc.js', 'scripts/*'],
ignorePatterns: ['.eslintrc.js', 'scripts/*', 'tsdx.config.js'],
rules: {
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'import/no-mutable-exports': 0,
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ https://seesparkbox.com/foundry/semantic_commit_messages

## [Unreleased]

## [0.2.3] - 2021-2-1
### Added:
- chore: Separate build modules instead of index.js

Hence the following is possible:
```javascript
// to import promise module
import promise from 'utilzed/dist/promise'

// the caveat will be having the need to use dist/
```
## [0.2.2] - 2021-2-1
### Fixed:
- fix: Fix `package.json` dependencies
Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,16 @@ npm install utilzed

```shell
# set specific version
npm install [email protected]
npm install [email protected]
```

### Important for pure ES6

```javascript
// If uses require function you will need to use .default
// For import in typescript or flow, this is not required

const utilzed = require('utilzed').default;
```

## Library Functions:
Expand Down
8 changes: 8 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
echo "build multiple modules"
tsdx build \
--entry=src/index.ts \
--entry=src/promise.ts \
--entry=src/validation.ts \
--entry=src/timeconvert.ts \
&& node ./scripts/flowgen.js \
&& node ./scripts/indexify.js \
Loading

0 comments on commit 32b7ed0

Please sign in to comment.