Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/release-migrate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: 'Release @ionic/migrate'

on:
workflow_call:
inputs:
tag:
description: 'Which npm tag should this be published to?'
required: true
type: string

permissions:
contents: read
id-token: write

jobs:
release-migrate:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/migrate
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: 🟢 Configure Node for Publish
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24.x
registry-url: 'https://registry.npmjs.org'
scope: '@ionic'
cache: 'npm'
cache-dependency-path: packages/migrate/package-lock.json
- name: 📦 Install latest npm
run: npm install -g npm@latest
shell: bash
- name: 🕸️ Install Dependencies
run: npm ci
shell: bash
- name: 🔎 Resolve Version
id: resolve-version
run: |
set -euo pipefail
version="$(node -p "require('./package.json').version")"
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "Releasing @ionic/migrate@$version to the '${{ inputs.tag }}' tag"
shell: bash
- name: 🚧 Ensure Version Is Unpublished
run: |
set -euo pipefail
version="${{ steps.resolve-version.outputs.version }}"
# `npm view` exits non-zero both for an unpublished version and for a
# package that does not exist yet, and the latter is the expected state
# on the very first release. So inspect stdout rather than the exit
# code: empty output means the version is free to publish.
if [ -n "$(npm view "@ionic/migrate@$version" version 2>/dev/null || true)" ]; then
echo "::error::@ionic/migrate@$version is already published. Bump the version in packages/migrate/package.json."
exit 1
fi
shell: bash
- name: 🔍 Lint
run: npm run lint
shell: bash
- name: 🧪 Test
run: npm test
shell: bash
- name: 🏗️ Run Build
run: npm run build
shell: bash
# `--access public` is not passed here because publishConfig.access in
# package.json already sets it; a scoped package would otherwise default to
# restricted on its first publish.
- name: 🚀 Publish to NPM
run: npm publish --tag ${{ inputs.tag }} --provenance
shell: bash
13 changes: 12 additions & 1 deletion .github/workflows/release-orchestrator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:
options:
- dev
- production
- migrate
version:
description: 'Which version should be published? (Only for production releases)'
required: false
Expand All @@ -28,7 +29,7 @@ on:
- premajor
- prerelease
tag:
description: 'Which npm tag should this be published to? (Only for production releases)'
description: 'Which npm tag should this be published to? (Only for production and migrate releases)'
required: false
type: choice
default: latest
Expand Down Expand Up @@ -68,6 +69,16 @@ jobs:
uses: ./.github/workflows/dev-build.yml
secrets: inherit

run-migrate:
if: ${{ github.event_name == 'workflow_dispatch' && inputs.release-type == 'migrate' }}
permissions:
contents: read
id-token: write
uses: ./.github/workflows/release-migrate.yml
secrets: inherit
with:
tag: ${{ inputs.tag }}

run-production:
if: ${{ github.event_name == 'workflow_dispatch' && inputs.release-type == 'production' }}
permissions:
Expand Down
11 changes: 9 additions & 2 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{
"//": "packages/migrate is deliberately omitted: @ionic/migrate is versioned independently of the framework and is published by .github/workflows/release-migrate.yml, so `lerna version` must not rewrite it. Listing the packages explicitly is what keeps it out -- lerna 5 ignores negated globs like \"!packages/migrate\". Add new publishable packages here.",
"packages": [
"core",
"packages/*"
"packages/angular",
"packages/angular-server",
"packages/docs",
"packages/react",
"packages/react-router",
"packages/vue",
"packages/vue-router"
],
"version": "8.8.17"
}
}
27 changes: 15 additions & 12 deletions packages/migrate/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 26 additions & 3 deletions packages/migrate/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,41 @@
{
"name": "@ionic/migrate",
"version": "0.0.0",
"private": true,
"version": "0.1.0",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woot!

"description": "Migration tool to automate and report on breaking changes across Ionic Framework major versions.",
"keywords": [
"ionic",
"framework",
"migrate",
"migration",
"codemod",
"upgrade",
"angular",
"react",
"vue",
"cli"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/ionic-team/ionic-framework.git",
"directory": "packages/migrate"
},
"engines": {
"node": ">=20.0.0"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow is using 24, we should consider syncing the minimum version to be used in the workflow. This can be a follow up if we decided to go down that route.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Putting it at 24 would be higher than necessary and higher than v9 even requires, so maybe if we go update everything else we do it then? In reality though, we should maybe even consider dropping this to >= 16 for this specific package if that's possible, since that's what v8 - what we're migrating from right now - requires (and presumably some people will be using it because of that version setting the floor).

But I think >= 20 is fine for now

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created a node sync ticket last sprint so we can look into it then.

},
"publishConfig": {
"access": "public"
},
"type": "module",
"bin": {
"ionic-migrate": "./dist/cli.js"
"ionic-migrate": "dist/cli.js"
},
"files": [
"dist"
],
"scripts": {
"build": "tsc -p tsconfig.build.json",
"prepack": "npm run build",
"test": "vitest run",
"test.watch": "vitest",
"lint": "tsc --noEmit"
Expand Down