Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esm and cjs #112

Merged
merged 2 commits into from
Sep 10, 2024
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
45 changes: 37 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,47 @@
on: pull_request
on:
- pull_request

jobs:
lint_and_test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- uses: actions/[email protected]
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
node-version: '20.11'
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install

- run: yarn
- run: yarn lint:check
- name: Run linter
run: pnpm lint:check

- run: yarn test
- name: Run unit tests
run: pnpm test

- run: yarn build
- name: Run build
run: pnpm build

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ You can simply add the `witnet-radon-js` package as a
dependency with npm:

```console
yarn add witnet-radon-js
pnpm add witnet-radon-js
```


Expand Down
15 changes: 10 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,25 @@
"name": "witnet-radon-js",
"version": "2.0.1",
"description": "",
"main": "dist/src/index.js",
"main": "dist/witnet-radon-js.cjs.js",
"module": "dist/witnet-radon-js.es.js",
"types": "dist/src/index.d.ts",
"type": "module",
"files": [
"dist/**/*"
],
"exports": {
".": "./dist/src/index.js"
".": {
"import": "./dist/witnet-radon-js.es.js",
"require": "./dist/witnet-radon-js.cjs.js"
}
},
"scripts": {
"build": "tsc -p tsconfig.build.json",
"build": "vite build",
"lint": "prettier --write '{src,test}/**/*.{t,j}s'",
"lint:check": "prettier --check '{src,test}/**/*.{t,j}s'",
"test": "vitest",
"prepare": "npm run build"
"prepare": "pnpm run build"
},
"keywords": [
"radon",
Expand All @@ -26,7 +30,8 @@
"license": "GPL-3.0",
"devDependencies": {
"typescript": "latest",
"vitest": "^2.0.5"
"vite": "^5.4.3",
"vitest": "^1.2.2"
},
"dependencies": {
"@types/node": "^20.11.10",
Expand Down
Loading