Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion libs/accounts/email-renderer/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
"outputPath": "dist/libs/accounts/email-renderer",
"main": "libs/accounts/email-renderer/src/index.ts",
"tsConfig": "libs/accounts/email-renderer/tsconfig.lib.json",
"assets": ["libs/accounts/email-renderer/*.md"],
"assets": [
"libs/accounts/email-renderer/*.md",
"libs/accounts/email-renderer/src/**/*.txt",
"libs/accounts/email-renderer/src/**/*.mjml"
],
"format": ["cjs"],
"generatePackageJson": true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,12 @@ export class NodeRendererBindings extends RendererBindings {
}

async fetchResource(path: string): Promise<string> {
if (!existsSync(path)) {
throw new Error('Resource file does not exist: ' + path);
}
const raw = readFileSync(path, {
encoding: 'utf8',
});

return raw;
}

Expand Down
15 changes: 15 additions & 0 deletions packages/fxa-auth-server/scripts/copy-assets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,18 @@ xargs -L1 bash -c 'mkdir -p dist/packages/fxa-auth-server/$0'
find config lib scripts bin public -type f | \
grep --invert -E "\.js$|\.ts$|\.sh" | \
xargs -L1 bash -c 'cp $0 dist/packages/fxa-auth-server/$0'

# Copy email templates into dist...
# Note that if we ran off the dist folder in the monorepo root we would not have this problem.
cd ../..

# First create all the directories
find dist/libs/accounts/email-renderer -type d | \
xargs -L1 bash -c 'mkdir -p packages/fxa-auth-server/$0'

# Then copy the template files
find dist/libs/accounts/email-renderer -type f | \
grep -E "\.mjml$|\.txt$" | \
xargs -L1 bash -c 'cp $0 packages/fxa-auth-server/$0'

cd packages/fxa-auth-server
Loading