Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 1 addition & 5 deletions .github/actions/build-vsix/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ runs:
run: npm run updateBuildNumber -- --buildNumber $GITHUB_RUN_ID
shell: bash

- name: Update extension dependencies
run: npm run addExtensionDependencies
shell: bash

- name: Update Optional extension dependencies
- name: Update optional extension dependencies
run: npm run addExtensionPackDependencies
shell: bash

Expand Down
17 changes: 1 addition & 16 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,32 +77,17 @@ gulp.task('webpack', async () => {
await buildWebPackForDevOrProduction('./build/webpack/webpack.extension.config.js', 'extension');
});

gulp.task('addExtensionDependencies', async () => {
await addExtensionDependencies();
});

gulp.task('addExtensionPackDependencies', async () => {
await buildLicense();
await addExtensionPackDependencies();
});

async function addExtensionDependencies() {
// Update the package.json to add extension dependencies at build time so that
// extension dependencies need not be installed during development
const packageJsonContents = await fsExtra.readFile('package.json', 'utf-8');
const packageJson = JSON.parse(packageJsonContents);
packageJson.extensionDependencies = ['ms-toolsai.jupyter'].concat(
packageJson.extensionDependencies ? packageJson.extensionDependencies : [],
);
await fsExtra.writeFile('package.json', JSON.stringify(packageJson, null, 4), 'utf-8');
}

async function addExtensionPackDependencies() {
// Update the package.json to add extension pack dependencies at build time so that
// extension dependencies need not be installed during development
const packageJsonContents = await fsExtra.readFile('package.json', 'utf-8');
const packageJson = JSON.parse(packageJsonContents);
packageJson.extensionPack = ['ms-python.vscode-pylance'].concat(
packageJson.extensionPack = ['ms-toolsai.jupyter', 'ms-python.vscode-pylance'].concat(

Choose a reason for hiding this comment

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

why not hardcode this in package.json instead of injecting this during build time?

Copy link
Member

Choose a reason for hiding this comment

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

+1. That should work. Since these are optional dependencies they should not affect debugging like required dependencies did.

Copy link
Author

@kimadeline kimadeline May 18, 2021

Choose a reason for hiding this comment

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

Are we ok with hardcoding them now? There were some concerns about hardcoding Pylance when we added it.

Copy link
Author

@kimadeline kimadeline May 18, 2021

Choose a reason for hiding this comment

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

Discussed with @brettcannon, not going to hardcode this, as we would prefer keeping the package.json dependency-free, and add them at build time instead.

packageJson.extensionPack ? packageJson.extensionPack : [],

Choose a reason for hiding this comment

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

Suggested change
packageJson.extensionPack ? packageJson.extensionPack : [],
packageJson.extensionPack || [],

Copy link
Member

Choose a reason for hiding this comment

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

If we follow the previous comment this won't be needed.

);
await fsExtra.writeFile('package.json', JSON.stringify(packageJson, null, 4), 'utf-8');
Expand Down
1 change: 1 addition & 0 deletions news/1 Enhancements/16102.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Move the Jupyter extension from being a hard dependency to an optional one.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2075,7 +2075,6 @@
"format-check": "prettier --check 'src/**/*.ts' 'src/**/*.tsx' 'build/**/*.js' '.github/**/*.yml' gulpfile.js",
"format-fix": "prettier --write 'src/**/*.ts' 'src/**/*.tsx' 'build/**/*.js' '.github/**/*.yml' gulpfile.js",
"clean": "gulp clean",
"addExtensionDependencies": "gulp addExtensionDependencies",
"addExtensionPackDependencies": "gulp addExtensionPackDependencies",
"updateBuildNumber": "gulp updateBuildNumber",
"verifyBundle": "gulp verifyBundle",
Expand Down