Skip to content

Commit

Permalink
#1 #3 - Add basic tooling
Browse files Browse the repository at this point in the history
  • Loading branch information
TheZoker committed Nov 14, 2018
1 parent 4a38ad8 commit 0f65e8d
Show file tree
Hide file tree
Showing 9 changed files with 13,371 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

node_modules/
theia-plugin/npm-debug.log

tooling/out/
6 changes: 6 additions & 0 deletions tooling/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": [
["@babel/preset-env", { "modules": false }],
"@babel/preset-typescript"
]
}
5,776 changes: 5,776 additions & 0 deletions tooling/package-lock.json

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions tooling/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "jsonforms-tooling",
"version": "0.0.1",
"description": "",
"author": "EclipseSource",
"main": "out/index",
"typings": "out/index",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "babel src -d out --extensions \".ts,.tsx\"",
"compile": "rimraf out && tsc -p ./ --declaration"
},
"dependencies": {
"npm": "^6.4.1",
"simple-git": "^1.107.0"
},
"type-check": "tsc",
"devDependencies": {
"@babel/cli": "^7.1.5",
"@babel/core": "^7.1.6",
"@babel/preset-env": "^7.1.6",
"@babel/preset-typescript": "^7.1.0",
"@types/node": "^10.12.7",
"rimraf": "^2.6.2",
"typescript": "^3.1.6"
}
}
30 changes: 30 additions & 0 deletions tooling/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import * as simplegit from 'simple-git/promise';
import * as child from 'child_process';

export function cloneAndInstall(repo: String, path: string) {
var url = '';
switch(repo) {
case 'example':
url = 'https://github.com/eclipsesource/make-it-happen-react';
break;
case 'seed':
url = 'https://github.com/eclipsesource/jsonforms-react-seed';
break;
}
const git = simplegit();
console.log('Starting to clone repo');
git.clone(url, path)
.then(function() {
console.log('Finished to clone repo');
console.log('Running npm install');
child.exec('cd /${path} && npm install', (error, stdout, stderr) => {
if (error) {
console.error(`exec error: ${error}`);
return;
}
console.log(`stdout: ${stdout}`);
console.log(`stderr: ${stderr}`);
});
})
.catch((err: any) => console.error('failed: ', err));
}
25 changes: 25 additions & 0 deletions tooling/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "out",
"lib": [
"es6"
],
"noEmit": false,
"pretty": true,
"skipLibCheck": true,
"sourceMap": true,
"rootDir": "src",
/* Strict Type-Checking Option */
"strict": true, /* enable all strict type-checking options */
/* Additional Checks */
"noUnusedLocals": true /* Report errors on unused locals. */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */
},
"exclude": [
"node_modules"
]
}
Loading

0 comments on commit 0f65e8d

Please sign in to comment.