Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
85341a5
Add support for writing CLI executable into sync metadata
kingston Jun 24, 2025
8ea1533
Add command to list generators to project-builder-cli
kingston Jun 24, 2025
14d9997
Update button component
kingston Jun 24, 2025
8c37626
Convert Alert component
kingston Jun 24, 2025
7239561
Fix plural template
kingston Jun 24, 2025
8d0e23d
Convert card component
kingston Jun 24, 2025
450effe
Change from spinner to loader component
kingston Jun 24, 2025
06deb8a
Add label/scroll-area/input components
kingston Jun 24, 2025
3e296dd
Add combobox + select + textarea
kingston Jun 24, 2025
8c8f5af
Add Input field support
kingston Jun 24, 2025
cd850b6
Add sidebar layout
kingston Jun 24, 2025
9ee6a6f
Add sonner package
kingston Jun 24, 2025
95c2282
Switch to sonner for toasts
kingston Jun 24, 2025
e335c76
Remove react-hot-toast from generation
kingston Jun 24, 2025
b537c0e
Add navigation menu support
kingston Jun 24, 2025
72f2e6f
Remove tailwind form
kingston Jun 25, 2025
5590b95
Upgrade to Tailwind 4
kingston Jun 25, 2025
0aebf76
Run prettier on templates
kingston Jun 25, 2025
e22c9b5
Rename admin-layout component
kingston Jun 25, 2025
c5928be
Update admin layout generator to use sidebar layout
kingston Jun 25, 2025
7fe5ef6
Remove sidebar component
kingston Jun 25, 2025
48a6194
Remove back button usage
kingston Jun 25, 2025
841a802
Add checkbox/checkbox-fieldselect-field
kingston Jun 25, 2025
ce950f6
Add updated form fields
kingston Jun 25, 2025
463f80a
Add error display and update empty display/errorable loader
kingston Jun 25, 2025
4d4dde8
Adjust enum input to use select field controller
kingston Jun 25, 2025
f6783ed
Add calendar component
kingston Jun 25, 2025
b9f5900
Add DatePickerField
kingston Jun 25, 2025
fd0ba32
Support date picker field and convert generated components
kingston Jun 25, 2025
a34e08e
Add new DateTimePickerField
kingston Jun 25, 2025
43d9873
Add DateTimePickerField
kingston Jun 25, 2025
21fe29c
Switch date picker fields to use strings instead of dates
kingston Jun 25, 2025
45a00ed
Convert table component
kingston Jun 25, 2025
5f7f380
Use strings for date picker/date time picker fields
kingston Jun 25, 2025
a3d5596
Fix sorting of barrel exports
kingston Jun 25, 2025
89ad125
Remove AlertIcon/Spinner/BackButton/ButtonGroup
kingston Jun 25, 2025
507c397
Use Combobox instead of ReactSelectInput
kingston Jun 25, 2025
f872c65
Convert useConfirmDialog
kingston Jun 25, 2025
8ce9b0f
Add circular progress bar support
kingston Jun 25, 2025
e22818b
Add circular progress bar
kingston Jun 25, 2025
bd2e79b
Update notfoundcard
kingston Jun 26, 2025
4d4dc8a
Switch out references to LinkButton
kingston Jun 26, 2025
03d6d30
Rename require-auth to kebab case
kingston Jun 26, 2025
be3b2c6
Fix up embedded list/object field
kingston Jun 26, 2025
9fba9c0
Switch to Bundler for tsconfig.node.json
kingston Jun 26, 2025
c335807
Fix up tsconfig properly
kingston Jun 26, 2025
8f9d661
Fix up tsconfigs for tsconfig.app/node
kingston Jun 27, 2025
53891c2
Implement unified templates command instead of multiple commands
kingston Jun 27, 2025
8e4190e
Fix up delete template
kingston Jun 27, 2025
2d3e82d
Fix up file input field
kingston Jun 27, 2025
9550500
Remove TextInput and TextAreaInput
kingston Jun 27, 2025
a28c65a
Remove remaining inputs
kingston Jun 27, 2025
f7692d0
Remove form item / form label
kingston Jun 27, 2025
d4b2b27
Remove remaining unused components
kingston Jun 27, 2025
ac8b494
Rename error-boundary
kingston Jun 27, 2025
9906d09
Clean up react component exports
kingston Jun 27, 2025
d28825e
Add simple padding to admin layout
kingston Jun 27, 2025
31ebd12
Add changesets
kingston Jun 27, 2025
6ad106a
Fix TS error with tests
kingston Jun 27, 2025
a47a95a
Small fix for test
kingston Jun 27, 2025
e7bbd5b
Run test generate
kingston Jun 27, 2025
220168b
Fix casing of alert/button/card/table
kingston Jun 27, 2025
e70bdd1
Format switch with prettier correctly
kingston Jun 27, 2025
cfd3d1d
Regenerate the files
kingston Jun 27, 2025
594006c
Attempt to fix styling again...
kingston Jun 27, 2025
e920b9c
Try fixing install for e2e tests
kingston Jun 27, 2025
74cf415
Disable prettier checks
kingston Jun 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .changeset/better-ways-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@baseplate-dev/react-generators': minor
---

Refresh all UI components generated by React generators to use ShadCN components
5 changes: 5 additions & 0 deletions .changeset/lazy-pianos-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@baseplate-dev/project-builder-cli': patch
---

Refactor template commands to allow listing/deleting of templates from CLI
5 changes: 5 additions & 0 deletions .changeset/lucky-banks-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@baseplate-dev/react-generators': patch
---

Match tsconfig for React projects to newer Vite templates with tsconfig.app and tsconfig.node
5 changes: 5 additions & 0 deletions .changeset/seven-paws-tell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@baseplate-dev/sync': patch
---

Fix issues with how renames are handled
7 changes: 7 additions & 0 deletions .changeset/tough-ducks-fall.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@baseplate-dev/project-builder-server': patch
'@baseplate-dev/project-builder-cli': patch
'@baseplate-dev/sync': patch
---

Add command to list available generators with templates
2 changes: 1 addition & 1 deletion .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
cache: 'pnpm'

- name: Install Dependencies
run: pnpm install --frozen-lockfile --filter @baseplate-dev/project-builder-test... --filter @baseplate-dev/project-builder-cli... --filter @baseplate-dev/root
run: pnpm install --frozen-lockfile

- name: Get Playwright version
id: get-playwright-version
Expand Down
4 changes: 4 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ save-prefix=""
link-workspace-packages=true
# Defaults to saving as workspace:*
save-workspace-protocol=rolling

# Hoist prettier-plugin-packagejson to allow husky to prettify all files
public-hoist-pattern[]=prettier-plugin-packagejson
public-hoist-pattern[]=prettier-plugin-tailwindcss
1 change: 1 addition & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"group": "build",
"problemMatcher": {
"base": "$tsc-watch",
"owner": "typescript",
"pattern": {
"regexp": "^//:watch:tsc:root: (.+):(\\d+):(\\d+) - (error|warning|info) TS(\\d+): (.*)$",
"file": 1,
Expand Down
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Note: Make sure to run the commands in the sub-packages if only modifying files
- If a particular interface or type is not exported, change the file so it is exported
- We use the prefer using nullish coalescing operator (`??`) ESLint rule instead of a logical or (`||`), as it is a safer operator
- Prefer barrel exports e.g. export \* from './foo.js' instead of individual named exports
- Use console.info/warn/error instead of console.log

## UI Development Guidelines

Expand Down
5 changes: 0 additions & 5 deletions knip.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ export default {
'packages/fastify-generators': {
entry: ['src/index.{ts,tsx}'],
project: 'src/**/*.{ts,tsx}',
ignoreDependencies: [
// Tricky bug where @tailwlindcss/forms is being used by prettier-plugin-tailwindcss
// so must be included to not bug the build
'@tailwindcss/forms',
],
},
'packages/project-builder-web': {
entry: ['src/index.{ts,tsx}'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ const [setupTask, typescriptSetupProvider, typescriptSetupValuesProvider] =
exclude: t.array<string>(['**/node_modules', '**/dist', '**/lib']),
references: t.array<TypescriptConfigReference>(),
extraSections: t.array<Record<string, unknown>>(),
tsconfigPath: t.scalar<string>('tsconfig.json'),
}),
{
prefix: 'typescript',
Expand Down Expand Up @@ -206,7 +207,7 @@ export const typescriptGenerator = createGenerator({

writeJsonToBuilder(builder, {
id: 'tsconfig',
destination: 'tsconfig.json',
destination: typescriptConfig.tsconfigPath,
contents: {
compilerOptions,
include,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ describe('typescriptGenerator', () => {
exclude: ['**/node_modules', '**/dist'],
references: [],
extraSections: [],
tsconfigPath: 'tsconfig.json',
};

const testTemplateFile = createTsTemplateFile({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { existsSync } from 'node:fs';
import path from 'node:path';
import { ResolverFactory } from 'oxc-resolver';

Expand All @@ -7,9 +8,16 @@ import { ResolverFactory } from 'oxc-resolver';
* @returns A resolver factory for the given working directory.
*/
export function getResolverFactory(workingDirectory: string): ResolverFactory {
// Slight hack to support tsconfig.app.json instead of tsconfig.json
const tsconfigAppExists = existsSync(
path.join(workingDirectory, 'tsconfig.app.json'),
);
const tsconfigPath = tsconfigAppExists
? path.join(workingDirectory, 'tsconfig.app.json')
: path.join(workingDirectory, 'tsconfig.json');
return new ResolverFactory({
tsconfig: {
configFile: path.join(workingDirectory, 'tsconfig.json'),
configFile: tsconfigPath,
},
conditionNames: ['node', 'require', 'types'],
extensions: ['.ts', '.tsx', '.d.ts', '.js', '.jsx', '.json', '.node'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ export function capitalizeString(str: string) {

import { A } from "test";



export function capitalizeString(str: string) {
A();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export function replaceImportDeclarationsInSourceFile(
const child = children[0];
return !Node.isStringLiteral(child);
});
const insertionPosition = firstNonDirectiveNode?.getNonWhitespaceStart() ?? 0;
const insertionPosition = firstNonDirectiveNode?.getFullStart() ?? 0;

// special case shebang to remove the first line if it's a shebang
const firstNonDirectiveNodeHasShebang = firstNonDirectiveNode
Expand All @@ -175,6 +175,9 @@ export function replaceImportDeclarationsInSourceFile(
if (beforeImportsWriter) {
beforeImportsWriter(writer);
}
if (insertionPosition > 0) {
writer.blankLineIfLastNot();
}
writeGroupedImportDeclarationsWithCodeBlockWriter(
writer,
newImportDeclarations,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,13 @@ const x = A();`,
it('should preserve client directives', () => {
// Arrange
sourceFile.replaceWithText(
`"use client";
import React from "react";
`'use client';

import type React from 'react';

import { Toaster as Sonner } from 'sonner';

import { buttonVariants } from '@src/styles/button.js';

const x = A();`,
);
Expand All @@ -528,7 +533,7 @@ const x = A();`,

// Assert
expect(sourceFile.getFullText()).toBe(
'"use client";\n' + 'import React from "react";\n\nconst x = A();',
"'use client';\n\n" + 'import React from "react";\n\n\nconst x = A();',
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -581,3 +581,6 @@ export const TsCodeUtils = {

// Shortcut for template function
export const tsTemplate = TsCodeUtils.template.bind(TsCodeUtils);

export const tsTemplateWithImports =
TsCodeUtils.templateWithImports.bind(TsCodeUtils);
1 change: 0 additions & 1 deletion packages/fastify-generators/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
},
"devDependencies": {
"@baseplate-dev/tools": "workspace:*",
"@tailwindcss/forms": "0.5.9",
"concurrently": "9.0.1",
"cpx2": "catalog:",
"eslint": "catalog:",
Expand Down
2 changes: 1 addition & 1 deletion packages/project-builder-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"clean": "rm -rf ./dist",
"dev": "tsx watch --tsconfig ./tsconfig.app.json --exclude /**/node_modules/** -r dotenv/config -C development ./src/cli.ts",
"dev:serve": "pnpm dev serve",
"extract:templates": "pnpm start extract-templates",
"extract:templates": "pnpm start templates extract",
"lint": "eslint .",
"prettier:check": "prettier --check .",
"prettier:write": "prettier -w .",
Expand Down
1 change: 1 addition & 0 deletions packages/project-builder-cli/src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export function addBuildCommand(program: Command): void {
logger,
context,
userConfig,
cliFilePath: process.argv[1],
});
});
}
55 changes: 0 additions & 55 deletions packages/project-builder-cli/src/commands/extract-templates.ts

This file was deleted.

1 change: 1 addition & 0 deletions packages/project-builder-cli/src/commands/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export async function serveWebServer(
builtInPlugins,
userConfig,
skipCommands,
cliFilePath: process.argv[1],
});

const fastifyInstance = await startWebServer({
Expand Down
Loading