Skip to content

Commit

Permalink
fix: use default export for main module (#702)
Browse files Browse the repository at this point in the history
  • Loading branch information
scolladon authored Oct 4, 2023
1 parent f471d16 commit 774b7fc
Show file tree
Hide file tree
Showing 6 changed files with 489 additions and 292 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,8 @@ Then use the JavaScript module
```js
// sample/app.js
const sgd = require('sfdx-git-delta')
// or
// import sgd from 'sfdx-git-delta'
const work = await sgd({
to: '', // commit sha to where the diff is done. [default : "HEAD"]
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"author": "Sebastien Colladon <[email protected]>",
"dependencies": {
"@salesforce/command": "^5.3.9",
"fast-xml-parser": "^4.2.7",
"fast-xml-parser": "^4.3.2",
"fs-extra": "^11.1.1",
"ignore": "^5.2.4",
"lodash": "^4.17.21",
Expand Down Expand Up @@ -63,25 +63,25 @@
"upgrade:dependencies": "shx rm -rf yarn.lock ; shx touch yarn.lock ; yarn-upgrade-all ; yarn-audit-fix"
},
"devDependencies": {
"@commitlint/cli": "^17.7.1",
"@commitlint/cli": "^17.7.2",
"@commitlint/config-conventional": "^17.7.0",
"@jest/globals": "^29.7.0",
"@oclif/dev-cli": "^1.26.10",
"@salesforce/cli-plugins-testkit": "^4.3.5",
"@salesforce/cli-plugins-testkit": "^4.4.5",
"@salesforce/dev-config": "^4.0.1",
"@salesforce/ts-sinon": "^1.4.15",
"@stryker-mutator/core": "^7.1.1",
"@stryker-mutator/jest-runner": "^7.1.1",
"@salesforce/ts-sinon": "^1.4.17",
"@stryker-mutator/core": "^7.2.0",
"@stryker-mutator/jest-runner": "^7.2.0",
"@swc/core": "^1.3.81",
"@types/jest": "^29.5.4",
"@types/mocha": "^10.0.1",
"@types/node": "^20.6.0",
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@typescript-eslint/parser": "^6.7.0",
"@types/jest": "^29.5.5",
"@types/mocha": "^10.0.2",
"@types/node": "^20.8.2",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"benchmark": "^2.1.4",
"chai": "^4.3.8",
"chai": "^4.3.10",
"depcheck": "^1.4.6",
"eslint": "^8.49.0",
"eslint": "^8.50.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"husky": "^8.0.3",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/sgd/source/delta.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { flags, SfdxCommand } from '@salesforce/command'
import { Messages } from '@salesforce/core'
import { sgd } from '../../../main'
import sgd from '../../../main'
import {
TO_DEFAULT_VALUE,
REPO_DEFAULT_VALUE,
Expand Down
4 changes: 3 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Config } from './types/config'
import { Work } from './types/work'
import { MetadataRepository } from './types/metadata'

export const sgd = async (config: Config): Promise<Work> => {
const sgd = async (config: Config): Promise<Work> => {
const work: Work = {
config,
diffs: { package: new Map(), destructiveChanges: new Map() },
Expand All @@ -26,3 +26,5 @@ export const sgd = async (config: Config): Promise<Work> => {
await getPostProcessors(work, metadata).execute()
return work
}

export default sgd
2 changes: 2 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
"noImplicitReturns": true,
"noImplicitThis": true,
"noPropertyAccessFromIndexSignature": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"strictBindCallApply": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
Expand Down
Loading

0 comments on commit 774b7fc

Please sign in to comment.