@@ -4,6 +4,7 @@ import { execSync } from "child_process";
4
4
5
5
// var myArgs = process.argv.slice(2);
6
6
var scopedVersion = process . argv [ 2 ] ;
7
+ var skipInstall = process . argv [ 3 ] ;
7
8
console . log ( `Packing nativescript-angular package with @nativescript/angular: ${ scopedVersion } ` ) ;
8
9
9
10
const distFolderPath = path . resolve ( "../../dist" ) ;
@@ -15,7 +16,8 @@ const packageJsonPath = path.resolve(`${nsAngularPackagePath}/package.json`);
15
16
console . log ( "Getting package.json from" , packageJsonPath ) ;
16
17
17
18
let npmInstallParams = "" ;
18
- if ( scopedVersion . indexOf ( ".tgz" ) > 0 ) {
19
+
20
+ if ( scopedVersion . indexOf ( ".tgz" ) > 0 || skipInstall === "no-save-exact" ) {
19
21
// rewrite dependency in package.json
20
22
const packageJsonObject = JSON . parse ( fs . readFileSync ( packageJsonPath , { encoding : "utf8" } ) ) ;
21
23
packageJsonObject . dependencies [ "@nativescript/angular" ] = scopedVersion ;
@@ -24,14 +26,21 @@ if (scopedVersion.indexOf(".tgz") > 0) {
24
26
npmInstallParams = `@nativescript/angular@${ scopedVersion } ` ;
25
27
}
26
28
27
- execSync ( `npm install --save-exact ${ npmInstallParams } ` , {
28
- cwd : nsAngularPackagePath
29
- } ) ;
29
+ if ( skipInstall !== "no-save-exact" ) {
30
+ execSync ( `npm install --save-exact ${ npmInstallParams } ` , {
31
+ cwd : nsAngularPackagePath
32
+ } ) ;
33
+ }
30
34
31
35
// ensure empty temp and existing dist folders
32
36
fs . emptyDirSync ( tempFolderPath ) ;
33
37
fs . ensureDirSync ( distFolderPath ) ;
34
38
39
+ // Install, run tsc and run ngc
40
+ execSync ( `npm i && tsc && npm run ngc` , {
41
+ cwd : nsAngularPackagePath
42
+ } ) ;
43
+
35
44
// create .tgz in temp folder
36
45
execSync ( `npm pack ${ nsAngularPackagePath } ` , {
37
46
cwd : tempFolderPath
0 commit comments