diff options
Diffstat (limited to 'packages/db')
-rw-r--r-- | packages/db/CHANGELOG.md | 24 | ||||
-rw-r--r-- | packages/db/package.json | 8 | ||||
-rw-r--r-- | packages/db/src/core/cli/commands/link/index.ts | 6 | ||||
-rw-r--r-- | packages/db/src/core/cli/commands/login/index.ts | 6 | ||||
-rw-r--r-- | packages/db/src/core/integration/index.ts | 15 | ||||
-rw-r--r-- | packages/db/test/fixtures/ticketing-example/package.json | 3 | ||||
-rw-r--r-- | packages/db/test/fixtures/ticketing-example/src/layouts/Layout.astro | 4 | ||||
-rw-r--r-- | packages/db/test/fixtures/ticketing-example/tsconfig.json | 4 | ||||
-rw-r--r-- | packages/db/test/local-prod.test.js | 2 |
9 files changed, 47 insertions, 25 deletions
diff --git a/packages/db/CHANGELOG.md b/packages/db/CHANGELOG.md index 911a61cbe..e8165782c 100644 --- a/packages/db/CHANGELOG.md +++ b/packages/db/CHANGELOG.md @@ -1,5 +1,29 @@ # @astrojs/db +## 0.14.0-beta.2 + +### Patch Changes + +- [#12073](https://github.com/withastro/astro/pull/12073) [`acf264d`](https://github.com/withastro/astro/commit/acf264d8c003718cda5a0b9ce5fb7ac1cd6641b6) Thanks [@bluwy](https://github.com/bluwy)! - Replaces `ora` with `yocto-spinner` + +- Updated dependencies [[`acf264d`](https://github.com/withastro/astro/commit/acf264d8c003718cda5a0b9ce5fb7ac1cd6641b6)]: + - @astrojs/studio@0.1.2-beta.0 + +## 0.14.0-beta.1 + +### Minor Changes + +- [#12008](https://github.com/withastro/astro/pull/12008) [`5608338`](https://github.com/withastro/astro/commit/560833843c6d3ce2b6c6c473ec4ae70e744bf255) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Welcome to the Astro 5 beta! This release has no changes from the latest alpha of this package, but it does bring us one step closer to the final, stable release. + + Starting from this release, no breaking changes will be introduced unless absolutely necessary. + + To learn how to upgrade, check out the [Astro v5.0 upgrade guide in our beta docs site](https://5-0-0-beta.docs.astro.build/en/guides/upgrade-to/v5/). + +### Patch Changes + +- Updated dependencies []: + - @astrojs/studio@0.1.1 + ## 0.14.3 ### Patch Changes diff --git a/packages/db/package.json b/packages/db/package.json index 3a737cc16..031f6628d 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -1,6 +1,6 @@ { "name": "@astrojs/db", - "version": "0.14.3", + "version": "0.14.0-beta.2", "description": "Add libSQL and Astro Studio support to your Astro site", "license": "MIT", "repository": { @@ -78,9 +78,9 @@ "kleur": "^4.1.5", "nanoid": "^5.0.9", "open": "^10.1.0", - "ora": "^8.1.1", "prompts": "^2.4.2", "yargs-parser": "^21.1.1", + "yocto-spinner": "^0.1.0", "zod": "^3.23.8" }, "devDependencies": { @@ -90,7 +90,7 @@ "astro": "workspace:*", "astro-scripts": "workspace:*", "cheerio": "1.0.0", - "typescript": "^5.7.2", - "vite": "^5.4.11" + "typescript": "^5.6.3", + "vite": "^6.0.1" } } diff --git a/packages/db/src/core/cli/commands/link/index.ts b/packages/db/src/core/cli/commands/link/index.ts index 525dacce0..bd07b7824 100644 --- a/packages/db/src/core/cli/commands/link/index.ts +++ b/packages/db/src/core/cli/commands/link/index.ts @@ -9,8 +9,8 @@ import { } from '@astrojs/studio'; import { slug } from 'github-slugger'; import { bgRed, cyan } from 'kleur/colors'; -import ora from 'ora'; import prompts from 'prompts'; +import yoctoSpinner from 'yocto-spinner'; import { safeFetch } from '../../../../runtime/utils.js'; import type { Result } from '../../../utils.js'; @@ -33,7 +33,7 @@ export async function cmd() { const workspaceId = await promptWorkspace(sessionToken); const newProjectName = await promptNewProjectName(); const newProjectRegion = await promptNewProjectRegion(); - const spinner = ora('Creating new project...').start(); + const spinner = yoctoSpinner({ text: 'Creating new project...' }).start(); const newProjectData = await createNewProject({ workspaceId, name: newProjectName, @@ -42,7 +42,7 @@ export async function cmd() { // TODO(fks): Actually listen for project creation before continuing // This is just a dumb spinner that roughly matches database creation time. await new Promise((r) => setTimeout(r, 4000)); - spinner.succeed('Project created!'); + spinner.success('Project created!'); return await linkProject(newProjectData.id); } } diff --git a/packages/db/src/core/cli/commands/login/index.ts b/packages/db/src/core/cli/commands/login/index.ts index 61f7e0275..0b0979384 100644 --- a/packages/db/src/core/cli/commands/login/index.ts +++ b/packages/db/src/core/cli/commands/login/index.ts @@ -5,9 +5,9 @@ import type { AstroConfig } from 'astro'; import { listen } from 'async-listen'; import { cyan } from 'kleur/colors'; import open from 'open'; -import ora from 'ora'; import prompt from 'prompts'; import type { Arguments } from 'yargs-parser'; +import yoctoSpinner from 'yocto-spinner'; import type { DBConfig } from '../../../types.js'; const isWebContainer = @@ -48,9 +48,9 @@ export async function cmd({ console.log(cyan(loginUrl.href)); console.log(`If something goes wrong, copy-and-paste the URL into your browser.`); open(loginUrl.href); - const spinner = ora('Waiting for confirmation...'); + const spinner = yoctoSpinner({ text: 'Waiting for confirmation...' }); session = await promise; - spinner.succeed('Successfully logged in'); + spinner.success('Successfully logged in'); } await mkdir(new URL('.', SESSION_LOGIN_FILE), { recursive: true }); diff --git a/packages/db/src/core/integration/index.ts b/packages/db/src/core/integration/index.ts index 6debb4017..b96765870 100644 --- a/packages/db/src/core/integration/index.ts +++ b/packages/db/src/core/integration/index.ts @@ -4,7 +4,7 @@ import { dirname } from 'node:path'; import { fileURLToPath } from 'node:url'; import type { ManagedAppToken } from '@astrojs/studio'; import { LibsqlError } from '@libsql/client'; -import type { AstroConfig, AstroIntegration } from 'astro'; +import type { AstroIntegration } from 'astro'; import { blue, yellow } from 'kleur/colors'; import { type HMRPayload, @@ -59,14 +59,13 @@ function astroDBIntegration(): AstroIntegration { }; let command: 'dev' | 'build' | 'preview' | 'sync'; - let output: AstroConfig['output'] = 'server'; + let finalBuildOutput: string; return { name: 'astro:db', hooks: { 'astro:config:setup': async ({ updateConfig, config, command: _command, logger }) => { command = _command; root = config.root; - output = config.output; if (command === 'preview') return; @@ -105,9 +104,11 @@ function astroDBIntegration(): AstroIntegration { }, }); }, - 'astro:config:done': async ({ config, injectTypes }) => { + 'astro:config:done': async ({ config, injectTypes, buildOutput }) => { if (command === 'preview') return; + finalBuildOutput = buildOutput; + // TODO: refine where we load tables // @matthewp: may want to load tables by path at runtime const { dbConfig, dependencies, integrationSeedPaths } = await resolveDbConfig(config); @@ -159,11 +160,7 @@ function astroDBIntegration(): AstroIntegration { }, 100); }, 'astro:build:start': async ({ logger }) => { - if ( - !connectToRemote && - !databaseFileEnvDefined() && - (output === 'server' || output === 'hybrid') - ) { + if (!connectToRemote && !databaseFileEnvDefined() && finalBuildOutput === 'server') { const message = `Attempting to build without the --remote flag or the ASTRO_DATABASE_FILE environment variable defined. You probably want to pass --remote to astro build.`; const hint = 'Learn more connecting to Studio: https://docs.astro.build/en/guides/astro-db/#connect-to-astro-studio'; diff --git a/packages/db/test/fixtures/ticketing-example/package.json b/packages/db/test/fixtures/ticketing-example/package.json index 7883d3b7c..765d46e2c 100644 --- a/packages/db/test/fixtures/ticketing-example/package.json +++ b/packages/db/test/fixtures/ticketing-example/package.json @@ -4,7 +4,6 @@ "version": "0.0.1", "scripts": { "dev": "pnpm astro dev", - "start": "astro dev", "build": "astro check && astro build", "preview": "astro preview", "astro": "astro" @@ -13,7 +12,7 @@ "@astrojs/check": "^0.9.4", "@astrojs/db": "workspace:*", "@astrojs/node": "^8.3.4", - "@astrojs/react": "^3.6.3", + "@astrojs/react": "workspace:*", "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", "astro": "workspace:*", diff --git a/packages/db/test/fixtures/ticketing-example/src/layouts/Layout.astro b/packages/db/test/fixtures/ticketing-example/src/layouts/Layout.astro index 114216824..482f10462 100644 --- a/packages/db/test/fixtures/ticketing-example/src/layouts/Layout.astro +++ b/packages/db/test/fixtures/ticketing-example/src/layouts/Layout.astro @@ -1,5 +1,5 @@ --- -import { ViewTransitions } from 'astro:transitions'; +import { ClientRouter } from 'astro:transitions'; import 'open-props/normalize'; import 'open-props/style'; @@ -19,7 +19,7 @@ const { title } = Astro.props; <link rel="icon" type="image/svg+xml" href="/favicon.svg" /> <meta name="generator" content={Astro.generator} /> <title>{title}</title> - <ViewTransitions handleForms /> + <ClientRouter handleForms /> </head> <body> <slot /> diff --git a/packages/db/test/fixtures/ticketing-example/tsconfig.json b/packages/db/test/fixtures/ticketing-example/tsconfig.json index b7243b92c..2424dae7d 100644 --- a/packages/db/test/fixtures/ticketing-example/tsconfig.json +++ b/packages/db/test/fixtures/ticketing-example/tsconfig.json @@ -3,5 +3,7 @@ "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "react" - } + }, + "include": [".astro/types.d.ts", "**/*"], + "exclude": ["dist"] } diff --git a/packages/db/test/local-prod.test.js b/packages/db/test/local-prod.test.js index 6513aeb08..9bd56dad0 100644 --- a/packages/db/test/local-prod.test.js +++ b/packages/db/test/local-prod.test.js @@ -71,7 +71,7 @@ describe('astro:db local database', () => { it('should throw during the build for hybrid output', async () => { let fixture2 = await loadFixture({ root: new URL('./fixtures/local-prod/', import.meta.url), - output: 'hybrid', + output: 'static', adapter: testAdapter(), }); |