postgresdk 0.6.15 → 0.6.16
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.
- package/dist/cli.js +5 -4
- package/dist/emit-tests.d.ts +1 -1
- package/dist/index.js +5 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
@@ -3214,8 +3214,9 @@ volumes:
|
|
3214
3214
|
postgres_data:
|
3215
3215
|
`;
|
3216
3216
|
}
|
3217
|
-
function emitTestScript(framework = "vitest") {
|
3217
|
+
function emitTestScript(framework = "vitest", testDirPath) {
|
3218
3218
|
const runCommand = framework === "bun" ? "bun test" : framework;
|
3219
|
+
const pathToRoot = testDirPath ? testDirPath.split("/").filter((p) => p && p !== ".").map(() => "..").join("/") : "../..";
|
3219
3220
|
return `#!/bin/bash
|
3220
3221
|
# Test Runner Script
|
3221
3222
|
#
|
@@ -3234,10 +3235,10 @@ set -e
|
|
3234
3235
|
|
3235
3236
|
SCRIPT_DIR="$( cd "$( dirname "\${BASH_SOURCE[0]}" )" && pwd )"
|
3236
3237
|
|
3237
|
-
# PROJECT_ROOT is the root of your project
|
3238
|
+
# PROJECT_ROOT is the root of your project
|
3238
3239
|
# Use this to reference files from your project root
|
3239
3240
|
# Example: $PROJECT_ROOT/src/server.ts
|
3240
|
-
PROJECT_ROOT="$( cd "$SCRIPT_DIR
|
3241
|
+
PROJECT_ROOT="$( cd "$SCRIPT_DIR/${pathToRoot}" && pwd )"
|
3241
3242
|
|
3242
3243
|
echo "\uD83D\uDCCD Project root: $PROJECT_ROOT"
|
3243
3244
|
echo "\uD83D\uDCCD Test directory: $SCRIPT_DIR"
|
@@ -4193,7 +4194,7 @@ async function generate(configPath) {
|
|
4193
4194
|
});
|
4194
4195
|
files.push({
|
4195
4196
|
path: join(testDir, "run-tests.sh"),
|
4196
|
-
content: emitTestScript(testFramework)
|
4197
|
+
content: emitTestScript(testFramework, originalTestDir)
|
4197
4198
|
});
|
4198
4199
|
files.push({
|
4199
4200
|
path: join(testDir, ".gitignore"),
|
package/dist/emit-tests.d.ts
CHANGED
@@ -22,4 +22,4 @@ export declare function emitDockerCompose(): string;
|
|
22
22
|
/**
|
23
23
|
* Generate test runner script
|
24
24
|
*/
|
25
|
-
export declare function emitTestScript(framework?: "vitest" | "jest" | "bun"): string;
|
25
|
+
export declare function emitTestScript(framework?: "vitest" | "jest" | "bun", testDirPath?: string): string;
|
package/dist/index.js
CHANGED
@@ -2951,8 +2951,9 @@ volumes:
|
|
2951
2951
|
postgres_data:
|
2952
2952
|
`;
|
2953
2953
|
}
|
2954
|
-
function emitTestScript(framework = "vitest") {
|
2954
|
+
function emitTestScript(framework = "vitest", testDirPath) {
|
2955
2955
|
const runCommand = framework === "bun" ? "bun test" : framework;
|
2956
|
+
const pathToRoot = testDirPath ? testDirPath.split("/").filter((p) => p && p !== ".").map(() => "..").join("/") : "../..";
|
2956
2957
|
return `#!/bin/bash
|
2957
2958
|
# Test Runner Script
|
2958
2959
|
#
|
@@ -2971,10 +2972,10 @@ set -e
|
|
2971
2972
|
|
2972
2973
|
SCRIPT_DIR="$( cd "$( dirname "\${BASH_SOURCE[0]}" )" && pwd )"
|
2973
2974
|
|
2974
|
-
# PROJECT_ROOT is the root of your project
|
2975
|
+
# PROJECT_ROOT is the root of your project
|
2975
2976
|
# Use this to reference files from your project root
|
2976
2977
|
# Example: $PROJECT_ROOT/src/server.ts
|
2977
|
-
PROJECT_ROOT="$( cd "$SCRIPT_DIR
|
2978
|
+
PROJECT_ROOT="$( cd "$SCRIPT_DIR/${pathToRoot}" && pwd )"
|
2978
2979
|
|
2979
2980
|
echo "\uD83D\uDCCD Project root: $PROJECT_ROOT"
|
2980
2981
|
echo "\uD83D\uDCCD Test directory: $SCRIPT_DIR"
|
@@ -3930,7 +3931,7 @@ async function generate(configPath) {
|
|
3930
3931
|
});
|
3931
3932
|
files.push({
|
3932
3933
|
path: join(testDir, "run-tests.sh"),
|
3933
|
-
content: emitTestScript(testFramework)
|
3934
|
+
content: emitTestScript(testFramework, originalTestDir)
|
3934
3935
|
});
|
3935
3936
|
files.push({
|
3936
3937
|
path: join(testDir, ".gitignore"),
|