From 294187c41fe05bb645754012daad983aa3374b32 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Wed, 8 Apr 2020 14:49:14 +0100 Subject: [PATCH] Switched to extracted `@tryghost/kg-default-atoms` package no issue - removed code that now lives in the external Koenig monorepo --- core/server/lib/mobiledoc/atoms/index.js | 3 --- core/server/lib/mobiledoc/atoms/soft-return.js | 7 ------- core/server/lib/mobiledoc/index.js | 2 +- package.json | 1 + .../unit/lib/mobiledoc/atoms/soft-return_spec.js | 16 ---------------- yarn.lock | 5 +++++ 6 files changed, 7 insertions(+), 27 deletions(-) delete mode 100644 core/server/lib/mobiledoc/atoms/index.js delete mode 100644 core/server/lib/mobiledoc/atoms/soft-return.js delete mode 100644 test/unit/lib/mobiledoc/atoms/soft-return_spec.js diff --git a/core/server/lib/mobiledoc/atoms/index.js b/core/server/lib/mobiledoc/atoms/index.js deleted file mode 100644 index 380ec8c7c4..0000000000 --- a/core/server/lib/mobiledoc/atoms/index.js +++ /dev/null @@ -1,3 +0,0 @@ -const softReturn = require('./soft-return'); - -module.exports = [softReturn]; diff --git a/core/server/lib/mobiledoc/atoms/soft-return.js b/core/server/lib/mobiledoc/atoms/soft-return.js deleted file mode 100644 index 3841940081..0000000000 --- a/core/server/lib/mobiledoc/atoms/soft-return.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - name: 'soft-return', - type: 'dom', - render(opts) { - return opts.env.dom.createElement('br'); - } -}; diff --git a/core/server/lib/mobiledoc/index.js b/core/server/lib/mobiledoc/index.js index d4b0440efe..ed08771586 100644 --- a/core/server/lib/mobiledoc/index.js +++ b/core/server/lib/mobiledoc/index.js @@ -24,7 +24,7 @@ module.exports = { }, get atoms() { - return require('./atoms'); + return require('@tryghost/kg-default-atoms'); }, get renderers() { diff --git a/package.json b/package.json index 90930c2625..2c615e2714 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "@tryghost/helpers": "1.1.25", "@tryghost/image-transform": "0.2.0", "@tryghost/kg-card-factory": "1.0.1", + "@tryghost/kg-default-atoms": "1.0.0", "@tryghost/kg-default-cards": "1.0.1", "@tryghost/kg-markdown-html-renderer": "1.0.2", "@tryghost/members-api": "0.18.0", diff --git a/test/unit/lib/mobiledoc/atoms/soft-return_spec.js b/test/unit/lib/mobiledoc/atoms/soft-return_spec.js deleted file mode 100644 index 177ea74427..0000000000 --- a/test/unit/lib/mobiledoc/atoms/soft-return_spec.js +++ /dev/null @@ -1,16 +0,0 @@ -const should = require('should'); -const atom = require('../../../../../core/server/lib/mobiledoc/atoms/soft-return'); -const SimpleDom = require('simple-dom'); -const serializer = new SimpleDom.HTMLSerializer(SimpleDom.voidMap); - -describe('Soft return atom', function () { - it('generates a `br` tag', function () { - let opts = { - env: { - dom: new SimpleDom.Document() - } - }; - - serializer.serialize(atom.render(opts)).should.match('
'); - }); -}); diff --git a/yarn.lock b/yarn.lock index ef5ea336a1..4b8de5fed6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -377,6 +377,11 @@ resolved "https://registry.yarnpkg.com/@tryghost/kg-clean-basic-html/-/kg-clean-basic-html-0.1.7.tgz#8cebadf0189106caef61f480f16092b375b12ef4" integrity sha512-S7utCsbIVvDd3el2yJ81HtInVg4WiVmmNKQCq8T13KC7oU1MrxUWjRgmieoHv2P9jqCkwPJm9eLQApJj6kp4dQ== +"@tryghost/kg-default-atoms@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@tryghost/kg-default-atoms/-/kg-default-atoms-1.0.0.tgz#d423a0f19a6989051bd6bbc9c8f104c88bd5c738" + integrity sha512-f6a8zIoL2w7aeZbeBj+0UPvFzE1Dd/zf3RGO+L4j/Kb4Z/yqOtoBWQun6I2H37XXoaqiiQc6Z3eW+L4iYSw1Ow== + "@tryghost/kg-default-cards@1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@tryghost/kg-default-cards/-/kg-default-cards-1.0.1.tgz#f6855db115af0868ecbe443a46123f856e006d9a"