File tree Expand file tree Collapse file tree
libs/accounts/email-renderer
packages/fxa-auth-server/scripts Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626 "outputPath" : " dist/libs/accounts/email-renderer" ,
2727 "main" : " libs/accounts/email-renderer/src/index.ts" ,
2828 "tsConfig" : " libs/accounts/email-renderer/tsconfig.lib.json" ,
29- "assets" : [" libs/accounts/email-renderer/*.md" ],
29+ "assets" : [
30+ " libs/accounts/email-renderer/*.md" ,
31+ " libs/accounts/email-renderer/src/**/*.txt" ,
32+ " libs/accounts/email-renderer/src/**/*.mjml"
33+ ],
3034 "format" : [" cjs" ],
3135 "generatePackageJson" : true
3236 }
Original file line number Diff line number Diff line change @@ -64,10 +64,12 @@ export class NodeRendererBindings extends RendererBindings {
6464 }
6565
6666 async fetchResource ( path : string ) : Promise < string > {
67+ if ( ! existsSync ( path ) ) {
68+ throw new Error ( 'Resource file does not exist: ' + path ) ;
69+ }
6770 const raw = readFileSync ( path , {
6871 encoding : 'utf8' ,
6972 } ) ;
70-
7173 return raw ;
7274 }
7375
Original file line number Diff line number Diff line change @@ -8,3 +8,18 @@ xargs -L1 bash -c 'mkdir -p dist/packages/fxa-auth-server/$0'
88find config lib scripts bin public -type f | \
99grep --invert -E " \.js$|\.ts$|\.sh" | \
1010xargs -L1 bash -c ' cp $0 dist/packages/fxa-auth-server/$0'
11+
12+ # Copy email templates into dist...
13+ # Note that if we ran off the dist folder in the monorepo root we would not have this problem.
14+ cd ../..
15+
16+ # First create all the directories
17+ find dist/libs/accounts/email-renderer -type d | \
18+ xargs -L1 bash -c ' mkdir -p packages/fxa-auth-server/$0'
19+
20+ # Then copy the template files
21+ find dist/libs/accounts/email-renderer -type f | \
22+ grep -E " \.mjml$|\.txt$" | \
23+ xargs -L1 bash -c ' cp $0 packages/fxa-auth-server/$0'
24+
25+ cd packages/fxa-auth-server
You can’t perform that action at this time.
0 commit comments