Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,9 @@ jobs:
shell: bash

- name: Check artifact list
run: node ./scripts/npmPack.js
run: |
node ./scripts/updateArtifactList.js
git diff --exit-code packages/artifacts.json

- name: Publish packages to pkg.pr.new
run: |
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ make artifacts
- OCaml Code: snake case format is used, e.g, `to_string`
- ReScript Code: the camel case format is used, e.g `toString`

## Adding new Files to the Npm Package
## Adding new Files to the Npm Packages

To make sure that no files are added to or removed from the npm package inadvertently, an artifact list is kept at `packages/artifacts.txt`. During CI build, it is verified that only the files that are listed there are actually included in the npm package.
To make sure that no files are added to or removed from the `rescript` or `@rescript/runtime` npm package inadvertently, an artifact list is kept at `packages/artifacts.json`. During CI build, it is verified that only the files that are listed there are actually included in the npm packages.

After adding a new file to the repository that should go into the npm package - e.g., a new stdlib module -, run `make artifacts`.
After adding a new file to the repository that should go into one of the npm packages - e.g., a new stdlib module -, run `make artifacts`.

## Test the compiler

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ lib:
yarn workspace @rescript/runtime build

artifacts: lib
./scripts/npmPack.js --updateArtifactList
./scripts/updateArtifactList.js

# Builds the core playground bundle (without the relevant cmijs files for the runtime)
playground:
Expand Down
4 changes: 2 additions & 2 deletions lib_dev/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ export const compilerVersionFile = path.resolve(
);

/**
* path: `<projectDir>/packages/artifacts.txt`
* path: `<projectDir>/packages/artifacts.json`
*/
export const artifactListFile = path.resolve(
projectDir,
"packages",
"artifacts.txt",
"artifacts.json",
);

/**
Expand Down
5 changes: 5 additions & 0 deletions packages/@rescript/runtime/lib/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bs/
*.ast
*.iast
rescript.lock
.compiler.log
4 changes: 1 addition & 3 deletions packages/@rescript/runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
"access": "public"
},
"files": [
"lib/es6",
"lib/js",
"lib/ocaml"
"lib"
],
"exports": {
"./lib/es6/*": "./lib/es6/*",
Expand Down
Loading
Loading