From def282137fb1985eae2c9b6d834a7c1aec946487 Mon Sep 17 00:00:00 2001 From: Yadd Date: Mon, 11 Oct 2021 06:24:07 +0200 Subject: Build stylis with rollup --- debian/clean | 1 + debian/control | 3 +++ debian/nodejs/stylis/build | 1 + debian/patches/drop-rollup-plugin-size.patch | 30 ++++++++++++++++++++++++++++ debian/patches/series | 1 + debian/rules | 1 + debian/tests/control | 5 ----- 7 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 debian/nodejs/stylis/build create mode 100644 debian/patches/drop-rollup-plugin-size.patch delete mode 100644 debian/tests/control diff --git a/debian/clean b/debian/clean index c29600b..2fbb184 100644 --- a/debian/clean +++ b/debian/clean @@ -3,3 +3,4 @@ escaper/dist/escaper.min.js dist/*.js dist/*.map strip-css-comments/index.cjs +stylis/dist/ diff --git a/debian/control b/debian/control index 2505f42..54e6dd3 100644 --- a/debian/control +++ b/debian/control @@ -15,12 +15,15 @@ Build-Depends: , node-dompurify , node-graphlibrary (>= 2.2.0+really2.1.8+dfsg~) , node-moment + , node-rollup-plugin-terser + , rollup , uglifyjs.terser , webpack (>= 4.43.0~) Standards-Version: 4.6.0 Vcs-Browser: https://salsa.debian.org/js-team/node-mermaid Vcs-Git: https://salsa.debian.org/js-team/node-mermaid.git Homepage: https://github.com/knsv/mermaid +Testsuite: autopkgtest-pkg-nodejs Rules-Requires-Root: no Package: node-mermaid diff --git a/debian/nodejs/stylis/build b/debian/nodejs/stylis/build new file mode 100644 index 0000000..06618f3 --- /dev/null +++ b/debian/nodejs/stylis/build @@ -0,0 +1 @@ +rollup --config script/build.js --configSrc ./ diff --git a/debian/patches/drop-rollup-plugin-size.patch b/debian/patches/drop-rollup-plugin-size.patch new file mode 100644 index 0000000..1fd4399 --- /dev/null +++ b/debian/patches/drop-rollup-plugin-size.patch @@ -0,0 +1,30 @@ +Description: drop rollup-plugin-size +Author: Yadd +Forwarded: not-needed +Last-Update: 2021-10-11 + +--- a/stylis/script/build.js ++++ b/stylis/script/build.js +@@ -1,6 +1,5 @@ + import {join} from 'path' + import {terser} from 'rollup-plugin-terser' +-import size from 'rollup-plugin-size' + + const emitPackageScopeFile = (type) => { + return { +@@ -31,13 +30,13 @@ + ...defaults, + input: configInput, + output: [{file: join(configSrc, 'dist', 'umd', 'stylis.js'), format: 'umd', name: 'stylis', freeze: false, sourcemap: true}], +- plugins: [emitPackageScopeFile('commonjs'), terser(options), size()] ++ plugins: [emitPackageScopeFile('commonjs'), terser(options)] + }, + { + ...defaults, + input: configInput, + output: [{file: join(configSrc, 'dist', 'stylis.mjs'), format: 'esm', name: 'stylis', freeze: false, sourcemap: true}], +- plugins: [terser(options), size()] ++ plugins: [terser(options)] + } + ] + } diff --git a/debian/patches/series b/debian/patches/series index 77728fd..5d4c5a4 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ 0002-Fix-unsupported-syntax.patch 0003-Replace-moment-mini-with-moment.patch strip-css-comments.commonjs.patch +drop-rollup-plugin-size.patch diff --git a/debian/rules b/debian/rules index a175be9..653908b 100755 --- a/debian/rules +++ b/debian/rules @@ -8,6 +8,7 @@ dh $@ override_dh_auto_build: + dh_auto_build --buildsystem=nodejs ln -sf /usr/share/nodejs/buffer . uglifyjs.terser escaper/dist/escaper.js -c -m -o escaper/dist/escaper.min.js webpack --progress --colors diff --git a/debian/tests/control b/debian/tests/control deleted file mode 100644 index 2613764..0000000 --- a/debian/tests/control +++ /dev/null @@ -1,5 +0,0 @@ -Test-Command: /usr/share/pkg-js-autopkgtest/runner -Depends: @, @builddeps@, pkg-js-autopkgtest, rollup -Restrictions: allow-stderr -Features: test-name=pkg-js-autopkgtest - -- cgit v1.2.3