Skip to content

Commit

Permalink
fix build for demo
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielmfern committed Dec 23, 2024
1 parent bd1e6e1 commit 8b2a443
Show file tree
Hide file tree
Showing 22 changed files with 41 additions and 73 deletions.
23 changes: 0 additions & 23 deletions packages/preview-utils/package.json

This file was deleted.

9 changes: 0 additions & 9 deletions packages/preview-utils/tsconfig.json

This file was deleted.

16 changes: 15 additions & 1 deletion packages/react-email/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
"bin": {
"email": "./dist/cli/index.js"
},
"main": "./dist/package/index.js",
"module": "./dist/package/index.mjs",
"types": "./dist/package/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/package/index.d.mts",
"default": "./dist/package/index.mjs"
},
"require": {
"types": "./dist/package/index.d.ts",
"default": "./dist/package/index.js"
}
}
},
"scripts": {
"build": "tsup-node && node build-preview-server.mjs",
"dev": "tsup-node --watch",
Expand Down Expand Up @@ -67,7 +82,6 @@
"eslint-config-turbo": "2.1.0",
"framer-motion": "12.0.0-alpha.2",
"postcss": "8.4.40",
"preview-utils": "workspace:*",
"prism-react-renderer": "2.1.0",
"react": "^19",
"react-dom": "^19",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import fs from 'node:fs';
import path from 'node:path';
import { isFileAnEmail } from 'preview-utils';
import { isFileAnEmail } from '../package';

export interface EmailsDirectory {
absolutePath: string;
Expand Down
4 changes: 2 additions & 2 deletions packages/react-email/src/actions/render-email-by-path.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import path from 'node:path';
import ora from 'ora';
import logSymbols from 'log-symbols';
import chalk from 'chalk';
import type { RenderedEmailMetadata } from 'preview-utils';
import { renderEmailByPath } from 'preview-utils';
import type { RenderedEmailMetadata } from '../package';
import { renderEmailByPath } from '../package';
import { fromError, type ErrorObject } from '../utils/types/error-object';
import { registerSpinnerAutostopping } from '../utils/register-spinner-autostopping';

Expand Down
2 changes: 1 addition & 1 deletion packages/react-email/src/cli/commands/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
EmailsDirectory,
getEmailsDirectoryMetadata,
} from '../../actions/get-emails-directory-metadata';
import { renderingUtilitiesExporter } from 'preview-utils';
import { renderingUtilitiesExporter } from '../../package';

const getEmailTemplatesFromDirectory = (emailDirectory: EmailsDirectory) => {
const templatePaths = [] as string[];
Expand Down
2 changes: 1 addition & 1 deletion packages/react-email/src/hooks/use-rendering-metadata.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect } from 'react';
import type { RenderedEmailMetadata } from 'preview-utils';
import type { RenderedEmailMetadata } from '../package';
import type { ActionResult } from '../actions/render-email-by-path';

const lastRenderingMetadataPerEmailPath = {} as Record<
Expand Down
1 change: 1 addition & 0 deletions packages/react-email/src/package/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './preview-utils';
File renamed without changes.
21 changes: 14 additions & 7 deletions packages/react-email/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { defineConfig } from 'tsup';

export default defineConfig({
dts: true,
entry: ['./src/cli/index.ts'],
noExternal: ['preview-utils'],
format: ['esm', 'cjs'],
outDir: 'dist/cli',
});
export default defineConfig([
{
dts: true,
entry: ['./src/cli/index.ts'],
format: ['esm', 'cjs'],
outDir: 'dist/cli',
},
{
dts: true,
entry: ['./src/package/index.ts'],
format: ['esm', 'cjs'],
outDir: 'dist/package',
},
]);
4 changes: 2 additions & 2 deletions packages/visual-studio-code-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
},
"scripts": {
"publish": "vsce publish",
"package": "pnpm build && node ./prebuild.mjs && vsce package",
"package": "node ./prebuild.mjs && vsce package",
"vscode:prepublish": "pnpm build --minify",
"dev": "pnpm build --watch",
"build": "esbuild ./src/extension.ts --bundle --outfile=out/extension.js --tsconfig=./tsconfig.json --external:vscode --external:esbuild --format=cjs --platform=node",
Expand Down Expand Up @@ -73,7 +73,7 @@
"esbuild": "^0.19.12"
},
"devDependencies": {
"preview-utils": "workspace:*",
"react-email": "workspace:*",
"@types/mocha": "^10.0.2",
"@types/node": "18.x",
"@types/vscode": "^1.83.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as vscode from "vscode";

import * as path from "path";

import { isFileAnEmail, renderEmailByPath } from "preview-utils";
import { isFileAnEmail, renderEmailByPath } from "react-email";

export type BuiltEmail =
| {
Expand Down Expand Up @@ -41,7 +41,6 @@ export async function renderOpenEmailFile(
const err = new Error(result.error.message);
err.stack = result.error.stack;
err.name = result.error.name;
err.cause = result.error.cause;
throw err;
}

Expand Down
1 change: 1 addition & 0 deletions packages/visual-studio-code-extension/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"ES2020",
"DOM"
],
"esModuleInterop": true,
"sourceMap": true,
"rootDir": "src",
"strict": true /* enable all strict type-checking options */
Expand Down
26 changes: 2 additions & 24 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8b2a443

Please sign in to comment.