Skip to content

Commit

Permalink
Refactor/esm (#1331)
Browse files Browse the repository at this point in the history
* esm

* ts2esm vodoo

* bump axios major version for esm support

* replace ts-node with tsx

* importing json files in esm

* refactor: yargs esm

* quickfix: downgrade axios to fix type problems with axios-mock-adapter

* fix import issues

* jest + esm

* replace global jest with import.meta.jest

- https://jestjs.io/docs/ecmascript-modules#differences-between-esm-and-commonjs

* install esbuild

* pkg+esbuild

* make it possible to run jest without npm run build

* manage to get ts-node to work

- when using tsx unable to get source-mapping to work

* fix npm run test-except-dind

* tweak tsconfig

* attempt to run npm coverage without building

* only way i manage to get npm run coverage to work

- was getting the exact same error as per jestjs/jest#15000

* resolve esbuild warning with direct eval

* fix `pkg` warnings

* docs: update docs

* Use @yao-pkg/pkg. Use bin/ instead of pkg/ folder

* Upgrade axios

* Reintroduce babel-jest

* Rename github action job to smoke-test

* Use node20 for pkg vm

* Fix user-agent

---------

Co-authored-by: Mads Jon Nielsen <[email protected]>
  • Loading branch information
ANGkeith and firecow authored Oct 10, 2024
1 parent 8266f03 commit 9de321c
Show file tree
Hide file tree
Showing 148 changed files with 1,293 additions and 868 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
with:
strict: true

pkg:
smoke-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -33,9 +33,9 @@ jobs:
path: ${{ env.PKG_CACHE_PATH }}
key: pkg-cache-${{ matrix.node-version }}
- run: npm ci
- run: npm run build
- run: npm run esbuild
- run: npm run pkg-linux
- run: node src/index.js --version
- run: node bin/index.cjs --version
- run: bin/linux/gitlab-ci-local --version
- run: bin/linux/gitlab-ci-local --help

Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
cache: 'npm'
- run: npm ci
- name: Run Tests
run: FORCE_COLOR=1 npx jest --coverage --testTimeout 90000 --verbose
run: npm run coverage
- uses: sonarsource/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ tsconfig.tsbuildinfo
.DS_Store

.vscode
pkg

/.gitlab-ci.yml
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,6 @@ You need nodejs 18+
# Install node_modules
npm install
# Compiled typescript to javascript
npm run build
# Run all tests
npm run test
Expand Down
Loading

0 comments on commit 9de321c

Please sign in to comment.