From cc6b8fc81367b72f83db9c770f68e079cfd37629 Mon Sep 17 00:00:00 2001 From: Emjay Date: Thu, 3 Aug 2017 16:46:45 +0100 Subject: [PATCH 1/3] switch from NPM to YARN --- .gitignore | 1 + lambda-create.js | 10 +++++----- lambda-update.js | 12 ++++++------ 3 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b512c09 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/lambda-create.js b/lambda-create.js index afc0d87..5d71369 100644 --- a/lambda-create.js +++ b/lambda-create.js @@ -46,10 +46,10 @@ if (!program.skipUpload) { process.exit(1); } - //run an npm update to get the latest dependencies - console.log(`Updating package dependencies...`); + //run a yarn install to get the latest dependencies + console.log(`Installing package dependencies...`); try { - execSync('npm update -S && npm update -D'); + execSync('yarn install'); } catch (err) { console.error(`Error updating dependencies: ${err.message}`); process.exit(1); @@ -58,7 +58,7 @@ if (!program.skipUpload) { //compile the package console.log(`Compiling package...`); try { - execSync('npm run compile'); + execSync('yarn run compile'); } catch (err) { console.error(`Error compiling package: ${err.message}`); process.exit(1); @@ -67,7 +67,7 @@ if (!program.skipUpload) { //remove dev dependencies from output to streamline output console.log(`Removing dev dependencies...`); try { - execSync('npm prune --production'); + execSync('rm -rf node_modules/ && yarn install --production'); } catch (err) { console.error(`Error removing dev dependencies: ${err.message}`); process.exit(1); diff --git a/lambda-update.js b/lambda-update.js index 15a232a..a0eeb7c 100644 --- a/lambda-update.js +++ b/lambda-update.js @@ -48,10 +48,10 @@ if (!program.skipUpload) { process.exit(1); } - //run an npm update to get the latest dependencies - console.log(`Updating package dependencies...`); + //run a yarn install to get the latest dependencies + console.log(`Installing package dependencies...`); try { - execSync('npm update -S && npm update -D'); + execSync('yarn install'); } catch (err) { console.error(`Error updating dependencies: ${err.message}`); process.exit(1); @@ -60,7 +60,7 @@ if (!program.skipUpload) { //compile the package console.log(`Compiling package...`); try { - execSync('npm run compile'); + execSync('yarn run compile'); } catch (err) { console.error(`Error compiling package: ${err.message}`); process.exit(1); @@ -69,11 +69,11 @@ if (!program.skipUpload) { //remove dev dependencies from output to streamline output console.log(`Removing dev dependencies...`); try { - execSync('npm prune --production'); + execSync('rm -rf node_modules/ && yarn install --production'); } catch (err) { console.error(`Error removing dev dependencies: ${err.message}`); process.exit(1); - } + } //zip up the distribution files console.log(`Creating distribution package '${zipfile}' from [${files.join()}]...`); From 1f7c5ef0e71fee7ef60727287dcaa4aa8fab01ad Mon Sep 17 00:00:00 2001 From: Siddhartha Goyal Date: Sat, 12 Aug 2017 19:54:44 -0400 Subject: [PATCH 2/3] added code block to remove yarn.lock before running 'yarn install' to allow for pickup of new packages --- lambda-create.js | 8 ++++++++ lambda-update.js | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/lambda-create.js b/lambda-create.js index 5d71369..3fba4ec 100644 --- a/lambda-create.js +++ b/lambda-create.js @@ -46,6 +46,14 @@ if (!program.skipUpload) { process.exit(1); } + //remove the yarn.lock file + try { + execSync(`rm -f yarn.lock`); + } catch (err) { + console.error(`Error removing yarn.lock: ${err.message}`); + process.exit(1); + } + //run a yarn install to get the latest dependencies console.log(`Installing package dependencies...`); try { diff --git a/lambda-update.js b/lambda-update.js index a0eeb7c..1da5111 100644 --- a/lambda-update.js +++ b/lambda-update.js @@ -48,6 +48,14 @@ if (!program.skipUpload) { process.exit(1); } + //remove the yarn.lock file + try { + execSync(`rm -f yarn.lock`); + } catch (err) { + console.error(`Error removing yarn.lock: ${err.message}`); + process.exit(1); + } + //run a yarn install to get the latest dependencies console.log(`Installing package dependencies...`); try { From ce98d22505630da862ae470904761dad5c5d50b0 Mon Sep 17 00:00:00 2001 From: Siddhartha Goyal Date: Fri, 18 Aug 2017 16:45:12 -0400 Subject: [PATCH 3/3] added new ignore files --- .gitignore | 4 +++- lambda.js | 0 2 files changed, 3 insertions(+), 1 deletion(-) mode change 100644 => 100755 lambda.js diff --git a/.gitignore b/.gitignore index b512c09..b5ea54c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -node_modules \ No newline at end of file +node_modules +.project +examples/basic.json diff --git a/lambda.js b/lambda.js old mode 100644 new mode 100755