From df6986ec0a5c353babb60836ec97c21923913e79 Mon Sep 17 00:00:00 2001 From: Denis Date: Wed, 26 Jul 2017 15:06:01 -0400 Subject: [PATCH] Fixes #861 copy license file --- package.json | 1 + scripts/create-new-module | 28 +++------------------------- yarn.lock | 20 +++++++++++++++++++- 3 files changed, 23 insertions(+), 26 deletions(-) diff --git a/package.json b/package.json index 3b36d0899b..4d44e16996 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,7 @@ "documentation": "4.0.0-beta7", "eslint": "^2.0.0", "eslint-config-mourner": "^2.0.0", + "fs-extra": "^4.0.0", "lerna": "2.0.0-beta.34", "load-json-file": "^2.0.0", "meow": "^3.7.0", diff --git a/scripts/create-new-module b/scripts/create-new-module index 9910cd0deb..fd0363355d 100755 --- a/scripts/create-new-module +++ b/scripts/create-new-module @@ -1,6 +1,6 @@ #!/usr/bin/env node -const fs = require('fs'); +const fs = require('fs-extra'); const path = require('path'); const meow = require('meow'); const camelcase = require('camelcase'); @@ -90,27 +90,8 @@ fs.writeFileSync(path.join(folderPath, 'package.json'), `{ `); // Create LICENSE -fs.writeFileSync(path.join(folderPath, 'LICENSE'), `The MIT License (MIT) - -Copyright (c) 2017 TurfJS - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -`); +const license = path.join(__dirname, '..', 'packages', 'turf', 'LICENSE'); +fs.copySync(license, path.join(folderPath, 'LICENSE')); // Create index.d.ts fs.writeFileSync(path.join(folderPath, 'index.d.ts'), `/// @@ -187,9 +168,6 @@ test('turf-${decamelizeName}', t => { }); `); -// Create geojson files -fs.writeFileSync(path.join(folderPath, 'test/in/feature.geojson'), ``); -fs.writeFileSync(path.join(folderPath, 'test/out/feature.geojson'), ``); // Create README.md fs.writeFileSync(path.join(folderPath, 'README.md'), `# @turf/${decamelizeName} diff --git a/yarn.lock b/yarn.lock index 26fcf6d8a7..32b66885f4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2072,6 +2072,14 @@ fs-exists-cached@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs-exists-cached/-/fs-exists-cached-1.0.0.tgz#cf25554ca050dc49ae6656b41de42258989dcbce" +fs-extra@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.0.tgz#414fb4ca2d2170ba0014159d3a8aec3303418d9e" + dependencies: + graceful-fs "^4.1.2" + jsonfile "^3.0.0" + universalify "^0.1.0" + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -2262,7 +2270,7 @@ globby@^5.0.0: pify "^2.0.0" pinkie-promise "^2.0.0" -graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.2: +graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" @@ -2835,6 +2843,12 @@ json5@^0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" +jsonfile@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-3.0.1.tgz#a5ecc6f65f53f662c4415c7675a0331d0992ec66" + optionalDependencies: + graceful-fs "^4.1.6" + jsonify@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" @@ -4687,6 +4701,10 @@ unist-util-visit@^1.0.0, unist-util-visit@^1.0.1, unist-util-visit@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-1.1.1.tgz#e917a3b137658b335cb4420c7da2e74d928e4e94" +universalify@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.1.tgz#fa71badd4437af4c148841e3b3b165f9e9e590b7" + unpipe@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"