@astrojs/db 0.13.2-alpha.1 → 0.14.0-beta.1
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.
|
@@ -45,14 +45,13 @@ function astroDBIntegration() {
|
|
|
45
45
|
inProgress: false
|
|
46
46
|
};
|
|
47
47
|
let command;
|
|
48
|
-
let
|
|
48
|
+
let finalBuildOutput;
|
|
49
49
|
return {
|
|
50
50
|
name: "astro:db",
|
|
51
51
|
hooks: {
|
|
52
52
|
"astro:config:setup": async ({ updateConfig, config, command: _command, logger }) => {
|
|
53
53
|
command = _command;
|
|
54
54
|
root = config.root;
|
|
55
|
-
output = config.output;
|
|
56
55
|
if (command === "preview") return;
|
|
57
56
|
let dbPlugin = void 0;
|
|
58
57
|
const args = parseArgs(process.argv.slice(3));
|
|
@@ -87,8 +86,9 @@ function astroDBIntegration() {
|
|
|
87
86
|
}
|
|
88
87
|
});
|
|
89
88
|
},
|
|
90
|
-
"astro:config:done": async ({ config, injectTypes }) => {
|
|
89
|
+
"astro:config:done": async ({ config, injectTypes, buildOutput }) => {
|
|
91
90
|
if (command === "preview") return;
|
|
91
|
+
finalBuildOutput = buildOutput;
|
|
92
92
|
const { dbConfig, dependencies, integrationSeedPaths } = await resolveDbConfig(config);
|
|
93
93
|
tables.get = () => dbConfig.tables;
|
|
94
94
|
seedFiles.get = () => integrationSeedPaths;
|
|
@@ -133,7 +133,7 @@ function astroDBIntegration() {
|
|
|
133
133
|
}, 100);
|
|
134
134
|
},
|
|
135
135
|
"astro:build:start": async ({ logger }) => {
|
|
136
|
-
if (!connectToRemote && !databaseFileEnvDefined() &&
|
|
136
|
+
if (!connectToRemote && !databaseFileEnvDefined() && finalBuildOutput === "server") {
|
|
137
137
|
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.`;
|
|
138
138
|
const hint = "Learn more connecting to Studio: https://docs.astro.build/en/guides/astro-db/#connect-to-astro-studio";
|
|
139
139
|
throw new AstroDbError(message, hint);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrojs/db",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0-beta.1",
|
|
4
4
|
"description": "Add libSQL and Astro Studio support to your Astro site",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -83,9 +83,9 @@
|
|
|
83
83
|
"@types/yargs-parser": "^21.0.3",
|
|
84
84
|
"cheerio": "1.0.0",
|
|
85
85
|
"typescript": "^5.5.4",
|
|
86
|
-
"vite": "^5.4.
|
|
87
|
-
"astro
|
|
88
|
-
"astro": "
|
|
86
|
+
"vite": "^5.4.3",
|
|
87
|
+
"astro": "5.0.0-beta.1",
|
|
88
|
+
"astro-scripts": "0.0.14"
|
|
89
89
|
},
|
|
90
90
|
"scripts": {
|
|
91
91
|
"types:virtual": "tsc -p ./tsconfig.virtual.json",
|