From 2a3deaf790bcb712f60956584fc451ce6efff4f1 Mon Sep 17 00:00:00 2001 From: bryan newbold Date: Fri, 12 Apr 2024 14:26:52 -0700 Subject: [PATCH] tweaks to build process --- Makefile | 1 + bskyweb/.gitignore | 4 ++ scripts/post-embed-build.js | 76 ++++++++++++++++++------------------- 3 files changed, 43 insertions(+), 38 deletions(-) diff --git a/Makefile b/Makefile index c90abb783e..3bdfca882b 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,7 @@ lint: ## Run style checks and verify syntax .PHONY: deps deps: ## Installs dependent libs using 'yarn install' yarn install --frozen-lockfile + cd bskyembed && yarn install --frozen-lockfile .PHONY: nvm-setup nvm-setup: ## Use NVM to install and activate node+yarn diff --git a/bskyweb/.gitignore b/bskyweb/.gitignore index 42910b1c43..2582b048c7 100644 --- a/bskyweb/.gitignore +++ b/bskyweb/.gitignore @@ -14,6 +14,10 @@ templates/*-embed.html static/embed/*.html static/embed/assets/*.js static/embed/assets/*.css +embedr-static/post-*.js +embedr-static/post-*.css +embedr-static/index-*.js +embedr-static/polyfills-*.js # Don't ignore this file !.gitignore diff --git a/scripts/post-embed-build.js b/scripts/post-embed-build.js index 5bece544aa..5fb3377bd8 100644 --- a/scripts/post-embed-build.js +++ b/scripts/post-embed-build.js @@ -1,49 +1,49 @@ -// const path = require('node:path') -// const fs = require('node:fs') +const path = require('node:path') +const fs = require('node:fs') -// const projectRoot = path.join(__dirname, '..') +const projectRoot = path.join(__dirname, '..') -// // copy embed assets to web-build +// copy embed assets to embedr -// const embedAssetSource = path.join( -// projectRoot, -// 'bskyembed', -// 'dist', -// 'static', -// 'embed', -// 'assets', -// ) +const embedAssetSource = path.join(projectRoot, 'bskyembed', 'dist', 'static') -// const embedAssetDest = path.join( -// projectRoot, -// 'web-build', -// 'static', -// 'embed', -// 'assets', -// ) +const embedAssetDest = path.join(projectRoot, 'bskyweb', 'embedr-static') -// fs.cpSync(embedAssetSource, embedAssetDest, {recursive: true}) +fs.cpSync(embedAssetSource, embedAssetDest, {recursive: true}) -// // copy entrypoint(s) to web-build +// copy entrypoint(s) to embedr -// // additional entrypoints will need more work, but this'll do for now -// const embedHtmlSource = path.join( -// projectRoot, -// 'bskyembed', -// 'dist', -// 'index.html', -// ) +// additional entrypoints will need more work, but this'll do for now +const embedHomeHtmlSource = path.join( + projectRoot, + 'bskyembed', + 'dist', + 'index.html', +) -// const embedHtmlDest = path.join( -// projectRoot, -// 'web-build', -// 'static', -// 'embed', -// 'post.html', -// ) +const embedHomeHtmlDest = path.join( + projectRoot, + 'bskyweb', + 'embedr-templates', + 'home.html', +) -// fs.copyFileSync(embedHtmlSource, embedHtmlDest) +fs.copyFileSync(embedHomeHtmlSource, embedHomeHtmlDest) -// console.log(`Copied embed assets to web-build`) +const embedPostHtmlSource = path.join( + projectRoot, + 'bskyembed', + 'dist', + 'post.html', +) -console.log('post-embed-build.js - waiting for embedr!') +const embedPostHtmlDest = path.join( + projectRoot, + 'bskyweb', + 'embedr-templates', + 'postEmbed.html', +) + +fs.copyFileSync(embedPostHtmlSource, embedPostHtmlDest) + +console.log(`Copied embed assets to embedr`)