From f29c25f4ee75d5f1a3da36a2a39eb0565907d952 Mon Sep 17 00:00:00 2001 From: Uni Sayo Date: Thu, 8 Nov 2018 21:15:54 +0000 Subject: [PATCH 1/3] Initial commit v0.1.0 --- .gitignore | 6 + .gitpod | 8 + .vscode/launch.json | 60 + README.md | 48 +- browser-app/package.json | 32 + electron-app/package.json | 32 + lerna.json | 11 + package.json | 18 + theia-vue-extension/data/vue.tmLanguage.json | 929 ++ theia-vue-extension/package.json | 39 + theia-vue-extension/src/browser/monaco.d.ts | 1 + .../src/browser/vue-client-contribution.ts | 22 + .../src/browser/vue-frontend-module.ts | 13 + .../src/browser/vue-grammar-contribution.ts | 58 + theia-vue-extension/src/common/index.ts | 2 + .../src/node/vue-backend-module.ts | 7 + .../src/node/vue-contribution.ts | 33 + theia-vue-extension/src/node/vue-starter.ts | 1 + theia-vue-extension/tsconfig.json | 23 + yarn.lock | 11247 ++++++++++++++++ 20 files changed, 12588 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 .gitpod create mode 100644 .vscode/launch.json create mode 100644 browser-app/package.json create mode 100644 electron-app/package.json create mode 100644 lerna.json create mode 100644 package.json create mode 100644 theia-vue-extension/data/vue.tmLanguage.json create mode 100644 theia-vue-extension/package.json create mode 100644 theia-vue-extension/src/browser/monaco.d.ts create mode 100644 theia-vue-extension/src/browser/vue-client-contribution.ts create mode 100644 theia-vue-extension/src/browser/vue-frontend-module.ts create mode 100644 theia-vue-extension/src/browser/vue-grammar-contribution.ts create mode 100644 theia-vue-extension/src/common/index.ts create mode 100644 theia-vue-extension/src/node/vue-backend-module.ts create mode 100644 theia-vue-extension/src/node/vue-contribution.ts create mode 100644 theia-vue-extension/src/node/vue-starter.ts create mode 100644 theia-vue-extension/tsconfig.json create mode 100644 yarn.lock diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a0160d6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +node_modules +.browser_modules +lib +*.log +*-app/* +!*-app/package.json diff --git a/.gitpod b/.gitpod new file mode 100644 index 0000000..7b83963 --- /dev/null +++ b/.gitpod @@ -0,0 +1,8 @@ +ports: +- port: 3000 + protocol: "http" +tasks: + - command: > + yarn && + cd browser-app && + yarn start --hostname 0.0.0.0 ../.. diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..63be103 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,60 @@ +{ + // Use IntelliSense to learn about possible Node.js debug attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Start Browser Backend", + "program": "${workspaceRoot}/browser-app/src-gen/backend/main.js", + "args": [ + "--loglevel=debug", + "--port=3000", + "--no-cluster" + ], + "env": { + "NODE_ENV": "development" + }, + "sourceMaps": true, + "outFiles": [ + "${workspaceRoot}/node_modules/@theia/*/lib/**/*.js", + "${workspaceRoot}/browser-app/lib/**/*.js", + "${workspaceRoot}/browser-app/src-gen/**/*.js" + ], + "smartStep": true, + "internalConsoleOptions": "openOnSessionStart", + "outputCapture": "std" + }, + { + "type": "node", + "request": "launch", + "name": "Start Electron Backend", + "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron", + "windows": { + "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd" + }, + "program": "${workspaceRoot}/electron-app/src-gen/frontend/electron-main.js", + "protocol": "inspector", + "args": [ + "--loglevel=debug", + "--hostname=localhost", + "--no-cluster" + ], + "env": { + "NODE_ENV": "development" + }, + "sourceMaps": true, + "outFiles": [ + "${workspaceRoot}/electron-app/src-gen/frontend/electron-main.js", + "${workspaceRoot}/electron-app/src-gen/backend/main.js", + "${workspaceRoot}/electron-app/lib/**/*.js", + "${workspaceRoot}/node_modules/@theia/*/lib/**/*.js" + ], + "smartStep": true, + "internalConsoleOptions": "openOnSessionStart", + "outputCapture": "std" + } + ] +} \ No newline at end of file diff --git a/README.md b/README.md index ded036a..ea6d557 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,46 @@ -# theia-vue-extension -theia ide extension for vuejs +# Theia Vue Extension +Adds VueJs extension support to [Theia IDE](https://www.theia-ide.org/) + +## Getting started + +Install [nvm](https://github.com/creationix/nvm#install-script). + + curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash + +Install npm and node. + + nvm install 8 + nvm use 8 + +Install yarn. + + npm install -g yarn + +## Development Installation +For local installation: + +- `git clone https://github.com/uniibu/theia-vue-extension.git` +- `cd theia-vue-extension` +- `yarn` + +## Running the Browser example + + yarn rebuild:browser + cd browser-app + yarn start + +## Running the Electron example + + yarn rebuild:electron + cd electron-app + yarn start + +## Publishing vue + +Create a npm user and login to the npm registry, [more on npm publishing](https://docs.npmjs.com/getting-started/publishing-npm-packages). + + npm login + +Publish packages with lerna to update versions properly across local packages, [more on publishing with lerna](https://github.com/lerna/lerna#publish). + + npx lerna publish diff --git a/browser-app/package.json b/browser-app/package.json new file mode 100644 index 0000000..d230763 --- /dev/null +++ b/browser-app/package.json @@ -0,0 +1,32 @@ +{ + "private": true, + "name": "browser-app", + "version": "0.0.0", + "dependencies": { + "@theia/core": "next", + "@theia/filesystem": "next", + "@theia/workspace": "next", + "@theia/preferences": "next", + "@theia/navigator": "next", + "@theia/process": "next", + "@theia/terminal": "next", + "@theia/editor": "next", + "@theia/languages": "next", + "@theia/markers": "next", + "@theia/monaco": "next", + "@theia/typescript": "next", + "@theia/messages": "next", + "@unibtc/theia-vue-extension": "^0.1.0" + }, + "devDependencies": { + "@theia/cli": "next" + }, + "scripts": { + "prepare": "theia build --mode development", + "start": "theia start", + "watch": "theia build --watch --mode development" + }, + "theia": { + "target": "browser" + } +} \ No newline at end of file diff --git a/electron-app/package.json b/electron-app/package.json new file mode 100644 index 0000000..6129998 --- /dev/null +++ b/electron-app/package.json @@ -0,0 +1,32 @@ +{ + "private": true, + "name": "electron-app", + "version": "0.0.0", + "dependencies": { + "@theia/core": "next", + "@theia/filesystem": "next", + "@theia/workspace": "next", + "@theia/preferences": "next", + "@theia/navigator": "next", + "@theia/process": "next", + "@theia/terminal": "next", + "@theia/editor": "next", + "@theia/languages": "next", + "@theia/markers": "next", + "@theia/monaco": "next", + "@theia/typescript": "next", + "@theia/messages": "next", + "@unibtc/theia-vue-extension": "^0.1.0" + }, + "devDependencies": { + "@theia/cli": "next" + }, + "scripts": { + "prepare": "theia build --mode development", + "start": "theia start", + "watch": "theia build --watch --mode development" + }, + "theia": { + "target": "electron" + } +} \ No newline at end of file diff --git a/lerna.json b/lerna.json new file mode 100644 index 0000000..25d3bbc --- /dev/null +++ b/lerna.json @@ -0,0 +1,11 @@ +{ + "lerna": "2.11.0", + "version": "0.1.0", + "useWorkspaces": true, + "npmClient": "yarn", + "command": { + "run": { + "stream": true + } + } +} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..6e72a34 --- /dev/null +++ b/package.json @@ -0,0 +1,18 @@ +{ + "private": true, + "scripts": { + "prepare": "lerna run prepare", + "rebuild:browser": "theia rebuild:browser", + "rebuild:electron": "theia rebuild:electron", + "publish:latest": "lerna publish --registry=https://registry.npmjs.org/ --exact --skip-git", + "publish:next": "lerna publish --registry=https://registry.npmjs.org/ --exact --canary=next --npm-tag=next --skip-git --yes" + }, + "devDependencies": { + "lerna": "2.11.0" + }, + "workspaces": [ + "theia-vue-extension", + "browser-app", + "electron-app" + ] +} \ No newline at end of file diff --git a/theia-vue-extension/data/vue.tmLanguage.json b/theia-vue-extension/data/vue.tmLanguage.json new file mode 100644 index 0000000..ff4fb50 --- /dev/null +++ b/theia-vue-extension/data/vue.tmLanguage.json @@ -0,0 +1,929 @@ +{ + "information_for_contributors": [ + "This file has been converted from https://github.com/vuejs/vue-syntax-highlight/blob/master/vue.tmLanguage", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], + "version": "https://github.com/vuejs/vue-syntax-highlight/commit/bc432742a6cf1c53fb3f93f9b87cc7f217dae328", + "name": "Vue Component", + "scopeName": "text.html.vue", + "patterns": [ + { + "include": "#vue-interpolations" + }, + { + "begin": "(<)([a-zA-Z0-9:-]++)(?=[^>]*>)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.tag.begin.html" + }, + "2": { + "name": "entity.name.tag.html" + } + }, + "end": "(>)(<)(/)(\\2)(>)", + "endCaptures": { + "1": { + "name": "punctuation.definition.tag.end.html" + }, + "2": { + "name": "punctuation.definition.tag.begin.html meta.scope.between-tag-pair.html" + }, + "3": { + "name": "punctuation.definition.tag.begin.html" + }, + "4": { + "name": "entity.name.tag.html" + }, + "5": { + "name": "punctuation.definition.tag.end.html" + } + }, + "name": "meta.tag.any.html", + "patterns": [ + { + "include": "#tag-stuff" + } + ] + }, + { + "begin": "(<\\?)(xml)", + "captures": { + "1": { + "name": "punctuation.definition.tag.html" + }, + "2": { + "name": "entity.name.tag.xml.html" + } + }, + "end": "(\\?>)", + "name": "meta.tag.preprocessor.xml.html", + "patterns": [ + { + "include": "#tag-generic-attribute" + }, + { + "include": "#string-double-quoted" + }, + { + "include": "#string-single-quoted" + } + ] + }, + { + "begin": "