Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: migrate to plugin v2 #924

Open
wants to merge 92 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 84 commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
05eb85a
build: upgrade yarn
scolladon Sep 7, 2024
51059e2
build: fix commitlint compilation issue
scolladon Sep 7, 2024
27e1e98
build: fix jest config compilation issue
scolladon Sep 7, 2024
257f0cd
feat: convert messages
scolladon Sep 7, 2024
0e893f5
feat(migrate-v2): update dependencies
scolladon Sep 7, 2024
9ca7e97
feat(migrate-v2): convert command
scolladon Sep 7, 2024
b787939
feat(migrate-v2): fix module compilation issue
scolladon Sep 7, 2024
b41b658
refactor: use node prefix
scolladon Sep 10, 2024
1b24b09
build: convert bin
scolladon Sep 11, 2024
1971ff8
fix: fs-extra and lodash esm import
scolladon Sep 11, 2024
f424bc7
docs: convert command explanation
scolladon Sep 11, 2024
9072cbd
build: upgrade dependencies
scolladon Sep 11, 2024
c149862
build: update script oclif
scolladon Sep 11, 2024
b0e0f9d
test: fix jest test with esm
scolladon Sep 11, 2024
83c4d8f
test: fix nut test with esm
scolladon Sep 11, 2024
1ba4e12
build: fix dependency linting issues
scolladon Sep 11, 2024
be20950
feat: migrate to sf space topic separator style
scolladon Sep 12, 2024
e1ddbe1
build: add plugin linting
scolladon Sep 12, 2024
490c9be
build: add node 22 check
scolladon Sep 13, 2024
2102a70
build: fix formatting
scolladon Sep 13, 2024
4452e95
docs: fix link
scolladon Sep 13, 2024
5b49eb0
refactor: use `exists` on flags and remove obsolete code
scolladon Sep 16, 2024
d997cf3
refactor: use Message for every errors and warnings
scolladon Sep 16, 2024
1fb2300
build: upgrade dependencies
scolladon Sep 29, 2024
3e42af7
fix: ignore esm compatibility
scolladon Sep 29, 2024
6a65399
refactor: improve readibility
scolladon Sep 29, 2024
6dc9b9b
fix: build cache
scolladon Sep 29, 2024
adbc5cb
feat: add npm shrinkwrap file to speed up installation time
scolladon Sep 29, 2024
936c1a1
fix: script dependencies
scolladon Sep 29, 2024
9d8f1fb
feat: add spinner
scolladon Sep 29, 2024
11ab8c3
fix: relax plugin linting issues
scolladon Sep 29, 2024
c9c5ffb
revert: ignore type workaround
scolladon Sep 29, 2024
01251e9
build: override ignore type
scolladon Oct 5, 2024
7101c90
feat: convert to esm dependencies
scolladon Oct 1, 2024
1c3dd5b
chore: fix jest weird esm compilation
scolladon Oct 5, 2024
d704822
fix: dev script with ts-node
scolladon Oct 5, 2024
12b23d5
fix: dependencies linting with lodash
scolladon Oct 5, 2024
b8ad604
docs: update sf command line references
scolladon Oct 5, 2024
cfd2164
build: update ci to node lts
scolladon Oct 5, 2024
f8fdb51
build: upgrade yarn
scolladon Oct 5, 2024
1e6db6e
fix: invisible char
scolladon Oct 5, 2024
2abf7c4
revert: does not change sfdx format for e2e
scolladon Oct 5, 2024
ed7d4f4
build: upgrade dependencies
scolladon Oct 5, 2024
976e287
build: fix matrix testing
scolladon Oct 6, 2024
2a5f37a
build: configure gitleaks
scolladon Oct 6, 2024
83a26de
build: fix dependency linting config file format issue
scolladon Oct 6, 2024
1b13b60
feat: implement compliant cli parameters
scolladon Oct 6, 2024
9fed707
docs: update contributing toolbelt
scolladon Oct 6, 2024
04e1456
refactor: migrate back from `yarn` to `npm`
scolladon Oct 18, 2024
9ba5bf7
build: add branch name checking
scolladon Oct 11, 2024
0bf3c12
build: include incremental mutation testing
scolladon Oct 12, 2024
a9d00f6
build: upgrade dependencies
scolladon Oct 12, 2024
d7a4595
docs: write migration to v6 instructions
scolladon Oct 13, 2024
592c4f9
docs: fix typos and rephrase
Oct 15, 2024
fa6166c
docs: fix minor typo in migration guide
scolladon Oct 15, 2024
0d1bb0a
build: upgrade dependencies
scolladon Oct 15, 2024
263f3e6
Revert "build: update ci to node lts"
scolladon Oct 18, 2024
3db02a7
refactor: use dynamic import to get metadata definition
scolladon Oct 18, 2024
87c6e60
revert: plugin linting
scolladon Oct 18, 2024
613d83c
build: upgrade dependencies
scolladon Oct 18, 2024
45215ed
fix: biome indentation check
scolladon Oct 18, 2024
d9c3f25
docs: fix relative links in migration guide
scolladon Oct 18, 2024
78d8c22
chore: add funding
scolladon Oct 18, 2024
d2abdea
docs: add installation details and channel information
scolladon Oct 19, 2024
6db7e59
chore: upgrade package-lock.json to latest version as well
scolladon Oct 19, 2024
21224f1
docs: update readme link
scolladon Oct 19, 2024
b7dd29d
test: do not ignore static when mutation testing
scolladon Oct 19, 2024
abb43a5
docs: update migration guide
scolladon Oct 19, 2024
51411e8
build: upgrade dependencies
scolladon Oct 20, 2024
5fed3af
docs: update long commands
Oct 21, 2024
ec5bb77
docs: update supported version
Oct 21, 2024
3e993d3
docs: update message and usage
scolladon Oct 21, 2024
38a299d
docs: add sfdx-hardis reference in used by section
scolladon Oct 27, 2024
c016c7d
docs: reorder badges and remove gitter
scolladon Oct 27, 2024
d717286
docs: add "Become a Sponsor" button
scolladon Oct 27, 2024
10b11de
feat: add donating call to action in logs
scolladon Oct 27, 2024
5857bc2
build: fix test:build script
scolladon Nov 4, 2024
b4cdcb7
fix: decomposed workflow sub types definition
scolladon Nov 4, 2024
6ba8991
build: fix incremental build issue
scolladon Nov 4, 2024
8c0c60d
build: upgrade dependencies
scolladon Nov 4, 2024
7733b00
feat: add sponsor link in release comments
scolladon Nov 4, 2024
014402f
fix: dependencies linting
scolladon Nov 4, 2024
fadbf30
Merge branch 'main' into feat/migrate-to-plugin-v2
scolladon Nov 12, 2024
2aaf75d
build: upgrade dependencies
scolladon Nov 12, 2024
36a4022
docs: simplify legacy npm channel
scolladon Nov 12, 2024
675b121
Merge branch 'main' into feat/migrate-to-plugin-v2
scolladon Nov 14, 2024
f390f75
build: upgrade dependencies
scolladon Nov 14, 2024
1c78896
Merge branch 'main' into feat/migrate-to-plugin-v2
scolladon Dec 9, 2024
6f395a3
build: debugging help on e2e tests
scolladon Dec 9, 2024
ca3fce6
Merge branch 'main' into feat/migrate-to-plugin-v2
scolladon Dec 12, 2024
6337114
build: upgrade dependencies
scolladon Dec 12, 2024
9ef732b
Merge branch 'main' into feat/migrate-to-plugin-v2
scolladon Dec 18, 2024
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
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,26 @@ Issue verification check:
Ex:
https://github.com/scolladon/sfdx-git-delta-reproduction-playground
sgd -d -r . -f HEAD^
sfdx sgd:source:delta -d -f HEAD^
sf sgd source delta -d -f HEAD^
-->

## Execution context

---

<!--
$ uname -v ; yarn -v ; node -v ; git --version ; sfdx --version ; sfdx plugins
$ uname -v; npm -v ; node -v ; git --version ; sf --version ; sf plugins
-->

**Operating System:** …

**yarn version:** …
**npm version:** …

**node version:** …

**git version:** …

**sfdx version:** …
**sf version:** …

**sgd plugin version:** …

Expand Down
12 changes: 6 additions & 6 deletions .github/actions/install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ description: Install dependencies
runs:
using: composite
steps:
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "yarn-cache=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT"
- name: Get cache directory
id: cache-dir
run: echo "dir=$(npm config get cache)" >> "$GITHUB_OUTPUT"
shell: bash

- uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.yarn-cache }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

- name: Install dependencies
run: yarn install --immutable --check-cache
run: npm ci
shell: bash
env:
HUSKY: '0' # By default do not run HUSKY install
10 changes: 5 additions & 5 deletions .github/linters/.cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"ignorePaths": [
"**/CHANGELOG.md",
"**/.git/**",
"**/.yarnrc.yml",
"**/megalinter.yml",
"**/node_modules/**",
"**/src/metadata/**",
"**/src/service/typeHandlerFactory.ts",
"**/yarn.lock"
"**/src/service/typeHandlerFactory.ts"
],
"language": "en",
"noConfigSearch": true,
Expand All @@ -27,6 +25,7 @@
"biomejs",
"brqh",
"cherfaoui",
"cloudity",
"codeclimate",
"codecov",
"codecov",
Expand Down Expand Up @@ -59,6 +58,7 @@
"fullname",
"geodata",
"gitdir",
"hardis",
"hardlinks",
"iframe",
"iframe",
Expand Down Expand Up @@ -90,6 +90,7 @@
"mutingpermissionset",
"mutingpermissionsets",
"myexperiencebundle",
"namerc",
"nimn",
"nonblock",
"nonoctal",
Expand Down Expand Up @@ -167,7 +168,6 @@
"weblinks",
"wireit",
"wlens",
"xmlbuilder",
"yarnrc"
"xmlbuilder"
]
}
2 changes: 1 addition & 1 deletion .github/workflows/manual-deprecate-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
- name: Change version
run: npm deprecate sfdx-git-delta@$"${{ github.event.inputs.version-expression }}" "${{ github.event.inputs.rationale }}"
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/manual-manage-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:
- name: Change version
run: npm dist-tag add sfdx-git-delta@${{ github.event.inputs.version-number }} ${{ github.event.inputs.version-alias }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
13 changes: 6 additions & 7 deletions .github/workflows/on-main-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ jobs:
uses: ./.github/actions/install

- name: Publish to npm
run: yarn npm publish --access public --tag latest-rc
run: npm publish --access public --tag latest-rc
env:
YARN_NPM_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

test-release:
uses: ./.github/workflows/run-e2e-tests.yml
Expand Down Expand Up @@ -76,16 +76,15 @@ jobs:
- uses: google/wireit@setup-github-actions-caching/v2

- name: Build plugin
run: yarn pack
run: npm pack

- name: Install salesforce CLI
run: npm install -g @salesforce/cli

- name: Install plugin
run: |
yarn set version classic
sfdx plugins:link .
sfdx plugins
sf plugins link .
sf plugins

- name: Checkout e2e test subject
uses: actions/checkout@v4
Expand All @@ -96,7 +95,7 @@ jobs:

- name: Run benchmark
run: |
yarn test:perf
npm run test:perf
git reset --hard

- name: Store benchmark result
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/on-merged-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@ jobs:
- name: Remove dist-tag
run: npm dist-tag rm sfdx-git-delta ${{ env.DEV_CHANNEL }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Deprecate related dev versions
run: |
DEV_VERSIONS=$(npm view sfdx-git-delta versions --json | jq -r '.[]' | grep -E "${{env.CURRENT_VERSION}}-${{ env.DEV_CHANNEL }}")
DEV_VERSIONS=$(npm view sfdx-git-delta versions --json | jq -r '.[]' | grep -E "${{ env.CURRENT_VERSION}}-${{ env.DEV_CHANNEL }}")
[ -n "$DEV_VERSIONS" ] && for DEV_VERSION in ${DEV_VERSIONS}; do npm deprecate "sfdx-git-delta@${DEV_VERSION}" "Deprecated dev version"; done
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Delete package dev channel PR comment
uses: thollander/actions-comment-pull-request@v2
with:
message: |
Published under `${{ env.DEV_CHANNEL }}` npm channel.
```sh
$ sfdx plugins:install sfdx-git-delta@${{ env.DEV_CHANNEL }}
$ sf plugins install sfdx-git-delta@${{ env.DEV_CHANNEL }}
```
comment_tag: dev-publish
mode: delete
11 changes: 8 additions & 3 deletions .github/workflows/on-published-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
comment-template: |
Shipped in [release `{release_tag}`]({release_link}).
You can install the new version using the version number or the `latest-rc` channel
Version `{release_tag}` will be assigned to the `latest` npm channel soon
Install it using either `{release_tag}` or the `latest-rc` npm channel
```sh
$ sfdx plugins:install sfdx-git-delta@latest-rc
$ sfdx plugins:install sfdx-git-delta@{release_tag}
$ sf plugins install sfdx-git-delta@latest-rc
# Or
$ sf plugins install sfdx-git-delta@{release_tag}
```
💡 Enjoying sfdx-git-delta?
Your contribution helps us provide fast support 🚀 and high quality features 🔥
Become a [sponsor](https://github.com/sponsors/scolladon) 💙
Happy incremental deployment!
36 changes: 30 additions & 6 deletions .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ jobs:
run: npm outdated

- name: Check unused dependencies
run: yarn lint:dependencies
run: npm run lint:dependencies

- name: Audit dependencies
run: yarn npm audit
run: npm audit

megalinter:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -96,6 +96,30 @@ jobs:
megalinter-reports
mega-linter.log

incremental-mutation-testing:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18

- name: Setup dependencies, cache and install
uses: ./.github/actions/install

- name: Incremental Mutation testing
run: npm run test:mutation:incremental

- uses: actions/upload-artifact@v4
with:
name: mutation-testing-reports
path: reports/mutation

build:
uses: ./.github/workflows/reusable-build.yml
secrets: inherit
Expand Down Expand Up @@ -133,19 +157,19 @@ jobs:
- name: NPM Publish dev channel
run: |
CURRENT_VERSION=$(jq -r '.version' package.json)
DEV_TAG="${{ env.DEV_CHANNEL }}.${{ github.run_id }}-${{github.run_attempt}}"
DEV_TAG="${{ env.DEV_CHANNEL }}.${{ github.run_id }}-${{ github.run_attempt }}"
npm version "${CURRENT_VERSION}-${DEV_TAG}"
yarn npm publish --access public --tag "${{ env.DEV_CHANNEL }}"
npm publish --access public --tag "${{ env.DEV_CHANNEL }}"
env:
YARN_NPM_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Comment PR dev channel
uses: thollander/actions-comment-pull-request@v2
with:
message: |
Published under `${{ env.DEV_CHANNEL }}` npm channel.
```sh
$ sfdx plugins:install sfdx-git-delta@${{ env.DEV_CHANNEL }}
$ sf plugins install sfdx-git-delta@${{ env.DEV_CHANNEL }}
```
comment_tag: dev-publish
mode: recreate
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ jobs:
- uses: google/wireit@setup-github-actions-caching/v2

- name: Lint plugin
run: yarn lint
run: npm run lint

- name: Build plugin
run: yarn pack
run: npm pack

- name: Unit test
run: yarn test:unit -- --runInBand
run: npm run test:unit -- --runInBand

- name: Upload coverage
uses: codecov/codecov-action@v4
Expand All @@ -43,7 +43,7 @@ jobs:
path: ./e2e

- name: Functional test
run: yarn test:nut
run: npm run test:nut

- uses: actions/upload-artifact@v4
with:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/run-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
node: [18, 20]
cli: [sfdx-cli, '@salesforce/cli']
node: [18, 20, 22]
cli: ['@salesforce/cli']
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
Expand All @@ -29,15 +29,15 @@ jobs:
node-version: ${{ matrix.node }}

- name: Install cli
run: npm install -g ${{matrix.cli}}
run: npm install -g ${{ matrix.cli }}

- name: Install new plugin version
run: echo y | sfdx plugins:install sfdx-git-delta@${{ inputs.channel }}
run: echo y | sf plugins install sfdx-git-delta@${{ inputs.channel }}

- name: Test new plugin version
run: sfdx sgd:source:delta --help
run: sf sgd source delta --help

- name: E2E Tests
run: |
yarn
yarn test:e2e
npm install
npm run test:e2e
22 changes: 10 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
.stryker-tmp
.wireit
*-debug.log
*-error.log
/.nyc_output
/e2e
/lib
/node_modules
/reports
/lib
/.nyc_output
/.yarn/cache
install-state.gz
*-debug.log
*-error.log
sfdx-git-delta-*.tgz
megalinter-reports/
package.tgz
perf-result.txt
sfdx-git-delta-*.tgz
stderr*.txt
stdout*.txt
perf-result.txt
# stryker temp files
.stryker-tmp

megalinter-reports/
.wireit
tsconfig.tsbuildinfo
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

yarn commitlint --edit
npx commitlint --edit
2 changes: 1 addition & 1 deletion .husky/post-checkout
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

yarn dependencies:reinstall
npm run dependencies:reinstall
2 changes: 1 addition & 1 deletion .husky/post-merge
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

yarn dependencies:reinstall
npm run dependencies:reinstall
2 changes: 1 addition & 1 deletion .husky/post-rewrite
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

yarn dependencies:reinstall
npm run dependencies:reinstall
3 changes: 2 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh

yarn lint-staged
npx validate-branch-name
npx lint-staged
Loading
Loading