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 ESM #683

Merged
merged 43 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
6ff57ad
feat!: migrate to ESM
mdonnalley Oct 17, 2023
5630d42
fix: tests
mdonnalley Oct 17, 2023
4bbf966
test: integration and unit tests
mdonnalley Oct 17, 2023
37743d4
test: link tests
mdonnalley Oct 17, 2023
f635621
chore: valid test workflow
mdonnalley Oct 17, 2023
88e9d02
feat: compile github-installed plugins
mdonnalley Oct 18, 2023
ec52b94
chore: remove unused dep
mdonnalley Oct 18, 2023
699e926
feat: add env var for yarn --network-timeout
mdonnalley Oct 18, 2023
dbdb4df
feat: add --silent flag to install
mdonnalley Oct 18, 2023
a071ef1
feat: configurable pluginPrefix
mdonnalley Oct 18, 2023
ab8f9cd
test: clean up
mdonnalley Oct 18, 2023
59f9a98
chore: code review
mdonnalley Oct 18, 2023
9f3c4bc
fix: throw preemptive error if npm pkg does not exist
mdonnalley Oct 19, 2023
aaab8ec
feat: improved terminal output
mdonnalley Oct 19, 2023
1a483fa
chore: update fs and path imports
mdonnalley Oct 19, 2023
196a2e8
ci: update test.yml
mdonnalley Oct 19, 2023
4567aaa
chore: bump oclif/core
mdonnalley Oct 19, 2023
9902fbc
Merge branch 'main' into mdonnalley/esm
mdonnalley Oct 19, 2023
460f2e4
ci: use node latest for integration tests
mdonnalley Oct 19, 2023
94ca767
fix: file exists check
mdonnalley Oct 19, 2023
e607a77
fix: remove rogue console.log
mdonnalley Oct 19, 2023
e270ed3
ci: test perf
mdonnalley Oct 19, 2023
abc3fe0
ci: test perf
mdonnalley Oct 19, 2023
29e64ff
ci: test perf
mdonnalley Oct 19, 2023
f11e12b
sm/pr-feedback (#685)
mshanemc Oct 23, 2023
bc54d05
fix: ignore yarn path resolution
mdonnalley Oct 23, 2023
aa628ab
chore: clean up
mdonnalley Oct 23, 2023
5ef2429
chore(release): 3.9.4-qa.1 [skip ci]
svc-cli-bot Oct 23, 2023
2be40c4
fix: prevent circular json
mdonnalley Oct 23, 2023
42bd760
Merge branch 'mdonnalley/esm' of github.com:oclif/plugin-plugins into…
mdonnalley Oct 23, 2023
aa86e2a
fix: resolve yarn from plugin and config.root
mdonnalley Oct 23, 2023
f68c98c
chore(release): 3.9.4-qa.2 [skip ci]
svc-cli-bot Oct 23, 2023
e803fe1
fix: dont cache yarn bin on class
mdonnalley Oct 23, 2023
cb39c84
chore(release): 3.9.4-qa.3 [skip ci]
svc-cli-bot Oct 23, 2023
5b58de1
fix: check config root for yarn
mdonnalley Oct 23, 2023
05e7a7e
chore(release): 3.9.4-qa.4 [skip ci]
svc-cli-bot Oct 23, 2023
779dac6
Merge branch 'main' into mdonnalley/esm
mdonnalley Oct 23, 2023
aacc034
chore: bump oclif/core
mdonnalley Oct 24, 2023
b462f16
fix: improve install warnings
mdonnalley Oct 25, 2023
9d3a916
test: --no-install on link
mdonnalley Oct 26, 2023
f4bb41e
test: use lts
mdonnalley Oct 26, 2023
0558f23
Merge branch 'main' into mdonnalley/esm
mdonnalley Oct 26, 2023
a67753f
chore(release): 3.9.4-qa.5 [skip ci]
svc-cli-bot Oct 26, 2023
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
3 changes: 3 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["@commitlint/config-conventional"]
}
11 changes: 0 additions & 11 deletions .editorconfig

This file was deleted.

21 changes: 0 additions & 21 deletions .eslintrc

This file was deleted.

3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["oclif", "oclif-typescript", "prettier"]
}
7 changes: 5 additions & 2 deletions .git2gus/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"productTag": "a1aB0000000ce2IIAQ",
"defaultBuild": "offcore.tooling.55",
"issueTypeLabels": { "enhancement": "USER STORY", "bug": "BUG P3" },
"defaultBuild": "offcore.tooling.59",
"issueTypeLabels": {
"enhancement": "USER STORY",
"bug": "BUG P3"
},
"hideWorkItemUrl": true,
"statusWhenClosed": "CLOSED"
}
1 change: 0 additions & 1 deletion .github/CODEOWNERS

This file was deleted.

1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ updates:
prefix-development: chore(dev-deps)
ignore:
- dependency-name: '@salesforce/dev-scripts'
- dependency-name: 'npm' # Updated with update-npm-version.yml
- dependency-name: '*'
update-types: ['version-update:semver-major']
9 changes: 6 additions & 3 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ name: automerge
on:
workflow_dispatch:
schedule:
- cron: '17 2,5,8,11 * * *'
- cron: '42 2,5,8,11 * * *'
Copy link
Member

Choose a reason for hiding this comment

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

oclif might not have the same concurrent job limits as Salesforce so maybe we should spread these around a bit?

Suggested change
- cron: '42 2,5,8,11 * * *'
- cron: '12 2,5,8,11 * * *'


jobs:
automerge:
uses: oclif/github-workflows/.github/workflows/automerge.yml@main
secrets: inherit
uses: salesforcecli/github-workflows/.github/workflows/automerge.yml@main
secrets:
SVC_CLI_BOT_GITHUB_TOKEN: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
with:
mergeMethod: squash
28 changes: 28 additions & 0 deletions .github/workflows/create-github-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: create-github-release

on:
push:
branches:
- main
# point at specific branches, or a naming convention via wildcard
- prerelease/**
tags-ignore:
- '*'
workflow_dispatch:
inputs:
prerelease:
type: string
description: 'Name to use for the prerelease: beta, dev, etc. NOTE: If this is already set in the package.json, it does not need to be passed in here.'

jobs:
release:
# this job will throw if prerelease is true but it doesn't have a prerelease-looking package.json version
uses: salesforcecli/github-workflows/.github/workflows/create-github-release.yml@main
secrets:
SVC_CLI_BOT_GITHUB_TOKEN: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
with:
prerelease: ${{ inputs.prerelease }}
# If this is a push event, we want to skip the release if there are no semantic commits
# However, if this is a manual release (workflow_dispatch), then we want to disable skip-on-empty
# This helps recover from forgetting to add semantic commits ('fix:', 'feat:', etc.)
skip-on-empty: ${{ github.event_name == 'push' }}
3 changes: 1 addition & 2 deletions .github/workflows/failureNotifications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ name: failureNotifications
on:
workflow_run:
workflows:
- version, tag and github release
- create-github-release
- publish
- update-npm-version
types:
- completed

Expand Down
36 changes: 0 additions & 36 deletions .github/workflows/manualRelease.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/onPushToMain.yml

This file was deleted.

11 changes: 7 additions & 4 deletions .github/workflows/onRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: publish

on:
release:
types: [released]
types: [published]
# support manual release in case something goes wrong and needs to be repeated or tested
workflow_dispatch:
inputs:
Expand All @@ -11,6 +11,7 @@ on:
type: string
required: true
jobs:
# parses the package.json version and detects prerelease tag (ex: beta from 4.4.4-beta.0)
getDistTag:
outputs:
tag: ${{ steps.distTag.outputs.tag }}
Expand All @@ -19,12 +20,14 @@ jobs:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.release.tag_name || inputs.tag }}
- uses: oclif/github-workflows/.github/actions/getPreReleaseTag@main
- uses: salesforcecli/github-workflows/.github/actions/getPreReleaseTag@main
id: distTag

npm:
uses: oclif/github-workflows/.github/workflows/npmPublish.yml@main
uses: salesforcecli/github-workflows/.github/workflows/npmPublish.yml@main
needs: [getDistTag]
with:
tag: ${{ needs.getDistTag.outputs.tag || 'latest' }}
githubTag: ${{ github.event.release.tag_name || inputs.tag }}
secrets: inherit
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
26 changes: 20 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
workflow_dispatch:

jobs:
integration-tests:
sf-integration-tests:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
Expand All @@ -22,12 +22,26 @@ jobs:
retry_wait_seconds: 60
command: npm install -g @salesforce/cli@$nightly --omit=dev
Copy link
Member

Choose a reason for hiding this comment

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

what does the $ do?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it does anything - it probably was a typo and we got lucky that npm doesn't care???

timeout_minutes: 60
- name: Build project
run: |
yarn
yarn build
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
- run: yarn build
- name: Run tests
run: yarn test:integration:sf

integration-tests:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
test: ['test:integration:install', 'test:integration:link']
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
- run: yarn build
- name: Run tests
run: yarn test:integration
run: yarn ${{matrix.test}}

unit-tests:
uses: salesforcecli/github-workflows/.github/workflows/unitTest.yml@main
38 changes: 0 additions & 38 deletions .github/workflows/update-npm-version.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@
/lib
/node_modules
/tmp

oclif.lock
oclif.manifest.json
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname $0)/_/husky.sh"

yarn run commitlint --edit $1
yarn commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged --concurrent false
5 changes: 5 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"*.json": ["prettier --write"],
"*.md": ["prettier --write"],
"+(src|test)/**/*.+(ts|js)": ["eslint --fix", "prettier --write"]
}
15 changes: 5 additions & 10 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
{
"require": [
"test/helpers/init.js",
"ts-node/register",
"source-map-support/register"
],
"watch-extensions": [
"ts"
],
"require": ["ts-node/register"],
"watch-extensions": ["ts"],
"recursive": true,
"reporter": "spec",
"timeout": 200000
}
"timeout": 200000,
"node-option": ["loader=ts-node/esm"]
}
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@oclif/prettier-config"
Loading
Loading