1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
Description: render banner reproducible
Author: Yadd <yadd@debian.org>
Forwarded: not-needed
Last-Update: 2023-01-03
--- a/build-plugins/get-banner.ts
+++ b/build-plugins/get-banner.ts
@@ -1,11 +1,7 @@
-import { exec } from 'node:child_process';
import { readFile } from 'node:fs/promises';
import { env } from 'node:process';
-import { promisify } from 'node:util';
-const execPromise = promisify(exec);
-
-function generateBanner(commitHash: string, version: string): string {
+function generateBanner(version: string): string {
const date = new Date(
env.SOURCE_DATE_EPOCH ? 1000 * +env.SOURCE_DATE_EPOCH : Date.now()
).toUTCString();
@@ -13,7 +9,7 @@
return `/*
@license
Rollup.js v${version}
- ${date} - commit ${commitHash}
+ ${date}
https://github.com/rollup/rollup
@@ -25,12 +21,6 @@
export default function getBanner(): Promise<string> {
return (getBannerPromise ||= Promise.all([
- execPromise('git rev-parse HEAD')
- .then(({ stdout }) => stdout.trim())
- .catch(error => {
- console.error('Could not determine commit hash:', error);
- return 'unknown';
- }),
readFile(new URL('../package.json', import.meta.url), 'utf8')
- ]).then(([commit, package_]) => generateBanner(commit, JSON.parse(package_).version)));
+ ]).then(([package_]) => generateBanner(JSON.parse(package_).version)));
}
--- a/rollup.config.ts
+++ b/rollup.config.ts
@@ -106,11 +106,9 @@
minifyInternalExports: false,
sourcemap: false
},
- plugins: [...nodePlugins, emitModulePackageFile(), collectLicenses(), writeLicense()]
+ plugins: [...nodePlugins, emitModulePackageFile(), collectLicenses()]
};
- const { collectLicenses: collectLicensesBrowser, writeLicense: writeLicenseBrowser } =
- getLicenseHandler(fileURLToPath(new URL('browser', import.meta.url)));
const browserBuilds: RollupOptions = {
input: 'src/browser-entry.ts',
|