Skip to content
This repository was archived by the owner on Feb 2, 2018. It is now read-only.

Commit 6e60cfa

Browse files
authored
Merge pull request #2 from strongloop/initial-setup
Add initial project infrastructure
2 parents 706710f + 1e4ec5e commit 6e60cfa

File tree

19 files changed

+305
-2
lines changed

19 files changed

+305
-2
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
dist
3+
dist6

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"eslintIntegration": true,
3+
"bracketSpacing": false,
4+
"singleQuote": true,
5+
"printWidth": 80,
6+
"trailingComma": "all"
7+
}

.vscode/settings.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"editor.rulers": [80],
3+
"editor.tabCompletion": true,
4+
"editor.tabSize": 2,
5+
"editor.trimAutoWhitespace": true,
6+
"editor.formatOnSave": true,
7+
8+
"files.exclude": {
9+
"**/.DS_Store": true,
10+
"**/.git": true,
11+
"**/.hg": true,
12+
"**/.svn": true,
13+
"**/CVS": true,
14+
"dist": true,
15+
"dist6": true
16+
},
17+
"files.insertFinalNewline": true,
18+
"files.trimTrailingWhitespace": true,
19+
20+
"tslint.ignoreDefinitionFiles": true,
21+
"typescript.tsdk": "./node_modules/typescript/lib"
22+
}

.vscode/tasks.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"taskName": "Watch and compile TypeScript",
8+
"command": "tsc",
9+
"args": ["--watch"],
10+
"type": "process",
11+
"isBackground": true,
12+
"problemMatcher": "$tsc-watch",
13+
"group": {
14+
"kind": "build",
15+
"isDefault": true
16+
},
17+
"presentation": {
18+
"echo": true,
19+
"reveal": "never",
20+
"focus": false,
21+
"panel": "dedicated"
22+
}
23+
},
24+
{
25+
"taskName": "Test and lint",
26+
"command": "npm",
27+
"args": [
28+
"--silent",
29+
"run",
30+
"vscode-test"
31+
],
32+
"type": "process",
33+
"group": {
34+
"kind": "test",
35+
"isDefault": true
36+
},
37+
"presentation": {
38+
"echo": true,
39+
"reveal": "always",
40+
"focus": false,
41+
"panel": "dedicated"
42+
},
43+
"problemMatcher": "$tslint5"
44+
}
45+
]
46+
}

DEVELOPING.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Developer's Guide
2+
3+
We use Visual Studio Code for developing LoopBack and recommend the same to our contributors.
4+
5+
While this package supports both Node.js 6.x and 8.x versions, you will need Node.js 8.x (or newer) for the best development experience in VS Code.
6+
7+
## VSCode setup
8+
9+
Install the following extensions:
10+
11+
- [tslint](https://marketplace.visualstudio.com/items?itemName=eg2.tslint)
12+
- [prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
13+
14+
## Development workflow
15+
16+
1. Start the build task (Cmd+Shift+B), it will run TypeScript compiler in backround, watching and recompiling files as you change them. Compilation errors will be shown in the VSCode's "PROBLEMS" window.
17+
18+
19+
2. Execute "Test and lint" task (Cmd+Shift+T) to re-run the test suite and lint the code for both programming and style errors. Linting errors will be shown in VSCode's "PROBLEMS" window. Failed tests are printed to terminal output only.
20+
21+
3. Run "npm test" explicitly before committing your changes. This will execute the same sequence as our CI server does.

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# loopback-next-extension-starter
2-
A starter project to create extensions for loopback-next
32

4-
Starting point to create a variety of extensions for loopback-next.
3+
A starter project to create extensions for loopback-next.

index.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Copyright IBM Corp. 2017. All Rights Reserved.
2+
// Node module: @loopback/core
3+
// This file is licensed under the MIT License.
4+
// License text available at https://opensource.org/licenses/MIT
5+
6+
export * from './dist/lib';

index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Copyright IBM Corp. 2017. All Rights Reserved.
2+
// Node module: @loopback/core
3+
// This file is licensed under the MIT License.
4+
// License text available at https://opensource.org/licenses/MIT
5+
6+
const nodeMajorVersion = +process.versions.node.split('.')[0];
7+
module.exports = nodeMajorVersion >= 7 ?
8+
require('./dist/lib') :
9+
require('./dist6/lib');

package.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"name": "loopback-next-extension-starter",
3+
"version": "1.0.0",
4+
"description": "A starter project for LoopBack Next Extensions",
5+
"main": "index.js",
6+
"scripts": {
7+
"build": "npm run build:lib && npm run build:lib6",
8+
"build:lib": "tsc --target es2017 --outDir dist",
9+
"build:lib6": "tsc --target es2015 --outDir dist6",
10+
"lint": "tslint -c tslint.full.json --project tsconfig.json --type-check",
11+
"lint:fix": "npm run lint -- --fix",
12+
"prepublish": "npm run build",
13+
"pretest": "npm run build",
14+
"test": "mocha",
15+
"posttest": "npm run lint",
16+
"vscode-test": "mocha && npm run lint"
17+
},
18+
"repository": {
19+
"type": "git",
20+
"url": "git+https://github.com/strongloop/loopback-next-extension-starter.git"
21+
},
22+
"author": "",
23+
"license": "MIT",
24+
"bugs": {
25+
"url": "https://github.com/strongloop/loopback-next-extension-starter/issues"
26+
},
27+
"homepage": "https://github.com/strongloop/loopback-next-extension-starter#readme",
28+
"files": [
29+
"README.md",
30+
"index.js",
31+
"index.d.ts",
32+
"dist",
33+
"dist6"
34+
],
35+
"dependencies": {
36+
"@loopback/core": "^4.0.0-alpha.14",
37+
"@loopback/repository": "^4.0.0-alpha.8"
38+
},
39+
"devDependencies": {
40+
"@loopback/testlab": "^4.0.0-alpha.7",
41+
"@types/mocha": "^2.2.43",
42+
"mocha": "^3.5.3",
43+
"tslint": "^5.7.0",
44+
"typescript": "^2.5.2"
45+
}
46+
}

0 commit comments

Comments
 (0)