innetjs 1.7.4 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/innet +13 -4
- package/index.d.ts +1 -4
- package/index.es6.js +9 -1
- package/index.js +9 -1
- package/package.json +1 -1
- package/templates/be/.env +1 -0
- package/templates/be/README.md +15 -0
- package/templates/be/package.json +13 -0
- package/templates/be/src/App.tsx +7 -0
- package/templates/be/src/index.tsx +6 -0
- package/templates/be/tsconfig.json +35 -0
- package/templates/fe/package.json +1 -1
package/bin/innet
CHANGED
|
@@ -112,9 +112,17 @@ class InnetJS {
|
|
|
112
112
|
this.api = api;
|
|
113
113
|
}
|
|
114
114
|
// Methods
|
|
115
|
-
init(appName, { template
|
|
115
|
+
init(appName, { template, force = false } = {}) {
|
|
116
116
|
return __awaiter(this, void 0, void 0, function* () {
|
|
117
117
|
const appPath = path__default['default'].resolve(appName);
|
|
118
|
+
if (!template) {
|
|
119
|
+
console.log(chalk__default['default'].green(`Select one of those templates?`));
|
|
120
|
+
const { value } = yield selector__default['default']({
|
|
121
|
+
values: ['fe', 'be']
|
|
122
|
+
});
|
|
123
|
+
template = value;
|
|
124
|
+
readline.moveCursor(process.stdout, 0, -2);
|
|
125
|
+
}
|
|
118
126
|
if (!force) {
|
|
119
127
|
yield logger__default['default'].start('Check if app folder is available', () => __awaiter(this, void 0, void 0, function* () {
|
|
120
128
|
if (fs__default['default'].existsSync(appPath)) {
|
|
@@ -425,7 +433,7 @@ class InnetJS {
|
|
|
425
433
|
}
|
|
426
434
|
}
|
|
427
435
|
|
|
428
|
-
var version = "1.
|
|
436
|
+
var version = "1.8.0";
|
|
429
437
|
|
|
430
438
|
require('dotenv').config();
|
|
431
439
|
const innetJS = new InnetJS();
|
|
@@ -435,8 +443,9 @@ commander.program
|
|
|
435
443
|
.command('init <app-name>')
|
|
436
444
|
.description('Create innet boilerplate')
|
|
437
445
|
.option('-e, --error', 'Show error details')
|
|
438
|
-
.
|
|
439
|
-
|
|
446
|
+
.option('-t, --template', 'Select template')
|
|
447
|
+
.action((appName, { error, template }) => {
|
|
448
|
+
innetJS.init(appName, { template }).catch(e => {
|
|
440
449
|
if (error) {
|
|
441
450
|
console.error(e);
|
|
442
451
|
process.exit(1);
|
package/index.d.ts
CHANGED
|
@@ -28,10 +28,7 @@ export default class InnetJS {
|
|
|
28
28
|
port?: number;
|
|
29
29
|
api?: string;
|
|
30
30
|
});
|
|
31
|
-
init(appName: string, { template, force }?:
|
|
32
|
-
template?: string;
|
|
33
|
-
force?: boolean;
|
|
34
|
-
}): Promise<void>;
|
|
31
|
+
init(appName: string, { template, force }?: any): Promise<void>;
|
|
35
32
|
build({ node }?: {
|
|
36
33
|
node?: boolean;
|
|
37
34
|
}): Promise<void>;
|
package/index.es6.js
CHANGED
|
@@ -88,9 +88,17 @@ class InnetJS {
|
|
|
88
88
|
this.api = api;
|
|
89
89
|
}
|
|
90
90
|
// Methods
|
|
91
|
-
init(appName, { template
|
|
91
|
+
init(appName, { template, force = false } = {}) {
|
|
92
92
|
return __awaiter(this, void 0, void 0, function* () {
|
|
93
93
|
const appPath = path.resolve(appName);
|
|
94
|
+
if (!template) {
|
|
95
|
+
console.log(chalk.green(`Select one of those templates?`));
|
|
96
|
+
const { value } = yield selector({
|
|
97
|
+
values: ['fe', 'be']
|
|
98
|
+
});
|
|
99
|
+
template = value;
|
|
100
|
+
readline.moveCursor(process.stdout, 0, -2);
|
|
101
|
+
}
|
|
94
102
|
if (!force) {
|
|
95
103
|
yield logger.start('Check if app folder is available', () => __awaiter(this, void 0, void 0, function* () {
|
|
96
104
|
if (fs.existsSync(appPath)) {
|
package/index.js
CHANGED
|
@@ -110,9 +110,17 @@ class InnetJS {
|
|
|
110
110
|
this.api = api;
|
|
111
111
|
}
|
|
112
112
|
// Methods
|
|
113
|
-
init(appName, { template
|
|
113
|
+
init(appName, { template, force = false } = {}) {
|
|
114
114
|
return __awaiter(this, void 0, void 0, function* () {
|
|
115
115
|
const appPath = path__default['default'].resolve(appName);
|
|
116
|
+
if (!template) {
|
|
117
|
+
console.log(chalk__default['default'].green(`Select one of those templates?`));
|
|
118
|
+
const { value } = yield selector__default['default']({
|
|
119
|
+
values: ['fe', 'be']
|
|
120
|
+
});
|
|
121
|
+
template = value;
|
|
122
|
+
readline.moveCursor(process.stdout, 0, -2);
|
|
123
|
+
}
|
|
116
124
|
if (!force) {
|
|
117
125
|
yield logger__default['default'].start('Check if app folder is available', () => __awaiter(this, void 0, void 0, function* () {
|
|
118
126
|
if (fs__default['default'].existsSync(appPath)) {
|
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
BUILD_FOLDER=build
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"baseUrl": ".",
|
|
4
|
+
"paths": {
|
|
5
|
+
"/": ["src"],
|
|
6
|
+
"/*": ["src/*"],
|
|
7
|
+
"@cantinc/utils": ["src/@cantinc/utils"],
|
|
8
|
+
"@innet/*": ["src/@innet/*"],
|
|
9
|
+
"innet/*": ["src/@innet/innet/*"],
|
|
10
|
+
"innet": ["src/@innet/innet"],
|
|
11
|
+
},
|
|
12
|
+
"target": "ES6",
|
|
13
|
+
"lib": [
|
|
14
|
+
"esnext"
|
|
15
|
+
],
|
|
16
|
+
"allowJs": true,
|
|
17
|
+
"skipLibCheck": true,
|
|
18
|
+
"esModuleInterop": true,
|
|
19
|
+
"experimentalDecorators": true,
|
|
20
|
+
"allowSyntheticDefaultImports": true,
|
|
21
|
+
"strict": false,
|
|
22
|
+
"forceConsistentCasingInFileNames": true,
|
|
23
|
+
"module": "esnext",
|
|
24
|
+
"moduleResolution": "node",
|
|
25
|
+
"resolveJsonModule": true,
|
|
26
|
+
"isolatedModules": false,
|
|
27
|
+
"removeComments": true,
|
|
28
|
+
"declaration": false,
|
|
29
|
+
"noEmit": true,
|
|
30
|
+
"jsx": "preserve"
|
|
31
|
+
},
|
|
32
|
+
"include": [
|
|
33
|
+
"src"
|
|
34
|
+
]
|
|
35
|
+
}
|