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

Create platform directory structure #9439

Merged
merged 19 commits into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
485 changes: 39 additions & 446 deletions .eslintrc.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ jobs:
- name: 'Check for telemetry edit'
uses: brettcannon/check-for-changed-files@v1.1.0
with:
prereq-pattern: './src/client/telemetry/index.ts'
prereq-pattern: './src/telemetry/index.ts'
file-pattern: 'telemetry.md'
skip-label: 'skip telemetry'
failure-message: 'TELEMETRY.md should be updated when adding or removing telemetry. Please run "npm run generateTelemetry"'
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Ignore the pythonEnvironments/ folder because we use ESLint there instead
src/client/pythonEnvironments/*
src/platform/pythonEnvironments/*
src/test/pythonEnvironments/*
4 changes: 2 additions & 2 deletions .sonarcloud.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sonar.sources=src/client,src/datascience-ui
sonar.sources=src/platform,src/datascience-ui
sonar.exclusions=src/datascience-ui/**/codicon*.*
sonar.tests=src/test
sonar.cfamily.build-wrapper-output.bypass=true
sonar.cpd.exclusions=src/datascience-ui/**/redux/actions.ts,src/client/**/raw-kernel/rawKernel.ts,src/client/datascience/jupyter/*ariable*.ts,src/client/activation/**/*.ts
sonar.cpd.exclusions=src/datascience-ui/**/redux/actions.ts,src/platform/**/raw-kernel/rawKernel.ts,src/platform/datascience/jupyter/*ariable*.ts,src/platform/activation/**/*.ts
2 changes: 1 addition & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ news/**
node_modules/**
obj/**
out/**/*.stats.json
out/client/**/*.analyzer.html
out/**/*.analyzer.html
out/coverconfig.json
out/datascience-ui/**/*.analyzer.html
out/datascience-ui/common/**
Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
| `main` branch |
| ------------- |


## | ![Main Build](https://github.com/microsoft/vscode-jupyter/actions/workflows/build-test.yml/badge.svg?branch=main)

[For contributing to the [Microsoft Python Language Server](https://github.com/Microsoft/python-language-server) see its own repo; for [Pylance](https://github.com/microsoft/pylance-release) see its own repo; for [debugpy](https://github.com/microsoft/debugpy) see its own repo]
Expand Down Expand Up @@ -214,7 +215,7 @@ Clone the repo into any directory, open that directory in VSCode, and use the `E
Information on our coding standards can be found [here](https://github.com/Microsoft/vscode-jupyter/blob/main/CODING_STANDARDS.md).
We have CI tests to ensure the code committed will adhere to the above coding standards.

Messages displayed to the user must be localized using/created constants from/in the [localize.ts](https://github.com/Microsoft/vscode-jupyter/blob/main/src/client/common/utils/localize.ts) file.
Messages displayed to the user must be localized using/created constants from/in the [localize.ts](https://github.com/Microsoft/vscode-jupyter/blob/main/src/platform/common/utils/localize.ts) file.

## Development process

Expand Down
1,642 changes: 995 additions & 647 deletions TELEMETRY.md

Large diffs are not rendered by default.

644 changes: 322 additions & 322 deletions build/existingFiles.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion build/tslint-rules/messagesMustBeLocalizedRule.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const methodNames = [
// TODO: Ideally we would not ignore any files.
const ignoredFiles = util.getListOfFiles('unlocalizedFiles.json');
const ignoredPrefix = path.normalize('src/test');
const failureMessage = 'Messages must be localized in the Jupyter Extension (use src/client/common/utils/localize.ts)';
const failureMessage =
'Messages must be localized in the Jupyter Extension (use src/platform/common/utils/localize.ts)';
class NoStringLiteralsInMessages extends baseRuleWalker.BaseRuleWalker {
visitCallExpression(node) {
if (!this.shouldIgnoreNode(node)) {
Expand Down
48 changes: 24 additions & 24 deletions build/unlocalizedFiles.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
[
"src/client/activation/activationService.ts",
"src/client/common/installer/channelManager.ts",
"src/client/common/installer/moduleInstaller.ts",
"src/client/common/installer/productInstaller.ts",
"src/client/debugger/extension/hooks/childProcessAttachService.ts",
"src/client/formatters/baseFormatter.ts",
"src/client/formatters/blackFormatter.ts",
"src/client/interpreter/configuration/pythonPathUpdaterService.ts",
"src/client/linters/errorHandlers/notInstalled.ts",
"src/client/linters/errorHandlers/standard.ts",
"src/client/linters/linterCommands.ts",
"src/client/linters/prospector.ts",
"src/client/providers/importSortProvider.ts",
"src/client/providers/objectDefinitionProvider.ts",
"src/client/providers/simpleRefactorProvider.ts",
"src/client/pythonEnvironments/discovery/locators/services/pipEnvService.ts",
"src/client/terminals/codeExecution/helper.ts",
"src/client/testing/common/debugLauncher.ts",
"src/client/testing/common/managers/baseTestManager.ts",
"src/client/testing/common/services/discovery.ts",
"src/client/testing/configuration.ts",
"src/client/testing/display/main.ts",
"src/client/testing/main.ts",
"src/client/workspaceSymbols/generator.ts"
"src/platform/activation/activationService.ts",
"src/platform/common/installer/channelManager.ts",
"src/platform/common/installer/moduleInstaller.ts",
"src/platform/common/installer/productInstaller.ts",
"src/platform/debugger/extension/hooks/childProcessAttachService.ts",
"src/platform/formatters/baseFormatter.ts",
"src/platform/formatters/blackFormatter.ts",
"src/platform/interpreter/configuration/pythonPathUpdaterService.ts",
"src/platform/linters/errorHandlers/notInstalled.ts",
"src/platform/linters/errorHandlers/standard.ts",
"src/platform/linters/linterCommands.ts",
"src/platform/linters/prospector.ts",
"src/platform/providers/importSortProvider.ts",
"src/platform/providers/objectDefinitionProvider.ts",
"src/platform/providers/simpleRefactorProvider.ts",
"src/platform/pythonEnvironments/discovery/locators/services/pipEnvService.ts",
"src/platform/terminals/codeExecution/helper.ts",
"src/platform/testing/common/debugLauncher.ts",
"src/platform/testing/common/managers/baseTestManager.ts",
"src/platform/testing/common/services/discovery.ts",
"src/platform/testing/configuration.ts",
"src/platform/testing/display/main.ts",
"src/platform/testing/main.ts",
"src/platform/workspaceSymbols/generator.ts"
]
2 changes: 1 addition & 1 deletion build/webpack/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function getDefaultPlugins(name) {
}
exports.getDefaultPlugins = getDefaultPlugins;
function getListOfExistingModulesInOutDir() {
const outDir = path.join(constants.ExtensionRootDir, 'out', 'client');
const outDir = path.join(constants.ExtensionRootDir, 'out');
const files = glob.sync('**/*.js', { sync: true, cwd: outDir });
return files.map((filePath) => `./${filePath.slice(0, -3)}`);
}
Expand Down
6 changes: 3 additions & 3 deletions build/webpack/webpack.extension.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const config = {
mode: 'production',
target: 'node',
entry: {
extension: './src/client/extension.ts'
extension: './src/extension.ts'
},
devtool: 'source-map',
node: {
Expand Down Expand Up @@ -112,7 +112,7 @@ const config = {
// ZMQ requires prebuilds to be in our node_modules directory. So recreate the ZMQ structure.
// However we don't webpack to manage this, so it was part of the excluded modules. Delete it from there
// so at runtime we pick up the original structure.
new removeFilesWebpackPlugin({ after: { include: ['./out/client/node_modules/zeromq.js'], log: false } }),
new removeFilesWebpackPlugin({ after: { include: ['./out/node_modules/zeromq.js'], log: false } }),
new copyWebpackPlugin({ patterns: [{ from: './node_modules/zeromq/**/*.js' }] }),
new copyWebpackPlugin({ patterns: [{ from: './node_modules/zeromq/**/*.node' }] }),
new copyWebpackPlugin({ patterns: [{ from: './node_modules/zeromq/**/*.json' }] }),
Expand All @@ -134,7 +134,7 @@ const config = {
},
output: {
filename: '[name].js',
path: path.resolve(constants.ExtensionRootDir, 'out', 'client'),
path: path.resolve(constants.ExtensionRootDir, 'out'),
libraryTarget: 'commonjs2',
devtoolModuleFilenameTemplate: '../../[resource-path]'
}
Expand Down
2 changes: 1 addition & 1 deletion build/webpack/webpack.extension.dependencies.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const config = {
},
output: {
filename: '[name].js',
path: path.resolve(constants.ExtensionRootDir, 'out', 'client'),
path: path.resolve(constants.ExtensionRootDir, 'out'),
libraryTarget: 'commonjs2',
devtoolModuleFilenameTemplate: '../../[resource-path]'
}
Expand Down
1 change: 1 addition & 0 deletions news/3 Code Health/8981.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Refactor client code into a 'platform' directory and organize serviceRegistry files in a hierarchical structure.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"onNotebook:jupyter-notebook",
"onNotebook:interactive"
],
"main": "./out/client/extension",
"main": "./out/extension.js",
"capabilities": {
"virtualWorkspaces": true,
"untrustedWorkspaces": {
Expand Down
16 changes: 0 additions & 16 deletions src/client/constants.ts

This file was deleted.

Loading