auramaxx 0.1.6 → 0.1.7
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.
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Create, play, and publish from your terminal.
|
|
|
7
7
|
|
|
8
8
|
> Alpha status: AuraJS is still in alpha and not ready for production use.
|
|
9
9
|
|
|
10
|
-

|
|
11
11
|
|
|
12
12
|
Website: [aurajs.gg](https://aurajs.gg)
|
|
13
13
|
|
|
@@ -39,8 +39,6 @@ auramaxx play auracraft
|
|
|
39
39
|
npx auracraft play
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-

|
|
43
|
-
|
|
44
42
|
## Fork a Game
|
|
45
43
|
|
|
46
44
|
```bash
|
package/package.json
CHANGED
|
@@ -95,12 +95,16 @@ async function resolveGameName(initialName: string | null): Promise<string> {
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
async function resolveTemplate(initialTemplate: string | null): Promise<string> {
|
|
98
|
+
async function resolveTemplate(initialTemplate: string | null, options: { allowPrompt?: boolean } = {}): Promise<string> {
|
|
99
99
|
const normalized = normalizeTemplate(initialTemplate);
|
|
100
100
|
if (normalized) {
|
|
101
101
|
return normalized;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
if (options.allowPrompt === false) {
|
|
105
|
+
return '2d';
|
|
106
|
+
}
|
|
107
|
+
|
|
104
108
|
const selected = await promptSelect(' Starter template', TEMPLATE_OPTIONS, '2d');
|
|
105
109
|
if (selected !== 'custom') {
|
|
106
110
|
return selected;
|
|
@@ -136,7 +140,9 @@ async function main() {
|
|
|
136
140
|
printSection('New AuraJS Game', 'AuraMaxx styling + prompts, delegated to AuraJS scaffolder.');
|
|
137
141
|
|
|
138
142
|
const name = await resolveGameName(parsed.name);
|
|
139
|
-
const template = await resolveTemplate(parsed.template
|
|
143
|
+
const template = await resolveTemplate(parsed.template, {
|
|
144
|
+
allowPrompt: !parsed.name,
|
|
145
|
+
});
|
|
140
146
|
const invocationCwd = resolveInvocationCwd();
|
|
141
147
|
|
|
142
148
|
printSection('Scaffolding', `Delegating to AuraJS (${template})...`);
|
|
@@ -3,6 +3,7 @@ import { rmSync } from 'fs';
|
|
|
3
3
|
import { pathToFileURL } from 'url';
|
|
4
4
|
|
|
5
5
|
import { printBanner, printSection, paint, ANSI } from '../lib/theme';
|
|
6
|
+
import { resolveInvocationCwd } from '../lib/aurajs-project';
|
|
6
7
|
import {
|
|
7
8
|
buildPublishedGameLaunchEnv,
|
|
8
9
|
installVerifiedGamePackage,
|
|
@@ -32,6 +33,7 @@ export function buildForkPlan(argv: string[]): ForkCommandPlan {
|
|
|
32
33
|
|
|
33
34
|
export async function main(argv: string[] = process.argv.slice(2)) {
|
|
34
35
|
const plan = buildForkPlan(argv);
|
|
36
|
+
const invocationCwd = resolveInvocationCwd();
|
|
35
37
|
|
|
36
38
|
if (plan.help || !plan.name) {
|
|
37
39
|
printBanner('FORK');
|
|
@@ -57,7 +59,10 @@ export async function main(argv: string[] = process.argv.slice(2)) {
|
|
|
57
59
|
let install: Awaited<ReturnType<typeof installVerifiedGamePackage>> | null = null;
|
|
58
60
|
try {
|
|
59
61
|
install = await installVerifiedGamePackage(plan);
|
|
60
|
-
const env = buildPublishedGameLaunchEnv(process.env
|
|
62
|
+
const env = buildPublishedGameLaunchEnv(process.env, {
|
|
63
|
+
AURA_INVOKE_CWD: invocationCwd,
|
|
64
|
+
AURAMAXX_CLI_AVAILABLE: '1',
|
|
65
|
+
});
|
|
61
66
|
execFileSync(process.execPath, [install.binAbsolutePath, ...plan.forwardedArgs], {
|
|
62
67
|
stdio: 'inherit',
|
|
63
68
|
cwd: install.packageRoot,
|
|
@@ -409,6 +409,7 @@ export async function main(argv: string[] = process.argv.slice(2)) {
|
|
|
409
409
|
{
|
|
410
410
|
...(plan.forwardedArgs[0] === 'join' ? { AURA_GAME_JOIN_MODE: 'play' } : {}),
|
|
411
411
|
AURAMAXX_CLI_AVAILABLE: '1',
|
|
412
|
+
AURA_INVOKE_CWD: invocationCwd,
|
|
412
413
|
},
|
|
413
414
|
);
|
|
414
415
|
progress.update(4, 'Launching game', plan.forwardedArgs[0] || 'play');
|