Skip to content

Commit

Permalink
Enrich package.json metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed May 19, 2020
1 parent 0041f2d commit 8c8b684
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# toml

Parses TOML documents and outputs JS object.
This package contains methods for parsing
[TOML](https://github.com/toml-lang/toml) documents and converting JS objects to
TOML.

## Usage

Expand Down Expand Up @@ -71,4 +73,5 @@ You need [NodeJS](https://nodejs.org) and

```console
$ npm run build
$ npm run test
```
5 changes: 3 additions & 2 deletions createMJS.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const fs = require("fs");

const pkgPackageConfigFile = "./pkg/package.json";
const pkg = require(pkgPackageConfigFile);
const { name } = require("./package.json");
const currentConfig = require("./package.json");

const { main } = pkg;
const esmMain = main.replace(".js", ".mjs");
Expand Down Expand Up @@ -45,7 +45,8 @@ fs.writeFileSync(
pkgPackageConfigFile,
JSON.stringify({
...pkg,
name,
...currentConfig,
private: undefined,
exports: { ".": { require: `./${main}`, import: `./${esmMain}` } },
})
);
13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
{
"name": "@aduh95/toml",
"description": "This package contains methods for parsing Tom's Obvious, Minimal Language (TOML) and converting values to TOML.",
"keywords": [
"toml",
"webassembly",
"wasm",
"wasm-bindgen"
],
"license": "MIT",
"private": true,
"homepage": "https://github.com/aduh95/toml.wasm",
"repository": {
"type": "git",
"url": "https://github.com/aduh95/toml.wasm.git"
},
"scripts": {
"build": "wasm-pack build --target nodejs && node ./createMJS.js",
"preversion": "echo 'Version number is set in Cargo.toml.' && exit 1",
"test": "cp -r tests pkg && node pkg/tests/cjs.js && node pkg/tests/esm.mjs"
}
}

0 comments on commit 8c8b684

Please sign in to comment.