Skip to content

Commit e849b4f

Browse files
authored
Merge pull request #7 from oncyberio/dev
chore: prepare repo for public release
2 parents d43a8be + 47b7c5d commit e849b4f

13 files changed

Lines changed: 158 additions & 112 deletions

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Thanks for your interest in contributing to oncyberio! This guide will help you
1313
### Setup
1414

1515
```bash
16-
git clone <repo-url>
16+
git clone https://github.com/oncyberio/awe.git
1717
cd awe
1818
pnpm install
1919
```

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ This scaffolds a full Next.js project with the oncyberio engine pre-configured,
7676
### Monorepo Development
7777

7878
```bash
79-
git clone <repo-url>
79+
git clone https://github.com/oncyberio/awe.git
8080
cd awe
8181
pnpm install
8282
```

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "awe",
33
"private": true,
4+
"packageManager": "pnpm@10.10.0",
45
"engines": {
56
"node": ">=20.9.0"
67
},

packages/create-oncyber-app/README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Scaffold a new 3D game powered by the oncyberio engine.
77
```bash
88
npx create-oncyber-app my-game
99
cd my-game
10-
npm run dev
10+
pnpm dev
1111
```
1212

1313
Open [http://localhost:3000](http://localhost:3000) to see your game, or [http://localhost:3000/_studio](http://localhost:3000/_studio) for the visual editor.
@@ -18,34 +18,33 @@ Open [http://localhost:3000](http://localhost:3000) to see your game, or [http:/
1818
npx create-oncyber-app [project-name] [options]
1919
```
2020

21-
When run without a project name, the CLI starts in interactive mode and prompts for a name and package manager.
21+
When run without a project name, the CLI starts in interactive mode and prompts for a name and template. The generated project uses pnpm.
2222

2323
## Options
2424

2525
| Flag | Description |
2626
| --- | --- |
27-
| `--use-npm` | Use npm as the package manager |
28-
| `--use-pnpm` | Use pnpm as the package manager |
29-
| `--use-yarn` | Use yarn as the package manager |
3027
| `--skip-install` | Skip automatic dependency installation |
3128
| `--skip-git` | Skip git repository initialization |
3229
| `--help` | Show the help message |
3330
| `--version` | Show the CLI version |
3431

32+
The CLI uses pnpm automatically. If pnpm is missing, it will try to enable it with Corepack.
33+
3534
## Examples
3635

3736
```bash
38-
# Interactive mode — prompts for name and package manager
37+
# Interactive mode — prompts for name and template
3938
npx create-oncyber-app
4039

4140
# Create a project with a specific name
4241
npx create-oncyber-app my-game
4342

44-
# Use pnpm and skip git init
45-
npx create-oncyber-app my-game --use-pnpm --skip-git
43+
# Skip git init
44+
npx create-oncyber-app my-game --skip-git
4645

4746
# Scaffold only — no install, no git
48-
npx create-oncyber-app my-game --use-npm --skip-install --skip-git
47+
npx create-oncyber-app my-game --skip-install --skip-git
4948
```
5049

5150
## What's Included
@@ -102,7 +101,7 @@ my-game/
102101

103102
## Next Steps
104103

105-
1. Run `npm run dev` to start the dev server
104+
1. Run `pnpm dev` to start the dev server
106105
2. Open [http://localhost:3000](http://localhost:3000) to see your game
107106
3. Open [http://localhost:3000/_studio](http://localhost:3000/_studio) to edit the scene visually
108107
4. Edit `src/components/game-script.tsx` to add game logic

packages/create-oncyber-app/src/__tests__/cli-integration.test.ts

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,23 @@ describe("CLI integration", { timeout: 30000 }, () => {
115115
expect(rootPkg.scripts["dev"]).toBeDefined();
116116
});
117117

118+
it("writes pnpm workspace scripts for generated projects", () => {
119+
runCli("pnpm-script-test --template starter --skip-install --skip-git", tmpDir);
120+
121+
const rootPkg = JSON.parse(
122+
fs.readFileSync(path.join(tmpDir, "pnpm-script-test", "package.json"), "utf-8"),
123+
);
124+
125+
expect(rootPkg.packageManager).toBe("pnpm@10.10.0");
126+
expect(rootPkg.workspaces).toEqual(["packages/*", "apps/*"]);
127+
expect(rootPkg.scripts["dev"]).toBe(
128+
"pnpm --filter pnpm-script-test dev",
129+
);
130+
expect(rootPkg.scripts["build"]).toBe(
131+
"pnpm --filter pnpm-script-test build",
132+
);
133+
});
134+
118135
it("removes examples/* from pnpm-workspace.yaml and keeps apps/*", () => {
119136
runCli("workspace-test --template starter --use-pnpm --skip-install --skip-git", tmpDir);
120137

@@ -147,6 +164,26 @@ describe("CLI integration", { timeout: 30000 }, () => {
147164
expect(stdout).toContain("nonexistent");
148165
});
149166

167+
it("fails fast when --use-npm is passed", () => {
168+
const { exitCode, stdout } = runCli(
169+
"bad-package-manager --use-npm --skip-install --skip-git",
170+
tmpDir,
171+
);
172+
173+
expect(exitCode).not.toBe(0);
174+
expect(stdout).toContain("pnpm only");
175+
});
176+
177+
it("fails fast when --use-yarn is passed", () => {
178+
const { exitCode, stdout } = runCli(
179+
"bad-package-manager --use-yarn --skip-install --skip-git",
180+
tmpDir,
181+
);
182+
183+
expect(exitCode).not.toBe(0);
184+
expect(stdout).toContain("pnpm only");
185+
});
186+
150187
it("initializes git repo when --skip-git is not passed", () => {
151188
runCli("git-test --template starter --use-pnpm --skip-install", tmpDir);
152189

@@ -184,11 +221,11 @@ describe("CLI integration", { timeout: 30000 }, () => {
184221
expect(exitCode).toBe(0);
185222
expect(stdout).toContain("Usage:");
186223
expect(stdout).toContain("--template");
187-
expect(stdout).toContain("--use-npm");
188-
expect(stdout).toContain("--use-pnpm");
189-
expect(stdout).toContain("--use-yarn");
190224
expect(stdout).toContain("--skip-install");
191225
expect(stdout).toContain("--skip-git");
226+
expect(stdout).toContain("Uses pnpm automatically");
227+
expect(stdout).not.toContain("--use-npm");
228+
expect(stdout).not.toContain("--use-yarn");
192229
expect(stdout).toContain("update");
193230
expect(stdout).toContain("Templates:");
194231
expect(stdout).toContain("starter");

packages/create-oncyber-app/src/__tests__/detect-package-manager.test.ts

Lines changed: 0 additions & 41 deletions
This file was deleted.

packages/create-oncyber-app/src/__tests__/parse-args.test.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,11 @@ describe("parseArgs", () => {
2525
expect(result.projectName).toBe("my-game");
2626
});
2727

28-
it("parses --use-npm flag", () => {
29-
const result = parseArgs(["node", "create-oncyber-app", "--use-npm"]);
30-
expect(result.packageManager).toBe("npm");
31-
});
32-
3328
it("parses --use-pnpm flag", () => {
3429
const result = parseArgs(["node", "create-oncyber-app", "--use-pnpm"]);
3530
expect(result.packageManager).toBe("pnpm");
3631
});
3732

38-
it("parses --use-yarn flag", () => {
39-
const result = parseArgs(["node", "create-oncyber-app", "--use-yarn"]);
40-
expect(result.packageManager).toBe("yarn");
41-
});
42-
4333
it("parses --skip-install flag", () => {
4434
const result = parseArgs(["node", "create-oncyber-app", "--skip-install"]);
4535
expect(result.skipInstall).toBe(true);
@@ -117,11 +107,11 @@ describe("parseArgs", () => {
117107
"create-oncyber-app",
118108
"--skip-git",
119109
"my-game",
120-
"--use-npm",
110+
"--use-pnpm",
121111
]);
122112
expect(result.projectName).toBe("my-game");
123113
expect(result.skipGit).toBe(true);
124-
expect(result.packageManager).toBe("npm");
114+
expect(result.packageManager).toBe("pnpm");
125115
});
126116

127117
it("parses --local flag", () => {

packages/create-oncyber-app/src/detect-package-manager.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)