Skip to content

Commit

Permalink
build: qol improvements (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
EdieLemoine committed Feb 1, 2022
1 parent 819a60c commit 4480425
Show file tree
Hide file tree
Showing 34 changed files with 15,433 additions and 36,695 deletions.
28 changes: 28 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"root": true,
"extends": [
"@myparcel/eslint-config/preset-vue"
],
"rules": {
"jsdoc/no-undefined-types": [
"warn",
{
"definedTypes": [
"MyParcel",
"MyParcelDeliveryOptions",
"Wrapper",
"VNode",
"webpack"
]
}
]
},
"overrides": [
{
"extends": "@myparcel/eslint-config/preset-typescript",
"files": [
"**/*.ts"
]
}
]
}
23 changes: 0 additions & 23 deletions .eslintrc.js

This file was deleted.

9 changes: 4 additions & 5 deletions .github/workflows/live-api-test.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
name: Run test on the live API
name: 'Run test on the live API'

on:
schedule:
- cron: '0 12 * * *'

jobs:
test:
name: Run test on live API
name: 'Run test on live API'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
ref: 'main'
- uses: bahmutov/npm-install@v1
- name: Run jest
- uses: myparcelnl/actions/yarn-install@v1
- name: 'Run jest'
run: ./node_modules/.bin/cross-env npm test -- tests/unit/delivery-options/testLiveApi.spec.js --coverage=false
env:
NODE_ICU_DATA: node_modules/full-icu
31 changes: 16 additions & 15 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Build

on:
pull_request:
branches-ignore:
- main
paths-ignore:
- ./**/*.md
- screenshots/**/*
Expand All @@ -13,6 +15,7 @@ on:
paths:
- src/**/*
- public/**/*
- types/**/*
- .browserslistrc
- babel.config.js
- package-lock.json
Expand All @@ -22,60 +25,58 @@ on:

jobs:
test:
name: Run tests
name: 'Run tests'
if: contains(github.event.head_commit.message, '[skip ci]') == false

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- uses: myparcelnl/actions/npm-install@v1
- name: Run jest
run: ./node_modules/.bin/cross-env npm test
- uses: myparcelnl/actions/yarn-install@v1
- name: 'Run tests'
run: ./node_modules/.bin/cross-env yarn test:unit --coverage
env:
NODE_ICU_DATA: node_modules/full-icu

- name: Update coverage
- name: 'Upload code coverage'
uses: codecov/[email protected]

build:
name: Create build
name: 'Create build'
runs-on: ubuntu-latest
needs:
- test
steps:
- uses: actions/checkout@v2
- uses: myparcelnl/actions/npm-install@v1
- run: npm run build
- uses: myparcelnl/actions/yarn-install@v1
- run: yarn run build
- name: Upload build
uses: actions/upload-artifact@v1
with:
name: dist
path: dist/

release:
name: Publish
name: 'Publish'
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs:
- build
- test
steps:
- uses: actions/checkout@v2
- uses: myparcelnl/actions/npm-install@v1
- uses: myparcelnl/actions/yarn-install@v1
- name: Get build
uses: actions/download-artifact@v1
with:
name: dist

- name: Run semantic release
run: npx semantic-release
- name: 'Release'
run: 'npx semantic-release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{secrets.NPM_TOKEN}}

- name: Publish to Github Pages
- name: 'Publish updated sandbox'
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
BRANCH: gh-pages
Expand Down
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import 'types'
export * from './types/index';
27 changes: 1 addition & 26 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
module.exports = {
moduleFileExtensions: ['js', 'jsx', 'json', 'vue'],
testTimeout: 10000,
transform: {
'^.+\\.vue$': 'vue-jest',
'^.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub',
'^.+\\.js$': 'babel-jest',
},
preset: '@vue/cli-plugin-unit-jest',
transformIgnorePatterns: [
'node_modules/(?!('
+ 'babel-jest|'
+ 'bootstrap-vue|'
+ 'jest-vue-preprocessor|'
+ 'lodash-es'
+ ')/)',
],
Expand All @@ -20,25 +12,8 @@ module.exports = {
'^@Mocks/(.*)$': '<rootDir>/tests/__mocks__/$1',
'^!?raw-loader!(.*)': '<rootDir>/tests/__mocks__/raw-loader.js',
},
roots: [
'<rootDir>/tests',
],
snapshotSerializers: ['jest-serializer-vue'],
testMatch: [
'<rootDir>/tests/unit/**/*.spec.(js|jsx|ts|tsx)',
],
setupFilesAfterEnv: [
'@testing-library/jest-dom',
'<rootDir>/tests/jest-setup',
],
testURL: 'http://localhost/',
watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname',
],
collectCoverage: true,
collectCoverageFrom: [
'<rootDir>/src/**/*.{js,vue}',
],
coverageReporters: ['lcov', 'text-summary'],
};
Loading

0 comments on commit 4480425

Please sign in to comment.