Skip to content

Commit 82d6abc

Browse files
Add official support for Node.js 8 (#2979)
* Add official support for Node.js 8 Add npm-shrinkwrap.json that is required for building CLI's package with npm 5. By default npm 5 creates package-lock.json, but it cannot be published. So in case we use `package-lock.json`, we'll always have exact dependency tree when using the repository, but end-users will have different dependency tree. So instead of using package-lock.json we'll use npm-shrinkwrap.json that can be published in npm. Update engine's tag in package.json, so in case Node.js 8 is used, we'll no longer show warning to the users. * Ensure symlinks from plugins are copied from realpath to platforms dir In case a plugin is symlinked or it has symlink files/directories, we do not want to copy the symlink to platforms dir, but the real files. This is required as the symlink may be relative to the current location and copying it makes it invalid. So pass `-L` option to `shelljs.cp`, so the symlinked files will be followed and the real ones will be copied. This also fixes unit tests with npm5.
1 parent 8590ede commit 82d6abc

File tree

3 files changed

+3808
-9
lines changed

3 files changed

+3808
-9
lines changed

lib/tools/node-modules/node-modules-dest-copy.ts

+3-8
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,9 @@ export class TnsModulesCopy {
4040

4141
shelljs.mkdir("-p", targetPackageDir);
4242

43-
let isScoped = dependency.name.indexOf("@") === 0;
44-
45-
if (isScoped) {
46-
// copy module into tns_modules/@scope/module instead of tns_modules/module
47-
shelljs.cp("-Rf", dependency.directory, path.join(this.outputRoot, dependency.name.substring(0, dependency.name.indexOf("/"))));
48-
} else {
49-
shelljs.cp("-Rf", dependency.directory, this.outputRoot);
50-
}
43+
const isScoped = dependency.name.indexOf("@") === 0;
44+
const destinationPath = isScoped ? path.join(this.outputRoot, dependency.name.substring(0, dependency.name.indexOf("/"))) : this.outputRoot;
45+
shelljs.cp("-RfL", dependency.directory, destinationPath);
5146

5247
// remove platform-specific files (processed separately by plugin services)
5348
shelljs.rm("-rf", path.join(targetPackageDir, "platforms"));

0 commit comments

Comments
 (0)