@@ -4,6 +4,7 @@ import { execSync } from "child_process";
44
55// var myArgs = process.argv.slice(2);
66var scopedVersion = process . argv [ 2 ] ;
7+ var skipInstall = process . argv [ 3 ] ;
78console . log ( `Packing nativescript-angular package with @nativescript/angular: ${ scopedVersion } ` ) ;
89
910const distFolderPath = path . resolve ( "../../dist" ) ;
@@ -15,7 +16,8 @@ const packageJsonPath = path.resolve(`${nsAngularPackagePath}/package.json`);
1516console . log ( "Getting package.json from" , packageJsonPath ) ;
1617
1718let npmInstallParams = "" ;
18- if ( scopedVersion . indexOf ( ".tgz" ) > 0 ) {
19+
20+ if ( scopedVersion . indexOf ( ".tgz" ) > 0 || skipInstall === "no-save-exact" ) {
1921 // rewrite dependency in package.json
2022 const packageJsonObject = JSON . parse ( fs . readFileSync ( packageJsonPath , { encoding : "utf8" } ) ) ;
2123 packageJsonObject . dependencies [ "@nativescript/angular" ] = scopedVersion ;
@@ -24,14 +26,21 @@ if (scopedVersion.indexOf(".tgz") > 0) {
2426 npmInstallParams = `@nativescript/angular@${ scopedVersion } ` ;
2527}
2628
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+ }
3034
3135// ensure empty temp and existing dist folders
3236fs . emptyDirSync ( tempFolderPath ) ;
3337fs . ensureDirSync ( distFolderPath ) ;
3438
39+ // Install, run tsc and run ngc
40+ execSync ( `npm i && tsc && npm run ngc` , {
41+ cwd : nsAngularPackagePath
42+ } ) ;
43+
3544// create .tgz in temp folder
3645execSync ( `npm pack ${ nsAngularPackagePath } ` , {
3746 cwd : tempFolderPath
0 commit comments