Skip to content

Commit

Permalink
feat(*): upgrade kongponents for vue 3 [KHCP-3330]
Browse files Browse the repository at this point in the history
Upgrade Kongponents for Vue 3 and a singular npm distribution under a new package name.

BREAKING CHANGE: Upgrade Kongponents to v7.x for Vue v3.x usage. If your project still uses Vue 2.x
please use Kongponents v6.x at https://legacy.kongponents.konghq.com
  • Loading branch information
adamdehaven committed Apr 9, 2022
1 parent 66898fe commit 3a29e2a
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

### Vue 3 Upgrade

We are currently in the process of upgrading Kongponents to Vue 3. Any changes on the `next` branch should ensure that:
We are currently in the process of upgrading Kongponents to Vue 3. Any changes on the `beta` branch should ensure that:

* The component, component tests, and docs have been updated for Vue 3 and the Composition API.
* The test file(s) should be migrated from `vue-test-utils` and should utilize [Cypress Component Testing](https://docs.cypress.io/guides/component-testing/introduction).
Expand Down
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ updates:
directory: /
schedule:
interval: daily
target-branch: "next"
target-branch: 'beta'
commit-message:
# Prefix commit messages with "fix" (to trigger a release from semantic-versioning)
prefix: fix
Expand All @@ -24,4 +24,4 @@ updates:
directory: /
schedule:
interval: daily
target-branch: "next"
target-branch: 'beta'
18 changes: 9 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ name: Publish

on:
push:
branches: [main]
branches: [beta]

jobs:
run-tests:
name: Tests
# Update `@next` branch to `@beta`
uses: Kong/kongponents/.github/workflows/test.yml@next
# Update `@beta` branch to `@main` once 6.x branch is created
uses: Kong/kongponents/.github/workflows/test.yml@beta
# Must pass in secrets here so that the calling workflow can pass in the NPM_TOKEN needed to install private packages.
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}

publish:
needs: run-tests
Expand Down Expand Up @@ -49,8 +49,8 @@ jobs:
- name: Build
run: yarn build

# - name: Semantic Release
# uses: cycjimmy/semantic-release-action@v2
# env:
# # if branch protections are on (Pushing commits) you need to use ${{ secrets.KONGPONENTS_BOT_PAT }} instead
# GITHUB_TOKEN: ${{ secrets.KONGPONENTS_BOT_PAT }}
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
env:
# Since branch protections are on (pushing commits) you need to use a bot PAT
GITHUB_TOKEN: ${{ secrets.KONGPONENTS_BOT_PAT }}
17 changes: 11 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Already updated for `next` branch

name: Tests

on:
pull_request:
branches: [next]
branches: [beta]
# Allow workflow to be called by another workflow
workflow_call:
# Allow workflow to be called manually
# Must define secrets here so that the calling workflow can pass in the NPM_TOKEN needed to install private packages.
secrets:
PERCY_TOKEN:
description: 'The PERCY_TOKEN passed from the caller workflow as it is not available within workflow_call.'
required: true
workflow_dispatch:

jobs:
Expand All @@ -29,6 +31,9 @@ jobs:
- name: Lint
run: yarn lint

- name: Check Types
run: yarn typecheck

- name: Run Cypress component tests
uses: cypress-io/github-action@v2
with:
Expand All @@ -49,11 +54,11 @@ jobs:
name: cypress-videos
path: cypress/videos/

# Percy - disabled on `next` branch for now
# Percy - disabled on `beta` branch for now
# - name: Build docs for Percy
# run: yarn build

# Percy - disabled on `next` branch for now
# Percy - disabled on `beta` branch for now
# - name: Percy visual regression test for docs
# run: |
# npx percy snapshot docs/.vuepress/dist/ --ignore-files "**/404.html"
Expand Down
2 changes: 1 addition & 1 deletion TEMP-MIGRATION-CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Vue 3 Changelog

This file is a temporary list of changes that will be referenced to create a Migration page on the docs site for users migrating from the Vue 2 version to the new version of Kongponents (on the `next` branch) that utilizes Vue 3 and the Composition API.
This file is a temporary list of changes that will be referenced to create a Migration page on the docs site for users migrating from the Vue 2 version to the new version of Kongponents (on the `beta` branch) that utilizes Vue 3 and the Composition API.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion docs/.vuepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default defineUserConfig<DefaultThemeOptions, ViteBundlerOptions>({

docsDir: 'docs',

docsBranch: 'next',
docsBranch: 'beta',

editLink: false,

Expand Down
8 changes: 4 additions & 4 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Settings in the [build] context are global and are applied to all contexts
# unless otherwise overridden by more specific contexts.
#
# Defaulting to the same settings as the `next` branch
# Defaulting to the settings for the `beta` branch
[build]
base = "/"
command = "yarn docs:build"
publish = "docs/.vuepress/dist"
environment = { NODE_VERSION = "16.14.0", YARN_FLAGS="--frozen-lockfile --ignore-optional" }

# ##############################
# 'next' branch
# 'beta' branch
# ##############################

# 'next' branch context
[context.next]
# 'beta' branch context
[context.beta]
base = "/"
command = "yarn docs:build"
publish = "docs/.vuepress/dist"
Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@
},
"release": {
"branches": [
"next"
"main",
{
"name": "beta",
"prerelease": true
}
],
"plugins": [
"@semantic-release/commit-analyzer",
Expand All @@ -132,8 +136,7 @@
],
"@semantic-release/npm",
"@semantic-release/github"
],
"dryRun": true
]
},
"volta": {
"node": "16.14.0",
Expand Down

0 comments on commit 3a29e2a

Please sign in to comment.