Skip to content

Commit

Permalink
feat!: migrate to ESM (#683)
Browse files Browse the repository at this point in the history
* feat!: migrate to ESM

BREAKING CHANGES: ESM and node 18 minimum

* fix: tests

* test: integration and unit tests

* test: link tests

* chore: valid test workflow

* feat: compile github-installed plugins

* chore: remove unused dep

* feat: add env var for yarn --network-timeout

* feat: add --silent flag to install

* feat: configurable pluginPrefix

* test: clean up

* chore: code review

* fix: throw preemptive error if npm pkg does not exist

* feat: improved terminal output

* chore: update fs and path imports

* ci: update test.yml

* chore: bump oclif/core

* ci: use node latest for integration tests

* fix: file exists check

* fix: remove rogue console.log

* ci: test perf

* ci: test perf

* ci: test perf

* sm/pr-feedback (#685)

* refactor: hasPlugin type uses this.list types

* refactor: omit class props, parallelization from TODO

* refactor: warningCache use set

* chore: dev-dep cleanup

---------

Co-authored-by: svc-cli-bot <[email protected]>

* fix: ignore yarn path resolution

* chore: clean up

* fix: prevent circular json

* fix: resolve yarn from plugin and config.root

* fix: dont cache yarn bin on class

* fix: check config root for yarn

* chore: bump oclif/core

* fix: improve install warnings

* test: --no-install on link

* test: use lts

---------

Co-authored-by: Shane McLaughlin <[email protected]>
Co-authored-by: svc-cli-bot <[email protected]>
  • Loading branch information
3 people authored Oct 26, 2023
1 parent 5ba86b5 commit 66e3d4f
Show file tree
Hide file tree
Showing 48 changed files with 4,157 additions and 4,292 deletions.
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: '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
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
42 changes: 33 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@ on:
workflow_dispatch:

jobs:
integration-tests:
yarn-lockfile-check:
uses: salesforcecli/github-workflows/.github/workflows/lockFileCheck.yml@main
linux-unit-tests:
needs: yarn-lockfile-check
uses: salesforcecli/github-workflows/.github/workflows/unitTestsLinux.yml@main
windows-unit-tests:
needs: linux-unit-tests
uses: salesforcecli/github-workflows/.github/workflows/unitTestsWindows.yml@main
sf-integration-tests:
needs: linux-unit-tests
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
Expand All @@ -20,14 +29,29 @@ jobs:
with:
max_attempts: 3
retry_wait_seconds: 60
command: npm install -g @salesforce/cli@$nightly --omit=dev
command: npm install -g @salesforce/cli@nightly --omit=dev
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
run: yarn test:integration:sf

unit-tests:
uses: salesforcecli/github-workflows/.github/workflows/unitTest.yml@main
integration-tests:
needs: linux-unit-tests
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
test: ['test:integration:install', 'test:integration:link']
exclude:
- os: windows-latest
test: test:integration:link
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: latest
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
- run: yarn build
- name: Run tests
run: yarn ${{matrix.test}}
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

0 comments on commit 66e3d4f

Please sign in to comment.