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

KOGITO-5725: Enable extensions for github.dev #617

Merged
merged 1 commit into from
Sep 17, 2021
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
4 changes: 3 additions & 1 deletion .github/workflows/monorepo_pr_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ jobs:

- name: "Build dependencies"
shell: bash
env:
KOGITO_TOOLING_BUILD_examples: "true"
run: |
export REF=${{ github.event.pull_request.base.sha }} &&
export SCOPE=$(diff <(echo "$(lerna ls --since $REF --include-dependencies --all | cut -d' ' -f1)") <(echo "$(lerna ls --since $REF --all | cut -d' ' -f1)") --changed-group-format='%<%>' --unchanged-group-format='' | xargs -I{} echo -n ' --scope="{}"') &&
echo $REF $SCOPE &&
yarn run-script-if --silent --env SCOPE --eq "" \
--then "echo No dependencies to build." \
--else "lerna run --stream build:dev $SCOPE"
--else "lerna run --stream --concurrency 1 build:dev $SCOPE"

- name: "Build changed and dependents"
env:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
**/.idea/
**/.DS_Store
*.log
**/.vscode/
.classpath
.project
**/.settings/
Expand Down Expand Up @@ -47,9 +46,11 @@ package-lock.json

## vscode-*
**/.vscode-test/
**/.vscode-test-web/
*.vsix
*.dockerimage
**/test-resources/
**/vscode*-tmp

**/mvnw
**/mvnw.cmd
Expand Down
9 changes: 8 additions & 1 deletion config/webpack.common.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,14 @@ module.exports = (env) => {
maxEntrypointSize: 30000000,
},
resolve: {
fallback: { path: require.resolve("path-browserify") }, // Required for `minimatch`, as Webpack 5 doesn't add polyfills automatically anymore.
// Required for github.dev and `minimatch`, as Webpack 5 doesn't add polyfills automatically anymore.
fallback: {
path: require.resolve("path-browserify"),
os: require.resolve("os-browserify/browser"),
fs: false,
child_process: false,
net: false,
},
extensions: [".tsx", ".ts", ".js", ".jsx"],
modules: [path.resolve("../../node_modules"), path.resolve("./node_modules"), path.resolve("./src")],
},
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"@types/vscode": "^1.56.0",
"@typescript-eslint/eslint-plugin": "^4.24.0",
"@typescript-eslint/parser": "^4.24.0",
"@vscode/test-web": "^0.0.8",
"babel-loader": "^8.2.2",
"chai": "^4.3.4",
"chromedriver": "^92.0.0",
Expand Down Expand Up @@ -100,6 +101,7 @@
"mocha-multi-reporters": "1.5.1",
"npm-run-all": "^4.1.5",
"null-loader": "^4.0.1",
"os-browserify": "^0.3.0",
"patch-package": "^6.4.7",
"path-browserify": "^1.0.1",
"postinstall-postinstall": "^2.1.0",
Expand Down Expand Up @@ -127,7 +129,7 @@
"underscore": "^1.13.1",
"uniforms-bridge-simple-schema-2": "^3.5.1",
"url-loader": "^4.1.1",
"vsce": "^1.88.0",
"vsce": "^1.96.1",
"vscode-extension-tester": "4.2.0",
"vscode-test": "^1.5.2",
"watch": "^1.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@ export class ProblemsTabNotificationHandler implements NotificationsApi {
private readonly diagnosticCollection = vscode.languages.createDiagnosticCollection(DIAGNOSTIC_COLLECTION_NAME);

public kogitoNotifications_createNotification(notification: Notification): void {
const uri = vscode.Uri.file(notification.path);
const uri = vscode.Uri.parse(notification.path);
const diagnostics: vscode.Diagnostic[] = this.diagnosticCollection.get(uri)?.map((elem) => elem) || [];
diagnostics.push(this.buildDiagnostic(notification));
this.diagnosticCollection.set(uri, diagnostics);
}

public kogitoNotifications_setNotifications(path: string, notifications: Notification[]): void {
const uri = vscode.Uri.file(path);
const uri = vscode.Uri.parse(path);
const diagnostics = notifications.map((notification) => this.buildDiagnostic(notification));
this.diagnosticCollection.set(uri, diagnostics);
}

public kogitoNotifications_removeNotifications(path: string) {
this.diagnosticCollection.delete(vscode.Uri.file(path));
this.diagnosticCollection.delete(vscode.Uri.parse(path));
}

private buildDiagnostic(notification: Notification): vscode.Diagnostic {
Expand Down
24 changes: 24 additions & 0 deletions packages/vscode-extension-bpmn-editor/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
"outFiles": ["${workspaceRoot}/dist/**/*.js"],
"preLaunchTask": "npm: watch"
},
{
"name": "Run Extension (web)",
"type": "pwa-extensionHost",
"debugWebWorkerHost": true,
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionDevelopmentKind=web"],
"outFiles": ["${workspaceRoot}/dist/**/*.js"],
"preLaunchTask": "npm: watch"
}
]
}
9 changes: 9 additions & 0 deletions packages/vscode-extension-bpmn-editor/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"files.exclude": {
"out": false
},
"search.exclude": {
"out": true
},
"typescript.tsc.autoDetect": "off"
}
18 changes: 18 additions & 0 deletions packages/vscode-extension-bpmn-editor/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
4 changes: 3 additions & 1 deletion packages/vscode-extension-bpmn-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"build:dev": "rimraf dist && webpack --env dev",
"pack:prod": "vsce package --githubBranch main --yarn -o ./dist/vscode_extension_bpmn_editor_$npm_package_version.vsix",
"compile": "webpack",
"watch": "webpack"
"watch": "webpack",
"run:webmode": "yarn vscode-test-web --browserType=chromium --extensionDevelopmentPath=. --version=stable"
},
"dependencies": {
"@kie-tooling-core/editor": "0.0.0",
Expand All @@ -28,6 +29,7 @@
},
"icon": "icon.png",
"main": "./dist/extension/extension.js",
"browser": "./dist/extension/extension.js",
"engines": {
"vscode": "^1.46.0"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/vscode-extension-bpmn-editor/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const commonConfig = (env) =>
library: "DmnEditor",
libraryTarget: "umd",
umdNamedDefine: true,
globalObject: "this",
},
externals: {
vscode: "commonjs vscode",
Expand All @@ -35,7 +36,7 @@ const commonConfig = (env) =>

module.exports = async (env) => [
merge(commonConfig(env), {
target: "node",
target: "web",
entry: {
"extension/extension": "./src/extension/extension.ts",
},
Expand Down
24 changes: 24 additions & 0 deletions packages/vscode-extension-dmn-editor/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
"outFiles": ["${workspaceRoot}/dist/**/*.js"],
"preLaunchTask": "npm: watch"
},
{
"name": "Run Extension (web)",
"type": "pwa-extensionHost",
"debugWebWorkerHost": true,
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionDevelopmentKind=web"],
"outFiles": ["${workspaceRoot}/dist/**/*.js"],
"preLaunchTask": "npm: watch"
}
]
}
9 changes: 9 additions & 0 deletions packages/vscode-extension-dmn-editor/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"files.exclude": {
"out": false
},
"search.exclude": {
"out": true
},
"typescript.tsc.autoDetect": "off"
}
18 changes: 18 additions & 0 deletions packages/vscode-extension-dmn-editor/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
4 changes: 3 additions & 1 deletion packages/vscode-extension-dmn-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"build:dev": "rimraf dist && webpack --env dev",
"pack:prod": "vsce package --githubBranch main --yarn -o ./dist/vscode_extension_dmn_editor_$npm_package_version.vsix",
"compile": "webpack",
"watch": "webpack"
"watch": "webpack",
"run:webmode": "yarn vscode-test-web --browserType=chromium --extensionDevelopmentPath=. --version=stable"
},
"dependencies": {
"@kie-tooling-core/editor": "0.0.0",
Expand All @@ -29,6 +30,7 @@
},
"icon": "icon.png",
"main": "./dist/extension/extension.js",
"browser": "./dist/extension/extension.js",
"engines": {
"vscode": "^1.46.0"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/vscode-extension-dmn-editor/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const commonConfig = (env) =>
library: "DmnEditor",
libraryTarget: "umd",
umdNamedDefine: true,
globalObject: "this",
},
externals: {
vscode: "commonjs vscode",
Expand All @@ -34,7 +35,7 @@ const commonConfig = (env) =>

module.exports = async (env) => [
merge(commonConfig(env), {
target: "node",
target: "web",
entry: {
"extension/extension": "./src/extension/extension.ts",
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}"
],
"outFiles": [
"${workspaceRoot}/dist/**/*.js"
],
"preLaunchTask": "npm: watch"
}
]
}
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
"outFiles": ["${workspaceRoot}/dist/**/*.js"],
"preLaunchTask": "npm: watch"
},
{
"name": "Run Extension (web)",
"type": "pwa-extensionHost",
"debugWebWorkerHost": true,
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionDevelopmentKind=web"],
"outFiles": ["${workspaceRoot}/dist/**/*.js"],
"preLaunchTask": "npm: watch"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"files.exclude": {
"out": false
},
"search.exclude": {
"out": true
},
"typescript.tsc.autoDetect": "off"
}
"files.exclude": {
"out": false
},
"search.exclude": {
"out": true
},
"typescript.tsc.autoDetect": "off"
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
],
"publisher": "kie-group",
"main": "./dist/extension/extension.js",
"browser": "./dist/extension/extension.js",
"capabilities": {
"untrustedWorkspaces": {
"supported": false
Expand Down Expand Up @@ -131,7 +132,8 @@
"test:it:insider": "rimraf ./test-resource && rimraf ./out && tsc --project tsconfig.it-tests.json --skipLibCheck --sourceMap true && extest setup-and-run -t insider --yarn -u -e ./test-resources -o it-tests/settings.json out/*.test.js",
"test:it:clean": "rimraf ./dist-it-tests && rimraf ./test-resource && rimraf ./out && rimraf ./it-tests-tmp",
"build:dev": "rimraf dist && webpack --env dev",
"build:prod": "rimraf dist && yarn lint && webpack && yarn run test && yarn run package:prod && yarn test:it"
"build:prod": "rimraf dist && yarn lint && webpack && yarn run test && yarn run package:prod && yarn test:it",
"run:webmode": "yarn vscode-test-web --browserType=chromium --extensionDevelopmentPath=. --version=stable"
},
"dependencies": {
"@kie-tooling-core/patternfly-base": "0.0.0",
Expand Down
Loading