diff --git a/.autorc.json b/.autorc.json deleted file mode 100644 index a1a7f145c6..0000000000 --- a/.autorc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "plugins": [ - "npm", - "conventional-commits", - "first-time-contributor", - "released" - ], - "baseBranch": "stable", - "prereleaseBranches": ["next"] -} diff --git a/.github/workflows/first-interaction.yml b/.github/workflows/first-interaction.yml index 2ec579d277..7ad31fbc57 100644 --- a/.github/workflows/first-interaction.yml +++ b/.github/workflows/first-interaction.yml @@ -11,4 +11,4 @@ jobs: - uses: actions/first-interaction@v1 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - pr-message: 'Welcome to Vega. Since this is your first contribution, please make sure to read the [contributing guide](https://github.com/vega/vega-lite/blob/next/CONTRIBUTING.md).' + pr-message: 'Welcome to Vega. Since this is your first contribution, please make sure to read the [contributing guide](https://github.com/vega/vega-lite/blob/main/CONTRIBUTING.md).' diff --git a/.github/workflows/publish-to-npm.yml b/.github/workflows/publish-to-npm.yml deleted file mode 100644 index dad6b24aa6..0000000000 --- a/.github/workflows/publish-to-npm.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Publish to NPM - -on: - push: - branches-ignore: - # No canary deploys for branches opened by dependabot - - 'dependabot/**' - # documentation site should not trigger releases - - 'gh-pages' - paths-ignore: - - 'site/**' - -jobs: - publish: - runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')" - - name: Make a release and publish to NPM - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - uses: actions/setup-node@v3 - with: - registry-url: 'https://registry.npmjs.org' - cache: 'yarn' - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - - - name: Install Node dependencies - run: yarn --frozen-lockfile - - - name: Build - run: yarn build - - - name: Check NPM deployment - run: ./scripts/check-npm.sh - - - name: Create release - run: npm run shipit - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GH_PAT }} diff --git a/.prettierignore b/.prettierignore index 5c02ad7666..03d17ae2be 100644 --- a/.prettierignore +++ b/.prettierignore @@ -4,3 +4,4 @@ examples/specs/*.vl.json site/_includes/* site/examples/* site/_site/* +CHANGELOG.md diff --git a/.release-it.json b/.release-it.json new file mode 100644 index 0000000000..daeb91414d --- /dev/null +++ b/.release-it.json @@ -0,0 +1,16 @@ +{ + "git": { + "commitMessage": "chore: release v${version}" + }, + "github": { + "release": true + }, + "hooks": { + "after:bump": "yarn build" + }, + "plugins": { + "@release-it/conventional-changelog": { + "infile": "CHANGELOG.md" + } + } +} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f7f0c2f56f..1ce89e4e15 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,7 +42,7 @@ You can find [tasks with the "Good first issue" label in the issue tracker :pray The website is under `site/` and the documentation is under `site/docs/`. We use GitHub Pages to publish our documentation when we release a new version. To contribute changes to the documentation or website, simply submit a pull request that changes the corresponding markdown files in `site/`. -Since we only publish the GitHub Pages when we release a new version, it might be slightly outdated compared to `next`. For development, once you have [setup the repository](#repository-setup), you can run `yarn site` to serve the GitHub page locally at [http://localhost:4000/vega-lite/](http://localhost:4000/vega-lite/). +Since we only publish the GitHub Pages when we release a new version, it might be slightly outdated compared to `main`. For development, once you have [setup the repository](#repository-setup), you can run `yarn site` to serve the GitHub page locally at [http://localhost:4000/vega-lite/](http://localhost:4000/vega-lite/). Note that when you checkout different branches, the compiled JavaScript for the website might be reset. You might have to run `yarn build:site` to recompile the JavaScript so that interactive examples work. @@ -194,15 +194,9 @@ During development, it can be convenient to rebuild automatically or to run test `yarn site`. See details in [Documentation and Website](#documentation-and-website). -### Deployment +### Publishing -Publishing is handled by a 2-branch [pre-release process](https://intuit.github.io/auto/docs/generated/shipit#next-branch-default), configured in `publish-to-npm.yml`. All changes should be based off the default `next` branch, and are published automatically. - -- PRs made into the default branch are auto-deployed to the `next` pre-release tag on NPM. The result can be installed with `npm install vega-lite/@next`. - - When merging into `next`, please use the `squash and merge` strategy. -- To release a new stable version, open a PR from `next` into `stable` using this [compare link](https://github.com/vega/vega-lite/compare/stable...next). - - When merging from `next` into `stable`, please use the `create a merge commit` strategy. - - After the release note is generated (from commits), please take a look to clean up so the log is readable to the community. +To make a release, run `npm run release`. After the release notes are generated (from commits), please take a look to clean up so they are readable to the community. Triggered by the GitHub release, the CI will automatically deploy the website and update the schema repo. ## Suggested Programming Environment. diff --git a/README.md b/README.md index 6e3022dcef..3004e87b7a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Vega-Lite -[![npm version](https://img.shields.io/npm/v/vega-lite.svg)](https://www.npmjs.com/package/vega-lite) [![Build Status](https://github.com/vega/vega-lite/workflows/Test/badge.svg)](https://github.com/vega/vega-lite/actions) [![codecov](https://codecov.io/gh/vega/vega-lite/branch/next/graph/badge.svg)](https://codecov.io/gh/vega/vega-lite) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=rounded)](https://github.com/prettier/prettier) [![JSDevlivr](https://data.jsdelivr.com/v1/package/npm/vega-lite/badge?style=rounded)](https://www.jsdelivr.com/package/npm/vega-lite) +[![npm version](https://img.shields.io/npm/v/vega-lite.svg)](https://www.npmjs.com/package/vega-lite) [![Build Status](https://github.com/vega/vega-lite/workflows/Test/badge.svg)](https://github.com/vega/vega-lite/actions) [![codecov](https://codecov.io/gh/vega/vega-lite/branch/main/graph/badge.svg)](https://codecov.io/gh/vega/vega-lite) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=rounded)](https://github.com/prettier/prettier) [![JSDevlivr](https://data.jsdelivr.com/v1/package/npm/vega-lite/badge?style=rounded)](https://www.jsdelivr.com/package/npm/vega-lite) ![Teaser](site/static/teaser.png) diff --git a/package.json b/package.json index 8fa9a6c983..1bd9d68dbc 100644 --- a/package.json +++ b/package.json @@ -71,8 +71,7 @@ "watch:site": "yarn build:site -w", "watch:test": "yarn jest --watch test/", "watch:test:runtime": "NODE_OPTIONS=--experimental-vm-modules TZ=America/Los_Angeles npx jest --watch test-runtime/ --config test-runtime/jest-config.json", - "release": "yarn run prebuild && yarn build && yarn shipit", - "shipit": "auto shipit" + "release": "yarn release-it" }, "repository": { "type": "git", @@ -83,16 +82,16 @@ "url": "https://github.com/vega/vega-lite/issues" }, "devDependencies": { - "@auto-it/conventional-commits": "^10.37.6", - "@auto-it/first-time-contributor": "^10.37.6", "@babel/core": "^7.19.1", "@babel/preset-env": "^7.19.1", "@babel/preset-typescript": "^7.18.6", + "@release-it/conventional-changelog": "^5.1.1", "@rollup/plugin-alias": "^4.0.0", "@rollup/plugin-babel": "^6.0.0", "@rollup/plugin-commonjs": "^24.0.0", "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-node-resolve": "^15.0.1", + "@rollup/plugin-terser": "^0.4.0", "@types/chai": "^4.3.3", "@types/d3": "^7.4.0", "@types/jest": "^27.4.1", @@ -100,30 +99,29 @@ "@types/pako": "^2.0.0", "@typescript-eslint/eslint-plugin": "^5.38.0", "@typescript-eslint/parser": "^5.38.0", - "ajv": "^8.11.0", "ajv-formats": "^2.1.1", - "auto": "^10.37.6", + "ajv": "^8.11.0", "chai": "^4.3.6", "cheerio": "^1.0.0-rc.12", "conventional-changelog-cli": "^2.2.2", "d3": "^7.6.1", "del-cli": "^5.0.0", - "eslint": "^8.23.1", "eslint-config-prettier": "^8.5.0", "eslint-plugin-jest": "^27.0.4", "eslint-plugin-prettier": "^4.2.1", + "eslint": "^8.23.1", "gh-pages": "^5.0.0", "highlight.js": "^11.6.0", - "jest": "^27.5.1", "jest-dev-server": "^6.1.1", + "jest": "^27.5.1", "mkdirp": "^2.1.3", "pako": "^2.0.4", "prettier": "^2.7.1", "puppeteer": "^15.0.0", - "rollup": "^2.79.1", + "release-it": "^15.6.0", "rollup-plugin-bundle-size": "^1.0.3", "rollup-plugin-sourcemaps": "^0.6.3", - "rollup-plugin-terser": "^7.0.2", + "rollup": "^2.79.1", "serve": "^14.0.1", "terser": "^5.15.0", "ts-jest": "^29.0.1", diff --git a/rollup.config.js b/rollup.config.js index b56e8ea36a..31e003d2f1 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,10 +1,11 @@ +import alias from '@rollup/plugin-alias'; import babel from '@rollup/plugin-babel'; import commonjs from '@rollup/plugin-commonjs'; import json from '@rollup/plugin-json'; import resolve from '@rollup/plugin-node-resolve'; -import alias from '@rollup/plugin-alias'; +import terser from '@rollup/plugin-terser'; import bundleSize from 'rollup-plugin-bundle-size'; -import {terser} from 'rollup-plugin-terser'; + import pkg from './package.json'; export function disallowedImports() { diff --git a/scripts/check-and-commit-toc.sh b/scripts/check-and-commit-toc.sh index f853cb8a69..58b94441b0 100755 --- a/scripts/check-and-commit-toc.sh +++ b/scripts/check-and-commit-toc.sh @@ -5,7 +5,7 @@ set -euo pipefail GIT_BRANCH="${GITHUB_REF/refs\/heads\//}" # Only push on human pull request branches. Exclude release, prerelease, and bot branches. -if [ "$GIT_BRANCH" != "stable" ] && [ "$GIT_BRANCH" != "next" ] && [[ "$GIT_BRANCH" != dependabot/* ]]; then +if [ "$GIT_BRANCH" != "stable" ] && [ "$GIT_BRANCH" != "main" ] && [[ "$GIT_BRANCH" != dependabot/* ]]; then PUSH_BRANCH=true echo "Will try to push changes." else diff --git a/scripts/check-and-commit.sh b/scripts/check-and-commit.sh index 8f2e33b213..0b2fdb524f 100755 --- a/scripts/check-and-commit.sh +++ b/scripts/check-and-commit.sh @@ -5,7 +5,7 @@ set -euo pipefail GIT_BRANCH="${GITHUB_REF/refs\/heads\//}" # Only push on human pull request branches. Exclude release, prerelease, and bot branches. -if [ "$GIT_BRANCH" != "stable" ] && [ "$GIT_BRANCH" != "next" ] && [[ "$GIT_BRANCH" != dependabot/* ]]; then +if [ "$GIT_BRANCH" != "stable" ] && [ "$GIT_BRANCH" != "main" ] && [[ "$GIT_BRANCH" != dependabot/* ]]; then PUSH_BRANCH=true echo "Will try to push changes." else diff --git a/site/ecosystem.md b/site/ecosystem.md index bc36a4f06b..0081850a71 100644 --- a/site/ecosystem.md +++ b/site/ecosystem.md @@ -6,7 +6,7 @@ permalink: /ecosystem.html redirect_from: /applications.html --- -This is an incomplete list of integrations, applications, and extensions of the Vega-Lite language and compiler. If you want to add a tool or library, [edit this file and send us a pull request](https://github.com/vega/vega-lite/blob/next/site/ecosystem.md). +This is an incomplete list of integrations, applications, and extensions of the Vega-Lite language and compiler. If you want to add a tool or library, [edit this file and send us a pull request](https://github.com/vega/vega-lite/blob/main/site/ecosystem.md). We mark featured plugins and tools with a . diff --git a/site/rollup.config.js b/site/rollup.config.js index b57cb6f2ab..9c0a6d80cd 100644 --- a/site/rollup.config.js +++ b/site/rollup.config.js @@ -2,8 +2,8 @@ import babel from '@rollup/plugin-babel'; import commonjs from '@rollup/plugin-commonjs'; import json from '@rollup/plugin-json'; import nodeResolve from '@rollup/plugin-node-resolve'; +import terser from '@rollup/plugin-terser'; import bundleSize from 'rollup-plugin-bundle-size'; -import {terser} from 'rollup-plugin-terser'; const watch = process.env.ROLLUP_WATCH;