Skip to content

Commit

Permalink
chore!: move to krakenjs scope (#395)
Browse files Browse the repository at this point in the history
  • Loading branch information
westeezy committed Mar 1, 2022
1 parent eb8677a commit c10ac41
Show file tree
Hide file tree
Showing 47 changed files with 123 additions and 91 deletions.
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[libs]
flow-typed
src/declarations.js
node_modules/post-robot/src/declarations.js
node_modules/@krakenjs/post-robot/src/declarations.js
node_modules/grumbler-scripts/declarations.js
[options]
module.name_mapper='^src\(.*\)$' -> '<PROJECT_ROOT>/src/\1'
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "publish to npm"
on: workflow_dispatch
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v2
with:
token: ${{ secrets.ACCESS_TOKEN }}
fetch-depth: 0

- name: ⎔ Setup node
# sets up the .npmrc file to publish to npm
uses: actions/setup-node@v2
with:
node-version: "14"
registry-url: "https://registry.npmjs.org"

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false

- name: Configure git user
run: |
git config --global user.email ${{ github.actor }}@users.noreply.github.com
git config --global user.name ${{ github.actor }}
- name: ▶️ Run release
run: npm run release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion globals.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* @flow */
/* eslint import/no-commonjs: off */

const postRobotGlobals = require('post-robot/globals');
const postRobotGlobals = require('@krakenjs/post-robot/globals');

const pkg = require('./package.json');

Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "zoid",
"name": "@krakenjs/zoid",
"version": "9.0.87",
"description": "Cross domain components.",
"main": "index.js",
Expand Down Expand Up @@ -102,9 +102,9 @@
"standard-version": "^9.3.2"
},
"dependencies": {
"belter": "^1.0.123",
"cross-domain-utils": "^2.0.33",
"post-robot": "^10",
"zalgo-promise": "^1.0.45"
"@krakenjs/belter": "^2.0.0",
"@krakenjs/cross-domain-utils": "^3.0.0",
"@krakenjs/post-robot": "^11.0.0",
"@krakenjs/zalgo-promise": "^2.0.0"
}
}
8 changes: 4 additions & 4 deletions src/child/child.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/* eslint max-lines: 0 */

import { isSameDomain, matchDomain, getAllFramesInWindow, type CrossDomainWindowType,
onCloseWindow, assertSameDomain } from 'cross-domain-utils/src';
import { markWindowKnown, type CrossDomainFunctionType } from 'post-robot/src';
import { ZalgoPromise } from 'zalgo-promise/src';
import { extend, onResize, elementReady, noop } from 'belter/src';
onCloseWindow, assertSameDomain } from '@krakenjs/cross-domain-utils/src';
import { markWindowKnown, type CrossDomainFunctionType } from '@krakenjs/post-robot/src';
import { ZalgoPromise } from '@krakenjs/zalgo-promise/src';
import { extend, onResize, elementReady, noop } from '@krakenjs/belter/src';

import { getGlobal, tryGlobal, getInitialParentPayload, updateChildWindowNameWithRef } from '../lib';
import { CONTEXT } from '../constants';
Expand Down
2 changes: 1 addition & 1 deletion src/child/props.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @flow */

import { getDomain, isSameDomain, type CrossDomainWindowType } from 'cross-domain-utils/src';
import { getDomain, isSameDomain, type CrossDomainWindowType } from '@krakenjs/cross-domain-utils/src';

import type { PropsDefinitionType, PropsType, ChildPropsType } from '../component/props';

Expand Down
8 changes: 4 additions & 4 deletions src/component/component.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* @flow */
/* eslint max-lines: 0 */

import { setup as setupPostRobot, on, send, bridge, toProxyWindow, destroy as destroyPostRobot } from 'post-robot/src';
import { ZalgoPromise } from 'zalgo-promise/src';
import { isWindow, getDomain, matchDomain, type CrossDomainWindowType, type DomainMatcher } from 'cross-domain-utils/src';
import { noop, isElement, cleanup, memoize, identity, extend, uniqueID } from 'belter/src';
import { setup as setupPostRobot, on, send, bridge, toProxyWindow, destroy as destroyPostRobot } from '@krakenjs/post-robot/src';
import { ZalgoPromise } from '@krakenjs/zalgo-promise/src';
import { isWindow, getDomain, matchDomain, type CrossDomainWindowType, type DomainMatcher } from '@krakenjs/cross-domain-utils/src';
import { noop, isElement, cleanup, memoize, identity, extend, uniqueID } from '@krakenjs/belter/src';

import { childComponent, type ChildComponent } from '../child';
import { type RenderOptionsType, type ParentHelpers, parentComponent } from '../parent/parent';
Expand Down
8 changes: 4 additions & 4 deletions src/component/props.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* @flow */

import { ZalgoPromise } from 'zalgo-promise/src';
import { once, noop, type EventEmitterType } from 'belter/src';
import { isWindow, type CrossDomainWindowType, isWindowClosed, isSameDomain } from 'cross-domain-utils/src';
import { ProxyWindow, toProxyWindow } from 'post-robot/src';
import { ZalgoPromise } from '@krakenjs/zalgo-promise/src';
import { once, noop, type EventEmitterType } from '@krakenjs/belter/src';
import { isWindow, type CrossDomainWindowType, isWindowClosed, isSameDomain } from '@krakenjs/cross-domain-utils/src';
import { ProxyWindow, toProxyWindow } from '@krakenjs/post-robot/src';

import type { CssDimensionsType } from '../types';
import { PROP_SERIALIZATION, PROP_TYPE } from '../constants';
Expand Down
2 changes: 1 addition & 1 deletion src/component/templates/container.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* @flow */
/* eslint react/react-in-jsx-scope: off */

import { destroyElement, toCSS } from 'belter/src';
import { destroyElement, toCSS } from '@krakenjs/belter/src';

import { type RenderOptionsType } from '../../parent/parent';
import { EVENT } from '../../constants';
Expand Down
2 changes: 1 addition & 1 deletion src/component/validate.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @flow */

import { isPerc, isPx, values } from 'belter/src';
import { isPerc, isPx, values } from '@krakenjs/belter/src';

import { CONTEXT, PROP_TYPE } from '../constants';

Expand Down
2 changes: 1 addition & 1 deletion src/constants.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @flow */

import { WINDOW_TYPE } from 'cross-domain-utils/src';
import { WINDOW_TYPE } from '@krakenjs/cross-domain-utils/src';

export const ZOID = `zoid`;

Expand Down
2 changes: 1 addition & 1 deletion src/drivers/angular.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @flow */

import { dasherizeToCamel, replaceObject, noop } from 'belter/src';
import { dasherizeToCamel, replaceObject, noop } from '@krakenjs/belter/src';

import type { ComponentDriverType } from '../component';
import { CONTEXT } from '../constants';
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/angular2.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* @flow */
/* eslint new-cap: 0 */

import { replaceObject } from 'belter/src';
import { replaceObject } from '@krakenjs/belter/src';

import type { ComponentDriverType } from '../component';
import { CONTEXT } from '../constants';
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/react.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* @flow */
/* eslint react/no-deprecated: off, react/no-find-dom-node: off, react/display-name: off, react/no-did-mount-set-state: off, react/destructuring-assignment: off, react/prop-types: off */

import { extend, noop } from 'belter/src';
import { extend, noop } from '@krakenjs/belter/src';

import type { ComponentDriverType } from '../component';
import { CONTEXT } from '../constants';
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/vue.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @flow */

import { noop, dasherizeToCamel } from 'belter/src';
import { noop, dasherizeToCamel } from '@krakenjs/belter/src';

import type { ComponentDriverType } from '../component';
import { CONTEXT } from '../constants';
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/vue3.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* @flow */
import { dasherizeToCamel, noop } from 'belter/src';
import { dasherizeToCamel, noop } from '@krakenjs/belter/src';

import type { ComponentDriverType } from '../component';
import { CONTEXT } from '../constants';
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/* @flow */

import typeof { PopupOpenError } from 'belter/src';
import typeof { PopupOpenError } from '@krakenjs/belter/src';

import type { CreateZoidComponent } from './component';
// eslint-disable-next-line no-duplicate-imports
import typeof { destroy, destroyComponents, destroyAll } from './component';
import typeof { PROP_TYPE, PROP_SERIALIZATION, CONTEXT, EVENT } from './constants';

export { PopupOpenError } from 'belter/src';
export { PopupOpenError } from '@krakenjs/belter/src';

export type { ZoidComponent, ZoidComponentInstance, ZoidProps } from './component';
export type { RenderOptionsType } from './parent';
Expand Down
4 changes: 2 additions & 2 deletions src/lib/global.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* @flow */

import { isSameDomain, type CrossDomainWindowType } from 'cross-domain-utils/src';
import { getCurrentScriptUID } from 'belter/src';
import { isSameDomain, type CrossDomainWindowType } from '@krakenjs/cross-domain-utils/src';
import { getCurrentScriptUID } from '@krakenjs/belter/src';

export function getGlobalKey() : string {
if (__ZOID__.__SCRIPT_NAMESPACE__) {
Expand Down
8 changes: 4 additions & 4 deletions src/lib/serialize.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* @flow */

import { ZalgoPromise } from 'zalgo-promise/src';
import { serializeMessage, deserializeMessage, toProxyWindow, type ProxyWindow } from 'post-robot/src';
import { uniqueID, base64encode, base64decode } from 'belter/src';
import type { CrossDomainWindowType, DomainMatcher } from 'cross-domain-utils/src';
import { ZalgoPromise } from '@krakenjs/zalgo-promise/src';
import { serializeMessage, deserializeMessage, toProxyWindow, type ProxyWindow } from '@krakenjs/post-robot/src';
import { uniqueID, base64encode, base64decode } from '@krakenjs/belter/src';
import type { CrossDomainWindowType, DomainMatcher } from '@krakenjs/cross-domain-utils/src';

import { getGlobal } from './global';

Expand Down
4 changes: 2 additions & 2 deletions src/lib/window.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* @flow */

import { assertExists, memoize } from 'belter/src';
import { assertExists, memoize } from '@krakenjs/belter/src';
import { isSameDomain, getOpener, getNthParentFromTop, getAncestor, getAllFramesInWindow, getParent, isTop,
findFrameByName, getDomain, assertSameDomain, type CrossDomainWindowType, getDistanceFromTop } from 'cross-domain-utils/src';
findFrameByName, getDomain, assertSameDomain, type CrossDomainWindowType, getDistanceFromTop } from '@krakenjs/cross-domain-utils/src';

import { ZOID, WINDOW_REFERENCE } from '../constants';
import type { InitialChildPayload, WindowRef } from '../parent';
Expand Down
8 changes: 4 additions & 4 deletions src/parent/parent.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/* @flow */
/* eslint max-lines: 0 */

import { send, bridge, ProxyWindow, toProxyWindow, type CrossDomainFunctionType, cleanUpWindow } from 'post-robot/src';
import { send, bridge, ProxyWindow, toProxyWindow, type CrossDomainFunctionType, cleanUpWindow } from '@krakenjs/post-robot/src';
import { isSameDomain, matchDomain, getDomainFromUrl, isBlankDomain, getAncestor, getDomain, type CrossDomainWindowType,
getDistanceFromTop, normalizeMockUrl, assertSameDomain, closeWindow, onCloseWindow, isWindowClosed, isSameTopWindow,
type DomainMatcher } from 'cross-domain-utils/src';
import { ZalgoPromise } from 'zalgo-promise/src';
type DomainMatcher } from '@krakenjs/cross-domain-utils/src';
import { ZalgoPromise } from '@krakenjs/zalgo-promise/src';
import { addEventListener, uniqueID, elementReady, writeElementToWindow, eventEmitter, type EventEmitterType,
noop, onResize, extendUrl, appendChild, cleanup,
once, stringifyError, destroyElement, getElementSafe, showElement, hideElement, iframe, memoize, isElementClosed,
awaitFrameWindow, popup, normalizeDimension, watchElementForClose, isShadowElement, insertShadowSlot, extend } from 'belter/src';
awaitFrameWindow, popup, normalizeDimension, watchElementForClose, isShadowElement, insertShadowSlot, extend } from '@krakenjs/belter/src';

import { ZOID, POST_MESSAGE, CONTEXT, EVENT, METHOD,
WINDOW_REFERENCE, DEFAULT_DIMENSIONS } from '../constants';
Expand Down
4 changes: 2 additions & 2 deletions src/parent/props.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* @flow */

import { ZalgoPromise } from 'zalgo-promise/src';
import { dotify, isDefined, base64encode, noop } from 'belter/src';
import { ZalgoPromise } from '@krakenjs/zalgo-promise/src';
import { dotify, isDefined, base64encode, noop } from '@krakenjs/belter/src';

import { eachProp, mapProps, type PropsInputType, type PropsType, type PropsDefinitionType } from '../component/props';
import { PROP_SERIALIZATION, METHOD, PROP_TYPE } from '../constants';
Expand Down
6 changes: 3 additions & 3 deletions test/common.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* @flow */

import { ZalgoPromise } from 'zalgo-promise/src';
import { isWindowClosed, type CrossDomainWindowType, type SameDomainWindowType } from 'cross-domain-utils/src';
import { createElement, destroyElement, uniqueID } from 'belter/src';
import { ZalgoPromise } from '@krakenjs/zalgo-promise/src';
import { isWindowClosed, type CrossDomainWindowType, type SameDomainWindowType } from '@krakenjs/cross-domain-utils/src';
import { createElement, destroyElement, uniqueID } from '@krakenjs/belter/src';

export function monkeyPatchFunction<T, A>(obj : Object, name : string, handler : ({| call : () => T, args : A |}) => void) : {| cancel : () => void |} {
const original = obj[name];
Expand Down
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* @flow */

import './tests';
import { noop } from 'belter/src';
import { noop } from '@krakenjs/belter/src';

import { zoid } from './zoid';

Expand Down
4 changes: 2 additions & 2 deletions test/tests/actions.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* @flow */
/** @jsx node */

import { onCloseWindow } from 'cross-domain-utils/src';
import { wrapPromise } from 'belter/src';
import { onCloseWindow } from '@krakenjs/cross-domain-utils/src';
import { wrapPromise } from '@krakenjs/belter/src';
import { node, dom } from 'jsx-pragmatic/src';

import { zoid } from '../zoid';
Expand Down
2 changes: 1 addition & 1 deletion test/tests/attributes.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @flow */

import { wrapPromise } from 'belter/src';
import { wrapPromise } from '@krakenjs/belter/src';

import { zoid } from '../zoid';
import { onWindowOpen, getBody } from '../common';
Expand Down
2 changes: 1 addition & 1 deletion test/tests/bridge.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @flow */

import { wrapPromise } from 'belter/src';
import { wrapPromise } from '@krakenjs/belter/src';

import { zoid } from '../zoid';
import { runOnClick, getBody } from '../common';
Expand Down
4 changes: 2 additions & 2 deletions test/tests/child.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* @flow */

import { wrapPromise } from 'belter/src';
import { onCloseWindow } from 'cross-domain-utils/src';
import { wrapPromise } from '@krakenjs/belter/src';
import { onCloseWindow } from '@krakenjs/cross-domain-utils/src';

import { zoid } from '../zoid';
import { onWindowOpen, runOnClick, getBody } from '../common';
Expand Down
6 changes: 3 additions & 3 deletions test/tests/children.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* @flow */
/** @jsx node */

import { wrapPromise } from 'belter/src';
import { getParent } from 'cross-domain-utils/src';
import { ZalgoPromise } from 'zalgo-promise/src';
import { wrapPromise } from '@krakenjs/belter/src';
import { getParent } from '@krakenjs/cross-domain-utils/src';
import { ZalgoPromise } from '@krakenjs/zalgo-promise/src';

import { onWindowOpen, getBody } from '../common';
import { zoid } from '../zoid';
Expand Down
6 changes: 3 additions & 3 deletions test/tests/clone.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* @flow */
/** @jsx node */

import { wrapPromise } from 'belter/src';
import { getParent } from 'cross-domain-utils/src';
import { ZalgoPromise } from 'zalgo-promise/src';
import { wrapPromise } from '@krakenjs/belter/src';
import { getParent } from '@krakenjs/cross-domain-utils/src';
import { ZalgoPromise } from '@krakenjs/zalgo-promise/src';

import { zoid } from '../zoid';
import { onWindowOpen, getBody } from '../common';
Expand Down
2 changes: 1 addition & 1 deletion test/tests/dimensions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/** @jsx node */
/* eslint max-lines: off */

import { wrapPromise } from 'belter/src';
import { wrapPromise } from '@krakenjs/belter/src';
import { node, dom } from 'jsx-pragmatic/src';

import { zoid } from '../zoid';
Expand Down
4 changes: 2 additions & 2 deletions test/tests/domain.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* @flow */

import { wrapPromise } from 'belter/src';
import { getDomain } from 'cross-domain-utils/src';
import { wrapPromise } from '@krakenjs/belter/src';
import { getDomain } from '@krakenjs/cross-domain-utils/src';

import { zoid } from '../zoid';
import { getBody } from '../common';
Expand Down
2 changes: 1 addition & 1 deletion test/tests/drivers.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @flow */

import { wrapPromise } from 'belter/src';
import { wrapPromise } from '@krakenjs/belter/src';

import { zoid } from '../zoid';
import { getBody, loadScript } from '../common';
Expand Down
2 changes: 1 addition & 1 deletion test/tests/eligible.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* @flow */
/** @jsx node */

import { wrapPromise } from 'belter/src';
import { wrapPromise } from '@krakenjs/belter/src';

import { zoid } from '../zoid';
import { getBody } from '../common';
Expand Down

0 comments on commit c10ac41

Please sign in to comment.