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

use vite #52

Merged
merged 17 commits into from
Dec 26, 2023
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
5 changes: 5 additions & 0 deletions .changeset/sharp-keys-glow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'pumpit': major
---

switch to vite build process
6 changes: 1 addition & 5 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
module.exports = {
root: true,
env: {
// commonjs: true,
es6: true,
node: true,
jest: true
node: true
},
globals: {
__DEV__: true,
Expand All @@ -20,8 +18,6 @@ module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:jest/recommended',
'plugin:jest/style',
'prettier'
],
parser: '@typescript-eslint/parser',
Expand Down
25 changes: 14 additions & 11 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: Test
concurrency:
group: tests-${{ github.ref || github.run_id }}
cancel-in-progress: true
on:
push:
branches:
- '*'
# push:
# branches:
# - '*'
pull_request:
branches:
- main
Expand All @@ -13,26 +16,26 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['16', '18']
node: ['18', '20', '21']
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Cache .pnpm-store
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
key: ${{ runner.os }}-node${{ matrix.node }}-${{ hashFiles('**/pnpm-lock.yaml') }}

- name: Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- name: Install dependencies
uses: pnpm/[email protected]
with:
version: 6.23.6
version: 8.12.1
run_install: true

- name: Lint source
Expand All @@ -45,7 +48,7 @@ jobs:

- name: Run tests
run: |
pnpm test:ci
pnpm test
env:
CI: true

Expand All @@ -57,7 +60,7 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}

- name: 'Consume changesets'
if: github.event_name == 'push' && github.repository == 'ivandotv/pumpit' && matrix.node == 16 && github.ref == 'refs/heads/main'
if: github.event_name == 'push' && github.repository == 'ivandotv/pumpit' && matrix.node == 18 && github.ref == 'refs/heads/main'
uses: changesets/action@v1
id: 'changesets'
with:
Expand Down
32 changes: 1 addition & 31 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,12 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Main",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/src/index.ts",
// "preLaunchTask": "npm: build:cjs",
"outFiles": ["${workspaceFolder}/dist/cjs/**/*.js"],
"smartStep": true,
"skipFiles": [
"${workspaceFolder}/node_modules/**/*.js",
"<node_internals>/**/*.js"
]
},
{
"name": "Current test file",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}",
"program": "${workspaceFolder}/node_modules/jest/bin/jest.js", //pnpm fix
"program": "${workspaceRoot}/node_modules/vitest/vitest.mjs",
"env": {
"JEST_DEBUG": "true"
},
Expand All @@ -33,29 +20,12 @@
"--runInBand"
],
"console": "integratedTerminal",
"protocol": "inspector",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"smartStep": true,
"skipFiles": [
"${workspaceFolder}/node_modules/**/*.js",
"<node_internals>/**/*.js"
]
},
{
"name": "Nodemon",
"type": "node",
"request": "attach",
"processId": "${command:PickProcess}",
"restart": true,
"protocol": "inspector",
"skipFiles": [
"${workspaceFolder}/node_modules/**/*.js",
"<node_internals>/**/*.js"
],
// "localRoot": "${workspaceFolder}/src/regexparam",
// "remoteRoot": "/",
"stopOnEntry": true
}
]
}
37 changes: 0 additions & 37 deletions jest.config.cjs

This file was deleted.

4 changes: 0 additions & 4 deletions jestSetup.ts

This file was deleted.

71 changes: 30 additions & 41 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,28 @@
"dependency injection container",
"inversion of control container"
],
"type": "module",
"private": false,
"author": "Ivan Vlatkovic",
"license": "MIT",
"type": "module",
"main": "./dist/prod/index.cjs",
"module": "./dist/prod/index.modern.js",
"umd:main": "./dist/prod/index.umd.js",
"exports": {
"require": "./dist/prod/index.cjs",
"default": "./dist/prod/index.modern.js"
},
"types": "./dist/types/index.d.ts",
"main": "./dist/pumpit.umd.cjs",
"files": [
"dist",
"src"
"dist"
],
"types": "./dist/index.d.ts",
"module": "./dist/my-lib.js",
"exports": {
"types": "./dist/index.d.ts",
"import": "./dist/pumpit.js",
"require": "./dist/pumpit.umd.cjs"
},
"scripts": {
"lint": "eslint --fix \"src/**/\"",
"lint:ci": "eslint \"src/**/\"",
"test": "jest --verbose --coverage",
"test:watch": "jest --watch",
"test:ci": "jest --runInBand --ci --coverage --coverageDirectory=coverage",
"build:prod": "cross-env NODE_ENV=production microbundle --tsconfig ./tsconfig.json --format modern,cjs --output dist/prod/index.js",
"build": "rm -rf ./dist && pnpm build:prod",
"gen:docs": "rm -rf ./docs/api && typedoc --options typedoc.cjs",
"test": "vitest run --coverage",
"test:watch": "vitest",
"build": "tsc && vite build",
"gen:docs": "rm -rf ./docs/api && typedoc --options typedoc.cjs --plugin typedoc-plugin-markdown",
"prepublishOnly": "pnpm build",
"prepare": "husky install",
"release": "pnpm run prepublishOnly && pnpm changeset publish"
Expand All @@ -48,33 +45,25 @@
},
"homepage": "https://github.com/ivandotv/pumpit#readme",
"devDependencies": {
"@babel/core": "^7.20.12",
"@babel/preset-env": "^7.20.2",
"@babel/preset-typescript": "^7.18.6",
"@changesets/cli": "^2.26.0",
"@types/jest": "^29.4.0",
"@types/node": "^18.11.18",
"@typescript-eslint/eslint-plugin": "^5.49.0",
"@typescript-eslint/parser": "^5.49.0",
"babel-plugin-dev-expression": "^0.2.3",
"babel-plugin-transform-define": "^2.1.0",
"cross-env": "^7.0.3",
"eslint": "^8.32.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-prettier": "^4.2.1",
"@changesets/cli": "^2.27.1",
"@typescript-eslint/eslint-plugin": "^6.15.0",
"@typescript-eslint/parser": "^6.15.0",
"@vitest/coverage-istanbul": "^1.1.0",
"@vitest/coverage-v8": "^1.1.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-tsdoc": "^0.2.17",
"husky": "^8.0.3",
"jest": "^29.4.1",
"jest-mock-console": "^2.0.0",
"jest-watch-typeahead": "^2.2.2",
"lint-staged": "^13.1.0",
"microbundle": "^0.15.1",
"prettier": "^2.8.3",
"lint-staged": "^15.2.0",
"prettier": "^3.1.1",
"shx": "^0.3.4",
"typedoc": "^0.25.0",
"typedoc-plugin-markdown": "^3.14.0",
"typescript": "^4.9.4"
"typedoc": "^0.25.4",
"typedoc-plugin-markdown": "^3.17.1",
"typescript": "^5.3.3",
"vite": "^5.0.10",
"vite-plugin-dts": "^3.6.4",
"vitest": "^1.1.0"
}
}
Loading