A free and open-source block-based email template builder.
TypeScript amazonsesdeveloper-toolsemailemail-editoremail-marketingemail-templateemail-template-builderemailapiemailjshtml-email-editorno-codenocode-email-editoropen-source-email-buildersendgridtransactional-emailswysiwyg-email-editorwysiwyg-html-editor
Renaming document package to document-core (#8)
cohitrefca0dea9719c
diff --git a/packages/document/.npmignore b/packages/document-core/.npmignoresimilarity index 100%rename from packages/document/.npmignorerename to packages/document-core/.npmignorediff --git a/packages/document/LICENSE b/packages/document-core/LICENSEsimilarity index 100%rename from packages/document/LICENSErename to packages/document-core/LICENSEdiff --git a/packages/document/README.md b/packages/document-core/README.mdsimilarity index 100%rename from packages/document/README.mdrename to packages/document-core/README.mddiff --git a/packages/document/package-lock.json b/packages/document-core/package-lock.jsonsimilarity index 92%rename from packages/document/package-lock.jsonrename to packages/document-core/package-lock.jsonindex 94a4a2a..2084bc5 100644--- a/packages/document/package-lock.json+++ b/packages/document-core/package-lock.json@@ -1,12 +1,12 @@{- "name": "@usewaypoint/document",- "version": "0.0.7",+ "name": "@usewaypoint/document-core",+ "version": "0.0.1","lockfileVersion": 3,"requires": true,"packages": {"": {- "name": "@usewaypoint/document",- "version": "0.0.7",+ "name": "@usewaypoint/document-core",+ "version": "0.0.1","license": "MIT","peerDependencies": {"react": "^16 || ^17 || ^18",diff --git a/packages/document/package.json b/packages/document-core/package.jsonsimilarity index 85%rename from packages/document/package.jsonrename to packages/document-core/package.jsonindex 0ed2f93..20b3316 100644--- a/packages/document/package.json+++ b/packages/document-core/package.json@@ -1,6 +1,6 @@{- "name": "@usewaypoint/document",- "version": "0.0.7",+ "name": "@usewaypoint/document-core",+ "version": "0.0.1","description": "Tools to render waypoint-style documents (core package)","main": "dist/index.js","types": "dist/index.d.ts",diff --git a/packages/document/src/builders/buildBlockComponent.ts b/packages/document-core/src/builders/buildBlockComponent.tssimilarity index 100%rename from packages/document/src/builders/buildBlockComponent.tsrename to packages/document-core/src/builders/buildBlockComponent.tsdiff --git a/packages/document/src/builders/buildBlockConfigurationSchema.ts b/packages/document-core/src/builders/buildBlockConfigurationSchema.tssimilarity index 100%rename from packages/document/src/builders/buildBlockConfigurationSchema.tsrename to packages/document-core/src/builders/buildBlockConfigurationSchema.tsdiff --git a/packages/document/src/index.ts b/packages/document-core/src/index.tssimilarity index 74%rename from packages/document/src/index.tsrename to packages/document-core/src/index.tsindex 4345b20..02801d2 100644--- a/packages/document/src/index.ts+++ b/packages/document-core/src/index.ts@@ -1,4 +1,4 @@export { default as buildBlockComponent } from './builders/buildBlockComponent';export { default as buildBlockConfigurationSchema } from './builders/buildBlockConfigurationSchema';-export { default as buildDocumentHandlers } from './builders/buildDocumentHandlers';+export { BlockConfiguration, DocumentBlocksDictionary } from './utils';diff --git a/packages/document/src/utils.ts b/packages/document-core/src/utils.tssimilarity index 100%rename from packages/document/src/utils.tsrename to packages/document-core/src/utils.tsdiff --git a/packages/document/tests/builder/__snapshots__/buildBlockComponent.spec.tsx.snap b/packages/document-core/tests/builder/__snapshots__/buildBlockComponent.spec.tsx.snapsimilarity index 100%rename from packages/document/tests/builder/__snapshots__/buildBlockComponent.spec.tsx.snaprename to packages/document-core/tests/builder/__snapshots__/buildBlockComponent.spec.tsx.snapdiff --git a/packages/document/tests/builder/buildBlockComponent.spec.tsx b/packages/document-core/tests/builder/buildBlockComponent.spec.tsxsimilarity index 100%rename from packages/document/tests/builder/buildBlockComponent.spec.tsxrename to packages/document-core/tests/builder/buildBlockComponent.spec.tsxdiff --git a/packages/document/tests/builder/buildBlockConfigurationSchema.spec.tsx b/packages/document-core/tests/builder/buildBlockConfigurationSchema.spec.tsxsimilarity index 100%rename from packages/document/tests/builder/buildBlockConfigurationSchema.spec.tsxrename to packages/document-core/tests/builder/buildBlockConfigurationSchema.spec.tsxdiff --git a/packages/document/tsconfig.build.json b/packages/document-core/tsconfig.build.jsonsimilarity index 100%rename from packages/document/tsconfig.build.jsonrename to packages/document-core/tsconfig.build.jsondiff --git a/packages/document/tsconfig.json b/packages/document-core/tsconfig.jsonsimilarity index 100%rename from packages/document/tsconfig.jsonrename to packages/document-core/tsconfig.jsondiff --git a/packages/document/src/builders/buildDocumentHandlers.ts b/packages/document/src/builders/buildDocumentHandlers.tsdeleted file mode 100644index 810c3b9..0000000--- a/packages/document/src/builders/buildDocumentHandlers.ts+++ /dev/null@@ -1,23 +0,0 @@-import { BaseZodDictionary, DocumentBlocksDictionary } from '../utils';--import buildBlockComponent from './buildBlockComponent';-import buildBlockConfigurationSchema from './buildBlockConfigurationSchema';--/**- * @typedef {Object} DocumentHandlers- * @property Schema - zod schema for a Document block- * @property Block - React component that can render a BlockConfiguration that is compatible with blocks- */--/**- * Shorthand function to create a Block and Schema in a single call- *- * @param blocks Main DocumentBlocksDictionary- * @returns {DocumentHandlers}- */-export default function buildDocumentHandlers<T extends BaseZodDictionary>(blocks: DocumentBlocksDictionary<T>) {- return {- Block: buildBlockComponent(blocks),- Schema: buildBlockConfigurationSchema(blocks),- };-}diff --git a/packages/document/tests/builder/buildDocumentHandlers.spec.tsx b/packages/document/tests/builder/buildDocumentHandlers.spec.tsxdeleted file mode 100644index e8659bf..0000000--- a/packages/document/tests/builder/buildDocumentHandlers.spec.tsx+++ /dev/null@@ -1,39 +0,0 @@-import React from 'react';-import { z } from 'zod';--import { render } from '@testing-library/react';--import buildDocumentHandlers from '../../src/builders/buildDocumentHandlers';--describe('builders/buildDocumentHandlers', () => {- const { Schema, Block } = buildDocumentHandlers({- SampleBlock: {- schema: z.object({ text: z.string() }),- Component: ({ text }) => <div>{text.toUpperCase()}</div>,- },- });-- describe('#Block', () => {- it('renders the component from the BlocksConfiguration', () => {- expect(- render(<Block type="SampleBlock" data={{ text: 'Test text!' }} />).queryAllByText('TEST TEXT!')- ).toHaveLength(1);- });- });-- describe('#Schema', () => {- it('builds a BlockConfiguration schema with an id, data, and type', () => {- const parsedData = Schema.safeParse({- type: 'SampleBlock',- data: { text: 'Test text!' },- });- expect(parsedData).toEqual({- success: true,- data: {- type: 'SampleBlock',- data: { text: 'Test text!' },- },- });- });- });-});