Skip to content

Commit 0f65e8d

Browse files
committed
#1 #3 - Add basic tooling
1 parent 4a38ad8 commit 0f65e8d

File tree

9 files changed

+13371
-9
lines changed

9 files changed

+13371
-9
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
node_modules/
3+
theia-plugin/npm-debug.log
4+
5+
tooling/out/

tooling/.babelrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"presets": [
3+
["@babel/preset-env", { "modules": false }],
4+
"@babel/preset-typescript"
5+
]
6+
}

tooling/package-lock.json

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

tooling/package.json

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "jsonforms-tooling",
3+
"version": "0.0.1",
4+
"description": "",
5+
"author": "EclipseSource",
6+
"main": "out/index",
7+
"typings": "out/index",
8+
"scripts": {
9+
"test": "echo \"Error: no test specified\" && exit 1",
10+
"build": "babel src -d out --extensions \".ts,.tsx\"",
11+
"compile": "rimraf out && tsc -p ./ --declaration"
12+
},
13+
"dependencies": {
14+
"npm": "^6.4.1",
15+
"simple-git": "^1.107.0"
16+
},
17+
"type-check": "tsc",
18+
"devDependencies": {
19+
"@babel/cli": "^7.1.5",
20+
"@babel/core": "^7.1.6",
21+
"@babel/preset-env": "^7.1.6",
22+
"@babel/preset-typescript": "^7.1.0",
23+
"@types/node": "^10.12.7",
24+
"rimraf": "^2.6.2",
25+
"typescript": "^3.1.6"
26+
}
27+
}

tooling/src/index.ts

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import * as simplegit from 'simple-git/promise';
2+
import * as child from 'child_process';
3+
4+
export function cloneAndInstall(repo: String, path: string) {
5+
var url = '';
6+
switch(repo) {
7+
case 'example':
8+
url = 'https://github.com/eclipsesource/make-it-happen-react';
9+
break;
10+
case 'seed':
11+
url = 'https://github.com/eclipsesource/jsonforms-react-seed';
12+
break;
13+
}
14+
const git = simplegit();
15+
console.log('Starting to clone repo');
16+
git.clone(url, path)
17+
.then(function() {
18+
console.log('Finished to clone repo');
19+
console.log('Running npm install');
20+
child.exec('cd /${path} && npm install', (error, stdout, stderr) => {
21+
if (error) {
22+
console.error(`exec error: ${error}`);
23+
return;
24+
}
25+
console.log(`stdout: ${stdout}`);
26+
console.log(`stderr: ${stderr}`);
27+
});
28+
})
29+
.catch((err: any) => console.error('failed: ', err));
30+
}

tooling/tsconfig.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"compilerOptions": {
3+
"module": "commonjs",
4+
"target": "es6",
5+
"outDir": "out",
6+
"lib": [
7+
"es6"
8+
],
9+
"noEmit": false,
10+
"pretty": true,
11+
"skipLibCheck": true,
12+
"sourceMap": true,
13+
"rootDir": "src",
14+
/* Strict Type-Checking Option */
15+
"strict": true, /* enable all strict type-checking options */
16+
/* Additional Checks */
17+
"noUnusedLocals": true /* Report errors on unused locals. */
18+
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
19+
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
20+
// "noUnusedParameters": true, /* Report errors on unused parameters. */
21+
},
22+
"exclude": [
23+
"node_modules"
24+
]
25+
}

0 commit comments

Comments
 (0)