@xaidenlabs/uso 1.1.34 → 1.1.36
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.
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as anchor from "@coral-xyz/anchor";
|
|
2
|
+
import { Program } from "@coral-xyz/anchor";
|
|
3
|
+
import { UsoVerifier } from "../target/types/uso_verifier";
|
|
4
|
+
|
|
5
|
+
describe("uso_verifier", () => {
|
|
6
|
+
// Configure the client to use the local cluster.
|
|
7
|
+
anchor.setProvider(anchor.AnchorProvider.env());
|
|
8
|
+
|
|
9
|
+
const program = anchor.workspace.UsoVerifier as Program<UsoVerifier>;
|
|
10
|
+
|
|
11
|
+
it("Is initialized!", async () => {
|
|
12
|
+
// Add your test here.
|
|
13
|
+
const tx = await program.methods.verifySetup().rpc();
|
|
14
|
+
console.log("Your transaction signature", tx);
|
|
15
|
+
});
|
|
16
|
+
});
|
package/bin/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xaidenlabs/uso",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.36",
|
|
4
4
|
"description": "Universal Solana Orchestrator - A one-command setup tool for Solana and Anchor development environments on Windows, macOS, and Linux.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"uso": "bin/index.js"
|
|
7
7
|
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin",
|
|
10
|
+
"src",
|
|
11
|
+
"templates",
|
|
12
|
+
"anchor_program",
|
|
13
|
+
"anchor_project"
|
|
14
|
+
],
|
|
8
15
|
"scripts": {
|
|
9
16
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
10
17
|
},
|
package/src/commands/create.js
CHANGED
|
@@ -35,11 +35,29 @@ const create = async (projectName, options) => {
|
|
|
35
35
|
shell.mkdir('-p', projectPath);
|
|
36
36
|
|
|
37
37
|
const copySpin = spinner(`Copying template files...`).start();
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
|
|
39
|
+
// Iterate and copy to avoid glob issues on Windows
|
|
40
|
+
try {
|
|
41
|
+
const files = fs.readdirSync(templatePath);
|
|
42
|
+
for (const file of files) {
|
|
43
|
+
const src = path.join(templatePath, file);
|
|
44
|
+
const dest = path.join(projectPath, file);
|
|
45
|
+
|
|
46
|
+
// Handle special dotfiles
|
|
47
|
+
if (file === '_gitignore') {
|
|
48
|
+
shell.cp(src, path.join(projectPath, '.gitignore'));
|
|
49
|
+
} else if (file === '_prettierignore') {
|
|
50
|
+
shell.cp(src, path.join(projectPath, '.prettierignore'));
|
|
51
|
+
} else {
|
|
52
|
+
shell.cp('-R', src, dest);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
} catch (e) {
|
|
56
|
+
copySpin.fail(`Failed to copy templates from ${templatePath}`);
|
|
57
|
+
log.error(e.message);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
|
|
43
61
|
copySpin.succeed("Template files copied.");
|
|
44
62
|
|
|
45
63
|
shell.cd(projectPath);
|
|
@@ -148,7 +166,29 @@ const create = async (projectName, options) => {
|
|
|
148
166
|
log.warn("⚠️ Proceeding without frontend.");
|
|
149
167
|
} else {
|
|
150
168
|
cloneSpin.succeed("Frontend template injected into ./app");
|
|
151
|
-
|
|
169
|
+
// Remove .git from the frontend so it's part of the main repo
|
|
170
|
+
// Robust removal for EBUSY
|
|
171
|
+
try {
|
|
172
|
+
const gitDir = path.join('app', '.git');
|
|
173
|
+
if (fs.existsSync(gitDir)) {
|
|
174
|
+
// Retry loop for Windows file locking
|
|
175
|
+
let retries = 5;
|
|
176
|
+
while (retries > 0) {
|
|
177
|
+
try {
|
|
178
|
+
shell.rm('-rf', gitDir);
|
|
179
|
+
if (!fs.existsSync(gitDir)) break;
|
|
180
|
+
} catch (e) { /* ignore errors during retry */ }
|
|
181
|
+
retries--;
|
|
182
|
+
if (retries > 0) shell.exec('powershell -Command "Start-Sleep -Milliseconds 500"');
|
|
183
|
+
}
|
|
184
|
+
// If shelljs fails, try node fs
|
|
185
|
+
if (fs.existsSync(gitDir)) {
|
|
186
|
+
fs.rmSync(gitDir, { recursive: true, force: true });
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
} catch (e) {
|
|
190
|
+
log.warn("⚠️ Could not fully remove app/.git (EBUSY). You may delete it manually.");
|
|
191
|
+
}
|
|
152
192
|
}
|
|
153
193
|
|
|
154
194
|
// 7. Install Dependencies (Optional but nice)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// @ts-ignore - Types generated by `anchor build`
|
|
2
|
+
import * as anchor from "@coral-xyz/anchor";
|
|
3
|
+
import { Program } from "@coral-xyz/anchor";
|
|
4
|
+
import { MyProject } from "../target/types/my_project";
|
|
5
|
+
|
|
6
|
+
describe("my-project", () => {
|
|
7
|
+
// Configure the client to use the local cluster.
|
|
8
|
+
anchor.setProvider(anchor.AnchorProvider.env());
|
|
9
|
+
|
|
10
|
+
const program = anchor.workspace.MyProject as Program<MyProject>;
|
|
11
|
+
|
|
12
|
+
it("Is initialized!", async () => {
|
|
13
|
+
// Add your test here.
|
|
14
|
+
const tx = await program.methods.initialize().rpc();
|
|
15
|
+
console.log("Your transaction signature", tx);
|
|
16
|
+
});
|
|
17
|
+
});
|