Skip to content

Commit

Permalink
Merge pull request #67 from Diokuz/github-actions
Browse files Browse the repository at this point in the history
feat: zero deps - rollup
  • Loading branch information
Diokuz authored Nov 25, 2022
2 parents cfec2e4 + e3bf23b commit 336de6d
Show file tree
Hide file tree
Showing 11 changed files with 275 additions and 241 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: yarn install
run: yarn --frozen-lockfile
- name: build
run: npm run build
- name: run unit tests
run: yarn jest
- name: install playwright browsers
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ jobs:
registry-url: 'https://registry.npmjs.org'
- name: yarn install
run: yarn --frozen-lockfile
- run: yarn tsc
- name: build
run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ dist
.yarnrc
/test-results
/playwright-report
*.d.ts
/index.js
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ contributing.md
jest.config.js
tsconfig.json
.yarnrc
/src
/dist
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.PHONY: ts
ts:
rm -r dist || true
yarn tsc
npm run build

.PHONY: pretty-write
pretty-write:
Expand Down
3 changes: 1 addition & 2 deletions __tests__/generator.pw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import path from 'path'
import { expect, test as base } from '@playwright/test'
import rimraf from 'rimraf'
import sinon from 'sinon'
import { Teremock } from '../src'
import { parseUrl } from '../src/utils'
import { Teremock, parseUrl } from '../index'

import type { Request } from '../src/types'

Expand Down
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "teremock",
"version": "2.0.3",
"description": "File-based real mocks request mocker for playwright",
"main": "dist",
"repository": {
"type": "git",
"url": "git+https://github.com/Diokuz/teremock.git"
Expand All @@ -22,18 +21,21 @@
"url": "https://github.com/Diokuz/teremock/issues"
},
"homepage": "https://github.com/Diokuz/teremock#readme",
"dependencies": {
"scripts": {
"build": "yarn rollup --config ./rollup.config.mjs",
"test": "yarn jest && yarn playwright test"
},
"devDependencies": {
"ci-info": "^3.7.0",
"debug": "^4.3.4",
"lodash.ismatch": "^4.4.0",
"make-dir": "^3.1.0",
"query-string": "^7.1.1",
"signale": "^1.4.0",
"sprout-data": "^1.3.0",
"tslib": "^2.4.1"
},
"devDependencies": {
"tslib": "^2.4.1",
"@playwright/test": "^1.28.1",
"@rollup/plugin-typescript": "^9.0.2",
"@types/debug": "^4.1.7",
"@types/express": "^4.17.14",
"@types/jest": "^29.2.3",
Expand All @@ -48,6 +50,7 @@
"jest": "^29.3.1",
"prettier": "2.8.0",
"rimraf": "^3.0.2",
"rollup": "^3.4.0",
"sinon": "^14.0.2",
"ts-jest": "^29.0.3",
"typescript": "^4.9.3",
Expand Down
10 changes: 10 additions & 0 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import typescript from '@rollup/plugin-typescript';

export default {
input: 'src/index.ts',
output: {
file: 'index.js',
format: 'cjs'
},
plugins: [typescript()]
};
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ export { Teremock, PlaywrightDriver }
export default teremock

export * from './types'
export * from './utils'
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"outDir": "./dist",
"rootDir": "src",
"moduleResolution": "node",
"module": "CommonJS",
"module": "ES2020",
"noUnusedLocals": true,
"noUnusedParameters": true,
"sourceMap": false,
Expand Down
Loading

0 comments on commit 336de6d

Please sign in to comment.