@tremho/mist-lift 1.0.2-pre-release.3 → 1.0.2-pre-release.5
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/build/commands/actions/initQuestions.js +24 -22
- package/build/commands/actions/initQuestions.js.map +1 -1
- package/build/commands/actions/setupPackageJson.js +4 -4
- package/build/commands/actions/setupPackageJson.js.map +1 -1
- package/build/commands/build.js +31 -25
- package/build/commands/build.js.map +1 -1
- package/build/commands/builtin/ApiDocMaker.js +60 -23
- package/build/commands/builtin/ApiDocMaker.js.map +1 -1
- package/build/commands/builtin/BuiltInHandler.js +6 -6
- package/build/commands/builtin/BuiltInHandler.js.map +1 -1
- package/build/commands/builtin/DeployBuiltInZip.js +4 -4
- package/build/commands/builtin/DeployBuiltInZip.js.map +1 -1
- package/build/commands/builtin/StageWebrootZip.js +1 -0
- package/build/commands/builtin/StageWebrootZip.js.map +1 -1
- package/build/commands/create.js +10 -11
- package/build/commands/create.js.map +1 -1
- package/build/commands/deploy.js +38 -42
- package/build/commands/deploy.js.map +1 -1
- package/build/commands/doctor.js +38 -37
- package/build/commands/doctor.js.map +1 -1
- package/build/commands/help.js +93 -93
- package/build/commands/help.js.map +1 -1
- package/build/commands/init.js +7 -7
- package/build/commands/init.js.map +1 -1
- package/build/commands/package.js +50 -51
- package/build/commands/package.js.map +1 -1
- package/build/commands/publish.js +98 -102
- package/build/commands/publish.js.map +1 -1
- package/build/commands/settings.js +19 -18
- package/build/commands/settings.js.map +1 -1
- package/build/commands/start.js +4 -4
- package/build/commands/start.js.map +1 -1
- package/build/commands/test.js +3 -3
- package/build/commands/test.js.map +1 -1
- package/build/commands/user.js +1 -1
- package/build/commands/user.js.map +1 -1
- package/build/expressRoutes/all.js +27 -26
- package/build/expressRoutes/all.js.map +1 -1
- package/build/expressRoutes/api.js +9 -7
- package/build/expressRoutes/api.js.map +1 -1
- package/build/expressRoutes/functionBinder.js +38 -36
- package/build/expressRoutes/functionBinder.js.map +1 -1
- package/build/lib/CaseUtils.js +2 -2
- package/build/lib/CaseUtils.js.map +1 -1
- package/build/lib/DirectoryUtils.js +4 -3
- package/build/lib/DirectoryUtils.js.map +1 -1
- package/build/lib/LiftConfig.js +18 -20
- package/build/lib/LiftConfig.js.map +1 -1
- package/build/lib/LiftVersion.js +17 -12
- package/build/lib/LiftVersion.js.map +1 -1
- package/build/lib/Tests/fileCompare.test.js +11 -10
- package/build/lib/Tests/fileCompare.test.js.map +1 -1
- package/build/lib/askQuestion.js +3 -2
- package/build/lib/askQuestion.js.map +1 -1
- package/build/lib/executeCommand.js +46 -33
- package/build/lib/executeCommand.js.map +1 -1
- package/build/lib/fileCompare.js +9 -8
- package/build/lib/fileCompare.js.map +1 -1
- package/build/lib/openAPI/ApiBuildCollector.js +9 -8
- package/build/lib/openAPI/ApiBuildCollector.js.map +1 -1
- package/build/lib/openAPI/WebrootFileSupport.js +4 -3
- package/build/lib/openAPI/WebrootFileSupport.js.map +1 -1
- package/build/lib/openAPI/openApiConstruction.js +62 -61
- package/build/lib/openAPI/openApiConstruction.js.map +1 -1
- package/build/lib/pathResolve.js +4 -4
- package/build/lib/pathResolve.js.map +1 -1
- package/build/lib/utils.js +5 -4
- package/build/lib/utils.js.map +1 -1
- package/build/lift.js +14 -15
- package/build/lift.js.map +1 -1
- package/package.json +2 -1
- package/src/commands/actions/initQuestions.ts +112 -112
- package/src/commands/actions/setupPackageJson.ts +21 -25
- package/src/commands/build.ts +143 -146
- package/src/commands/builtin/ApiDocMaker.ts +86 -54
- package/src/commands/builtin/BuiltInHandler.ts +31 -35
- package/src/commands/builtin/DeployBuiltInZip.ts +15 -17
- package/src/commands/builtin/StageWebrootZip.ts +29 -32
- package/src/commands/create.ts +40 -47
- package/src/commands/deploy.ts +139 -152
- package/src/commands/doctor.ts +86 -82
- package/src/commands/help.ts +152 -153
- package/src/commands/init.ts +37 -39
- package/src/commands/package.ts +201 -204
- package/src/commands/publish.ts +277 -312
- package/src/commands/settings.ts +67 -70
- package/src/commands/start.ts +32 -37
- package/src/commands/test.ts +15 -16
- package/src/commands/user.ts +1 -1
- package/src/expressRoutes/all.ts +73 -78
- package/src/expressRoutes/api.ts +14 -16
- package/src/expressRoutes/functionBinder.ts +144 -151
- package/src/lib/CaseUtils.ts +49 -54
- package/src/lib/DirectoryUtils.ts +25 -27
- package/src/lib/LiftConfig.ts +46 -54
- package/src/lib/LiftVersion.ts +69 -77
- package/src/lib/Tests/fileCompare.test.ts +27 -26
- package/src/lib/askQuestion.ts +12 -13
- package/src/lib/executeCommand.ts +40 -33
- package/src/lib/fileCompare.ts +46 -37
- package/src/lib/openAPI/ApiBuildCollector.ts +36 -36
- package/src/lib/openAPI/WebrootFileSupport.ts +15 -17
- package/src/lib/openAPI/openApiConstruction.ts +169 -175
- package/src/lib/pathResolve.ts +22 -28
- package/src/lib/utils.ts +31 -33
- package/src/lift.ts +68 -67
package/build/commands/help.js
CHANGED
|
@@ -58,24 +58,24 @@ function doHelp(command) {
|
|
|
58
58
|
exports.doHelp = doHelp;
|
|
59
59
|
function helpDefault() {
|
|
60
60
|
console.log('lift is the command-line tool of the MistLift framework.');
|
|
61
|
-
console.log(
|
|
62
|
-
console.log(ac.bold(
|
|
63
|
-
console.log(
|
|
64
|
-
console.log(
|
|
65
|
-
console.log(
|
|
66
|
-
console.log(
|
|
67
|
-
console.log(
|
|
68
|
-
console.log(
|
|
69
|
-
console.log(
|
|
61
|
+
console.log('');
|
|
62
|
+
console.log(ac.bold('Usage: ' + ac.grey('lift ' + ac.grey.dim('command [args]'))));
|
|
63
|
+
console.log('where ' + ac.grey.dim('command') + ' is one of:');
|
|
64
|
+
console.log(' ' + ac.blue.bold('help ' + ac.grey.dim('[command]')) + ' -- this list, or help on a given command');
|
|
65
|
+
console.log(' ' + ac.blue.bold('init') + ' -- create or prepare a directory as a MistLift project');
|
|
66
|
+
console.log(' ' + ac.blue.bold('create ' + ac.grey.italic('functionName')) + ' -- define and create a new API function');
|
|
67
|
+
console.log(' ' + ac.green('build') + ' -- build the project');
|
|
68
|
+
console.log(' ' + ac.green('test') + ' -- build, and run unit tests');
|
|
69
|
+
console.log(' ' + ac.cyan.bold('start') + ' -- start the local express server');
|
|
70
70
|
// console.log(" " + ac.cyan.bold("stop") + " -- stop the local express server");
|
|
71
|
-
console.log(
|
|
72
|
-
console.log(
|
|
73
|
-
console.log(
|
|
74
|
-
console.log(
|
|
75
|
-
console.log(
|
|
76
|
-
console.log('');
|
|
77
|
-
console.log(
|
|
78
|
-
console.log(ac.italic(
|
|
71
|
+
console.log(' ' + ac.green('package ' + ac.grey.italic('[functionName]')) + ' -- builds and packages functions into lambda-ready zips');
|
|
72
|
+
console.log(' ' + ac.green('deploy ' + ac.grey.italic('[functionName]')) + ' -- builds, packages, and deploys function packages to AWS lambda');
|
|
73
|
+
console.log(' ' + ac.blue.bold('publish') + ' -- publishes the API and binds to the deployed functions');
|
|
74
|
+
console.log(' ' + ac.blue.bold('settings') + ' -- sets up cloud settings');
|
|
75
|
+
console.log(' ' + ac.blue.bold('doctor') + ' -- checks MistLift installation and status');
|
|
76
|
+
console.log('');
|
|
77
|
+
console.log('use ' + ac.bold('lift help ' + ac.grey.dim('[command]')) + ' for command arguments and detals.');
|
|
78
|
+
console.log(ac.italic('use ' + ac.bold('lift version ' + ac.grey.dim('or lift -v or lift --version') + ac.grey(' to see current running version of MistLift'))));
|
|
79
79
|
}
|
|
80
80
|
function printBanner(cmd) {
|
|
81
81
|
let out = ' ' + ac.green('╭───────────────────────────────────────────────────────────────╮') + '\n';
|
|
@@ -88,118 +88,118 @@ function printBanner(cmd) {
|
|
|
88
88
|
console.log(out);
|
|
89
89
|
}
|
|
90
90
|
function helpHelp() {
|
|
91
|
-
printBanner(
|
|
92
|
-
console.log(
|
|
93
|
-
console.log(
|
|
91
|
+
printBanner('help');
|
|
92
|
+
console.log('use ' + ac.bold('lift help') + ' by itself to see a list of commands');
|
|
93
|
+
console.log('use ' + ac.bold('lift help ' + ac.grey.dim('[command]')) + ' for help on a given command');
|
|
94
94
|
console.log('');
|
|
95
95
|
}
|
|
96
96
|
function helpInit() {
|
|
97
|
-
printBanner(
|
|
98
|
-
console.log(
|
|
99
|
-
console.log(
|
|
100
|
-
|
|
101
|
-
console.log(
|
|
102
|
-
console.log(
|
|
103
|
-
console.log(
|
|
104
|
-
console.log(
|
|
97
|
+
printBanner('init');
|
|
98
|
+
console.log('use ' + ac.bold('lift init .') + ' from within a directory to init the current directory as a MistLift project');
|
|
99
|
+
console.log('use ' + ac.bold('lift init ' + ac.grey.dim('projectPath')) + ' to create a new directory at ' +
|
|
100
|
+
ac.grey.dim('projectPath') + ' if it does not exist and init a MistLift project in that directory, if not already initialized');
|
|
101
|
+
console.log('');
|
|
102
|
+
console.log('This will begin an interactive session where you will be asked questions about the project you are creating.');
|
|
103
|
+
console.log('The project will be complete and ready to run right away.');
|
|
104
|
+
console.log('You can then modify the application to your needs.');
|
|
105
105
|
}
|
|
106
106
|
exports.helpInit = helpInit;
|
|
107
107
|
function helpCreate() {
|
|
108
|
-
printBanner(
|
|
109
|
-
console.log(
|
|
110
|
-
console.log(
|
|
111
|
-
console.log(
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
console.log(
|
|
108
|
+
printBanner('create');
|
|
109
|
+
console.log('use ' + ac.bold('lift create') + ac.grey.dim(' functionName') + ' to create a new function for your API');
|
|
110
|
+
console.log('');
|
|
111
|
+
console.log('your project folder (set up with ' + ac.green.bold('init') + ') will have a new function template created as ' +
|
|
112
|
+
ac.grey.dim('functionName') +
|
|
113
|
+
' in a folder named ' +
|
|
114
|
+
ac.green.dim('functions') + ' within your project directory');
|
|
115
|
+
console.log('');
|
|
116
116
|
console.log(ac.grey("The default function will display a'Hello World!' message when built and run"));
|
|
117
|
-
console.log(ac.grey(
|
|
117
|
+
console.log(ac.grey('Modify the code to suit the needs of your function application'));
|
|
118
118
|
}
|
|
119
119
|
exports.helpCreate = helpCreate;
|
|
120
120
|
function helpBuild() {
|
|
121
|
-
printBanner(
|
|
122
|
-
console.log(
|
|
123
|
-
console.log(
|
|
124
|
-
console.log(
|
|
125
|
-
console.log(
|
|
126
|
-
console.log(
|
|
127
|
-
console.log(
|
|
128
|
-
console.log(
|
|
121
|
+
printBanner('build');
|
|
122
|
+
console.log('use ' + ac.bold('lift build') + ' to build all your functions of the project');
|
|
123
|
+
console.log('use ' + ac.bold('lift build') + ' one or more function names to build these individually');
|
|
124
|
+
console.log('');
|
|
125
|
+
console.log('include ' + ac.bold('--clean') + ' to force a rebuild, bypassing file date compare');
|
|
126
|
+
console.log('include ' + ac.bold('--failfast') + ' to stop after encountering an error');
|
|
127
|
+
console.log('include ' + ac.bold('--deferfail') + ' to build all, then report any errors (the default)');
|
|
128
|
+
console.log('');
|
|
129
129
|
console.log("The build step compiles your typescript (.ts) files into executable javascript (.js) files within a folder named 'build' in your project directory.");
|
|
130
|
-
console.log(
|
|
131
|
-
console.log(
|
|
132
|
-
console.log(
|
|
130
|
+
console.log('Files that are not updated are not rebuilt.');
|
|
131
|
+
console.log('The build step is automatically invoked by other actions that depend upon it as a prerequisite, so it does not need to be explicitly run in normal operation.');
|
|
132
|
+
console.log('');
|
|
133
133
|
}
|
|
134
134
|
exports.helpBuild = helpBuild;
|
|
135
135
|
function helpTest() {
|
|
136
|
-
printBanner(
|
|
137
|
-
console.log(
|
|
138
|
-
console.log(
|
|
139
|
-
console.log(
|
|
136
|
+
printBanner('test');
|
|
137
|
+
console.log('use ' + ac.bold('lift test') + ' to invoke the testing framework and run unit tests for all functions');
|
|
138
|
+
console.log('');
|
|
139
|
+
console.log('Tests should be written in files within the named test folder for each created function. test files are given the suffix .test.ts');
|
|
140
140
|
console.log("The test framework used is 'Tap' (https://node-tap.org)");
|
|
141
|
-
console.log(
|
|
141
|
+
console.log('');
|
|
142
142
|
}
|
|
143
143
|
exports.helpTest = helpTest;
|
|
144
144
|
function helpStart() {
|
|
145
|
-
printBanner(
|
|
146
|
-
console.log(
|
|
147
|
-
console.log(
|
|
148
|
-
console.log(
|
|
149
|
-
console.log(
|
|
150
|
-
console.log(
|
|
145
|
+
printBanner('start');
|
|
146
|
+
console.log('use ' + ac.bold('lift start') + " to start running the local 'Express' server for local execution");
|
|
147
|
+
console.log('');
|
|
148
|
+
console.log('Functions may be run and tested via a local http server powered by express.');
|
|
149
|
+
console.log('By default, access is at ' + ac.blue('http://localhost:8081'));
|
|
150
|
+
console.log('');
|
|
151
151
|
}
|
|
152
152
|
exports.helpStart = helpStart;
|
|
153
153
|
function helpStop() {
|
|
154
|
-
printBanner(
|
|
155
|
-
console.log(
|
|
156
|
-
console.log(
|
|
157
|
-
console.log(
|
|
158
|
-
console.log(
|
|
154
|
+
printBanner('stop');
|
|
155
|
+
console.log('use ' + ac.bold('lift stop') + " to stop the running local 'Express' server");
|
|
156
|
+
console.log('');
|
|
157
|
+
console.log('This will shut down the local server');
|
|
158
|
+
console.log('');
|
|
159
159
|
}
|
|
160
160
|
exports.helpStop = helpStop;
|
|
161
161
|
function helpPackage() {
|
|
162
|
-
printBanner(
|
|
163
|
-
console.log(
|
|
164
|
-
console.log(
|
|
165
|
-
console.log(
|
|
166
|
-
console.log(
|
|
167
|
-
console.log(
|
|
168
|
-
console.log(
|
|
169
|
-
console.log(ac.grey(
|
|
170
|
-
console.log(
|
|
162
|
+
printBanner('package');
|
|
163
|
+
console.log('use ' + ac.bold('lift package') + ' to build and package functions for cloud deployment');
|
|
164
|
+
console.log('');
|
|
165
|
+
console.log('options such as ' + ac.bold('--clean') + ' may be specified to force a build prior to packaging');
|
|
166
|
+
console.log('');
|
|
167
|
+
console.log('Functions must be packaged into zip files before delivery to the cloud');
|
|
168
|
+
console.log('The package command handles this by first insuring a fresh build and then packaging the function and its module dependencies');
|
|
169
|
+
console.log(ac.grey('This action is invoked as part of deployment, and need not be invoked separately with this command'));
|
|
170
|
+
console.log('');
|
|
171
171
|
}
|
|
172
172
|
exports.helpPackage = helpPackage;
|
|
173
173
|
function helpDeploy() {
|
|
174
|
-
printBanner(
|
|
175
|
-
console.log(
|
|
176
|
-
console.log(
|
|
177
|
-
console.log(
|
|
178
|
-
console.log(
|
|
179
|
-
console.log(
|
|
180
|
-
console.log(
|
|
181
|
-
console.log(
|
|
174
|
+
printBanner('deploy');
|
|
175
|
+
console.log('use ' + ac.bold('lift deploy') + ac.grey.dim(' functionName') + ' to package and deploy a function to the cloud');
|
|
176
|
+
console.log('use ' + ac.bold('lift deploy') + ' with no argument to deploy all functions to the cloud');
|
|
177
|
+
console.log('');
|
|
178
|
+
console.log('options such as ' + ac.bold('--clean') + ' may be specified to force a build prior to packaging');
|
|
179
|
+
console.log('the option ' + ac.bold('--no-package') + ' may be specified to deploy without repackaging');
|
|
180
|
+
console.log('');
|
|
181
|
+
console.log('functions will be built and packaged if necessary before deployment');
|
|
182
182
|
}
|
|
183
183
|
exports.helpDeploy = helpDeploy;
|
|
184
184
|
function helpPublish() {
|
|
185
|
-
printBanner(
|
|
186
|
-
console.log(
|
|
187
|
-
console.log(
|
|
188
|
-
console.log(
|
|
189
|
-
console.log(
|
|
190
|
-
console.log(
|
|
191
|
-
console.log(
|
|
192
|
-
console.log(
|
|
185
|
+
printBanner('publish');
|
|
186
|
+
console.log('use ' + ac.bold('lift publish') + ' to publish the API to an accessible cloud endpoint');
|
|
187
|
+
console.log('');
|
|
188
|
+
console.log('The base url for the cloud API will be returned by this operation.');
|
|
189
|
+
console.log('');
|
|
190
|
+
console.log('Once published, updates to functions may be made with ' + ac.bold('deploy') + ' without needing to republish.');
|
|
191
|
+
console.log('Changes to webroot content or api definitions will require a new publish');
|
|
192
|
+
console.log('Each publish operation returns a new URL. The previous URL is invalid.');
|
|
193
193
|
}
|
|
194
194
|
exports.helpPublish = helpPublish;
|
|
195
195
|
function helpSettings() {
|
|
196
|
-
printBanner(
|
|
197
|
-
console.log(
|
|
196
|
+
printBanner('settings');
|
|
197
|
+
console.log('use ' + ac.bold('lift settings') + ' to set or review the Cloud settings and configured options');
|
|
198
198
|
}
|
|
199
199
|
exports.helpSettings = helpSettings;
|
|
200
200
|
function helpDoctor() {
|
|
201
|
-
printBanner(
|
|
202
|
-
console.log(
|
|
201
|
+
printBanner('doctor');
|
|
202
|
+
console.log('use ' + ac.bold('lift doctor') + ' to report the status of your MistLift installation and dependencies');
|
|
203
203
|
}
|
|
204
204
|
exports.helpDoctor = helpDoctor;
|
|
205
205
|
//# sourceMappingURL=help.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/commands/help.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAiC;AAEjC,SAAgB,MAAM,
|
|
1
|
+
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/commands/help.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAiC;AAEjC,SAAgB,MAAM,CACpB,OAAe;IAEf,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,MAAM;YACT,OAAO,QAAQ,EAAE,CAAA;QACnB,KAAK,MAAM;YACT,OAAO,QAAQ,EAAE,CAAA;QACnB,KAAK,QAAQ;YACX,OAAO,UAAU,EAAE,CAAA;QACrB,KAAK,OAAO;YACV,OAAO,SAAS,EAAE,CAAA;QACpB,KAAK,MAAM;YACT,OAAO,QAAQ,EAAE,CAAA;QACnB,KAAK,OAAO;YACV,OAAO,SAAS,EAAE,CAAA;QAClB,eAAe;QACf,wBAAwB;QAC1B,KAAK,SAAS;YACZ,OAAO,WAAW,EAAE,CAAA;QACtB,KAAK,QAAQ;YACX,OAAO,UAAU,EAAE,CAAA;QACrB,KAAK,SAAS;YACZ,OAAO,WAAW,EAAE,CAAA;QACtB,KAAK,UAAU;YACb,OAAO,YAAY,EAAE,CAAA;QACvB,KAAK,QAAQ;YACX,OAAO,UAAU,EAAE,CAAA;QACrB;YACE,OAAO,WAAW,EAAE,CAAA;IACxB,CAAC;AACH,CAAC;AA/BD,wBA+BC;AACD,SAA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WAAW,CAAC,UAAU,CAAC,CAAA;IACvB,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,6DAA6D,CAAC,CAAA;AAChH,CAAC;AAHD,oCAGC;AACD,SAAgB,UAAU;IACxB,WAAW,CAAC,QAAQ,CAAC,CAAA;IACrB,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,sEAAsE,CAAC,CAAA;AACvH,CAAC;AAHD,gCAGC"}
|
package/build/commands/init.js
CHANGED
|
@@ -55,7 +55,7 @@ const initQuestions_1 = require("./actions/initQuestions");
|
|
|
55
55
|
const setupPackageJson_1 = require("./actions/setupPackageJson");
|
|
56
56
|
function doInit(folder) {
|
|
57
57
|
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
-
if (
|
|
58
|
+
if (folder === undefined || folder === '') {
|
|
59
59
|
(0, help_1.helpInit)();
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
@@ -65,12 +65,12 @@ function doInit(folder) {
|
|
|
65
65
|
if (!fs.existsSync(refPath)) {
|
|
66
66
|
fs.mkdirSync(refPath, { recursive: true });
|
|
67
67
|
}
|
|
68
|
-
const funcDir = path.join(refPath,
|
|
68
|
+
const funcDir = path.join(refPath, 'functions');
|
|
69
69
|
if (!fs.existsSync(funcDir)) {
|
|
70
70
|
fs.mkdirSync(funcDir);
|
|
71
71
|
}
|
|
72
72
|
// make webroot with docs folder and placeholder yaml
|
|
73
|
-
const webrootDocs = path.join(refPath,
|
|
73
|
+
const webrootDocs = path.join(refPath, 'webroot', 'docs');
|
|
74
74
|
if (!fs.existsSync(webrootDocs)) {
|
|
75
75
|
fs.mkdirSync(webrootDocs, { recursive: true });
|
|
76
76
|
const yaml = path.join(webrootDocs, 'apidoc.yaml');
|
|
@@ -82,10 +82,10 @@ function doInit(folder) {
|
|
|
82
82
|
}
|
|
83
83
|
yield (0, initQuestions_1.interrogateUserForPackageJsonSettings)(refPath);
|
|
84
84
|
yield (0, setupPackageJson_1.addPackageScripts)(refPath);
|
|
85
|
-
yield (0, setupPackageJson_1.installDevPackage)(refPath,
|
|
86
|
-
yield (0, setupPackageJson_1.installDevPackage)(refPath,
|
|
87
|
-
yield (0, setupPackageJson_1.installDevPackage)(refPath,
|
|
88
|
-
yield (0, setupPackageJson_1.installPackage)(refPath,
|
|
85
|
+
yield (0, setupPackageJson_1.installDevPackage)(refPath, '@types/node');
|
|
86
|
+
yield (0, setupPackageJson_1.installDevPackage)(refPath, 'typescript');
|
|
87
|
+
yield (0, setupPackageJson_1.installDevPackage)(refPath, 'tap');
|
|
88
|
+
yield (0, setupPackageJson_1.installPackage)(refPath, '@tremho/inverse-y');
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
exports.doInit = doInit;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,2CAA4B;AAC5B,uCAAwB;AACxB,
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,2CAA4B;AAC5B,uCAAwB;AACxB,iCAAiC;AACjC,2DAA+E;AAC/E,iEAAiG;AAEjG,SAAsB,MAAM,CAC1B,MAAe;;QAEf,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,EAAE,EAAE,CAAC;YAC1C,IAAA,eAAQ,GAAE,CAAA;YACV,OAAM;QACR,CAAC;QACD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAA;QACzB,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CA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AAC,IAAI,CAAC,aAAa,EAAE,sBAAsB,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,sBAAsB,CAAC,CAAC,CAAA;YACjH,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,iCAAiC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,iCAAiC,CAAC,CAAC,CAAA;QACzI,CAAC;QAED,MAAM,IAAA,qDAAqC,EAAC,OAAO,CAAC,CAAA;QACpD,MAAM,IAAA,oCAAiB,EAAC,OAAO,CAAC,CAAA;QAChC,MAAM,IAAA,oCAAiB,EAAC,OAAO,EAAE,aAAa,CAAC,CAAA;QAC/C,MAAM,IAAA,oCAAiB,EAAC,OAAO,EAAE,YAAY,CAAC,CAAA;QAC9C,MAAM,IAAA,oCAAiB,EAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QACvC,MAAM,IAAA,iCAAc,EAAC,OAAO,EAAE,mBAAmB,CAAC,CAAA;IACpD,CAAC;CAAA;AArCD,wBAqCC"}
|
|
@@ -44,8 +44,8 @@ const DirectoryUtils_1 = require("../lib/DirectoryUtils");
|
|
|
44
44
|
const LiftVersion_1 = require("../lib/LiftVersion");
|
|
45
45
|
const executeCommand_1 = require("../lib/executeCommand");
|
|
46
46
|
const fileCompare_1 = require("../lib/fileCompare");
|
|
47
|
-
const utils_1 = require("../lib/utils");
|
|
48
47
|
const build_1 = require("./build");
|
|
48
|
+
const utils_1 = require("../lib/utils");
|
|
49
49
|
// test then package
|
|
50
50
|
function doPackageAsync(args) {
|
|
51
51
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -57,33 +57,34 @@ function doPackageAsync(args) {
|
|
|
57
57
|
const buildFunctionsPath = path_1.default.join(projectPaths.buildPath, 'functions');
|
|
58
58
|
const funcsToPackage = [];
|
|
59
59
|
const options = [];
|
|
60
|
-
for (
|
|
61
|
-
if (arg.charAt(0)
|
|
60
|
+
for (const arg of args) {
|
|
61
|
+
if (arg.charAt(0) === '-') {
|
|
62
62
|
options.push(arg.toLowerCase());
|
|
63
63
|
}
|
|
64
64
|
else
|
|
65
65
|
funcsToPackage.push(arg);
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
if (ret)
|
|
67
|
+
const ret = yield (0, build_1.doBuildAsync)(args);
|
|
68
|
+
if (ret !== 0)
|
|
69
69
|
return ret;
|
|
70
|
-
if (
|
|
70
|
+
if (funcsToPackage.length === 0) {
|
|
71
71
|
let firstDepth = 0;
|
|
72
72
|
(0, DirectoryUtils_1.recurseDirectory)(buildFunctionsPath, (filepath, stats) => {
|
|
73
|
-
|
|
74
|
-
if (
|
|
73
|
+
const depth = filepath.split(path_1.default.sep).length;
|
|
74
|
+
if (firstDepth === 0)
|
|
75
75
|
firstDepth = depth;
|
|
76
|
-
if (stats.isDirectory() && depth
|
|
76
|
+
if (stats.isDirectory() && depth === firstDepth) {
|
|
77
77
|
funcsToPackage.push(path_1.default.basename(filepath));
|
|
78
78
|
}
|
|
79
|
+
return false;
|
|
79
80
|
});
|
|
80
81
|
}
|
|
81
82
|
const all = [];
|
|
82
|
-
|
|
83
|
-
for (
|
|
83
|
+
const error = 0;
|
|
84
|
+
for (const funcName of funcsToPackage) {
|
|
84
85
|
all.push(packageFunction(funcName));
|
|
85
86
|
}
|
|
86
|
-
return Promise.all(all).then(() => {
|
|
87
|
+
return yield Promise.all(all).then(() => {
|
|
87
88
|
return error;
|
|
88
89
|
});
|
|
89
90
|
});
|
|
@@ -91,13 +92,14 @@ function doPackageAsync(args) {
|
|
|
91
92
|
exports.doPackageAsync = doPackageAsync;
|
|
92
93
|
function packageFunction(funcName) {
|
|
93
94
|
return __awaiter(this, void 0, void 0, function* () {
|
|
95
|
+
var _a, _b, _c, _d, _e;
|
|
94
96
|
const projectPaths = (0, pathResolve_1.resolvePaths)();
|
|
95
97
|
const buildFunctionsPath = path_1.default.join(projectPaths.buildPath, 'functions');
|
|
96
98
|
const all = [];
|
|
97
|
-
|
|
98
|
-
|
|
99
|
+
const error = 0;
|
|
100
|
+
const funcPath = path_1.default.join(buildFunctionsPath, funcName);
|
|
99
101
|
if (!fs_1.default.existsSync(funcPath)) {
|
|
100
|
-
console.error(ac.red.bold(`${funcName} does not exist`) +
|
|
102
|
+
console.error(ac.red.bold(`${funcName} does not exist`) + ', cannot package');
|
|
101
103
|
return -1;
|
|
102
104
|
}
|
|
103
105
|
const zipdir = path_1.default.join(projectPaths.basePath, 'MistLift_Zips');
|
|
@@ -105,38 +107,35 @@ function packageFunction(funcName) {
|
|
|
105
107
|
if (!fs_1.default.existsSync(zipdir)) {
|
|
106
108
|
fs_1.default.mkdirSync(zipdir);
|
|
107
109
|
}
|
|
108
|
-
|
|
109
|
-
if (
|
|
110
|
-
|
|
111
|
-
else {
|
|
112
|
-
if (!(0, fileCompare_1.isNewerFile)(funcPath, zipFile, ".js", ".zip")) {
|
|
110
|
+
const zfx = fs_1.default.existsSync(zipFile);
|
|
111
|
+
if (zfx) {
|
|
112
|
+
if (!(0, fileCompare_1.isNewerFile)(funcPath, zipFile, '.js', '.zip')) {
|
|
113
113
|
return 0;
|
|
114
114
|
}
|
|
115
|
-
}
|
|
116
|
-
if (zfx)
|
|
117
115
|
fs_1.default.unlinkSync(zipFile);
|
|
118
|
-
|
|
119
|
-
const
|
|
120
|
-
const
|
|
116
|
+
}
|
|
117
|
+
const projectName = (_a = (0, LiftVersion_1.getProjectName)()) !== null && _a !== void 0 ? _a : '';
|
|
118
|
+
const projectVersion = (_c = (_b = (0, LiftVersion_1.getProjectVersion)()) === null || _b === void 0 ? void 0 : _b.toString()) !== null && _c !== void 0 ? _c : '';
|
|
119
|
+
const liftVersion = (_e = (_d = (0, LiftVersion_1.getLiftVersion)()) === null || _d === void 0 ? void 0 : _d.toString()) !== null && _e !== void 0 ? _e : '';
|
|
121
120
|
// the main package json that has all imports
|
|
122
121
|
const mainPkgJsonPath = path_1.default.join(projectPaths.packagePath);
|
|
123
122
|
const mainPkgSrc = fs_1.default.readFileSync(mainPkgJsonPath).toString();
|
|
124
123
|
const mainPkgJson = JSON.parse(mainPkgSrc);
|
|
125
124
|
const workPath = path_1.default.join(projectPaths.basePath, '.package_temp');
|
|
126
|
-
console.log(ac.green.italic(
|
|
125
|
+
console.log(ac.green.italic('packaging ') + ac.green.bold(funcName));
|
|
127
126
|
// make a nominal package.json
|
|
128
127
|
const pkgjson = {
|
|
129
128
|
name: funcName,
|
|
130
|
-
description:
|
|
129
|
+
description: 'Lambda function ' + funcName + ' for ' + projectName + ', created with MistLift ' + liftVersion,
|
|
131
130
|
version: projectVersion,
|
|
132
|
-
main:
|
|
131
|
+
main: 'runmain.mjs',
|
|
133
132
|
scripts: {
|
|
134
|
-
test:
|
|
133
|
+
test: 'echo "No Tests Defined" && exit 1'
|
|
135
134
|
},
|
|
136
135
|
dependencies: {},
|
|
137
136
|
keywords: [],
|
|
138
|
-
author:
|
|
139
|
-
license:
|
|
137
|
+
author: '',
|
|
138
|
+
license: 'MIT'
|
|
140
139
|
};
|
|
141
140
|
// find all the imports in the sources
|
|
142
141
|
const imports = findAllImports(funcPath);
|
|
@@ -145,12 +144,12 @@ function packageFunction(funcName) {
|
|
|
145
144
|
// console.log("writing package.json", pkgjson)
|
|
146
145
|
fs_1.default.writeFileSync(path_1.default.join(workPath, 'package.json'), JSON.stringify(pkgjson, null, 2));
|
|
147
146
|
// - execute npm i at workpath, create node_modules
|
|
148
|
-
|
|
147
|
+
yield (0, executeCommand_1.executeCommand)('npm i', [], workPath).then(() => {
|
|
149
148
|
// copy the lambda function
|
|
150
149
|
(0, DirectoryUtils_1.recurseDirectory)(funcPath, (filepath, stats) => {
|
|
151
|
-
if (filepath.substring(0, funcPath.length)
|
|
150
|
+
if (filepath.substring(0, funcPath.length) === funcPath) {
|
|
152
151
|
const endpath = filepath.substring(funcPath.length);
|
|
153
|
-
if (endpath.toLowerCase().
|
|
152
|
+
if (!endpath.toLowerCase().includes(`${funcName}-tests`.toLowerCase())) { // skip tests
|
|
154
153
|
const fromPath = path_1.default.join(funcPath, endpath);
|
|
155
154
|
const toPath = path_1.default.join(workPath, endpath);
|
|
156
155
|
if (stats.isDirectory() && !fs_1.default.existsSync(toPath)) {
|
|
@@ -161,17 +160,16 @@ function packageFunction(funcName) {
|
|
|
161
160
|
}
|
|
162
161
|
}
|
|
163
162
|
}
|
|
163
|
+
return false;
|
|
164
164
|
});
|
|
165
165
|
// put a runmain.mjs into place
|
|
166
166
|
const templatePath = path_1.default.join(__dirname, '..', '..', 'templateData', 'function-runmain-mjs');
|
|
167
167
|
const runmainPath = path_1.default.join(workPath, 'runmain.mjs');
|
|
168
168
|
fs_1.default.writeFileSync(runmainPath, fs_1.default.readFileSync(templatePath));
|
|
169
|
-
// ClogInfo("Zipping...")
|
|
170
169
|
all.push((0, utils_1.FolderToZip)(workPath, zipFile));
|
|
171
170
|
// console.log("now zip it")
|
|
172
|
-
})
|
|
173
|
-
return Promise.all(all).then(() => {
|
|
174
|
-
// remove temp folder when done
|
|
171
|
+
});
|
|
172
|
+
return yield Promise.all(all).then(() => {
|
|
175
173
|
return error;
|
|
176
174
|
});
|
|
177
175
|
});
|
|
@@ -181,7 +179,7 @@ function findAllImports(folder) {
|
|
|
181
179
|
if (fs_1.default.existsSync(folder)) {
|
|
182
180
|
(0, DirectoryUtils_1.recurseDirectory)(folder, (filepath, stats) => {
|
|
183
181
|
// console.log(`filepath = ${filepath}`);
|
|
184
|
-
if (filepath.
|
|
182
|
+
if (!filepath.includes('__files__')) {
|
|
185
183
|
if (!stats.isDirectory()) {
|
|
186
184
|
const content = fs_1.default.readFileSync(filepath).toString();
|
|
187
185
|
for (const m of findImports(content)) {
|
|
@@ -190,6 +188,7 @@ function findAllImports(folder) {
|
|
|
190
188
|
}
|
|
191
189
|
}
|
|
192
190
|
}
|
|
191
|
+
return false;
|
|
193
192
|
});
|
|
194
193
|
}
|
|
195
194
|
return imports;
|
|
@@ -208,38 +207,38 @@ function reconcileVersionImports(imports, mainPkgJson) {
|
|
|
208
207
|
const dependencies = (_a = mainPkgJson.dependencies) !== null && _a !== void 0 ? _a : {};
|
|
209
208
|
const devDependencies = (_b = mainPkgJson.devDependencies) !== null && _b !== void 0 ? _b : {};
|
|
210
209
|
const builtins = [
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
210
|
+
'fs',
|
|
211
|
+
'path',
|
|
212
|
+
'process',
|
|
213
|
+
'crypto',
|
|
214
|
+
'http'
|
|
216
215
|
];
|
|
217
216
|
const depsOut = {};
|
|
218
|
-
for (
|
|
217
|
+
for (const m of imports) {
|
|
219
218
|
let isDev = false;
|
|
220
219
|
let r = dependencies[m];
|
|
221
|
-
if (
|
|
220
|
+
if (r === undefined) {
|
|
222
221
|
isDev = true;
|
|
223
222
|
r = devDependencies[m];
|
|
224
223
|
}
|
|
225
|
-
if (r) {
|
|
226
|
-
if (depsOut[m] && depsOut[m] !== r) {
|
|
224
|
+
if (r !== undefined) {
|
|
225
|
+
if (depsOut[m] !== undefined && depsOut[m] !== r) {
|
|
227
226
|
console.error(ac.red.bold(` Version mismatch on ${m}: ${r} vs ${depsOut[m]}`));
|
|
228
227
|
}
|
|
229
228
|
if (isDev) {
|
|
230
229
|
console.error(ac.magenta(` ${m} import is dev-only, not migrated`));
|
|
231
230
|
}
|
|
232
231
|
else {
|
|
233
|
-
if (
|
|
232
|
+
if (depsOut[m] !== undefined)
|
|
234
233
|
console.log(ac.blue.dim(` ${m} exported as ${r}`));
|
|
235
234
|
depsOut[m] = r;
|
|
236
235
|
}
|
|
237
236
|
}
|
|
238
237
|
else {
|
|
239
238
|
// if not a builtin and not local..
|
|
240
|
-
if (builtins.
|
|
239
|
+
if (!builtins.includes(m)) {
|
|
241
240
|
if (m.charAt(0) !== '.') {
|
|
242
|
-
console.error(ac.red.bold(
|
|
241
|
+
console.error(ac.red.bold(' ERROR - Found no dependency reference for import'), m);
|
|
243
242
|
}
|
|
244
243
|
}
|
|
245
244
|
}
|