Skip to content

Commit

Permalink
LionWeb-io#9 build an NPM package. Tested in a Node project.
Browse files Browse the repository at this point in the history
  • Loading branch information
alessiostalla committed Mar 9, 2023
1 parent cd53082 commit 1fddb2a
Show file tree
Hide file tree
Showing 5 changed files with 217 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# IntelliJ IDEA:
/.idea
/lioncore-typescript.iml

/npm
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,34 @@ The following are considerations or concerns that bubbled up during implementati
* What happens during deserialization if things don't match the provided M2?
Just error out, or return `(model', issues*)`?

## Building an NPM Package

Run

```shell
deno run -A scripts/build_npm.ts x.y.z
```

where x.y.z is the version of the package we're building. This will create a package in the `npm` directory.

Then, we can build an archive with

```shell
pushd npm; npm pack; popd
```

We can use the compressed package as a dependency of local projects, for testing, with e.g.

```json
"dependencies": {
...
"lioncore": "file:///Users/alessio/projects/lioncore-typescript/npm/lioncore-0.2.0.tgz"
...
},
```

Or, we can publish the package to the NPM registry with

```shell
pushd npm; npm publish; popd
```
Loading

0 comments on commit 1fddb2a

Please sign in to comment.