react-email 1.9.5 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +5 -2
- package/dist/package.json +10 -13
- package/dist/source/commands/dev.d.ts +1 -0
- package/dist/source/commands/dev.d.ts.map +1 -0
- package/dist/source/commands/dev.js +72 -20
- package/dist/source/commands/export.d.ts +2 -1
- package/dist/source/commands/export.d.ts.map +1 -0
- package/dist/source/commands/export.js +137 -57
- package/dist/source/commands/preview.d.ts +1 -0
- package/dist/source/commands/preview.d.ts.map +1 -0
- package/dist/source/commands/preview.js +98 -30
- package/dist/source/index.d.ts +1 -0
- package/dist/source/index.d.ts.map +1 -0
- package/dist/source/index.js +11 -7
- package/dist/source/utils/close-ora-on-sigint.d.ts +2 -1
- package/dist/source/utils/close-ora-on-sigint.d.ts.map +1 -0
- package/dist/source/utils/close-ora-on-sigint.js +1 -1
- package/dist/source/utils/constants.d.ts +1 -0
- package/dist/source/utils/constants.d.ts.map +1 -0
- package/dist/source/utils/constants.js +6 -6
- package/dist/source/utils/convert-to-absolute-path.d.ts +1 -0
- package/dist/source/utils/convert-to-absolute-path.d.ts.map +1 -0
- package/dist/source/utils/convert-to-absolute-path.js +4 -2
- package/dist/source/utils/download-client.d.ts +1 -0
- package/dist/source/utils/download-client.d.ts.map +1 -0
- package/dist/source/utils/download-client.js +63 -18
- package/dist/source/utils/generate-email-preview.d.ts +1 -0
- package/dist/source/utils/generate-email-preview.d.ts.map +1 -0
- package/dist/source/utils/generate-email-preview.js +122 -63
- package/dist/source/utils/index.d.ts +1 -0
- package/dist/source/utils/index.d.ts.map +1 -0
- package/dist/source/utils/install-dependencies.d.ts +2 -1
- package/dist/source/utils/install-dependencies.d.ts.map +1 -0
- package/dist/source/utils/install-dependencies.js +10 -10
- package/dist/source/utils/run-server.d.ts +4 -3
- package/dist/source/utils/run-server.d.ts.map +1 -0
- package/dist/source/utils/run-server.js +90 -37
- package/dist/source/utils/start-server-command.d.ts +1 -0
- package/dist/source/utils/start-server-command.d.ts.map +1 -0
- package/dist/source/utils/start-server-command.js +17 -17
- package/dist/source/utils/sync-package.d.ts +1 -0
- package/dist/source/utils/sync-package.d.ts.map +1 -0
- package/dist/source/utils/sync-package.js +69 -16
- package/dist/source/utils/tree.d.ts +2 -0
- package/dist/source/utils/tree.d.ts.map +1 -0
- package/dist/source/utils/tree.js +58 -0
- package/dist/source/utils/watcher.d.ts +3 -2
- package/dist/source/utils/watcher.d.ts.map +1 -0
- package/dist/source/utils/watcher.js +21 -27
- package/package.json +10 -13
- package/source/commands/dev.ts +2 -2
- package/source/commands/export.ts +48 -20
- package/source/commands/preview.ts +1 -1
- package/source/index.ts +2 -1
- package/source/utils/close-ora-on-sigint.ts +2 -2
- package/source/utils/constants.ts +1 -1
- package/source/utils/convert-to-absolute-path.ts +1 -1
- package/source/utils/download-client.ts +3 -3
- package/source/utils/generate-email-preview.ts +32 -36
- package/source/utils/install-dependencies.ts +3 -3
- package/source/utils/run-server.ts +9 -9
- package/source/utils/start-server-command.ts +2 -2
- package/source/utils/sync-package.ts +2 -2
- package/source/utils/tree.ts +10 -0
- package/source/utils/watcher.ts +14 -22
- package/tsconfig.export.json +31 -0
- package/tsconfig.json +8 -31
- package/.yarn/cache/@babel-code-frame-npm-7.18.6-25229a7e34-195e2be317.zip +0 -0
- package/.yarn/cache/@babel-helper-validator-identifier-npm-7.19.1-d84f19e1dc-0eca5e86a7.zip +0 -0
- package/.yarn/cache/@babel-highlight-npm-7.18.6-9d35ad2e27-92d8ee6154.zip +0 -0
- package/.yarn/cache/@commander-js-extra-typings-npm-9.4.1-b0399e3b65-d69cd1c2b5.zip +0 -0
- package/.yarn/cache/@cspotcode-source-map-support-npm-0.8.1-964f2de99d-5718f26708.zip +0 -0
- package/.yarn/cache/@esbuild-darwin-arm64-npm-0.16.4-96d7e8a733-8.zip +0 -0
- package/.yarn/cache/@isaacs-cliui-npm-8.0.2-f4364666d5-4a473b9b32.zip +0 -0
- package/.yarn/cache/@jridgewell-resolve-uri-npm-3.1.0-6ff2351e61-b5ceaaf9a1.zip +0 -0
- package/.yarn/cache/@jridgewell-sourcemap-codec-npm-1.4.14-f5f0630788-61100637b6.zip +0 -0
- package/.yarn/cache/@jridgewell-trace-mapping-npm-0.3.9-91625cd7fb-d89597752f.zip +0 -0
- package/.yarn/cache/@manypkg-find-root-npm-2.2.1-6ca5d93706-7f31120c3e.zip +0 -0
- package/.yarn/cache/@manypkg-tools-npm-1.1.0-1975c91c51-f0228435c0.zip +0 -0
- package/.yarn/cache/@nodelib-fs.scandir-npm-2.1.5-89c67370dd-a970d595bd.zip +0 -0
- package/.yarn/cache/@nodelib-fs.stat-npm-2.0.5-01f4dd3030-012480b5ca.zip +0 -0
- package/.yarn/cache/@nodelib-fs.walk-npm-1.2.8-b4a89da548-190c643f15.zip +0 -0
- package/.yarn/cache/@npmcli-fs-npm-3.1.0-0844a57978-a50a6818de.zip +0 -0
- package/.yarn/cache/@octokit-auth-token-npm-3.0.3-6fba099166-9b3f569cec.zip +0 -0
- package/.yarn/cache/@octokit-core-npm-4.2.0-0f3a7f3979-5ac56e7f14.zip +0 -0
- package/.yarn/cache/@octokit-endpoint-npm-7.0.5-82841b7e23-81c9e9eabf.zip +0 -0
- package/.yarn/cache/@octokit-graphql-npm-5.0.5-0534ea7757-eb2d1a6305.zip +0 -0
- package/.yarn/cache/@octokit-openapi-types-npm-16.0.0-2fe91e346e-844f30a545.zip +0 -0
- package/.yarn/cache/@octokit-plugin-paginate-rest-npm-6.0.0-ccfed9f0b1-4ad89568d8.zip +0 -0
- package/.yarn/cache/@octokit-plugin-request-log-npm-1.0.4-9ab5a2f888-2086db0005.zip +0 -0
- package/.yarn/cache/@octokit-plugin-rest-endpoint-methods-npm-7.0.1-6524223f9b-cdb8734ec9.zip +0 -0
- package/.yarn/cache/@octokit-request-error-npm-3.0.3-cbba4d6220-5db0b51473.zip +0 -0
- package/.yarn/cache/@octokit-request-npm-6.2.3-1b72fec7bb-fef4097be8.zip +0 -0
- package/.yarn/cache/@octokit-rest-npm-19.0.7-f05ed3b2ee-1f970c4de2.zip +0 -0
- package/.yarn/cache/@octokit-types-npm-9.0.0-3a83131100-5c7f5cca8f.zip +0 -0
- package/.yarn/cache/@pkgjs-parseargs-npm-0.11.0-cd2a3fe948-6ad6a00fc4.zip +0 -0
- package/.yarn/cache/@react-email-render-npm-0.0.6-aba674abb4-fe1f044305.zip +0 -0
- package/.yarn/cache/@selderee-plugin-htmlparser2-npm-0.10.0-da625619f9-37b5e059f0.zip +0 -0
- package/.yarn/cache/@tootallnate-once-npm-2.0.0-e36cf4f140-ad87447820.zip +0 -0
- package/.yarn/cache/@tsconfig-node10-npm-1.0.9-f2e2d20feb-a33ae4dc2a.zip +0 -0
- package/.yarn/cache/@tsconfig-node12-npm-1.0.11-9710d1c61b-5ce29a41b1.zip +0 -0
- package/.yarn/cache/@tsconfig-node14-npm-1.0.3-15321421d2-19275fe80c.zip +0 -0
- package/.yarn/cache/@tsconfig-node16-npm-1.0.3-6a4a30eda2-3a8b657dd0.zip +0 -0
- package/.yarn/cache/@types-fs-extra-npm-11.0.1-f11620397b-3e930346e5.zip +0 -0
- package/.yarn/cache/@types-glob-npm-7.2.0-772334bf9a-6ae717fedf.zip +0 -0
- package/.yarn/cache/@types-jsonfile-npm-6.1.1-62ad833c58-0f8fe0a922.zip +0 -0
- package/.yarn/cache/@types-minimatch-npm-5.1.2-aab9c394d3-0391a28286.zip +0 -0
- package/.yarn/cache/@types-node-npm-18.11.10-cca0d46cb2-0f60cb090b.zip +0 -0
- package/.yarn/cache/@types-node-npm-18.11.9-d21dd6ec05-cc0aae109e.zip +0 -0
- package/.yarn/cache/@types-normalize-package-data-npm-2.4.1-c31c56ae6a-e87bccbf11.zip +0 -0
- package/.yarn/cache/@types-normalize-path-npm-3.0.0-a1f250f88f-19f49b1cef.zip +0 -0
- package/.yarn/cache/@types-shelljs-npm-0.8.12-cbc88427ef-ffb47809ab.zip +0 -0
- package/.yarn/cache/abbrev-npm-1.1.1-3659247eab-a4a97ec07d.zip +0 -0
- package/.yarn/cache/acorn-npm-8.8.1-20e4aea981-4079b67283.zip +0 -0
- package/.yarn/cache/acorn-walk-npm-8.2.0-2f2cac3177-1715e76c01.zip +0 -0
- package/.yarn/cache/agent-base-npm-6.0.2-428f325a93-f52b6872cc.zip +0 -0
- package/.yarn/cache/agentkeepalive-npm-4.5.0-f237b580b2-13278cd5b1.zip +0 -0
- package/.yarn/cache/aggregate-error-npm-3.1.0-415a406f4e-1101a33f21.zip +0 -0
- package/.yarn/cache/ansi-regex-npm-5.0.1-c963a48615-2aa4bb54ca.zip +0 -0
- package/.yarn/cache/ansi-regex-npm-6.0.1-8d663a607d-1ff8b7667c.zip +0 -0
- package/.yarn/cache/ansi-styles-npm-3.2.1-8cb8107983-d85ade01c1.zip +0 -0
- package/.yarn/cache/ansi-styles-npm-4.3.0-245c7d42c7-513b44c3b2.zip +0 -0
- package/.yarn/cache/ansi-styles-npm-6.2.1-d43647018c-ef940f2f0c.zip +0 -0
- package/.yarn/cache/anymatch-npm-3.1.3-bc81d103b1-3e044fd6d1.zip +0 -0
- package/.yarn/cache/aproba-npm-2.0.0-8716bcfde6-5615cadcfb.zip +0 -0
- package/.yarn/cache/are-we-there-yet-npm-3.0.1-3395b1512f-52590c2486.zip +0 -0
- package/.yarn/cache/arg-npm-4.1.3-1748b966a8-544af8dd3f.zip +0 -0
- package/.yarn/cache/argparse-npm-1.0.10-528934e59d-7ca6e45583.zip +0 -0
- package/.yarn/cache/array-union-npm-2.1.0-4e4852b221-5bee12395c.zip +0 -0
- package/.yarn/cache/balanced-match-npm-1.0.2-a53c126459-9706c088a2.zip +0 -0
- package/.yarn/cache/base64-js-npm-1.5.1-b2f7275641-669632eb37.zip +0 -0
- package/.yarn/cache/before-after-hook-npm-2.2.3-d79e3d6608-a1a2430976.zip +0 -0
- package/.yarn/cache/big-integer-npm-1.6.51-1a244d8e1f-3d444173d1.zip +0 -0
- package/.yarn/cache/binary-extensions-npm-2.2.0-180c33fec7-ccd267956c.zip +0 -0
- package/.yarn/cache/binary-npm-0.3.0-56515cf10f-b4699fda9e.zip +0 -0
- package/.yarn/cache/bl-npm-4.1.0-7f94cdcf3f-9e8521fa7e.zip +0 -0
- package/.yarn/cache/bluebird-npm-3.4.7-5dff099581-bffa9dee7d.zip +0 -0
- package/.yarn/cache/brace-expansion-npm-1.1.11-fb95eb05ad-faf34a7bb0.zip +0 -0
- package/.yarn/cache/brace-expansion-npm-2.0.1-17aa2616f9-a61e7cd2e8.zip +0 -0
- package/.yarn/cache/braces-npm-3.0.2-782240b28a-e2a8e769a8.zip +0 -0
- package/.yarn/cache/buffer-indexof-polyfill-npm-1.0.2-39d49d63c8-fbfb2d69c6.zip +0 -0
- package/.yarn/cache/buffer-npm-5.7.1-513ef8259e-e2cf8429e1.zip +0 -0
- package/.yarn/cache/buffers-npm-0.1.1-59dbe6d7fb-ad6f8e483e.zip +0 -0
- package/.yarn/cache/cacache-npm-17.1.4-51ef53d0a8-b7751df756.zip +0 -0
- package/.yarn/cache/chainsaw-npm-0.1.0-0d34a3db01-22a96b9fb0.zip +0 -0
- package/.yarn/cache/chalk-npm-2.4.2-3ea16dd91e-ec3661d38f.zip +0 -0
- package/.yarn/cache/chalk-npm-4.1.2-ba8b67ab80-fe75c9d5c7.zip +0 -0
- package/.yarn/cache/chokidar-npm-3.5.3-c5f9b0a56a-b49fcde401.zip +0 -0
- package/.yarn/cache/chownr-npm-2.0.0-638f1c9c61-c57cf9dd07.zip +0 -0
- package/.yarn/cache/clean-stack-npm-2.2.0-a8ce435a5c-2ac8cd2b2f.zip +0 -0
- package/.yarn/cache/cli-cursor-npm-3.1.0-fee1e46b5e-2692784c6c.zip +0 -0
- package/.yarn/cache/cli-spinners-npm-2.7.0-ace95632f5-a9afaf73f5.zip +0 -0
- package/.yarn/cache/clone-npm-1.0.4-a610fcbcf9-d06418b733.zip +0 -0
- package/.yarn/cache/color-convert-npm-1.9.3-1fe690075e-fd7a64a17c.zip +0 -0
- package/.yarn/cache/color-convert-npm-2.0.1-79730e935b-79e6bdb9fd.zip +0 -0
- package/.yarn/cache/color-name-npm-1.1.3-728b7b5d39-09c5d3e33d.zip +0 -0
- package/.yarn/cache/color-name-npm-1.1.4-025792b0ea-b044585952.zip +0 -0
- package/.yarn/cache/color-support-npm-1.1.3-3be5c53455-9b73568176.zip +0 -0
- package/.yarn/cache/commander-npm-2.20.3-d8dcbaa39b-ab8c07884e.zip +0 -0
- package/.yarn/cache/commander-npm-5.1.0-7e939e7832-0b7fec1712.zip +0 -0
- package/.yarn/cache/commander-npm-9.4.1-9deffb2749-bfb18e325a.zip +0 -0
- package/.yarn/cache/concat-map-npm-0.0.1-85a921b7ee-902a9f5d89.zip +0 -0
- package/.yarn/cache/condense-newlines-npm-0.2.1-016452195f-3c20ff6ee8.zip +0 -0
- package/.yarn/cache/config-chain-npm-1.1.13-82e06afbc4-828137a28e.zip +0 -0
- package/.yarn/cache/console-control-strings-npm-1.1.0-e3160e5275-8755d76787.zip +0 -0
- package/.yarn/cache/core-util-is-npm-1.0.3-ca74b76c90-9de8597363.zip +0 -0
- package/.yarn/cache/create-require-npm-1.1.1-839884ca2e-a9a1503d43.zip +0 -0
- package/.yarn/cache/cross-spawn-npm-7.0.3-e4ff3e65b3-671cc7c728.zip +0 -0
- package/.yarn/cache/debug-npm-4.3.4-4513954577-3dbad3f94e.zip +0 -0
- package/.yarn/cache/deepmerge-npm-4.2.2-112165ced2-a8c43a1ed8.zip +0 -0
- package/.yarn/cache/defaults-npm-1.0.4-f3fbaf2528-3a88b7a587.zip +0 -0
- package/.yarn/cache/delegates-npm-1.0.0-9b1942d75f-a51744d9b5.zip +0 -0
- package/.yarn/cache/deprecation-npm-2.3.1-e19c92d6e7-f56a05e182.zip +0 -0
- package/.yarn/cache/detect-package-manager-npm-2.0.1-e5377363d9-e72b910182.zip +0 -0
- package/.yarn/cache/diff-npm-4.0.2-73133c7102-f2c09b0ce4.zip +0 -0
- package/.yarn/cache/dir-glob-npm-3.0.1-1aea628b1b-fa05e18324.zip +0 -0
- package/.yarn/cache/dom-serializer-npm-2.0.0-378ebc7200-cd1810544f.zip +0 -0
- package/.yarn/cache/domelementtype-npm-2.3.0-02de7cbfba-ee837a318f.zip +0 -0
- package/.yarn/cache/domhandler-npm-5.0.3-3ede73dc10-0f58f4a6af.zip +0 -0
- package/.yarn/cache/domutils-npm-3.0.1-7937818218-23aa7a8405.zip +0 -0
- package/.yarn/cache/duplexer2-npm-0.1.4-6bca6bef12-744961f03c.zip +0 -0
- package/.yarn/cache/eastasianwidth-npm-0.2.0-c37eb16bd1-7d00d7cd8e.zip +0 -0
- package/.yarn/cache/editorconfig-npm-0.15.3-873be190a7-a94afeda19.zip +0 -0
- package/.yarn/cache/emoji-regex-npm-8.0.0-213764015c-d4c5c39d5a.zip +0 -0
- package/.yarn/cache/emoji-regex-npm-9.2.2-e6fac8d058-8487182da7.zip +0 -0
- package/.yarn/cache/encoding-npm-0.1.13-82a1837d30-bb98632f8f.zip +0 -0
- package/.yarn/cache/entities-npm-4.4.0-97635dc5cc-84d250329f.zip +0 -0
- package/.yarn/cache/env-paths-npm-2.2.1-7c7577428c-65b5df55a8.zip +0 -0
- package/.yarn/cache/err-code-npm-2.0.3-082e0ff9a7-8b7b1be20d.zip +0 -0
- package/.yarn/cache/error-ex-npm-1.3.2-5654f80c0f-c1c2b8b65f.zip +0 -0
- package/.yarn/cache/esbuild-npm-0.16.4-ac3d3897e5-c06e9b2e84.zip +0 -0
- package/.yarn/cache/escape-string-regexp-npm-1.0.5-3284de402f-6092fda75c.zip +0 -0
- package/.yarn/cache/esprima-npm-4.0.1-1084e98778-b45bc805a6.zip +0 -0
- package/.yarn/cache/execa-npm-5.1.1-191347acf5-fba9022c8c.zip +0 -0
- package/.yarn/cache/exponential-backoff-npm-3.1.1-04df458b30-3d21519a4f.zip +0 -0
- package/.yarn/cache/extend-shallow-npm-2.0.1-e6ef52b29c-8fb58d9d7a.zip +0 -0
- package/.yarn/cache/fast-folder-size-npm-1.6.1-2b11f9e719-3e85cb5960.zip +0 -0
- package/.yarn/cache/fast-glob-npm-3.2.12-162763bbae-0b1990f6ce.zip +0 -0
- package/.yarn/cache/fastq-npm-1.13.0-a45963881c-32cf15c29a.zip +0 -0
- package/.yarn/cache/fill-range-npm-7.0.1-b8b1817caa-cc283f4e65.zip +0 -0
- package/.yarn/cache/find-up-npm-4.1.0-c3ccf8d855-4c172680e8.zip +0 -0
- package/.yarn/cache/foreground-child-npm-3.1.1-77e78ed774-139d270bc8.zip +0 -0
- package/.yarn/cache/fs-extra-npm-11.1.1-ca44602180-fb883c6824.zip +0 -0
- package/.yarn/cache/fs-extra-npm-8.1.0-197473387f-bf44f0e6ce.zip +0 -0
- package/.yarn/cache/fs-minipass-npm-2.1.0-501ef87306-1b8d128dae.zip +0 -0
- package/.yarn/cache/fs-minipass-npm-3.0.3-d148d6ac19-8722a41109.zip +0 -0
- package/.yarn/cache/fs.realpath-npm-1.0.0-c8f05d8126-99ddea01a7.zip +0 -0
- package/.yarn/cache/fsevents-npm-2.3.2-a881d6ac9f-97ade64e75.zip +0 -0
- package/.yarn/cache/fsevents-patch-2882183fbf-8.zip +0 -0
- package/.yarn/cache/fstream-npm-1.0.12-db27e8a713-e6998651ae.zip +0 -0
- package/.yarn/cache/function-bind-npm-1.1.1-b56b322ae9-b32fbaebb3.zip +0 -0
- package/.yarn/cache/gauge-npm-4.0.4-8f878385e9-788b6bfe52.zip +0 -0
- package/.yarn/cache/get-stream-npm-6.0.1-83e51a4642-e04ecece32.zip +0 -0
- package/.yarn/cache/glob-npm-10.3.9-a41b2187b4-806a4ef571.zip +0 -0
- package/.yarn/cache/glob-npm-7.2.3-2d866d17a5-29452e97b3.zip +0 -0
- package/.yarn/cache/glob-npm-8.0.3-750f909025-50bcdea19d.zip +0 -0
- package/.yarn/cache/glob-parent-npm-5.1.2-021ab32634-f4f2bfe242.zip +0 -0
- package/.yarn/cache/globby-npm-11.1.0-bdcdf20c71-b4be8885e0.zip +0 -0
- package/.yarn/cache/graceful-fs-npm-4.2.10-79c70989ca-3f109d70ae.zip +0 -0
- package/.yarn/cache/graceful-fs-npm-4.2.11-24bb648a68-ac85f94da9.zip +0 -0
- package/.yarn/cache/has-flag-npm-3.0.0-16ac11fe05-4a15638b45.zip +0 -0
- package/.yarn/cache/has-flag-npm-4.0.0-32af9f0536-261a135703.zip +0 -0
- package/.yarn/cache/has-npm-1.0.3-b7f00631c1-b9ad53d53b.zip +0 -0
- package/.yarn/cache/has-unicode-npm-2.0.1-893adb4747-1eab07a743.zip +0 -0
- package/.yarn/cache/hosted-git-info-npm-2.8.9-62c44fa93f-c955394bda.zip +0 -0
- package/.yarn/cache/html-to-text-npm-9.0.3-27f776e12e-4509edd5c0.zip +0 -0
- package/.yarn/cache/htmlparser2-npm-8.0.1-b432299617-06d5c71e83.zip +0 -0
- package/.yarn/cache/http-cache-semantics-npm-4.1.1-1120131375-83ac0bc60b.zip +0 -0
- package/.yarn/cache/http-proxy-agent-npm-5.0.0-7f1f121b83-e2ee1ff165.zip +0 -0
- package/.yarn/cache/https-proxy-agent-npm-5.0.1-42d65f358e-571fccdf38.zip +0 -0
- package/.yarn/cache/human-signals-npm-2.1.0-f75815481d-b87fd89fce.zip +0 -0
- package/.yarn/cache/humanize-ms-npm-1.2.1-e942bd7329-9c7a74a282.zip +0 -0
- package/.yarn/cache/iconv-lite-npm-0.6.3-24b8aae27e-3f60d47a5c.zip +0 -0
- package/.yarn/cache/ieee754-npm-1.2.1-fb63b3caeb-5144c0c981.zip +0 -0
- package/.yarn/cache/ignore-npm-5.2.1-208dc99ae8-7251d00cba.zip +0 -0
- package/.yarn/cache/imurmurhash-npm-0.1.4-610c5068a0-7cae75c8cd.zip +0 -0
- package/.yarn/cache/indent-string-npm-4.0.0-7b717435b2-824cfb9929.zip +0 -0
- package/.yarn/cache/inflight-npm-1.0.6-ccedb4b908-f4f76aa072.zip +0 -0
- package/.yarn/cache/inherits-npm-2.0.4-c66b3957a0-4a48a73384.zip +0 -0
- package/.yarn/cache/ini-npm-1.3.8-fb5040b4c0-dfd98b0ca3.zip +0 -0
- package/.yarn/cache/interpret-npm-1.4.0-17b4b5b0a4-2e5f51268b.zip +0 -0
- package/.yarn/cache/ip-npm-2.0.0-204facb3cc-cfcfac6b87.zip +0 -0
- package/.yarn/cache/is-arrayish-npm-0.2.1-23927dfb15-eef4417e3c.zip +0 -0
- package/.yarn/cache/is-binary-path-npm-2.1.0-e61d46f557-84192eb88c.zip +0 -0
- package/.yarn/cache/is-buffer-npm-1.1.6-08199d9ccc-4a186d995d.zip +0 -0
- package/.yarn/cache/is-core-module-npm-2.11.0-70061e141a-f96fd490c6.zip +0 -0
- package/.yarn/cache/is-extendable-npm-0.1.1-322b4649ec-3875571d20.zip +0 -0
- package/.yarn/cache/is-extglob-npm-2.1.1-0870ea68b5-df033653d0.zip +0 -0
- package/.yarn/cache/is-fullwidth-code-point-npm-3.0.0-1ecf4ebee5-44a30c2945.zip +0 -0
- package/.yarn/cache/is-glob-npm-4.0.3-cb87bf1bdb-d381c1319f.zip +0 -0
- package/.yarn/cache/is-interactive-npm-1.0.0-7ff7c6e04a-824808776e.zip +0 -0
- package/.yarn/cache/is-lambda-npm-1.0.1-7ab55bc8a8-93a32f0194.zip +0 -0
- package/.yarn/cache/is-number-npm-7.0.0-060086935c-456ac6f8e0.zip +0 -0
- package/.yarn/cache/is-plain-object-npm-5.0.0-285b70faa3-e32d27061e.zip +0 -0
- package/.yarn/cache/is-stream-npm-2.0.1-c802db55e7-b8e05ccdf9.zip +0 -0
- package/.yarn/cache/is-unicode-supported-npm-0.1.0-0833e1bbfb-a2aab86ee7.zip +0 -0
- package/.yarn/cache/is-whitespace-npm-0.3.0-994f2b3b8c-dac8fc9a9b.zip +0 -0
- package/.yarn/cache/isarray-npm-1.0.0-db4f547720-f032df8e02.zip +0 -0
- package/.yarn/cache/isexe-npm-2.0.0-b58870bd2e-26bf6c5480.zip +0 -0
- package/.yarn/cache/jackspeak-npm-2.3.5-c631837bc0-c2c211f13c.zip +0 -0
- package/.yarn/cache/jju-npm-1.4.0-670678eaa3-3790481bd2.zip +0 -0
- package/.yarn/cache/js-beautify-npm-1.14.7-31d479fd5c-1950d0d3f0.zip +0 -0
- package/.yarn/cache/js-tokens-npm-4.0.0-0ac852e9e2-8a95213a5a.zip +0 -0
- package/.yarn/cache/js-yaml-npm-3.14.1-b968c6095e-bef146085f.zip +0 -0
- package/.yarn/cache/json-parse-even-better-errors-npm-2.3.1-144d62256e-798ed4cf33.zip +0 -0
- package/.yarn/cache/jsonfile-npm-4.0.0-10ce3aea15-6447d6224f.zip +0 -0
- package/.yarn/cache/jsonfile-npm-6.1.0-20a4796cee-7af3b8e1ac.zip +0 -0
- package/.yarn/cache/kind-of-npm-3.2.2-7deaffa5f9-e898df8ca2.zip +0 -0
- package/.yarn/cache/leac-npm-0.6.0-79f7890bc5-a7a722cfc2.zip +0 -0
- package/.yarn/cache/lines-and-columns-npm-1.2.4-d6c7cc5799-0c37f9f7fa.zip +0 -0
- package/.yarn/cache/listenercount-npm-1.0.1-01172e4210-0f1c9077cd.zip +0 -0
- package/.yarn/cache/locate-path-npm-5.0.0-46580c43e4-83e51725e6.zip +0 -0
- package/.yarn/cache/log-symbols-npm-4.1.0-0a13492d8b-fce1497b31.zip +0 -0
- package/.yarn/cache/loose-envify-npm-1.4.0-6307b72ccf-6517e24e0c.zip +0 -0
- package/.yarn/cache/lru-cache-npm-10.0.1-0e1abf4c13-06f8d0e1ce.zip +0 -0
- package/.yarn/cache/lru-cache-npm-4.1.5-ede304cc43-4bb4b58a36.zip +0 -0
- package/.yarn/cache/lru-cache-npm-6.0.0-b4c8668fe1-f97f499f89.zip +0 -0
- package/.yarn/cache/lru-cache-npm-7.18.3-e68be5b11c-e550d77238.zip +0 -0
- package/.yarn/cache/make-error-npm-1.3.6-ccb85d9458-b86e5e0e25.zip +0 -0
- package/.yarn/cache/make-fetch-happen-npm-11.1.1-f32b79aaaa-7268bf274a.zip +0 -0
- package/.yarn/cache/merge-stream-npm-2.0.0-2ac83efea5-6fa4dcc8d8.zip +0 -0
- package/.yarn/cache/merge2-npm-1.4.1-a2507bd06c-7268db63ed.zip +0 -0
- package/.yarn/cache/micromatch-npm-4.0.5-cfab5d7669-02a17b671c.zip +0 -0
- package/.yarn/cache/mimic-fn-npm-2.1.0-4fbeb3abb4-d2421a3444.zip +0 -0
- package/.yarn/cache/minimatch-npm-3.1.2-9405269906-c154e56640.zip +0 -0
- package/.yarn/cache/minimatch-npm-5.1.1-521233e3d2-215edd0978.zip +0 -0
- package/.yarn/cache/minimatch-npm-9.0.3-69d7d6fad5-253487976b.zip +0 -0
- package/.yarn/cache/minimist-npm-1.2.7-51d33b1371-7346574a10.zip +0 -0
- package/.yarn/cache/minipass-collect-npm-1.0.2-3b4676eab5-14df761028.zip +0 -0
- package/.yarn/cache/minipass-fetch-npm-3.0.4-200ac7c66d-af7aad15d5.zip +0 -0
- package/.yarn/cache/minipass-flush-npm-1.0.5-efe79d9826-56269a0b22.zip +0 -0
- package/.yarn/cache/minipass-npm-3.3.6-b8d93a945b-a30d083c80.zip +0 -0
- package/.yarn/cache/minipass-npm-5.0.0-c64fb63c92-425dab2887.zip +0 -0
- package/.yarn/cache/minipass-npm-7.0.3-3b57909ee9-6f1614f5b5.zip +0 -0
- package/.yarn/cache/minipass-pipeline-npm-1.2.4-5924cb077f-b14240dac0.zip +0 -0
- package/.yarn/cache/minipass-sized-npm-1.0.3-306d86f432-79076749fc.zip +0 -0
- package/.yarn/cache/minizlib-npm-2.1.2-ea89cd0cfb-f1fdeac0b0.zip +0 -0
- package/.yarn/cache/mkdirp-npm-0.5.6-dcd5a6b97b-0c91b721bb.zip +0 -0
- package/.yarn/cache/mkdirp-npm-1.0.4-37f6ef56b9-a96865108c.zip +0 -0
- package/.yarn/cache/ms-npm-2.1.2-ec0c1512ff-673cdb2c31.zip +0 -0
- package/.yarn/cache/ms-npm-2.1.3-81ff3cfac1-aa92de6080.zip +0 -0
- package/.yarn/cache/negotiator-npm-0.6.3-9d50e36171-b8ffeb1e26.zip +0 -0
- package/.yarn/cache/node-fetch-npm-2.6.8-ddb8bfc274-91f57be68e.zip +0 -0
- package/.yarn/cache/node-gyp-npm-9.4.0-ebf5f5573e-78b404e2e0.zip +0 -0
- package/.yarn/cache/nopt-npm-6.0.0-5ea8050815-82149371f8.zip +0 -0
- package/.yarn/cache/normalize-package-data-npm-2.5.0-af0345deed-7999112efc.zip +0 -0
- package/.yarn/cache/normalize-path-npm-3.0.0-658ba7d77f-88eeb4da89.zip +0 -0
- package/.yarn/cache/npm-run-path-npm-4.0.1-7aebd8bab3-5374c0cea4.zip +0 -0
- package/.yarn/cache/npmlog-npm-6.0.2-e0e69455c7-ae238cd264.zip +0 -0
- package/.yarn/cache/once-npm-1.4.0-ccf03ef07a-cd0a885013.zip +0 -0
- package/.yarn/cache/onetime-npm-5.1.2-3ed148fa42-2478859ef8.zip +0 -0
- package/.yarn/cache/ora-npm-5.4.1-4f0343adb7-28d476ee6c.zip +0 -0
- package/.yarn/cache/p-limit-npm-2.3.0-94a0310039-84ff17f1a3.zip +0 -0
- package/.yarn/cache/p-locate-npm-4.1.0-eec6872537-513bd14a45.zip +0 -0
- package/.yarn/cache/p-map-npm-4.0.0-4677ae07c7-cb0ab21ec0.zip +0 -0
- package/.yarn/cache/p-try-npm-2.2.0-e0390dbaf8-f8a8e9a769.zip +0 -0
- package/.yarn/cache/parse-json-npm-5.2.0-00a63b1199-62085b17d6.zip +0 -0
- package/.yarn/cache/parseley-npm-0.11.0-5969ada3fb-cbd4762bf7.zip +0 -0
- package/.yarn/cache/path-exists-npm-4.0.0-e9e4f63eb0-505807199d.zip +0 -0
- package/.yarn/cache/path-is-absolute-npm-1.0.1-31bc695ffd-060840f92c.zip +0 -0
- package/.yarn/cache/path-key-npm-3.1.1-0e66ea8321-55cd7a9dd4.zip +0 -0
- package/.yarn/cache/path-parse-npm-1.0.7-09564527b7-49abf3d811.zip +0 -0
- package/.yarn/cache/path-scurry-npm-1.10.1-52bd946f2e-e2557cff3a.zip +0 -0
- package/.yarn/cache/path-type-npm-4.0.0-10d47fc86a-5b1e2daa24.zip +0 -0
- package/.yarn/cache/peberminta-npm-0.8.0-24ccdcb8be-77d8c02b70.zip +0 -0
- package/.yarn/cache/picomatch-npm-2.3.1-c782cfd986-050c865ce8.zip +0 -0
- package/.yarn/cache/pify-npm-4.0.1-062756097b-9c4e34278c.zip +0 -0
- package/.yarn/cache/prettier-npm-3.0.0-7ffbcce680-6a832876a1.zip +0 -0
- package/.yarn/cache/pretty-bytes-npm-5.6.0-0061079c9f-9c082500d1.zip +0 -0
- package/.yarn/cache/pretty-npm-2.0.0-9c25795870-9c41ae0559.zip +0 -0
- package/.yarn/cache/process-nextick-args-npm-2.0.1-b8d7971609-1d38588e52.zip +0 -0
- package/.yarn/cache/promise-retry-npm-2.0.1-871f0b01b7-f96a3f6d90.zip +0 -0
- package/.yarn/cache/proto-list-npm-1.2.4-a96a43df28-4d4826e171.zip +0 -0
- package/.yarn/cache/pseudomap-npm-1.0.2-0d0e40fee0-856c0aae0f.zip +0 -0
- package/.yarn/cache/queue-microtask-npm-1.2.3-fcc98e4e2d-b676f8c040.zip +0 -0
- package/.yarn/cache/react-dom-npm-18.2.0-dd675bca1c-7d323310be.zip +0 -0
- package/.yarn/cache/react-npm-18.2.0-1eae08fee2-88e38092da.zip +0 -0
- package/.yarn/cache/read-pkg-npm-5.2.0-50426bd8dc-eb696e6052.zip +0 -0
- package/.yarn/cache/read-yaml-file-npm-1.1.0-52eaf1c9d4-41ee5f0755.zip +0 -0
- package/.yarn/cache/readable-stream-npm-2.3.7-77b22a9818-e4920cf754.zip +0 -0
- package/.yarn/cache/readable-stream-npm-3.6.0-23a4a5eb56-d4ea81502d.zip +0 -0
- package/.yarn/cache/readable-stream-npm-3.6.2-d2a6069158-bdcbe6c22e.zip +0 -0
- package/.yarn/cache/readdirp-npm-3.6.0-f950cc74ab-1ced032e6e.zip +0 -0
- package/.yarn/cache/rechoir-npm-0.6.2-0df5f171ec-fe76bf9c21.zip +0 -0
- package/.yarn/cache/resolve-npm-1.22.1-3980488690-07af5fc1e8.zip +0 -0
- package/.yarn/cache/resolve-patch-0c52e0e4f7-5656f4d0be.zip +0 -0
- package/.yarn/cache/restore-cursor-npm-3.1.0-52c5a4c98f-f877dd8741.zip +0 -0
- package/.yarn/cache/retry-npm-0.12.0-72ac7fb4cc-623bd7d2e5.zip +0 -0
- package/.yarn/cache/reusify-npm-1.0.4-95ac4aec11-c3076ebcc2.zip +0 -0
- package/.yarn/cache/rimraf-npm-2.7.1-9a71f3cc37-cdc7f6eacb.zip +0 -0
- package/.yarn/cache/rimraf-npm-3.0.2-2cb7dac69a-87f4164e39.zip +0 -0
- package/.yarn/cache/run-parallel-npm-1.2.0-3f47ff2034-cb4f97ad25.zip +0 -0
- package/.yarn/cache/safe-buffer-npm-5.1.2-c27fedf6c4-f2f1f7943c.zip +0 -0
- package/.yarn/cache/safe-buffer-npm-5.2.1-3481c8aa9b-b99c4b41fd.zip +0 -0
- package/.yarn/cache/safer-buffer-npm-2.1.2-8d5c0b705e-cab8f25ae6.zip +0 -0
- package/.yarn/cache/scheduler-npm-0.23.0-a379a6bc3b-d79192eeaa.zip +0 -0
- package/.yarn/cache/selderee-npm-0.10.0-c753260073-8ecd535fe8.zip +0 -0
- package/.yarn/cache/semver-npm-5.7.1-40bcea106b-57fd0acfd0.zip +0 -0
- package/.yarn/cache/semver-npm-7.5.4-c4ad957fcd-12d8ad952f.zip +0 -0
- package/.yarn/cache/set-blocking-npm-2.0.0-49e2cffa24-6e65a05f7c.zip +0 -0
- package/.yarn/cache/setimmediate-npm-1.0.5-54587459b6-c9a6f2c5b5.zip +0 -0
- package/.yarn/cache/shebang-command-npm-2.0.0-eb2b01921d-6b52fe8727.zip +0 -0
- package/.yarn/cache/shebang-regex-npm-3.0.0-899a0cd65e-1a2bcae50d.zip +0 -0
- package/.yarn/cache/shelljs-npm-0.8.5-44be43f84a-7babc46f73.zip +0 -0
- package/.yarn/cache/sigmund-npm-1.0.1-c0417d7c57-793f81f808.zip +0 -0
- package/.yarn/cache/signal-exit-npm-3.0.7-bd270458a3-a2f098f247.zip +0 -0
- package/.yarn/cache/signal-exit-npm-4.1.0-61fb957687-64c757b498.zip +0 -0
- package/.yarn/cache/slash-npm-3.0.0-b87de2279a-94a93fff61.zip +0 -0
- package/.yarn/cache/smart-buffer-npm-4.2.0-5ac3f668bb-b5167a7142.zip +0 -0
- package/.yarn/cache/socks-npm-2.7.1-17f2b53052-259d9e3e8e.zip +0 -0
- package/.yarn/cache/socks-proxy-agent-npm-7.0.0-7aacf32ea0-7205543701.zip +0 -0
- package/.yarn/cache/spdx-correct-npm-3.1.1-47f574c27a-77ce438344.zip +0 -0
- package/.yarn/cache/spdx-exceptions-npm-2.3.0-2b68dad75a-cb69a26fa3.zip +0 -0
- package/.yarn/cache/spdx-expression-parse-npm-3.0.1-b718cbb35a-a1c6e104a2.zip +0 -0
- package/.yarn/cache/spdx-license-ids-npm-3.0.12-750216a0df-92a4dddce6.zip +0 -0
- package/.yarn/cache/sprintf-js-npm-1.0.3-73f0a322fa-19d79aec21.zip +0 -0
- package/.yarn/cache/ssri-npm-10.0.5-1a7557d04d-0a31b65f21.zip +0 -0
- package/.yarn/cache/string-width-npm-4.2.3-2c27177bae-e52c10dc3f.zip +0 -0
- package/.yarn/cache/string-width-npm-5.1.2-bf60531341-7369deaa29.zip +0 -0
- package/.yarn/cache/string_decoder-npm-1.1.1-e46a6c1353-9ab7e56f9d.zip +0 -0
- package/.yarn/cache/string_decoder-npm-1.3.0-2422117fd0-8417646695.zip +0 -0
- package/.yarn/cache/strip-ansi-npm-6.0.1-caddc7cb40-f3cd25890a.zip +0 -0
- package/.yarn/cache/strip-ansi-npm-7.1.0-7453b80b79-859c73fcf2.zip +0 -0
- package/.yarn/cache/strip-bom-npm-3.0.0-71e8f81ff9-8d50ff27b7.zip +0 -0
- package/.yarn/cache/strip-final-newline-npm-2.0.0-340c4f7c66-69412b5e25.zip +0 -0
- package/.yarn/cache/supports-color-npm-5.5.0-183ac537bc-95f6f4ba5a.zip +0 -0
- package/.yarn/cache/supports-color-npm-7.2.0-606bfcf7da-3dda818de0.zip +0 -0
- package/.yarn/cache/supports-preserve-symlinks-flag-npm-1.0.0-f17c4d0028-53b1e247e6.zip +0 -0
- package/.yarn/cache/tar-npm-6.2.0-3eb25205a7-db4d9fe74a.zip +0 -0
- package/.yarn/cache/to-regex-range-npm-5.0.1-f1e8263b00-f76fa01b3d.zip +0 -0
- package/.yarn/cache/tr46-npm-0.0.3-de53018915-726321c5ea.zip +0 -0
- package/.yarn/cache/traverse-npm-0.3.9-913743c694-982982e4e2.zip +0 -0
- package/.yarn/cache/tree-node-cli-npm-1.6.0-b1b47ddc09-205422ccca.zip +0 -0
- package/.yarn/cache/ts-node-npm-10.9.1-6c268be7f4-090adff130.zip +0 -0
- package/.yarn/cache/type-fest-npm-0.6.0-76b229965b-b2188e6e4b.zip +0 -0
- package/.yarn/cache/typescript-npm-5.1.6-b157762de3-b2f2c35096.zip +0 -0
- package/.yarn/cache/typescript-patch-bd21d74a9d-f53bfe97f7.zip +0 -0
- package/.yarn/cache/unique-filename-npm-3.0.0-77d68e0a45-8e2f59b356.zip +0 -0
- package/.yarn/cache/unique-slug-npm-4.0.0-e6b08f28aa-0884b58365.zip +0 -0
- package/.yarn/cache/universal-user-agent-npm-6.0.0-b148fb997a-5092bbc80d.zip +0 -0
- package/.yarn/cache/universalify-npm-0.1.2-9b22d31d2d-40cdc60f6e.zip +0 -0
- package/.yarn/cache/universalify-npm-2.0.0-03b8b418a8-2406a4edf4.zip +0 -0
- package/.yarn/cache/unzipper-npm-0.10.11-7a1d871174-006cd43ec4.zip +0 -0
- package/.yarn/cache/util-deprecate-npm-1.0.2-e3fe1a219c-474acf1146.zip +0 -0
- package/.yarn/cache/v8-compile-cache-lib-npm-3.0.1-4886071ece-78089ad549.zip +0 -0
- package/.yarn/cache/validate-npm-package-license-npm-3.0.4-7af8adc7a8-35703ac889.zip +0 -0
- package/.yarn/cache/wcwidth-npm-1.0.1-05fa596453-814e9d1ddc.zip +0 -0
- package/.yarn/cache/webidl-conversions-npm-3.0.1-60310f6a2b-c92a0a6ab9.zip +0 -0
- package/.yarn/cache/whatwg-url-npm-5.0.0-374fb45e60-b8daed4ad3.zip +0 -0
- package/.yarn/cache/which-npm-2.0.2-320ddf72f7-1a5c563d3c.zip +0 -0
- package/.yarn/cache/wide-align-npm-1.1.5-889d77e592-d5fc37cd56.zip +0 -0
- package/.yarn/cache/wrap-ansi-npm-7.0.0-ad6e1a0554-a790b846fd.zip +0 -0
- package/.yarn/cache/wrap-ansi-npm-8.1.0-26a4e6ae28-371733296d.zip +0 -0
- package/.yarn/cache/wrappy-npm-1.0.2-916de4d4b3-159da4805f.zip +0 -0
- package/.yarn/cache/yallist-npm-2.1.2-2e38c366a3-9ba9940920.zip +0 -0
- package/.yarn/cache/yallist-npm-4.0.0-b493d9e907-343617202a.zip +0 -0
- package/.yarn/cache/yn-npm-3.1.1-8ad4259784-2c487b0e14.zip +0 -0
- package/.yarn/install-state.gz +0 -0
|
@@ -1,19 +1,19 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import ora from 'ora';
|
|
4
|
+
import shell from 'shelljs';
|
|
1
5
|
import logSymbols from 'log-symbols';
|
|
6
|
+
import fse from 'fs-extra';
|
|
7
|
+
import { sync } from 'glob';
|
|
2
8
|
import {
|
|
3
9
|
CURRENT_PATH,
|
|
4
10
|
PACKAGE_EMAILS_PATH,
|
|
5
11
|
PACKAGE_PUBLIC_PATH,
|
|
6
12
|
} from './constants';
|
|
7
|
-
import fs from 'fs';
|
|
8
|
-
import ora from 'ora';
|
|
9
|
-
import shell from 'shelljs';
|
|
10
|
-
import path from 'path';
|
|
11
|
-
import fse from 'fs-extra';
|
|
12
|
-
import glob from 'glob';
|
|
13
13
|
import { closeOraOnSIGNIT } from './close-ora-on-sigint';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* Node.js and imports are requiring all imports to be /, while some functions (like glob) return paths with
|
|
16
|
+
* Node.js and imports are requiring all imports to be /, while some functions (like glob) return paths with \\ for path separation on windows
|
|
17
17
|
*/
|
|
18
18
|
function osIndependentPath(p: string) {
|
|
19
19
|
return p.split(path.sep).join('/');
|
|
@@ -28,7 +28,7 @@ export const generateEmailsPreview = async (
|
|
|
28
28
|
closeOraOnSIGNIT(spinner);
|
|
29
29
|
|
|
30
30
|
if (type === 'all' || type === 'templates') {
|
|
31
|
-
|
|
31
|
+
createEmailPreviews(emailDir);
|
|
32
32
|
}
|
|
33
33
|
if (type === 'all' || type === 'static') {
|
|
34
34
|
await createStaticFiles();
|
|
@@ -43,56 +43,52 @@ export const generateEmailsPreview = async (
|
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
-
const
|
|
47
|
-
const hasEmailsDirectory = fs.existsSync(PACKAGE_EMAILS_PATH);
|
|
46
|
+
const packageEmailsPath = osIndependentPath(PACKAGE_EMAILS_PATH);
|
|
48
47
|
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
const createEmailPreviews = (emailDir: string) => {
|
|
49
|
+
if (fs.existsSync(PACKAGE_EMAILS_PATH)) {
|
|
50
|
+
fs.rmSync(PACKAGE_EMAILS_PATH, { recursive: true });
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
);
|
|
53
|
+
fs.mkdirSync(packageEmailsPath);
|
|
54
|
+
|
|
55
|
+
const list = sync(osIndependentPath(path.join(emailDir, '/*.{jsx,tsx}')), {
|
|
56
|
+
absolute: true,
|
|
57
|
+
});
|
|
59
58
|
|
|
60
59
|
/**
|
|
61
60
|
* instead of copying all files, which would break and js/ts imports,
|
|
62
61
|
* we create placeholder files which just contain the following code:
|
|
63
62
|
*
|
|
64
|
-
* import Mail from
|
|
63
|
+
* import Mail from `../../path/to/emails/my-template.tsx`
|
|
65
64
|
* export default Mail
|
|
66
65
|
*/
|
|
67
66
|
for (const _absoluteSrcFilePath of list) {
|
|
68
67
|
const absoluteSrcFilePath = osIndependentPath(_absoluteSrcFilePath);
|
|
69
|
-
const fileName = absoluteSrcFilePath.split('/').pop()
|
|
68
|
+
const fileName = absoluteSrcFilePath.split('/').pop();
|
|
69
|
+
|
|
70
|
+
if (fileName === undefined) {
|
|
71
|
+
throw new Error(`Could not get file name from ${absoluteSrcFilePath}`);
|
|
72
|
+
}
|
|
73
|
+
|
|
70
74
|
const targetFile = path.join(
|
|
71
|
-
|
|
75
|
+
packageEmailsPath,
|
|
72
76
|
absoluteSrcFilePath.replace(osIndependentPath(emailDir), ''),
|
|
73
77
|
);
|
|
78
|
+
|
|
79
|
+
const dirWithTargetFile = path.dirname(targetFile);
|
|
80
|
+
|
|
74
81
|
const importPath = path.relative(
|
|
75
|
-
|
|
82
|
+
dirWithTargetFile,
|
|
76
83
|
path.dirname(absoluteSrcFilePath),
|
|
77
84
|
);
|
|
78
85
|
|
|
79
86
|
const importFile = osIndependentPath(path.join(importPath, fileName));
|
|
80
87
|
|
|
81
88
|
// if this import is changed, you also need to update `client/src/app/preview/[slug]/page.tsx`
|
|
82
|
-
const sourceCode =
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
';\n',
|
|
86
|
-
);
|
|
87
|
-
await fse.ensureDir(path.dirname(targetFile));
|
|
88
|
-
if (fse.existsSync(targetFile)) {
|
|
89
|
-
if (fse.readFileSync(targetFile, 'utf8') === sourceCode) {
|
|
90
|
-
// file already exists, no need to trigger a rebuild.
|
|
91
|
-
// can otherwise trigger the next.js rebuild multiple times
|
|
92
|
-
continue;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
await fse.writeFile(targetFile, sourceCode);
|
|
89
|
+
const sourceCode = `import Mail from '${importFile}';\nexport default Mail;\n`;
|
|
90
|
+
|
|
91
|
+
fs.writeFileSync(targetFile, sourceCode);
|
|
96
92
|
}
|
|
97
93
|
};
|
|
98
94
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
1
2
|
import shell from 'shelljs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import { REACT_EMAIL_ROOT } from './constants';
|
|
4
3
|
import ora from 'ora';
|
|
5
4
|
import logSymbols from 'log-symbols';
|
|
5
|
+
import { REACT_EMAIL_ROOT } from './constants';
|
|
6
6
|
import { closeOraOnSIGNIT } from './close-ora-on-sigint';
|
|
7
7
|
|
|
8
8
|
export type PackageManager = 'yarn' | 'npm' | 'pnpm';
|
|
9
9
|
|
|
10
|
-
export const installDependencies =
|
|
10
|
+
export const installDependencies = (packageManager: PackageManager) => {
|
|
11
11
|
const spinner = ora('Installing dependencies...\n').start();
|
|
12
12
|
closeOraOnSIGNIT(spinner);
|
|
13
13
|
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import
|
|
1
|
+
import path from 'node:path';
|
|
2
2
|
import { detect as detectPackageManager } from 'detect-package-manager';
|
|
3
3
|
import { findRoot } from '@manypkg/find-root';
|
|
4
|
+
import shell from 'shelljs';
|
|
5
|
+
import { createWatcherInstance, watcher } from './watcher';
|
|
6
|
+
import type { PackageManager } from '.';
|
|
4
7
|
import {
|
|
5
8
|
CURRENT_PATH,
|
|
6
9
|
convertToAbsolutePath,
|
|
7
10
|
startDevServer,
|
|
8
11
|
installDependencies,
|
|
9
|
-
PackageManager,
|
|
10
12
|
syncPkg,
|
|
11
13
|
generateEmailsPreview,
|
|
12
14
|
buildProdServer,
|
|
13
15
|
startProdServer,
|
|
14
16
|
REACT_EMAIL_ROOT,
|
|
15
17
|
} from '.';
|
|
16
|
-
import path from 'path';
|
|
17
|
-
import shell from 'shelljs';
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Utility function to run init/sync for the server in dev, build or start mode.
|
|
21
21
|
*
|
|
22
|
-
* @param type dev | build | start
|
|
23
|
-
* @param dir Directory in which the emails are located, only for dev and build, unused for start.
|
|
24
|
-
* @param port The port on which the server will run, only for dev and start, unused for build.
|
|
22
|
+
* @param type - dev | build | start
|
|
23
|
+
* @param dir - Directory in which the emails are located, only for dev and build, unused for start.
|
|
24
|
+
* @param port - The port on which the server will run, only for dev and start, unused for build.
|
|
25
25
|
*/
|
|
26
26
|
export const setupServer = async (
|
|
27
27
|
type: 'dev' | 'build' | 'start',
|
|
28
28
|
dir: string,
|
|
29
29
|
port: string,
|
|
30
|
-
skipInstall
|
|
30
|
+
skipInstall = false,
|
|
31
31
|
) => {
|
|
32
32
|
const cwd = await findRoot(CURRENT_PATH).catch(() => ({
|
|
33
33
|
rootDir: CURRENT_PATH,
|
|
@@ -42,7 +42,7 @@ export const setupServer = async (
|
|
|
42
42
|
await generateEmailsPreview(emailDir);
|
|
43
43
|
await syncPkg();
|
|
44
44
|
if (!skipInstall) {
|
|
45
|
-
|
|
45
|
+
installDependencies(packageManager);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChildProcess } from 'child_process';
|
|
1
|
+
import type { ChildProcess } from 'node:child_process';
|
|
2
2
|
import shell from 'shelljs';
|
|
3
3
|
|
|
4
4
|
let processesToKill: ChildProcess[] = [];
|
|
@@ -23,7 +23,7 @@ export const buildProdServer = (packageManager: string) => {
|
|
|
23
23
|
execAsync(`${packageManager} run build`);
|
|
24
24
|
|
|
25
25
|
// if build fails for whatever reason, make sure the shell actually exits
|
|
26
|
-
process.on('close', (code) => {
|
|
26
|
+
process.on('close', (code: number | undefined) => {
|
|
27
27
|
shell.exit(code ?? undefined);
|
|
28
28
|
});
|
|
29
29
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
1
3
|
import readPackage from 'read-pkg';
|
|
2
4
|
import { REACT_EMAIL_ROOT } from './constants';
|
|
3
|
-
import fs from 'fs';
|
|
4
|
-
import path from 'path';
|
|
5
5
|
|
|
6
6
|
export const syncPkg = async () => {
|
|
7
7
|
const clientPkg = await readPackage({ cwd: REACT_EMAIL_ROOT });
|
package/source/utils/watcher.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import type { FSWatcher } from 'chokidar';
|
|
4
|
+
import { watch } from 'chokidar';
|
|
5
|
+
import { cp } from 'shelljs';
|
|
5
6
|
import {
|
|
6
7
|
EVENT_FILE_DELETED,
|
|
7
8
|
PACKAGE_EMAILS_PATH,
|
|
@@ -10,15 +11,15 @@ import {
|
|
|
10
11
|
import { generateEmailsPreview } from './generate-email-preview';
|
|
11
12
|
|
|
12
13
|
export const createWatcherInstance = (watchDir: string) => {
|
|
13
|
-
const watcher =
|
|
14
|
+
const watcher = watch(watchDir, {
|
|
14
15
|
ignoreInitial: true,
|
|
15
16
|
cwd: watchDir.split(path.sep).slice(0, -1).join(path.sep),
|
|
16
|
-
ignored: /(^|[
|
|
17
|
+
ignored: /(^|[/\\])\../,
|
|
17
18
|
});
|
|
18
19
|
|
|
19
20
|
// Catches ctrl+c event
|
|
20
|
-
const exit =
|
|
21
|
-
|
|
21
|
+
const exit = () => {
|
|
22
|
+
void watcher.close();
|
|
22
23
|
};
|
|
23
24
|
process.on('SIGINT', exit);
|
|
24
25
|
process.on('uncaughtException', exit);
|
|
@@ -27,7 +28,7 @@ export const createWatcherInstance = (watchDir: string) => {
|
|
|
27
28
|
};
|
|
28
29
|
|
|
29
30
|
export const watcher = (watcherInstance: FSWatcher, watchDir: string) => {
|
|
30
|
-
watcherInstance.on('all',
|
|
31
|
+
watcherInstance.on('all', (event, filename) => {
|
|
31
32
|
const file = filename.split(path.sep);
|
|
32
33
|
if (file[1] === undefined) {
|
|
33
34
|
return;
|
|
@@ -35,19 +36,17 @@ export const watcher = (watcherInstance: FSWatcher, watchDir: string) => {
|
|
|
35
36
|
|
|
36
37
|
if (event === EVENT_FILE_DELETED) {
|
|
37
38
|
if (file[1] === 'static' && file[2]) {
|
|
38
|
-
|
|
39
|
-
path.join(REACT_EMAIL_ROOT, 'public', 'static', file[2]),
|
|
40
|
-
);
|
|
39
|
+
fs.rmSync(path.join(REACT_EMAIL_ROOT, 'public', 'static', file[2]));
|
|
41
40
|
return;
|
|
42
41
|
}
|
|
43
42
|
|
|
44
|
-
|
|
43
|
+
fs.rmSync(path.join(REACT_EMAIL_ROOT, filename));
|
|
45
44
|
return;
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
if (file[1] === 'static' && file[2]) {
|
|
49
48
|
const srcPath = path.join(watchDir, 'static', file[2]);
|
|
50
|
-
const result =
|
|
49
|
+
const result = cp(
|
|
51
50
|
'-r',
|
|
52
51
|
srcPath,
|
|
53
52
|
path.join(REACT_EMAIL_ROOT, 'public', 'static'),
|
|
@@ -60,13 +59,6 @@ export const watcher = (watcherInstance: FSWatcher, watchDir: string) => {
|
|
|
60
59
|
return;
|
|
61
60
|
}
|
|
62
61
|
|
|
63
|
-
|
|
64
|
-
await generateEmailsPreview(watchDir, 'templates');
|
|
65
|
-
} catch (e) {
|
|
66
|
-
throw new Error(
|
|
67
|
-
`Something went wrong while copying the file to ${PACKAGE_EMAILS_PATH}, ${// @ts-expect-error
|
|
68
|
-
e?.message}`,
|
|
69
|
-
);
|
|
70
|
-
}
|
|
62
|
+
void generateEmailsPreview(watchDir, 'templates');
|
|
71
63
|
});
|
|
72
64
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es6",
|
|
4
|
+
"lib": [
|
|
5
|
+
"dom",
|
|
6
|
+
"dom.iterable",
|
|
7
|
+
"esnext"
|
|
8
|
+
],
|
|
9
|
+
"allowJs": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"strict": false,
|
|
12
|
+
"forceConsistentCasingInFileNames": true,
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"incremental": true,
|
|
15
|
+
"esModuleInterop": true,
|
|
16
|
+
"module": "esnext",
|
|
17
|
+
"moduleResolution": "node",
|
|
18
|
+
"resolveJsonModule": true,
|
|
19
|
+
"isolatedModules": true,
|
|
20
|
+
"jsx": "react-jsx",
|
|
21
|
+
"strictNullChecks": true,
|
|
22
|
+
"allowImportingTsExtensions": true
|
|
23
|
+
},
|
|
24
|
+
"include": [
|
|
25
|
+
"**/*.ts",
|
|
26
|
+
"**/*.tsx"
|
|
27
|
+
],
|
|
28
|
+
"exclude": [
|
|
29
|
+
"node_modules"
|
|
30
|
+
]
|
|
31
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,36 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"extends": "tsconfig/react-library.json",
|
|
4
|
+
"include": ["."],
|
|
5
|
+
"exclude": ["tsconfig.export.json", "dist", "build", "node_modules"],
|
|
2
6
|
"compilerOptions": {
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"target": "ES2020", // Node.js 14
|
|
6
|
-
"lib": ["DOM", "DOM.Iterable", "ES2020"],
|
|
7
|
-
"allowSyntheticDefaultImports": true, // To provide backwards compatibility, Node.js allows you to import most CommonJS packages with a default import. This flag tells TypeScript that it's okay to use import on CommonJS modules.
|
|
8
|
-
"resolveJsonModule": true,
|
|
9
|
-
"jsx": "react",
|
|
10
|
-
"declaration": true,
|
|
11
|
-
"pretty": true,
|
|
12
|
-
"newLine": "lf",
|
|
13
|
-
"stripInternal": true,
|
|
14
|
-
"strict": true,
|
|
15
|
-
"noImplicitReturns": true,
|
|
16
|
-
"noUnusedLocals": true,
|
|
17
|
-
"noUnusedParameters": true,
|
|
18
|
-
"noFallthroughCasesInSwitch": true,
|
|
7
|
+
"target": "es5",
|
|
8
|
+
"module": "CommonJS",
|
|
19
9
|
"noUncheckedIndexedAccess": true,
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"useDefineForClassFields": true,
|
|
23
|
-
"forceConsistentCasingInFileNames": true,
|
|
24
|
-
"skipLibCheck": true,
|
|
25
|
-
"outDir": "dist",
|
|
26
|
-
"esModuleInterop": true,
|
|
27
|
-
"typeRoots": ["./types", "./node_modules/@types"]
|
|
28
|
-
},
|
|
29
|
-
"include": ["source", "preview"],
|
|
30
|
-
"exclude": ["dist", "build", "node_modules", "preview"],
|
|
31
|
-
"ts-node": {
|
|
32
|
-
"transpileOnly": true,
|
|
33
|
-
"files": true,
|
|
34
|
-
"experimentalResolver": true
|
|
10
|
+
"resolveJsonModule": true,
|
|
11
|
+
"outDir": "dist"
|
|
35
12
|
}
|
|
36
13
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/.yarn/cache/@octokit-plugin-rest-endpoint-methods-npm-7.0.1-6524223f9b-cdb8734ec9.zip
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|