1
0
mirror of https://github.com/konvajs/konva.git synced 2025-04-05 20:48:28 +08:00

modules fixes

This commit is contained in:
Anton Lavrenov 2019-02-27 11:18:21 -05:00
parent c21ed2d898
commit 7c3d9fabae
8 changed files with 14 additions and 8 deletions

View File

@ -94,7 +94,7 @@
var _injectGlobal = function (Konva) {
globalKonva = Konva;
glob.Konva = Konva;
Object.assign(glob.Konva, _NODES_REGISTRY);
Object.assign(Konva, _NODES_REGISTRY);
};
var _registerNode = function (NodeClass) {
_NODES_REGISTRY[NodeClass.prototype.getClassName()] = NodeClass;

2
konva.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -10,7 +10,7 @@
"types",
"lib"
],
"main": "./lib/Full.js",
"main": "./lib/index.js",
"typings": "./types/index.d.ts",
"scripts": {
"start": "npm run watch & gulp",

View File

@ -9,7 +9,7 @@ old_cdn="https://unpkg.com/konva@${old_version}/konva.js"
new_cdn="https://unpkg.com/konva@${new_version}/konva.js"
old_cdn_min="https://unpkg.com/konva@${old_version}/konva.min.js"
new_cdn_min="https://unpkg.com/konva@${old_version}/konva.min.js"
new_cdn_min="https://unpkg.com/konva@${new_version}/konva.min.js"
# make sure new version parameter is passed
if [ -z "$1" ]
@ -28,6 +28,9 @@ while true; do
esac
done
echo "Old version: ${old_version}"
echo "New version: ${new_version}"
echo "Pulling"
git pull >/dev/null

View File

@ -114,7 +114,7 @@ let globalKonva = {};
export const _injectGlobal = Konva => {
globalKonva = Konva;
glob.Konva = Konva;
Object.assign(glob.Konva, _NODES_REGISTRY);
Object.assign(Konva, _NODES_REGISTRY);
};
export const _registerNode = NodeClass => {

View File

@ -1,4 +1,4 @@
import * as Konva from './Full';
import * as Konva from './_FullInternals';
// add Konva to global viriable
// umd build will actually do it

View File

@ -5,7 +5,7 @@ function equal(val1, val2, message) {
}
// try to import only core
let Konva = require('../lib/Core');
let Konva = require('../lib/Core').default;
// no external shapes
equal(Konva.Rect, undefined, 'no external shapes');
@ -15,6 +15,9 @@ let Rect = require('../lib/shapes/Rect').Rect;
equal(Rect !== undefined, true, 'Rect is defined');
// now import from package.json
let NewKonva = require('../');
let NewKonva = require('../').default;
equal(NewKonva.Rect, Rect, 'Same rects');
// check global injection
equal(global.Konva, NewKonva, 'injected');