Skip to content

Commit

Permalink
build: set up and document build and release scripts
Browse files Browse the repository at this point in the history
Since we have a build step now we must point the package.json file
reference to the dist folder and must explicitly list all files that we
want to be included in the npm tarball.

The initial idea was to prepare the contents of the final npm tarball
all in the dist directory (including a copy of the package.json) but
that turns out not to work particularly well with standard-version which
is used to manage the version numbers and changelog.

Unfortunately this change also required a small workaround to allow
local installation of the uuid module in the examples (see .local/).

Also instructions for relasing a new version have not yet been
documented which is finally done here.
  • Loading branch information
ctavan committed Jan 20, 2020
1 parent 7c7119e commit 3005b50
Show file tree
Hide file tree
Showing 15 changed files with 242 additions and 171 deletions.
9 changes: 9 additions & 0 deletions .local/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Local Fake Module for Testing

This is a local fake module for use in the [examples](../examples) and browser tests (that are
based on the examples) where we reference the `uuid` module with a local `file:` path in the
respective `package.json` files.

We must ensure that the local module does not contain locally installed dev dependencies in a
`node_modules` hence this "fake module" that just consists of symbolic links and imitates the final
contents of the npm tarball.
1 change: 1 addition & 0 deletions .local/dist
1 change: 1 addition & 0 deletions .local/package.json
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,5 +319,15 @@ Type `uuid --help` for usage details
npm test
```

## Releasing

Releases are supposed to be done from master, version bumping is automated through
[`standard-version`](https://github.com/conventional-changelog/standard-version):

```shell
npm run release -- --dry-run # verify output manually
npm run release # follow the instructions from the output of this command
```

----
Markdown generated from [README_js.md](README_js.md) by [![RunMD Logo](http://i.imgur.com/h0FVyzU.png)](https://github.com/broofa/runmd)
10 changes: 10 additions & 0 deletions README_js.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,3 +297,13 @@ Type `uuid --help` for usage details
```shell
npm test
```

## Releasing

Releases are supposed to be done from master, version bumping is automated through
[`standard-version`](https://github.com/conventional-changelog/standard-version):

```shell
npm run release -- --dry-run # verify output manually
npm run release # follow the instructions from the output of this command
```
2 changes: 1 addition & 1 deletion examples/browser-esmodules/package-lock.json

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

2 changes: 1 addition & 1 deletion examples/browser-esmodules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"start": "npm run build && npx http-server . -o"
},
"dependencies": {
"uuid": "file:../../dist"
"uuid": "file:../../.local"
}
}
26 changes: 13 additions & 13 deletions examples/browser-rollup/package-lock.json

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

2 changes: 1 addition & 1 deletion examples/browser-rollup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"start": "npm run build && npx http-server . -o"
},
"dependencies": {
"uuid": "file:../../dist"
"uuid": "file:../../.local"
},
"devDependencies": {
"rollup": "^1.24.0",
Expand Down

0 comments on commit 3005b50

Please sign in to comment.