diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 0000000..53c64bd --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,64 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: + push: + branches: [ master, beta ] + pull_request: + branches: [ master, beta ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [14.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v2 + with: + persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token + fetch-depth: 0 # otherwise, you will failed to push refs to dest repo + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + - name: Cache .pnpm-store + uses: actions/cache@v1 + with: + path: ~/.pnpm-store + key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }} + + - name: Install pnpm + run: curl -f https://get.pnpm.io/v6.js | node - add --global pnpm@6 + + - name: Install + run: pnpm install + + - name: Build + run: pnpm build + + - name: Demo + run: pnpm demo + + - name: Types + run: pnpm dts + + - name: API + run: pnpm typedoc + + - name: Commit files + run: | + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git commit -m "chore(gh-bot): :rocket: build demo, type, api & library files" -a + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.ref }} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 963b9ea..52f5307 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,13 +2,18 @@ language: node_js dist: xenial os: linux node_js: - - "16" + - "14" cache: npm: false directories: - "~/.pnpm-store" + before_install: - curl -f https://get.pnpm.io/v6.js | node - add --global pnpm@6 - pnpm config set store-dir ~/.pnpm-store + install: - pnpm install + +script: + - pnpm test && pnpm dts && pnpm build && pnpm demo diff --git a/gulpfile.js b/gulpfile.js index edcefe2..1e9f8e0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -105,7 +105,7 @@ task("js", async () => { import("pretty-bytes"), ]); - const esbuild = mode == "watch" ? createGulpEsbuild() : gulpEsBuild; // + const esbuild = mode == "watch" ? createGulpEsbuild() : gulpEsBuild; return stream(`${tsFolder}/*.ts`, { pipes: [ // Bundle Modules @@ -114,7 +114,7 @@ task("js", async () => { minify: true, sourcemap: true, format: "esm", - target: ["chrome71"], + target: ["es2018"], }), ], dest: jsFolder, // Output @@ -142,6 +142,9 @@ task("watch", async () => { extensions: ["html"], }, }, + + // I use Chrome canary for development + browser: "chrome", serveStatic: [ { route: "/lib", @@ -175,6 +178,7 @@ task("watch", async () => { `packages/manager/src/**/*.ts`, `packages/emitter/src/**/*.ts`, ], + { delay: 300 }, series("js") );