-
-
Notifications
You must be signed in to change notification settings - Fork 241
chore: add scoped package #2014
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
ed16c12
initial commit
tbozhikov 2ca7acd
save progress
tbozhikov 55da9f3
chore: make most of e2e apps work with the revamped older package
tbozhikov 1d640af
fix: single-page test app
tbozhikov 1090095
fix: revert changes to modal navigation e2e
tbozhikov 10b9253
chore: reorganise exports
tbozhikov f519624
chore: remove comment
tbozhikov f725a6e
fix: unit tests after refactoring
tbozhikov fdad1c9
chore: first bits of a pack script for non-scoped dependency
tbozhikov 1cb22db
chore: pack script for compat package
tbozhikov d975201
chore: rename out tgz file to nativescript-angular-compat.tgz
tbozhikov 1ca8279
fix: comments
tbozhikov 398fbe0
chore: remove unused npm script
tbozhikov 2595456
chore: add pack script in scoped pckg
tbozhikov 5c7f25f
fix: ensure dist
tbozhikov a492023
chore: build scoped package through nodejs script
tbozhikov e9e9327
chore: update build scripts, fix jenkins build
tbozhikov 63872d8
fix: try to fix error in jenkins
tbozhikov faede8a
fix: remove bin prop from compat so that npm flattens scoped deps in …
tbozhikov ddefe0e
cleanup: wrongly committed files
tbozhikov 8174558
fix: revert tns-ios and tns-android versions in package jsons
tbozhikov 0a25c40
chore: export most types from root scope of the scoped package
tbozhikov 916bc85
chore: add platform common exports in compat, clean ups
tbozhikov cb0292f
fix: update compat build script to work correctly with save-exact
tbozhikov f82e9aa
fix: potential breaking change
tbozhikov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import * as path from "path"; | ||
import * as fs from "fs-extra"; | ||
import { execSync } from "child_process"; | ||
|
||
// var myArgs = process.argv.slice(2); | ||
var scopedVersion = process.argv[2]; | ||
console.log(`Packing nativescript-angular package with @nativescript/angular: ${scopedVersion}`); | ||
|
||
const distFolderPath = path.resolve("../../dist"); | ||
const tempFolderPath = path.resolve("./temp-compat"); | ||
const outFileName = "nativescript-angular-compat.tgz"; | ||
|
||
const nsAngularPackagePath = path.resolve("../../nativescript-angular-package"); | ||
const packageJsonPath = path.resolve(`${nsAngularPackagePath}/package.json`); | ||
console.log("Getting package.json from", packageJsonPath); | ||
|
||
let npmInstallParams = ""; | ||
if (scopedVersion.indexOf(".tgz") > 0) { | ||
// rewrite dependency in package.json | ||
const packageJsonObject = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: "utf8" })); | ||
packageJsonObject.dependencies["@nativescript/angular"] = scopedVersion; | ||
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJsonObject, null, 4)); | ||
} else { | ||
npmInstallParams = `@nativescript/angular@${scopedVersion}`; | ||
} | ||
|
||
execSync(`npm install --save-exact ${npmInstallParams}`, { | ||
cwd: nsAngularPackagePath | ||
}); | ||
|
||
// ensure empty temp and existing dist folders | ||
fs.emptyDirSync(tempFolderPath); | ||
fs.ensureDirSync(distFolderPath); | ||
|
||
// create .tgz in temp folder | ||
execSync(`npm pack ${nsAngularPackagePath}`, { | ||
cwd: tempFolderPath | ||
}); | ||
|
||
// assume we have a single file built in temp folder, take its name | ||
const currentFileName = fs.readdirSync(tempFolderPath)[0]; | ||
|
||
// move built file and remove temp folder | ||
fs.moveSync(`${tempFolderPath}/${currentFileName}`, `${distFolderPath}/${outFileName}`, { overwrite: true }); | ||
fs.removeSync(`${tempFolderPath}`); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import * as path from "path"; | ||
import * as fs from "fs-extra"; | ||
import { execSync } from "child_process"; | ||
|
||
console.log(`Packing @nativescript/angular package`); | ||
|
||
const distFolderPath = path.resolve("../../dist"); | ||
const tempFolderPath = path.resolve("./temp-scoped"); | ||
const outFileName = "nativescript-angular-scoped.tgz"; | ||
|
||
const nsAngularPackagePath = path.resolve("../../nativescript-angular"); | ||
|
||
execSync(`npm install --save-exact`, { | ||
cwd: nsAngularPackagePath | ||
}); | ||
|
||
// ensure empty temp and dist folders | ||
fs.emptyDirSync(tempFolderPath); | ||
fs.ensureDirSync(distFolderPath); | ||
|
||
// create .tgz in temp folder | ||
execSync(`npm pack ${nsAngularPackagePath}`, { | ||
cwd: tempFolderPath | ||
}); | ||
|
||
// assume we have a single file built in temp folder, take its name | ||
const currentFileName = fs.readdirSync(tempFolderPath)[0]; | ||
|
||
// move built file and remove temp folder | ||
fs.moveSync(`${tempFolderPath}/${currentFileName}`, `${distFolderPath}/${outFileName}`, { overwrite: true }); | ||
fs.removeSync(`${tempFolderPath}`); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "build", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "prepublish-next.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"@types/node": "^12.7.12", | ||
"fs-extra": "^8.1.0", | ||
"rimraf": "^3.0.0", | ||
"ts-node": "^8.4.1", | ||
"typescript": "^3.6.4" | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"target": "es5", | ||
"experimentalDecorators": true, | ||
"emitDecoratorMetadata": true, | ||
"noEmitHelpers": true, | ||
"noEmitOnError": true, | ||
"lib": [ | ||
"es6", | ||
"dom", | ||
"es2015.iterable" | ||
], | ||
"types": [ | ||
"node" | ||
], | ||
"typeRoots": [ "./node_modules/@types" ] | ||
}, | ||
"include": [ | ||
"./**/*.ts" | ||
], | ||
"exclude": [ | ||
"node_modules" | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
*.tgz | ||
|
||
*.ts | ||
!*.d.ts | ||
|
||
*.js.map | ||
|
||
tsconfig.json | ||
global.d.ts | ||
.npmignore | ||
gulpfile.js | ||
tslint.json |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.