rwsdk 0.1.6-test.20250702135708 → 0.1.6-test.20250702140551
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.
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
2
3
|
import { $ } from "../lib/$.mjs";
|
|
4
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
3
5
|
export const debugSync = async (opts) => {
|
|
4
6
|
const { targetDir, sdkDir = process.cwd(), dev, watch, build } = opts;
|
|
5
7
|
if (!targetDir) {
|
|
6
8
|
console.error("❌ Please provide a target directory as an argument.");
|
|
7
9
|
process.exit(1);
|
|
8
10
|
}
|
|
9
|
-
const syncCommand = `echo 🏗️ rebuilding... && pnpm build && rm -rf ${targetDir}/node_modules/rwsdk/dist ${targetDir}/node_modules/rwsdk/package.json && echo 📁 syncing sdk from ${sdkDir} to ${targetDir}/node_modules/rwsdk/... && cp -r package.json dist ${targetDir}/node_modules/rwsdk/ && echo ✅ done syncing`;
|
|
11
|
+
const syncCommand = `echo 🏗️ rebuilding... && pnpm build && rm -rf ${targetDir}/node_modules/rwsdk/dist ${targetDir}/node_modules/rwsdk/package.json && echo 📁 syncing sdk from ${sdkDir} to ${targetDir}/node_modules/rwsdk/... && cp -r ${sdkDir}/package.json ${sdkDir}/dist ${targetDir}/node_modules/rwsdk/ && echo ✅ done syncing`;
|
|
10
12
|
// Run initial sync
|
|
11
13
|
await $({ stdio: "inherit", shell: true }) `${syncCommand}`;
|
|
12
14
|
if (!process.env.NO_CLEAN_VITE) {
|
|
@@ -41,7 +43,7 @@ export const debugSync = async (opts) => {
|
|
|
41
43
|
};
|
|
42
44
|
if (import.meta.url === new URL(process.argv[1], import.meta.url).href) {
|
|
43
45
|
const args = process.argv.slice(2);
|
|
44
|
-
const targetDir = args[0] ??
|
|
46
|
+
const targetDir = args[0] ?? process.cwd();
|
|
45
47
|
const flags = new Set(args.slice(1));
|
|
46
48
|
debugSync({
|
|
47
49
|
targetDir,
|