@rws-framework/db 2.0.0 → 2.0.2
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/exec/console.js +21 -14
- package/exec/src/cli.ts +3 -1
- package/package.json +3 -2
package/exec/console.js
CHANGED
|
@@ -15,6 +15,9 @@ const getCachedPath = (key) => path.resolve(rwsCliConfigDir, key);
|
|
|
15
15
|
|
|
16
16
|
const currentCwd = path.resolve(__dirname);
|
|
17
17
|
|
|
18
|
+
console.log({params})
|
|
19
|
+
|
|
20
|
+
|
|
18
21
|
const commandString = `npx webpack --config db.rws.webpack.config.js --output-path ./build ${process.cwd()} ${params[2]}`;
|
|
19
22
|
function needsCacheWarming(){
|
|
20
23
|
|
|
@@ -62,20 +65,11 @@ async function main()
|
|
|
62
65
|
}
|
|
63
66
|
}
|
|
64
67
|
|
|
68
|
+
await tsc();
|
|
69
|
+
|
|
65
70
|
await rwsShell.runCommand(commandString, currentCwd);
|
|
66
|
-
|
|
67
|
-
"extends": "./tsconfig.json",
|
|
68
|
-
"include": [
|
|
69
|
-
path.join(process.cwd(), params[2], 'index.ts')
|
|
70
|
-
],
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
const tempConfigPath = path.join(currentCwd, '.tmp.gitignore.json');
|
|
74
|
-
fs.writeFileSync(tempConfigPath, JSON.stringify(tempConfigContent, null, 2));
|
|
75
|
-
|
|
71
|
+
|
|
76
72
|
|
|
77
|
-
await rwsShell.runCommand(`tsc -p ${tempConfigPath}`, currentCwd);
|
|
78
|
-
fs.unlinkSync(tempConfigPath);
|
|
79
73
|
}else{
|
|
80
74
|
console.log(chalk.blue('[RWS CLI CACHE] Starting command from built CLI client.'));
|
|
81
75
|
}
|
|
@@ -83,8 +77,6 @@ async function main()
|
|
|
83
77
|
let startSlice = hasRebuild ? -1 : paramsString.split(' ').length;
|
|
84
78
|
let endSlice = hasRebuild ? -1 : null ;
|
|
85
79
|
|
|
86
|
-
console.log({startSlice, endSlice}, paramsString.split(' ').slice(0, startSlice))
|
|
87
|
-
|
|
88
80
|
paramsString = [
|
|
89
81
|
...paramsString.split(' ').slice(0, startSlice),
|
|
90
82
|
currentCwd,
|
|
@@ -96,6 +88,21 @@ async function main()
|
|
|
96
88
|
await rwsShell.runCommand(`node ${path.join(currentCwd, 'build', 'main.cli.rws.js')}${paramsString}`, process.cwd());
|
|
97
89
|
}
|
|
98
90
|
|
|
91
|
+
async function tsc (){
|
|
92
|
+
const tempConfigContent = {
|
|
93
|
+
"extends": "./tsconfig.json",
|
|
94
|
+
"include": [
|
|
95
|
+
path.join(process.cwd(), params[2], 'index.ts')
|
|
96
|
+
],
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const tempConfigPath = path.join(currentCwd, '.tmp.gitignore.json');
|
|
100
|
+
fs.writeFileSync(tempConfigPath, JSON.stringify(tempConfigContent, null, 2));
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
await rwsShell.runCommand(`tsc -p ${tempConfigPath}`, currentCwd);
|
|
104
|
+
fs.unlinkSync(tempConfigPath);
|
|
105
|
+
}
|
|
99
106
|
|
|
100
107
|
main().then((data) => {
|
|
101
108
|
console.log(chalk.green('[RWS DB CLI] Command complete.'));
|
package/exec/src/cli.ts
CHANGED
|
@@ -41,7 +41,9 @@ class Config implements IDbConfigHandler {
|
|
|
41
41
|
this.modelsDir = args[2];
|
|
42
42
|
this.cliExecRoot = args[3];
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
console.log({args})
|
|
45
|
+
|
|
46
|
+
// this.data.db_models = (await import('@V/index')).default;
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
getModelsDir(): string
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rws-framework/db",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.2",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"scripts": {},
|
|
@@ -32,5 +32,6 @@
|
|
|
32
32
|
"repository": {
|
|
33
33
|
"type": "git",
|
|
34
34
|
"url": "https://github.com/rws-framework/db.git"
|
|
35
|
-
}
|
|
35
|
+
},
|
|
36
|
+
"_rws": true
|
|
36
37
|
}
|