From 265d70111a76d7aadb0ea5ca9e092f381c46798d Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Thu, 28 Sep 2023 15:42:13 +0100 Subject: [PATCH] Add licensing info to npm readme files --- npm/darwin-x64/package.json | 3 +++ npm/from-github-release.js | 21 +++++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/npm/darwin-x64/package.json b/npm/darwin-x64/package.json index 89e4adb5..eab18da8 100644 --- a/npm/darwin-x64/package.json +++ b/npm/darwin-x64/package.json @@ -19,6 +19,9 @@ "files": [ "lib" ], + "publishConfig": { + "access": "public" + }, "exports": { "./sharp.node": "./lib/sharp-darwin-x64.node", "./package": "./package.json" diff --git a/npm/from-github-release.js b/npm/from-github-release.js index da71ce44..5458ccc8 100644 --- a/npm/from-github-release.js +++ b/npm/from-github-release.js @@ -20,8 +20,25 @@ const mapTarballEntry = (header) => { return header; }; +const licensing = ` +## Licensing + +Copyright 2013 Lovell Fuller and others. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +[https://www.apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0) + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +`; + workspaces.map(async platform => { - const url = `https://github.com/lovell/sharp/releases/download/v${version}/sharp-v${version}-napi-v7-${platform}.tar.gz`; + const url = `https://github.com/lovell/sharp/releases/download/v${version}/sharp-v${version}-napi-v9-${platform}.tar.gz`; const dir = path.join(__dirname, platform); const response = await fetch(url); if (!response.ok) { @@ -36,7 +53,7 @@ workspaces.map(async platform => { ); // Generate README const { name, description } = require(`./${platform}/package.json`); - await writeFile(path.join(dir, 'README.md'), `# ${name}\n${description}`); + await writeFile(path.join(dir, 'README.md'), `# \`${name}\`\n\n${description}.\n${licensing}`); // Copy Apache-2.0 LICENSE await copyFile(path.join(__dirname, '..', 'LICENSE'), path.join(dir, 'LICENSE')); // Copy Windows-specific files