Skip to content

Commit 2d8dbfa

Browse files
authored
update the playcanvas dependency used by pcui-graph to use a github release (#10)
1 parent 3be2fdb commit 2d8dbfa

File tree

6 files changed

+1390
-1786
lines changed

6 files changed

+1390
-1786
lines changed

.storybook/main.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ module.exports = {
3232
type: "javascript/auto",
3333
}
3434
);
35+
36+
config.module.rules[5].include = [
37+
/node_modules\/acorn-jsx/,
38+
/node_modules\/playcanvas/
39+
];
40+
3541
// Return the altered config
3642
return config;
3743
},

package-lock.json

Lines changed: 1374 additions & 1775 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,24 @@
1717
"@testing-library/jest-dom": "^4.2.4",
1818
"@testing-library/react": "^9.3.2",
1919
"@testing-library/user-event": "^7.1.2",
20-
"playcanvas": "^1.38.0",
2120
"react": "^16.13.1",
2221
"react-dom": "^16.13.1",
2322
"react-scripts": "3.4.1",
2423
"sass-loader": "^9.0.2",
2524
"webpack-bundle-analyzer": "^3.8.0"
2625
},
2726
"scripts": {
27+
"build": "rollup -c --environment target:all",
2828
"build:umd": "rollup -c --environment target:umd",
2929
"build:module": "rollup -c --environment target:module",
3030
"build:bundle": "rollup -c --environment target:bundle",
31-
"build": "rollup -c --environment target:all",
31+
"build:watch": "rollup -c --environment target:all --watch",
3232
"build:prod": "NODE_ENV=production rollup -c --environment target:all",
3333
"lint": "eslint --ext .js src",
3434
"storybook": "start-storybook -p 9010 -s public",
3535
"build:docs": "typedoc --options typedoc.json; cp ./_docs/classes/Graph.md ./docs/Graph.md; rm -rf ./_docs",
36-
"pkg:publish": "rm -rf ./dist/ && npm run build:prod && cp ./package.json dist && cp ./LICENSE dist && cp README.md dist && cp -r ./docs dist && npm publish dist",
37-
"pkg:publish:dry": "rm -rf ./dist/ && npm run build:prod && cp ./package.json dist && cp ./LICENSE dist && cp README.md dist && cp -r ./docs dist && npm publish dist --dry-run"
38-
36+
"pkg:publish": "rm -rf ./dist/ && npm run build:prod && cp ./package.json dist && cp ./LICENSE dist && cp README.md dist && cp -r ./docs dist && npm publish dist --access=public",
37+
"pkg:publish:dry": "rm -rf ./dist/ && npm run build:prod && cp ./package.json dist && cp ./LICENSE dist && cp README.md dist && cp -r ./docs dist && npm publish dist --dry-run --access=public"
3938
},
4039
"browserslist": {
4140
"production": [
@@ -84,6 +83,7 @@
8483
"json-loader": "^0.5.7",
8584
"lodash": "^4.17.20",
8685
"node-sass": "^4.14.1",
86+
"playcanvas": "https://github.com/playcanvas/engine/archive/c6f750223e3c184b26995a1d9952f769811ca542.tar.gz",
8787
"postcss": "^8.3.6",
8888
"prop-types": "^15.7.2",
8989
"react-app-rewire-alias": "^0.1.6",

rollup.config.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@ const umdBuild = {
1212
name: 'pcuiGraph',
1313
globals: {
1414
'@playcanvas/observer': 'observer',
15-
'@playcanvas/pcui': 'pcui',
16-
'playcanvas': 'pc'
15+
'@playcanvas/pcui': 'pcui'
1716
}
1817
},
19-
external: ['@playcanvas/observer', '@playcanvas/pcui', 'playcanvas'],
18+
external: ['@playcanvas/observer', '@playcanvas/pcui'],
2019
plugins: [
2120
postcss({
2221
minimize: false,
@@ -35,7 +34,7 @@ const moduleBuild = {
3534
file: 'dist/index.mjs',
3635
format: 'module'
3736
},
38-
external: ['@playcanvas/observer', '@playcanvas/pcui', 'playcanvas'],
37+
external: ['@playcanvas/observer', '@playcanvas/pcui'],
3938
plugins: [
4039
commonjs({ transformMixedEsModules: true }),
4140
babel({ babelHelpers: 'bundled' }),

src/graph-view.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { jointShapeElement, jointShapeElementView } from './joint-shape-node.js'
66
import { GRAPH_ACTIONS } from './constants.js';
77
import ContextMenu from '@playcanvas/pcui/ContextMenu';
88
// TODO replace with a lighter math library
9-
import { Vec2 } from 'playcanvas';
9+
import { Vec2 } from 'playcanvas/src/math/vec2.js';
1010

1111
class GraphView extends JointGraph {
1212
constructor(parent, dom, graphSchema, graphData, config) {

src/joint-graph.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import 'lodash';
66
import 'backbone';
77
import * as joint from 'jointjs/dist/joint.min';
88
// TODO replace with a lighter math library
9-
import { Vec2 } from 'playcanvas';
9+
import { Vec2 } from 'playcanvas/src/math/vec2.js';
1010

1111
class JointGraph {
1212
constructor(dom, config = {}) {

0 commit comments

Comments
 (0)