From 9e70dd9326e40f2e4a8d59adb6967e391c6ab819 Mon Sep 17 00:00:00 2001 From: eCode Date: Sat, 6 Aug 2022 16:07:55 -0300 Subject: [PATCH] sorted deps of all our @pixi-spine deps --- bundles/all-3.8/rollup.config.js | 12 ++++++++---- bundles/all-4.0/rollup.config.js | 11 ++++++++--- bundles/all-4.1/rollup.config.js | 12 ++++++++---- bundles/pixi-spine/rollup.config.js | 11 ++++++++--- 4 files changed, 32 insertions(+), 14 deletions(-) diff --git a/bundles/all-3.8/rollup.config.js b/bundles/all-3.8/rollup.config.js index a8d59236..7596c9ce 100644 --- a/bundles/all-3.8/rollup.config.js +++ b/bundles/all-3.8/rollup.config.js @@ -1,4 +1,5 @@ const { main } = require('@pixi-spine/rollup-config/main'); +const pkg = require('./package.json'); const results = main({ globals: { @@ -9,10 +10,13 @@ const results = main({ }, }); -// TODO: get sorted deps of all our @pixi-spine deps - -const umdDeps = ['@pixi/constants', '@pixi/core', '@pixi/display', '@pixi/graphics', - '@pixi/loaders', '@pixi/math', '@pixi/mesh-extras', '@pixi/sprite', '@pixi/utils']; +// Find all the peer deps. Note: This assumes we have only two levels of peer deps. +let umdDeps = []; +const deps = Object.keys(pkg.dependencies || {}); +for (let dep of deps) { + const p = require(`${dep}/package.json`); + umdDeps = umdDeps.concat(Object.keys(p.peerDependencies || {})); +} const license1 = 'is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license'; const licenseSpine = 'is licensed under SPINE-LICENSE\n * http://esotericsoftware.com/spine-runtimes-license'; diff --git a/bundles/all-4.0/rollup.config.js b/bundles/all-4.0/rollup.config.js index eb23df3b..373d9da8 100644 --- a/bundles/all-4.0/rollup.config.js +++ b/bundles/all-4.0/rollup.config.js @@ -1,4 +1,5 @@ const { main } = require('@pixi-spine/rollup-config/main'); +const pkg = require('./package.json'); const results = main({ globals: { @@ -9,10 +10,14 @@ const results = main({ }, }); -// TODO: get sorted deps of all our @pixi-spine deps +// Find all the peer deps. Note: This assumes we have only two levels of peer deps. +let umdDeps = []; +const deps = Object.keys(pkg.dependencies || {}); +for (let dep of deps) { + const p = require(`${dep}/package.json`); + umdDeps = umdDeps.concat(Object.keys(p.peerDependencies || {})); +} -const umdDeps = ['@pixi/constants', '@pixi/core', '@pixi/display', '@pixi/graphics', - '@pixi/loaders', '@pixi/math', '@pixi/mesh-extras', '@pixi/sprite', '@pixi/utils']; const license1 = 'is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license'; const licenseSpine = 'is licensed under SPINE-LICENSE\n * http://esotericsoftware.com/spine-runtimes-license'; diff --git a/bundles/all-4.1/rollup.config.js b/bundles/all-4.1/rollup.config.js index eb23df3b..614fb404 100644 --- a/bundles/all-4.1/rollup.config.js +++ b/bundles/all-4.1/rollup.config.js @@ -1,4 +1,5 @@ const { main } = require('@pixi-spine/rollup-config/main'); +const pkg = require('./package.json'); const results = main({ globals: { @@ -9,10 +10,13 @@ const results = main({ }, }); -// TODO: get sorted deps of all our @pixi-spine deps - -const umdDeps = ['@pixi/constants', '@pixi/core', '@pixi/display', '@pixi/graphics', - '@pixi/loaders', '@pixi/math', '@pixi/mesh-extras', '@pixi/sprite', '@pixi/utils']; +// Find all the peer deps. Note: This assumes we have only two levels of peer deps. +let umdDeps = []; +const deps = Object.keys(pkg.dependencies || {}); +for (let dep of deps) { + const p = require(`${dep}/package.json`); + umdDeps = umdDeps.concat(Object.keys(p.peerDependencies || {})); +} const license1 = 'is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license'; const licenseSpine = 'is licensed under SPINE-LICENSE\n * http://esotericsoftware.com/spine-runtimes-license'; diff --git a/bundles/pixi-spine/rollup.config.js b/bundles/pixi-spine/rollup.config.js index a98215d1..b223ee86 100644 --- a/bundles/pixi-spine/rollup.config.js +++ b/bundles/pixi-spine/rollup.config.js @@ -1,4 +1,5 @@ const { main } = require('@pixi-spine/rollup-config/main'); +const pkg = require('./package.json'); const results = main({ globals: { @@ -11,10 +12,14 @@ const results = main({ }, }); -// TODO: get sorted deps of all our @pixi-spine deps +// Find all the peer deps. Note: This assumes we have only two levels of peer deps. +let umdDeps = []; +const deps = Object.keys(pkg.dependencies || {}); +for (let dep of deps) { + const p = require(`${dep}/package.json`); + umdDeps = umdDeps.concat(Object.keys(p.peerDependencies || {})); +} -const umdDeps = ['@pixi/constants', '@pixi/core', '@pixi/display', '@pixi/graphics', - '@pixi/loaders', '@pixi/math', '@pixi/mesh-extras', '@pixi/sprite', '@pixi/utils']; const license1 = 'is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license'; const licenseSpine = 'is licensed under SPINE-LICENSE\n * http://esotericsoftware.com/spine-runtimes-license';