-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore: update in order to facilitate bundling (#5579)
* chore: update for bundling * chore: revert to unbundled versions * chore: apply js esbuild --------- Co-authored-by: Daphne Yang <[email protected]>
- Loading branch information
1 parent
5acd2da
commit 23da60c
Showing
22 changed files
with
1,278 additions
and
35 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
{ | ||
"root": true, | ||
"extends": ["../../config/base-eslintrc.json", "./fix-these-rules.json"], | ||
"extends": [ | ||
"../../config/base-eslintrc.json", | ||
"./fix-these-rules.json" | ||
], | ||
"overrides": [ | ||
{ | ||
"files": ["./src/**/*.ts", "./test/**/*.ts"], | ||
"files": [ | ||
"./src/**/*.ts", | ||
"./test/**/*.ts" | ||
], | ||
"parserOptions": { | ||
"project": "./tsconfig.json" | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"env": { | ||
"node": true | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
packages/salesforcedx-vscode-apex-debugger/esbuild.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright (c) 2024, salesforce.com, inc. | ||
* All rights reserved. | ||
* Licensed under the BSD 3-Clause license. | ||
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause | ||
*/ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const { build } = require('esbuild'); | ||
// const fs = require('fs').promises; | ||
|
||
// Configure and run the build process | ||
const sharedConfig = { | ||
bundle: true, // Bundle all dependencies into one file | ||
format: 'cjs', // Output format (CommonJS) | ||
platform: 'node', // Platform target (Node.js) | ||
minify: true, // Minify the output | ||
external: [ | ||
'vscode', | ||
'@salesforce/core', | ||
'@salesforce/source-tracking' | ||
] | ||
}; | ||
|
||
// copy core-bundle/lib/transformStream.js to dist if core-bundle is included | ||
// const copyFiles = async (src, dest) => { | ||
// try { | ||
// // Copy the file | ||
// await fs.copyFile(src, dest); | ||
// console.log(`File was copied from ${src} to ${dest}`); | ||
// } catch (error) { | ||
// console.error('An error occurred:', error); | ||
// } | ||
// }; | ||
|
||
// const srcPath = '../../node_modules/@salesforce/core-bundle/lib/transformStream.js'; | ||
// const destPath = './dist/transformStream.js'; | ||
|
||
(async () => { | ||
await build({ | ||
...sharedConfig, | ||
entryPoints: ['./src/index.ts'], | ||
outfile: 'dist/index.js' | ||
}); | ||
})().then(async () => { | ||
// await copyFiles(srcPath, destPath); | ||
}).catch(() => process.exit(1)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 13 additions & 4 deletions
17
packages/salesforcedx-vscode-apex-replay-debugger/.eslintrc.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
{ | ||
"root": true, | ||
"extends": ["../../config/base-eslintrc.json", "./fix-these-rules.json"], | ||
"extends": [ | ||
"../../config/base-eslintrc.json", | ||
"./fix-these-rules.json" | ||
], | ||
"overrides": [ | ||
{ | ||
"files": ["./src/**/*.ts", "./test/**/*.ts"], | ||
"files": [ | ||
"./src/**/*.ts", | ||
"./test/**/*.ts" | ||
], | ||
"parserOptions": { | ||
"project": "./tsconfig.json" | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"env": { | ||
"node": true | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
packages/salesforcedx-vscode-apex-replay-debugger/esbuild.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright (c) 2024, salesforce.com, inc. | ||
* All rights reserved. | ||
* Licensed under the BSD 3-Clause license. | ||
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause | ||
*/ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const { build } = require('esbuild'); | ||
// const fs = require('fs').promises; | ||
|
||
const sharedConfig = { | ||
bundle: true, | ||
format: 'cjs', | ||
platform: 'node', | ||
external: [ | ||
'vscode', | ||
'@salesforce/core', | ||
'@salesforce/source-tracking', | ||
'applicationinsights' | ||
], | ||
minify: true | ||
}; | ||
|
||
// copy core-bundle/lib/transformStream.js to dist if core-bundle is included | ||
// const copyFiles = async (src, dest) => { | ||
// try { | ||
// // Copy the file | ||
// await fs.copyFile(src, dest); | ||
// console.log(`File was copied from ${src} to ${dest}`); | ||
// } catch (error) { | ||
// console.error('An error occurred:', error); | ||
// } | ||
// }; | ||
|
||
// const srcPath = '../../node_modules/@salesforce/core-bundle/lib/transformStream.js'; | ||
// const destPath = './dist/transformStream.js'; | ||
|
||
(async () => { | ||
await build({ | ||
...sharedConfig, | ||
entryPoints: ['./src/index.ts'], | ||
outfile: 'dist/index.js' | ||
}); | ||
})().then(async () => { | ||
// await copyFiles(srcPath, destPath); | ||
}).catch(() => process.exit(1)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
{ | ||
"root": true, | ||
"extends": ["../../config/base-eslintrc.json", "./fix-these-rules.json"], | ||
"extends": [ | ||
"../../config/base-eslintrc.json", | ||
"./fix-these-rules.json" | ||
], | ||
"overrides": [ | ||
{ | ||
"files": ["./src/**/*.ts", "./test/**/*.ts"], | ||
"files": [ | ||
"./src/**/*.ts", | ||
"./test/**/*.ts" | ||
], | ||
"parserOptions": { | ||
"project": "./tsconfig.json" | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"env": { | ||
"node": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright (c) 2024, salesforce.com, inc. | ||
* All rights reserved. | ||
* Licensed under the BSD 3-Clause license. | ||
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause | ||
*/ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const { build } = require('esbuild'); | ||
// const fs = require('fs').promises; | ||
|
||
const sharedConfig = { | ||
bundle: true, | ||
format: 'cjs', | ||
platform: 'node', | ||
external: [ | ||
'vscode', | ||
'@salesforce/core', | ||
'applicationinsights', | ||
'shelljs', | ||
'@salesforce/source-deploy-retrieve', | ||
'@salesforce/source-tracking' | ||
], | ||
minify: true | ||
}; | ||
|
||
// copy core-bundle/lib/transformStream.js to dist if core-bundle is included | ||
// const copyFiles = async (src, dest) => { | ||
// try { | ||
// // Copy the file | ||
// await fs.copyFile(src, dest); | ||
// console.log(`File was copied from ${src} to ${dest}`); | ||
// } catch (error) { | ||
// console.error('An error occurred:', error); | ||
// } | ||
// }; | ||
|
||
// const srcPath = '../../node_modules/@salesforce/core-bundle/lib/transformStream.js'; | ||
// const destPath = './dist/transformStream.js'; | ||
|
||
(async () => { | ||
await build({ | ||
...sharedConfig, | ||
entryPoints: ['./src/index.ts'], | ||
outfile: 'dist/index.js' | ||
}); | ||
})().then(async () => { | ||
// await copyFiles(srcPath, destPath); | ||
}).catch(() => process.exit(1)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
{ | ||
"root": true, | ||
"extends": ["../../config/base-eslintrc.json", "./fix-these-rules.json"], | ||
"extends": [ | ||
"../../config/base-eslintrc.json", | ||
"./fix-these-rules.json" | ||
], | ||
"overrides": [ | ||
{ | ||
"files": ["./src/**/*.ts", "./test/**/*.ts"], | ||
"files": [ | ||
"./src/**/*.ts", | ||
"./test/**/*.ts" | ||
], | ||
"parserOptions": { | ||
"project": "./tsconfig.json" | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"env": { | ||
"node": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright (c) 2024, salesforce.com, inc. | ||
* All rights reserved. | ||
* Licensed under the BSD 3-Clause license. | ||
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause | ||
*/ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const { build } = require('esbuild'); | ||
// const fs = require('fs').promises; | ||
|
||
const sharedConfig = { | ||
bundle: true, | ||
format: 'cjs', | ||
platform: 'node', | ||
external: [ | ||
'vscode', | ||
'applicationinsights', | ||
'shelljs', | ||
'@salesforce/core', | ||
'@salesforce/source-tracking', | ||
'@salesforce/templates', | ||
'@salesforce/source-deploy-retrieve' | ||
], | ||
minify: true | ||
}; | ||
|
||
// copy core-bundle/lib/transformStream.js to dist if core-bundle is included | ||
// const copyFiles = async (src, dest) => { | ||
// try { | ||
// // Copy the file | ||
// await fs.copyFile(src, dest); | ||
// console.log(`File was copied from ${src} to ${dest}`); | ||
// } catch (error) { | ||
// console.error('An error occurred:', error); | ||
// } | ||
// }; | ||
|
||
// const srcPath = '../../node_modules/@salesforce/core-bundle/lib/transformStream.js'; | ||
// const destPath = './dist/transformStream.js'; | ||
|
||
(async () => { | ||
await build({ | ||
...sharedConfig, | ||
entryPoints: ['./src/index.ts'], | ||
outfile: 'dist/index.js' | ||
}); | ||
})() | ||
.then(async () => { | ||
// await copyFiles(srcPath, destPath); | ||
}) | ||
.catch(() => process.exit(1)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.