deps: replace inherits with inherits-browser

This increase the safety of our build; external consumers
do no longer need to account for the `browser` field to
bundle bpmn-js (or otherwise bundle a Node shim, unintentionally).
This commit is contained in:
Nico Rehwaldt 2022-04-06 21:38:27 +02:00 committed by fake-join[bot]
parent e02fd6138d
commit 7478388070
62 changed files with 66 additions and 68 deletions

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import Ids from 'ids'; import Ids from 'ids';

View File

@ -25,7 +25,7 @@ import {
import Diagram from 'diagram-js'; import Diagram from 'diagram-js';
import BpmnModdle from 'bpmn-moddle'; import BpmnModdle from 'bpmn-moddle';
import inherits from 'inherits'; import inherits from 'inherits-browser';
import { import {
importBpmnDiagram importBpmnDiagram

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import BaseModeler from './BaseModeler'; import BaseModeler from './BaseModeler';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import Viewer from './Viewer'; import Viewer from './Viewer';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import CoreModule from './core'; import CoreModule from './core';
import TranslateModule from 'diagram-js/lib/i18n/translate'; import TranslateModule from 'diagram-js/lib/i18n/translate';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import { import {
isObject, isObject,

View File

@ -1,6 +1,6 @@
import AutoResize from 'diagram-js/lib/features/auto-resize/AutoResize'; import AutoResize from 'diagram-js/lib/features/auto-resize/AutoResize';
import inherits from 'inherits'; import inherits from 'inherits-browser';
import { is } from '../../util/ModelUtil'; import { is } from '../../util/ModelUtil';

View File

@ -1,6 +1,6 @@
import { is } from '../../util/ModelUtil'; import { is } from '../../util/ModelUtil';
import inherits from 'inherits'; import inherits from 'inherits-browser';
import { forEach } from 'min-dash'; import { forEach } from 'min-dash';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor'; import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
import { is } from '../../util/ModelUtil'; import { is } from '../../util/ModelUtil';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import EditorActions from 'diagram-js/lib/features/editor-actions/EditorActions'; import EditorActions from 'diagram-js/lib/features/editor-actions/EditorActions';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor'; import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import KeyboardBindings from 'diagram-js/lib/features/keyboard/KeyboardBindings'; import KeyboardBindings from 'diagram-js/lib/features/keyboard/KeyboardBindings';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import { import {
assign assign

View File

@ -3,7 +3,7 @@ import {
forEach forEach
} from 'min-dash'; } from 'min-dash';
import inherits from 'inherits'; import inherits from 'inherits-browser';
import { import {
remove as collectionRemove, remove as collectionRemove,

View File

@ -4,7 +4,7 @@ import {
isObject isObject
} from 'min-dash'; } from 'min-dash';
import inherits from 'inherits'; import inherits from 'inherits-browser';
import { import {
getBusinessObject, getBusinessObject,

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import BaseModeling from 'diagram-js/lib/features/modeling/Modeling'; import BaseModeling from 'diagram-js/lib/features/modeling/Modeling';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import { import {
getOrientation, getOrientation,

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import { is } from '../../../util/ModelUtil'; import { is } from '../../../util/ModelUtil';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import { is } from '../../../util/ModelUtil'; import { is } from '../../../util/ModelUtil';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor'; import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor'; import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import { is } from '../../../util/ModelUtil'; import { is } from '../../../util/ModelUtil';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor'; import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor'; import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor'; import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor'; import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor'; import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor'; import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import { import {
assign, assign,

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor'; import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor'; import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor'; import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';

View File

@ -2,7 +2,7 @@ import {
assign assign
} from 'min-dash'; } from 'min-dash';
import inherits from 'inherits'; import inherits from 'inherits-browser';
import { import {
is, is,

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor'; import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import { is } from '../../../util/ModelUtil'; import { is } from '../../../util/ModelUtil';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor'; import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor'; import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';

View File

@ -4,7 +4,7 @@ import {
matchPattern matchPattern
} from 'min-dash'; } from 'min-dash';
import inherits from 'inherits'; import inherits from 'inherits-browser';
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor'; import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import { forEach } from 'min-dash'; import { forEach } from 'min-dash';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import { import {
find, find,

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor'; import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor'; import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';

View File

@ -1,5 +1,5 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor'; import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor'; import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor'; import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor'; import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor'; import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import OrderingProvider from 'diagram-js/lib/features/ordering/OrderingProvider'; import OrderingProvider from 'diagram-js/lib/features/ordering/OrderingProvider';

View File

@ -1,6 +1,6 @@
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor'; import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
import inherits from 'inherits'; import inherits from 'inherits-browser';
import cssEscape from 'css.escape'; import cssEscape from 'css.escape';

View File

@ -5,7 +5,7 @@ import {
some some
} from 'min-dash'; } from 'min-dash';
import inherits from 'inherits'; import inherits from 'inherits-browser';
import { import {
is, is,

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import CreateMoveSnapping from 'diagram-js/lib/features/snapping/CreateMoveSnapping'; import CreateMoveSnapping from 'diagram-js/lib/features/snapping/CreateMoveSnapping';

7
package-lock.json generated
View File

@ -5997,6 +5997,11 @@
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
}, },
"inherits-browser": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/inherits-browser/-/inherits-browser-0.0.1.tgz",
"integrity": "sha512-kaDA3DkCdCpvrKIo/1T/3yVn+qpFUHLjYtSHmTYewb+QfjfaQy6FGQ7LwBu7st0tG9UvYad/XAlqQmdIh6CICw=="
},
"ini": { "ini": {
"version": "1.3.8", "version": "1.3.8",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
@ -6627,7 +6632,7 @@
}, },
"json5": { "json5": {
"version": "0.5.1", "version": "0.5.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", "resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz",
"integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=",
"dev": true "dev": true
}, },

View File

@ -103,7 +103,7 @@
"diagram-js": "^8.3.0", "diagram-js": "^8.3.0",
"diagram-js-direct-editing": "^1.6.3", "diagram-js-direct-editing": "^1.6.3",
"ids": "^1.0.0", "ids": "^1.0.0",
"inherits": "^2.0.4", "inherits-browser": "0.0.1",
"min-dash": "^3.5.2", "min-dash": "^3.5.2",
"min-dom": "^3.2.0", "min-dom": "^3.2.0",
"object-refs": "^0.3.0", "object-refs": "^0.3.0",

View File

@ -97,13 +97,7 @@ function pgl(plugins=[], env='production') {
replace({ replace({
'process.env.NODE_ENV': JSON.stringify(env) 'process.env.NODE_ENV': JSON.stringify(env)
}), }),
nodeResolve({ nodeResolve(),
mainFields: [
'browser',
'module',
'main'
]
}),
commonjs(), commonjs(),
json(), json(),
...plugins ...plugins

View File

@ -83,7 +83,6 @@ module.exports = function(karma) {
resolve: { resolve: {
mainFields: [ mainFields: [
'dev:module', 'dev:module',
'browser',
'module', 'module',
'main' 'main'
], ],

View File

@ -2,7 +2,7 @@ import {
assign assign
} from 'min-dash'; } from 'min-dash';
import inherits from 'inherits'; import inherits from 'inherits-browser';
import BpmnElementFactory from 'lib/features/modeling/ElementFactory'; import BpmnElementFactory from 'lib/features/modeling/ElementFactory';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import BaseRenderer from 'diagram-js/lib/draw/BaseRenderer'; import BaseRenderer from 'diagram-js/lib/draw/BaseRenderer';

View File

@ -1,6 +1,6 @@
import { forEach } from 'min-dash'; import { forEach } from 'min-dash';
import inherits from 'inherits'; import inherits from 'inherits-browser';
import RuleProvider from 'diagram-js/lib/features/rules/RuleProvider'; import RuleProvider from 'diagram-js/lib/features/rules/RuleProvider';

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import { import {
is as isBpmn is as isBpmn

View File

@ -6,7 +6,7 @@ import ViewerDefaultExport from '../../';
import Viewer from 'lib/Viewer'; import Viewer from 'lib/Viewer';
import inherits from 'inherits'; import inherits from 'inherits-browser';
import { import {
createViewer createViewer

View File

@ -4,7 +4,7 @@ import {
getOrientation getOrientation
} from 'diagram-js/lib/layout/LayoutUtil'; } from 'diagram-js/lib/layout/LayoutUtil';
import inherits from 'inherits'; import inherits from 'inherits-browser';
export default function LoggingCroppingConnectionDocking(injector) { export default function LoggingCroppingConnectionDocking(injector) {

View File

@ -1,4 +1,4 @@
import inherits from 'inherits'; import inherits from 'inherits-browser';
import RuleProvider from 'diagram-js/lib/features/rules/RuleProvider'; import RuleProvider from 'diagram-js/lib/features/rules/RuleProvider';