Skip to content

Commit

Permalink
0.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
VirtualButFake committed Dec 5, 2024
1 parent e394d91 commit 7d08a8f
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 51 deletions.
21 changes: 20 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
# 0.4.3

Fixes

- Remove unneeded dependencies
- Fix bug where error type was not properly detected when exiting the CLI via a `PromptExitError`

# 0.4.2

Updates

- Bump react-lua version to `17.2.1`

Fixes

- Fix inquirer bug where answers were not recorded correctly
- Fix "none" option in UI framework selection causing an error
- Fixed bug where Storybook option would be asked if no UI framework is selected

# 0.4.1

Fixes

- Make generated `README.md` for Fusion 0.3 games/packages use the correct version instead of 0.2
- Make generated `README.md` for Fusion 0.3 games/packages use the correct version instead of 0.2

# 0.4.0

Expand Down
36 changes: 3 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "create-roblox",
"version": "0.4.1",
"version": "0.4.3",
"description": "A dynamic template CLI for Roblox projects.",
"main": "dist/index.cjs",
"type": "module",
"scripts": {
"build": "npx esbuild src/index.ts --bundle --outdir=dist --platform=node --minify --out-extension:.js=.cjs",
"start": "npm run build && node dist/index.cjs",
"dev": "npx esbuild src/index.ts --bundle --outdir=dist --platform=node --watch",
"dev": "esbuild src/index.ts --bundle --outdir=dist --platform=node --out-extension:.js=.cjs && node dist/index.cjs",
"npm:prepare": "npm run build",
"ci:eslint": "eslint src/**/*.ts --config eslint.config.ts --flag unstable_ts_config",
"ci:prettier": "prettier --check ./src",
Expand All @@ -29,16 +29,16 @@
"dependencies": {
"@inquirer/prompts": "^7.1.0",
"@types/fs-extra": "11.0.4",
"@types/inquirer": "9.0.7",
"chalk": "5.3.0",
"eslint-plugin-unused-imports": "^4.1.4",
"fs-extra": "11.2.0",
"jiti": "^2.4.1",
"typescript-eslint": "^8.17.0",
"winston": "3.11.0",
"winston-error-format": "^3.0.1"
},
"devDependencies": {
"jiti": "^2.4.1",
"typescript-eslint": "^8.17.0",
"eslint-plugin-unused-imports": "^4.1.4",
"@eslint/js": "^9.16.0",
"@typescript-eslint/eslint-plugin": "8.17.0",
"eslint": "9.16.0",
"prettier": "3.3.3"
Expand Down
15 changes: 10 additions & 5 deletions src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint no-var: 0, no-control-regex: 0 */
import { Answers } from 'inquirer';
import { input, select, checkbox, confirm, Separator } from '@inquirer/prompts';

type Question = {
Expand Down Expand Up @@ -83,20 +82,26 @@ async function ask(question: Question): Promise<Answer> {
}
}

async function queue(questions: Questions): Promise<Answers> {
async function queue(questions: Questions): Promise<{
[key: string]: Answer;
}> {
for (let question of questions) {
if ('question' in question) {
question = question as ReactiveQuestion;

const answer = await ask(question.question);
Object.assign(answers, answer);
Object.assign(answers, {
[question.question.name]: answer,
});

if (question.completed) {
await question.completed(answer[Object.keys(answer)[0]]);
await question.completed(answer);
}
} else {
const answer = await ask(question);
Object.assign(answers, answer);
Object.assign(answers, {
[question.name]: answer,
});
}
}

Expand Down
5 changes: 2 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import scripts from './scripts/index.js';
import fsExtra from 'fs-extra/esm';
import path from 'path';
import { executeCommand } from './utils.js';
import { ExitPromptError } from '@inquirer/core';

async function main() {
const oldPath = process.cwd();
Expand Down Expand Up @@ -72,8 +71,8 @@ main()
.then(() => {
logger.info('Project setup complete!');
})
.catch((err) => {
if (err instanceof ExitPromptError) {
.catch((err: Error) => {
if (err.name.includes('ExitPrompt')) {
logger.debug('Project setup canceled.');
process.exit(0);
}
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ProjectSettings } from '../cli.js';
import { writeTemplate } from '../utils.js';

export default async function (settings: ProjectSettings) {
if (!settings.ui) return;
if (!settings.ui || settings.ui == 'none') return;
if (!settings.storybookPlugin) return;

await writeTemplate(
Expand Down
4 changes: 2 additions & 2 deletions src/template/frontend/ui/react/.template.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"packages": [
"react = \"jsdotlua/react@17.1.0\"",
"react-roblox = \"jsdotlua/react-roblox@17.1.0\""
"react = \"jsdotlua/react@17.2.1\"",
"react-roblox = \"jsdotlua/react-roblox@17.2.1\""
]
}

0 comments on commit 7d08a8f

Please sign in to comment.