diff --git a/.changeset/new-frontend-system-default.md b/.changeset/new-frontend-system-default.md new file mode 100644 index 0000000000..eeef22ce35 --- /dev/null +++ b/.changeset/new-frontend-system-default.md @@ -0,0 +1,5 @@ +--- +'@backstage/create-app': minor +--- + +**BREAKING**: The new frontend system is now the default template when creating a new Backstage app. The previous `--next` flag has been replaced with a `--legacy` flag that can be used to create an app using the old frontend system instead. diff --git a/docs/frontend-system/building-apps/01-index.md b/docs/frontend-system/building-apps/01-index.md index cfef547afc..bedf42033f 100644 --- a/docs/frontend-system/building-apps/01-index.md +++ b/docs/frontend-system/building-apps/01-index.md @@ -20,10 +20,10 @@ The create-app CLI requires Node.js Active LTS Release, see the [prerequisites d ```sh # The command bellow creates a Backstage App inside the current folder. # The name of the app-folder is the name that was provided when prompted. -npx @backstage/create-app@latest --next +npx @backstage/create-app@latest ``` -Using the `--next` flag will result in a Backstage app using the New Frontend System which will be further explained in the sections below. +This will create a Backstage app using the new frontend system which will be further explained in the sections below. ## The app instance diff --git a/docs/frontend-system/building-apps/08-migrating.md b/docs/frontend-system/building-apps/08-migrating.md index 9f18067a55..d0e05d98ae 100644 --- a/docs/frontend-system/building-apps/08-migrating.md +++ b/docs/frontend-system/building-apps/08-migrating.md @@ -899,7 +899,7 @@ It's encouraged that once you switch over to using the new frontend system, that This practice is also pretty important early on, as it's going to help you get familiar with the practices of the new frontend system. -When creating a new Backstage app with `create-app` and using the `--next` flag you'll automatically get these choices in the `yarn new` command, but if you want to bring these templates to an older app, you can add the following to your root `package.json`: +When creating a new Backstage app with `create-app` you'll automatically get these choices in the `yarn new` command, but if you want to bring these templates to an older app, you can add the following to your root `package.json`: ```json { diff --git a/packages/create-app/cli-report.md b/packages/create-app/cli-report.md index 88e19d05c6..f9286a628c 100644 --- a/packages/create-app/cli-report.md +++ b/packages/create-app/cli-report.md @@ -8,7 +8,7 @@ Usage: backstage-create-app [options] Options: - --next + --legacy --path [directory] --skip-install --template-path [directory] diff --git a/packages/create-app/src/createApp.test.ts b/packages/create-app/src/createApp.test.ts index c38186b1d8..a032f9bb3b 100644 --- a/packages/create-app/src/createApp.test.ts +++ b/packages/create-app/src/createApp.test.ts @@ -69,7 +69,7 @@ describe('command entrypoint', () => { expect(tryInitGitRepositoryMock).toHaveBeenCalled(); expect(templatingMock).toHaveBeenCalled(); expect(templatingMock.mock.lastCall?.[0]).toEqual( - findOwnPaths(__dirname).resolve('templates/default-app'), + findOwnPaths(__dirname).resolve('templates/next-app'), ); expect(templatingMock.mock.lastCall?.[1]).toContain( path.join(tmpdir(), 'MyApp'), @@ -85,20 +85,20 @@ describe('command entrypoint', () => { expect(tryInitGitRepositoryMock).toHaveBeenCalled(); expect(templatingMock).toHaveBeenCalled(); expect(templatingMock.mock.lastCall?.[0]).toEqual( - findOwnPaths(__dirname).resolve('templates/default-app'), + findOwnPaths(__dirname).resolve('templates/next-app'), ); expect(templatingMock.mock.lastCall?.[1]).toEqual('myDirectory'); expect(buildAppMock).toHaveBeenCalled(); }); - it('should call expected tasks when `--next` is supplied', async () => { - const cmd = { next: true } as unknown as Command; + it('should call expected tasks when `--legacy` is supplied', async () => { + const cmd = { legacy: true } as unknown as Command; await createApp(cmd); expect(checkAppExistsMock).toHaveBeenCalled(); expect(tryInitGitRepositoryMock).toHaveBeenCalled(); expect(templatingMock).toHaveBeenCalled(); expect(templatingMock.mock.lastCall?.[0]).toEqual( - findOwnPaths(__dirname).resolve('templates/next-app'), + findOwnPaths(__dirname).resolve('templates/default-app'), ); expect(templatingMock.mock.lastCall?.[1]).toContain( path.join(tmpdir(), 'MyApp'), diff --git a/packages/create-app/src/createApp.ts b/packages/create-app/src/createApp.ts index 64db2e52ab..68c27d3a1a 100644 --- a/packages/create-app/src/createApp.ts +++ b/packages/create-app/src/createApp.ts @@ -63,12 +63,12 @@ export default async (opts: OptionValues): Promise => { }, ]); - // Pick the built-in template based on the --next flag + // Pick the built-in template based on the --legacy flag /* eslint-disable-next-line no-restricted-syntax */ const ownPaths = findOwnPaths(__dirname); - const builtInTemplate = opts.next - ? ownPaths.resolve('templates/next-app') - : ownPaths.resolve('templates/default-app'); + const builtInTemplate = opts.legacy + ? ownPaths.resolve('templates/default-app') + : ownPaths.resolve('templates/next-app'); // Use `--template-path` argument as template when specified. Otherwise, use the default template. const templateDir = opts.templatePath diff --git a/packages/create-app/src/index.ts b/packages/create-app/src/index.ts index cfa448aa1a..ff3ef29b18 100644 --- a/packages/create-app/src/index.ts +++ b/packages/create-app/src/index.ts @@ -31,7 +31,7 @@ const main = (argv: string[]) => { .name('backstage-create-app') .version(version) .description('Creates a new app in a new directory or specified path') - .option('--next', 'Use the next generation of the app template') + .option('--legacy', 'Use the legacy version of the app template') .option( '--path [directory]', 'Location to store the app defaulting to a new folder with the app name',