chore: move to github actions and changeset

This commit is contained in:
Thomas Allmer
2020-10-24 18:31:47 +02:00
parent 6343304456
commit 1ed49ff7ac
189 changed files with 952 additions and 2717 deletions

10
.changeset/config.json Normal file
View File

@@ -0,0 +1,10 @@
{
"$schema": "https://unpkg.com/@changesets/config@1.1.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"linked": [],
"ignore": [],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch"
}

View File

@@ -1,102 +0,0 @@
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2.1
# orbs:
# windows: circleci/windows@2.4.0
defaults: &defaults
working_directory: ~/repo
docker:
- image: circleci/node:14-browsers
jobs:
build:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- v4-dependencies-{{ checksum "yarn.lock" }}
- run: yarn install --frozen-lockfile
- save_cache:
paths:
- node_modules
key: v4-dependencies-{{ checksum "yarn.lock" }}
- run: npm run build
- run: npm run build:types
- persist_to_workspace:
root: ~/
paths:
- repo/node_modules
- repo/packages/*
test-local:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- v4-dependencies-{{ checksum "yarn.lock" }}
- attach_workspace:
at: ~/
- run: npm run lint
- run: npm run test:node
- run: npm run test:browser
# test-bs:
# <<: *defaults
# steps:
# - checkout
# - restore_cache:
# keys:
# - v4-dependencies-{{ checksum "yarn.lock" }}
# - attach_workspace:
# at: ~/
# - run: npm run test:bs
# test-windows:
# executor: windows/default
# steps:
# - checkout
# - attach_workspace:
# at: ~/
# # reinstall dependencies, cannot use cached dependencies from a linux VM
# - run: yarn install --frozen-lockfile
# - run: npm run test:node-windows
deploy:
<<: *defaults
steps:
# will add github as known host
- checkout
- attach_workspace:
at: ~/
- add_ssh_keys:
fingerprints:
- '3f:ea:54:b7:77:13:b6:cf:29:90:2b:19:bb:eb:b5:f1'
- run:
name: Authenticate with registry
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run: git config --global user.email circleci@circleci
- run: git config --global user.name CircleCI
- run:
name: Publish package
command: "./node_modules/.bin/lerna publish --message 'chore: release new versions' --yes"
workflows:
version: 2
test-deploy:
jobs:
- build
- test-local:
requires:
- build
# - test-bs:
# requires:
# - build
- deploy:
requires:
- test-local
# - test-bs
filters:
branches:
only: master

View File

@@ -3,11 +3,6 @@ coverage/
dist
tsc-dist
stats.html
/packages/create/src/generators/*/templates/**/*
/packages/import-maps-generate/test/assets/**/node_modules
/packages/**/test/**/snapshots
/packages/es-dev-server/test/fixtures/**/*
/packages/karma-esm/src/esm-debug.html
/packages/karma-esm/src/esm-context.html
/packages/**/test-node/**/snapshots
/packages/demoing-storybook/storybook-static/**/*
/packages/**/demo/**/*

View File

@@ -1,9 +1,14 @@
module.exports = {
extends: ['./packages/eslint-config/index.js', require.resolve('eslint-config-prettier')],
rules: {
'lit/no-useless-template-literals': 'off',
},
overrides: [
{
files: ['**/test/**/*.js', '**/*.config.js'],
files: ['**/test-node/**/*.js', '**/test-web/**/*.js', '**/*.config.js'],
rules: {
'lit/no-invalid-html': 'off',
'lit/binding-positions': 'off',
'no-console': 'off',
'no-unused-expressions': 'off',
'class-methods-use-this': 'off',

53
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,53 @@
name: Release
on:
push:
branches:
- master
jobs:
release:
# Prevents changesets action from creating a PR on forks
if: github.repository == 'open-wc/open-wc'
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- name: Setup Node.js 12.x
uses: actions/setup-node@master
with:
node-version: 12.x
registry-url: 'https://registry.npmjs.org'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
run: yarn --frozen-lockfile
- name: Build types
run: yarn build:types
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@master
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

93
.github/workflows/verify-node.yml vendored Normal file
View File

@@ -0,0 +1,93 @@
name: Verify changes
on: pull_request
jobs:
verify:
name: Verify changes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Lint
run: yarn lint
web-tests:
name: Web tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn --frozen-lockfile
- uses: microsoft/playwright-github-action@v1
- name: Test
run: yarn test:web
node-tests:
name: Node tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x]
steps:
- uses: actions/checkout@v2
- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Test
run: yarn test:node

View File

@@ -5,11 +5,7 @@ dist
tsc-dist
stats.html
packages/semantic-dom-diff/bundle/get-diffable-html.js
packages/**/test/**/snapshots
/packages/es-dev-server/test/fixtures/**/*
/packages/es-dev-server/demo/**/*
/packages/karma-esm/src/esm-debug.html
/packages/karma-esm/src/esm-context.html
packages/**/test-node/**/snapshots
/packages/demoing-storybook/storybook-static/**/*
/packages/rollup-plugin-input-html/test/fixtures/**/*
/packages/rollup-plugin-html/dist/**/*

View File

@@ -1,3 +0,0 @@
module.exports = {
extends: ['@commitlint/config-conventional', '@commitlint/config-lerna-scopes'],
};

View File

@@ -1,6 +1,5 @@
module.exports = {
hooks: {
'pre-commit': 'lint-staged',
'commit-msg': 'commitlint -E HUSKY_GIT_PARAMS',
},
};

View File

@@ -1,12 +0,0 @@
{
"packages": ["packages/*"],
"ignoreChanges": ["packages/*/test/**", "**/*.md", "**/*.mdx"],
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": true,
"command": {
"publish": {
"conventionalCommits": true
}
}
}

View File

@@ -3,7 +3,6 @@
"private": true,
"license": "MIT",
"scripts": {
"build": "lerna run build",
"build:types": "tsc -p tsconfig.build.types.json",
"codelabs:build": "node ./packages/codelabs/build-codelabs.js",
"docs:build": "rimraf _site && node cli-build.js",
@@ -17,14 +16,15 @@
"lint:prettier": "prettier \"**/*.{js,md}\" \"**/package.json\" --check",
"lint:types": "tsc",
"lint:versions": "node ./scripts/lint-versions.js",
"postinstall": "npm run build && patch-package",
"publish": "lerna publish --message 'chore: release new versions'",
"site:build": "npm run docs:build && lerna run site:build",
"postinstall": "patch-package",
"release": "changeset publish && yarn format",
"site:build": "npm run docs:build && node scripts/workspaces-scripts-bin.mjs site:build",
"site:start": "npm run docs:start",
"start": "npm run docs:start",
"test": "yarn test:browser && yarn test:node",
"test:browser": "web-test-runner",
"test:node": "lerna run test:node --stream",
"test": "yarn test:web && yarn test:node",
"test:node": "mocha \"packages/*/test-node/**/*.test.{ts,js,mjs,cjs}\" --exit --retries 3",
"test:node:watch": "mocha \"packages/*/test-node/**/*.test.{ts,js,mjs,cjs}\" --watch",
"test:web": "web-test-runner",
"update-dependency": "node scripts/update-dependency.js"
},
"dependencies": {
@@ -33,9 +33,7 @@
"devDependencies": {
"@11ty/eleventy": "^0.11.0",
"@11ty/eleventy-plugin-syntaxhighlight": "^3.0.1",
"@commitlint/cli": "7.2.1",
"@commitlint/config-conventional": "7.1.2",
"@commitlint/config-lerna-scopes": "7.2.1",
"@changesets/cli": "^2.11.1",
"@github/clipboard-copy-element": "^1.1.1",
"@types/aria-query": "^4.2.0",
"@types/chai": "^4.2.11",
@@ -47,6 +45,7 @@
"@web/test-runner-playwright": "^0.6.4",
"babel-eslint": "^10.0.3",
"chai": "^4.2.0",
"concurrently": "^5.2.0",
"core-js": "2.6.10",
"eslint": "^7.6.0",
"eslint-config-airbnb-base": "^14.0.0",
@@ -57,7 +56,6 @@
"eslint-plugin-wc": "^1.2.0",
"fs-extra": "^8.1.0",
"husky": "3.0.0",
"lerna": "3.4.3",
"lint-staged": "^10.0.0",
"lit-element": "^2.2.1",
"mocha": "^6.2.2",
@@ -79,12 +77,10 @@
"lint-staged": {
"*.js": [
"eslint --fix",
"prettier --write",
"git add"
"prettier --write"
],
"*.md": [
"prettier --write",
"git add"
"prettier --write"
]
},
"workspaces": [

View File

@@ -1,12 +1,14 @@
const merge = require('deepmerge');
const path = require('path');
const { createSpaConfig } = require('../../index.js');
const baseConfig = createSpaConfig({
developmentMode: false,
injectServiceWorker: true,
legacyBuild: true,
outputDir: path.join(__dirname, '..', '..', 'dist'),
});
module.exports = merge(baseConfig, {
input: 'demo/js/index.html',
input: require.resolve('./index.html'),
});

View File

@@ -1,11 +1,13 @@
const merge = require('deepmerge');
const path = require('path');
const { createSpaConfig } = require('../../index.js');
const baseConfig = createSpaConfig({
developmentMode: false,
injectServiceWorker: true,
outputDir: path.join(__dirname, '..', '..', 'dist'),
});
module.exports = merge(baseConfig, {
input: 'demo/js/index.html',
input: require.resolve('./index.html'),
});

View File

@@ -1,10 +1,12 @@
const merge = require('deepmerge');
const path = require('path');
const { createMpaConfig } = require('../../index.js');
const baseConfig = createMpaConfig({
developmentMode: true,
injectServiceWorker: true,
rootDir: 'demo/mpa',
rootDir: __dirname,
outputDir: path.join(__dirname, '..', '..', 'dist'),
});
module.exports = merge(baseConfig, {

View File

@@ -37,7 +37,7 @@
"start:ts": "npm run build:ts && npm run start:build",
"start:watch": "npm run build:spa-nomodule -- --watch & npm run start:build",
"test": "npm run test:node",
"test:node": "mocha test/**/*.test.js test/*.test.js"
"test:node": "mocha test-node"
},
"files": [
"*.js",

View File

@@ -37,7 +37,7 @@ describe('integration tests', () => {
['js/rollup.spa.config.js', 'js/rollup.spa-nomodule.config.js'].forEach(testCase => {
describe(`testcase ${testCase}`, function describe() {
this.timeout(10000);
this.timeout(20000);
let page;
before(async () => {

View File

@@ -36,7 +36,7 @@ describe('integration tests', () => {
});
describe(`Mpa Config`, function describe() {
this.timeout(10000);
this.timeout(20000);
let page;
before(async () => {

View File

@@ -15,7 +15,7 @@
"homepage": "https://github.com/open-wc/open-wc/tree/master/packages/building-utils",
"scripts": {
"test": "npm run test:node",
"test:node": "mocha test/**/*.test.js test/*.test.js",
"test:node": "mocha test-node",
"test:update-snapshots": "mocha test/**/*.test.js test/*.test.js --update-snapshots"
},
"files": [

View File

@@ -26,7 +26,7 @@
"storybook": "node src/start/cli.js -c demo/.storybook --root-dir ../../",
"storybook:build": "node src/build/cli.js -c demo/.storybook",
"storybook:build:start": "npm run storybook:build && es-dev-server --root-dir storybook-static --open",
"test": "mocha test/**/*.test.js test/*.test.js",
"test": "mocha test-node",
"test:watch": "mocha test/**/*.test.js test/*.test.js --watch"
},
"files": [

View File

@@ -20,8 +20,8 @@
"start:script": "node ../es-dev-server/dist/cli.js -c demo/script/server.js --root-dir ../../",
"start:stories": "node ../es-dev-server/dist/cli.js -c demo/stories/server.js --root-dir ../../",
"test": "npm run test:node",
"test:node": "mocha",
"test:watch": "mocha --watch"
"test:node": "mocha test-node",
"test:watch": "mocha test-node --watch"
},
"files": [
"*.d.ts",

Some files were not shown because too many files have changed in this diff Show More