Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions .changeset/good-ghosts-rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@powersync/web': minor
---

Added input flag option to copy assets command, allows you to specify a path to the node_modules directory - useful in cases like a monorepo.
5 changes: 4 additions & 1 deletion packages/web/bin/powersync.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ program.name('powersync-web').description('CLI for PowerSync Web SDK utilities')
program
.command('copy-assets')
.description('Copy assets to the specified output directory')
.option('-i, --input <directory>', 'node modules dependency directory', 'node_modules')
.option('-o, --output <directory>', 'output directory for assets', 'public')
.action(async (options) => {
const inputDir = options.input;
const outputDir = options.output;

console.log(`Input directory: ${inputDir}`);
console.log(`Target directory: ${outputDir}`);

const cwd = process.cwd();
const source = path.join(cwd, 'node_modules', '@powersync', 'web', 'dist');
const source = path.join(cwd, inputDir, '@powersync', 'web', 'dist');
const destination = path.join(cwd, outputDir, '@powersync');

await fsPromise.rm(destination, { recursive: true, force: true }); // Clear old assets
Expand Down