+ Add ignores for generated files
+ Add webpack
This commit is contained in:
2021-04-18 00:49:55 +05:30
parent bef076239e
commit 518e8ecbed
12 changed files with 8229 additions and 152 deletions

View File

@@ -3,3 +3,7 @@ client/node_modules/**
client/out/** client/out/**
server/node_modules/** server/node_modules/**
server/out/** server/out/**
server/dist/**
client/dist/**
client/src/generated/**

1
.gitignore vendored
View File

@@ -1,5 +1,6 @@
test.bf test.bf
out out
dist
node_modules node_modules
client/server client/server
.vscode-test .vscode-test

View File

@@ -1,15 +1,23 @@
client/bf.g4 **/out
*.bf
client/**
server/**
node_modules
!client/dist
!server/dist
**/*.md
!README.md
*.vsix
.vscode/** .vscode/**
**/*.ts **/*.ts
**/*.map **/*.map
.gitignore **/.gitignore
**/.eslintrc.json
**/.eslintignore
**/tsconfig.json **/tsconfig.json
**/tsconfig.base.json **/tsconfig.base.json
contributing.md # contributing.md
.travis.yml .travis.yml
client/node_modules/** # client/node_modules/**
!client/node_modules/vscode-jsonrpc/**
!client/node_modules/vscode-languageclient/**
!client/node_modules/vscode-languageserver-protocol/**
!client/node_modules/vscode-languageserver-types/**
!client/node_modules/semver/**

2364
client/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -18,10 +18,14 @@
}, },
"devDependencies": { "devDependencies": {
"@types/vscode": "1.43.0", "@types/vscode": "1.43.0",
"antlr4ts-cli": "^0.5.0-alpha.4", "vscode-test": "^1.3.0",
"vscode-test": "^1.3.0" "webpack": "^5.33.2",
"webpack-cli": "^4.6.0"
}, },
"scripts": { "scripts": {
"regen": "antlr4ts bf.g4 -no-listener -visitor -o src/generated/" "regen": "antlr4ts bf.g4 -no-listener -visitor -o src/generated/",
"webpack": "webpack --mode development",
"webpack-prod":"webpack --mode production",
"webpack-dev": "webpack --mode development --watch"
} }
} }

View File

@@ -19,7 +19,7 @@ let client: LanguageClient;
export function activate(context: ExtensionContext) { export function activate(context: ExtensionContext) {
// The server is implemented in node // The server is implemented in node
let serverModule = context.asAbsolutePath( let serverModule = context.asAbsolutePath(
path.join('server', 'out', 'server.js') path.join('server', 'dist', 'server.js')
); );
// The debug options for the server // The debug options for the server
// --inspect=6009: runs the server in Node's Inspector mode so VS Code can attach to the server for debugging // --inspect=6009: runs the server in Node's Inspector mode so VS Code can attach to the server for debugging

51
client/webpack.config.js Normal file
View File

@@ -0,0 +1,51 @@
//@ts-check
'use strict';
const path = require('path');
// const {} = require('webpack');
/**@type {import('webpack').Configuration}*/
const config = {
target: 'node', // vscode extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/
entry: {
extension:path.join(__dirname,'src','extension.ts'),
}, // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/
output: {
// the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
libraryTarget: 'commonjs2',
devtoolModuleFilenameTemplate: '../[resource-path]'
},
devtool: 'source-map',
externals: {
vscode: 'commonjs vscode' // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/
},
resolve: {
// support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader
extensions: ['.ts', '.js'],
plugins:[]
},
stats:'minimal',
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
use: [
{
loader: 'ts-loader',
options:{
configFile : 'tsconfig.json'
}
}
],
}
]
},
};
module.exports = config;

3478
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -5,15 +5,15 @@
"author": "Atreya Bain", "author": "Atreya Bain",
"license": "MIT", "license": "MIT",
"publisher": "atreyabain", "publisher": "atreyabain",
"version": "0.0.1", "version": "0.0.3",
"icon":"assets/128.png", "icon": "assets/128.png",
"categories": [], "categories": [],
"keywords": [ "keywords": [
"multi-root ready", "multi-root ready",
"brainfuck", "brainfuck",
"branflakes" "branflakes"
], ],
"prettier":{ "prettier": {
"tabWidth": 4, "tabWidth": 4,
"semi": true, "semi": true,
"arrowParens": "avoid", "arrowParens": "avoid",
@@ -27,9 +27,9 @@
], ],
"repository": { "repository": {
"type": "git", "type": "git",
"url":"https://github.com/chrisvrose/bf-server" "url": "https://github.com/chrisvrose/bf-server"
}, },
"main": "./client/out/extension", "main": "./client/dist/extension",
"contributes": { "contributes": {
"languages": [ "languages": [
{ {
@@ -55,12 +55,14 @@
"path": "./syntaxes/bf.tmLanguage.json" "path": "./syntaxes/bf.tmLanguage.json"
} }
], ],
"commands": [{ "commands": [
{
"command": "bf.execute", "command": "bf.execute",
"title": "BF: Execute", "title": "BF: Execute",
"when": "editorLangId == bf", "when": "editorLangId == bf",
"enablement": "editorLangId == bf" "enablement": "editorLangId == bf"
}], }
],
"configuration": { "configuration": {
"type": "object", "type": "object",
"title": "Configurable properties", "title": "Configurable properties",
@@ -87,7 +89,8 @@
}, },
"scripts": { "scripts": {
"vscode:prepublish": "npm run compile", "vscode:prepublish": "npm run compile",
"compile": "tsc -b", "compile": "concurrently \"npm run webpack-prod --prefix client\" \"npm run webpack-prod --prefix server \"",
"_compile": "tsc -b",
"watch": "tsc -b -w", "watch": "tsc -b -w",
"postinstall": "cd client && npm install && cd ../server && npm install && cd .." "postinstall": "cd client && npm install && cd ../server && npm install && cd .."
}, },
@@ -98,6 +101,12 @@
"@typescript-eslint/parser": "^2.33.0", "@typescript-eslint/parser": "^2.33.0",
"eslint": "^6.4.0", "eslint": "^6.4.0",
"mocha": "^6.2.2", "mocha": "^6.2.2",
"typescript": "^3.9.2" "ts-loader": "^8.1.0",
"typescript": "^3.9.2",
"webpack": "^5.33.2",
"webpack-cli": "^4.6.0"
},
"dependencies": {
"concurrently": "^6.0.2"
} }
} }

2348
server/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -15,5 +15,13 @@
"vscode-languageserver": "^6.1.1", "vscode-languageserver": "^6.1.1",
"vscode-languageserver-textdocument": "^1.0.1" "vscode-languageserver-textdocument": "^1.0.1"
}, },
"scripts": {} "scripts": {
"webpack-prod":"webpack --mode production",
"webpack": "webpack --mode development",
"webpack-dev": "webpack --mode development --watch"
},
"devDependencies": {
"webpack": "^5.33.2",
"webpack-cli": "^4.6.0"
}
} }

50
server/webpack.config.js Normal file
View File

@@ -0,0 +1,50 @@
//@ts-check
'use strict';
const path = require('path');
/**@type {import('webpack').Configuration}*/
const config = {
target: 'node', // vscode extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/
entry: {
server:path.join(__dirname,'src','server.ts'),
}, // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/
output: {
// the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
libraryTarget: 'commonjs2',
devtoolModuleFilenameTemplate: '../[resource-path]'
},
stats:'minimal',
devtool: 'source-map',
externals: {
vscode: 'commonjs vscode' // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/
},
resolve: {
// support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader
extensions: ['.ts', '.js'],
plugins:[]
},
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
use: [
{
loader: 'ts-loader',
options:{
configFile : 'tsconfig.json'
}
}
],
}
]
},
};
module.exports = config;