Skip to content

Commit 065a992

Browse files
authored
Move config parser into a separate package (#51)
* move parser into external package * add readme * remove old dependencies * update ci script * no ci flag * add build step
1 parent 7156e54 commit 065a992

File tree

113 files changed

+918
-445
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+918
-445
lines changed

.circleci/config.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ jobs:
1414
- v3-dependencies-
1515

1616
- run: sudo npm install lerna -g
17+
- run: lerna bootstrap --no-ci
1718
- run: npm install
18-
- run: lerna bootstrap
1919

2020
- save_cache:
2121
paths:
2222
- node_modules
2323
key: v3-dependencies-{{ checksum "package-lock.json" }}
2424

25+
- run: npm run build
2526
- run: npm run lint:types
2627
- run: npm run lint:ts
2728
- run: npm test

.eslintignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
**/node_modules/**
2-
**/out/**
2+
**/dist/**

.eslintrc.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
parser: "@typescript-eslint/parser",
3-
plugins: ["@typescript-eslint"],
3+
plugins: ["@typescript-eslint", "simple-import-sort"],
44
extends: [
55
"plugin:@typescript-eslint/recommended",
66
"prettier/@typescript-eslint",
@@ -13,6 +13,7 @@ module.exports = {
1313
rules: {
1414
"no-console": 2,
1515
"prettier/prettier": "error",
16+
"simple-import-sort/sort": "error",
1617
"@typescript-eslint/explicit-member-accessibility": [
1718
2,
1819
{
@@ -26,6 +27,8 @@ module.exports = {
2627
"@typescript-eslint/interface-name-prefix": 0,
2728
"@typescript-eslint/explicit-function-return-type": "off",
2829
"@typescript-eslint/no-non-null-assertion": "off",
29-
"@typescript-eslint/no-use-before-define": "off"
30+
"@typescript-eslint/no-use-before-define": "off",
31+
"sort-imports": "off",
32+
"import/order": "off"
3033
}
3134
}

.gitignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
**/node_modules
22
node_modules
3-
**/out
3+
**/dist
44
*.log
5-
*.vsix
5+
*.vsix
6+
.cache

.vscode/launch.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
"stopOnEntry": false,
1414
"sourceMaps": true,
1515
"outFiles": [
16-
"${workspaceRoot}/packages/vscode/out/**/*.js"
16+
"${workspaceRoot}/packages/vscode/dist/**/*.js"
1717
],
18-
"preLaunchTask": "compile"
18+
"preLaunchTask": "build"
1919
},
2020
{
2121
"name": "Attach Server",
@@ -24,7 +24,7 @@
2424
"port": 6009,
2525
"sourceMaps": true,
2626
"outFiles": [
27-
"${workspaceRoot}/packages/server/out/server/**/*.js"
27+
"${workspaceRoot}/packages/language-server/dist/**/*.js"
2828
],
2929
"protocol": "inspector",
3030
"trace": true

.vscode/tasks.json

+3-21
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,10 @@
22
"version": "2.0.0",
33
"tasks": [
44
{
5-
"label": "Watch client",
5+
"label": "build",
66
"type": "shell",
7-
"command": "lerna run --scope serverless-ide-vscode watch",
8-
"group": "build"
9-
},
10-
{
11-
"label": "compile",
12-
"type": "shell",
13-
"command": "lerna run --scope serverless-ide-vscode compile; and lerna run --scope @serverless-ide/language-server compile",
14-
"group": "build"
15-
},
16-
{
17-
"label": "Compile client",
18-
"type": "shell",
19-
"command": "lerna run --scope serverless-ide-vscode compile",
20-
"group": "build"
21-
},
22-
{
23-
"label": "Compile server",
24-
"type": "shell",
25-
"command": "lerna run --scope @serverless-ide/language-server compile",
7+
"command": "lerna run build",
268
"group": "build"
279
}
2810
]
29-
}
11+
}

README.md

+27-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[![Marketplace Version](https://vsmarketplacebadge.apphb.com/version/ThreadHeap.serverless-ide-vscode.svg 'Current Release')](https://marketplace.visualstudio.com/items?itemName=ThreadHeap.serverless-ide-vscode)
22
[![Rating](https://vsmarketplacebadge.apphb.com/rating-star/ThreadHeap.serverless-ide-vscode.svg 'Current Release')](https://marketplace.visualstudio.com/items?itemName=ThreadHeap.serverless-ide-vscode)
33
[![Installs](https://vsmarketplacebadge.apphb.com/installs/ThreadHeap.serverless-ide-vscode.svg 'Current Release')](https://marketplace.visualstudio.com/items?itemName=ThreadHeap.serverless-ide-vscode)
4-
[![Downloads](https://vsmarketplacebadge.apphb.com/downloads/ThreadHeap.serverless-ide-vscode.svg 'Current Release')](https://marketplace.visualstudio.com/items?itemName=ThreadHeap.serverless-ide-vscode)
54

65
# Serverless IDE: Enhanced support of AWS SAM, CloudFormation and Serverless Framework in Visual Studio Code
76

@@ -83,10 +82,6 @@ IMPORTANT: This option requires a restart of VS Code to take effect.
8382

8483
NOTE: We also respect the global telemetry setting telemetry.enableTelemetry; if that is set to false, ServerlessIDE telemetry is disabled. For more information see [Microsoft’s documentation](https://code.visualstudio.com/docs/supporting/faq#_how-to-disable-telemetry-reporting).
8584

86-
## Contributions
87-
88-
You can find [the code on GitHub repository](https://github.com/threadheap/serverless-ide-vscode)
89-
9085
## Questions and feedback
9186

9287
Feature requests and feedback are very appreciated
@@ -98,6 +93,33 @@ Check out [public roadmap board](https://github.com/threadheap/serverless-ide-vs
9893
DM or follow me on [twitter](https://twitter.com/pvl4sov) or [medium](https://medium.com/@pvlasov)
9994
or contact [by email](mailto:[email protected])
10095

96+
## Contributions
97+
98+
You can find [the code on GitHub repository](https://github.com/threadheap/serverless-ide-vscode)
99+
100+
### Setup
101+
102+
The project is split between packages backed by lerna.
103+
You can explore source code in `packages` folder.
104+
105+
#### Prerequisites
106+
107+
NodeJS >= 8.x
108+
VSCode
109+
110+
```sh
111+
npm install lerna -g
112+
npm install
113+
lerna bootstrap
114+
```
115+
116+
#### Test run
117+
118+
To test your changes in VSCode
119+
120+
Use `Launch Extension` command to build and start extension
121+
Use `Attach Server` command to attach debugger
122+
101123
### Author
102124

103125
[Pavel Vlasov](https://github.com/pavelvlasov)

jest.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ module.exports = {
66
],
77
testMatch: ["**/__tests__/**/?(*.)+(spec|test).+(ts|js)"],
88
modulePathIgnorePatterns: ["node_modules"],
9+
moduleNameMapper: {
10+
"@serverless-ide/(.*)$": "<rootDir>/packages/$1"
11+
},
912
preset: "ts-jest",
1013
testEnvironment: "node",
1114
verbose: false

lerna.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
"*.txt",
1010
"lerna.json"
1111
]
12-
}
12+
}

package-lock.json

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"eslint": "^6.0.1",
1212
"eslint-config-prettier": "^6.0.0",
1313
"eslint-plugin-prettier": "^3.1.0",
14+
"eslint-plugin-simple-import-sort": "^4.0.0",
1415
"husky": "^1.3.1",
1516
"jest": "^23.6.0",
1617
"lerna": "^3.15.0",
@@ -25,7 +26,7 @@
2526
"test": "jest",
2627
"test:changed": "jest --bail --findRelatedTests",
2728
"pre-commit": "./node_modules/.bin/lint-staged",
28-
"compile": "lerna run compile",
29+
"build": "lerna run build",
2930
"lint:types": "lerna run lint:types",
3031
"lint:ts": "eslint **/*.ts",
3132
"lint:ts:fix": "eslint **/*.ts --fix"

packages/cloudformation-schema/package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@serverless-ide/cloudformation-schema",
33
"version": "0.5.0",
44
"description": "Json schema for AWS SAM template configuration",
5-
"main": "out/index.js",
5+
"main": "dist/index.js",
66
"repository": "[email protected]:threadheap/aws-sam-json-schema.git",
77
"author": "Pavel Vlasov <[email protected]>",
88
"keywords": [
@@ -30,14 +30,14 @@
3030
"@types/request-promise": "^4.1.42"
3131
},
3232
"scripts": {
33-
"build": "rm -rf ./out && tsc -p .",
34-
"lint:types": "tsc --noEmit",
35-
"watch": "rm -rf ./out && npm run build --watch",
36-
"generate": "npm run build && node out/index.js",
37-
"prepublish": "npm run generate"
33+
"build": "npm run clean && npm run compile && node dist/index.js",
34+
"clean": "rm -rf ./dist",
35+
"compile": "tsc",
36+
"prepublishOnly": "npm run generate",
37+
"lint:types": "tsc --noEmit"
3838
},
3939
"publishConfig": {
4040
"access": "public"
4141
},
4242
"gitHead": "4bc5eddda35b9e7cc28f2580da1960b017881f33"
43-
}
43+
}
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
{
2+
"extends": "../../tsconfig.base.json",
23
"compilerOptions": {
3-
"target": "es6",
4-
"moduleResolution": "node",
5-
"module": "commonjs",
6-
"strict": true,
7-
"outDir": "./out",
8-
"declaration": true
4+
"outDir": "dist"
95
},
106
"include": [
117
"src"
12-
],
13-
"exclude": [
14-
"out"
158
]
169
}

packages/config/.npmignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
src/
2+
test/
3+
tsconfig.json
4+
jest.config.js

0 commit comments

Comments
 (0)