@coreframe/scripts 0.1.36 → 0.1.37
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/db/local-postgres.d.ts +2 -0
- package/dist/db/reset.js +1 -1
- package/dist/runner.js +1 -1
- package/package.json +2 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DrizzleExecutor } from "./client.js";
|
|
1
2
|
import { CoreframeConfig } from "../config.js";
|
|
2
3
|
import { createProjectPostgresDrizzleDatabase } from "./project.js";
|
|
3
4
|
import { LocalPostgresEnv, PostgresOutputTarget } from "local-postgres";
|
|
@@ -8,6 +9,7 @@ type LocalPostgresDb = Awaited<ReturnType<typeof createProjectPostgresDrizzleDat
|
|
|
8
9
|
$client: {
|
|
9
10
|
end(): Promise<void>;
|
|
10
11
|
};
|
|
12
|
+
transaction<Result>(run: (database: DrizzleExecutor) => Promise<Result>): Promise<Result>;
|
|
11
13
|
select(selection: Record<string, unknown>): {
|
|
12
14
|
from(table: unknown): {
|
|
13
15
|
where(condition: unknown): {
|
package/dist/db/reset.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createLocalPostgresDb as e,startProjectPostgres as t}from"./local-postgres.js";import n from"../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/usingCtx.js";import{sql as r}from"drizzle-orm";async function i({env:i=process.env}={}){try{var a=n();let o=await e({env:a.a(await t({env:i})).env});try{await o.execute(r`drop schema if exists public cascade`),await
|
|
2
|
+
import{createLocalPostgresDb as e,startProjectPostgres as t}from"./local-postgres.js";import n from"../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/usingCtx.js";import{sql as r}from"drizzle-orm";async function i({env:i=process.env}={}){try{var a=n();let o=await e({env:a.a(await t({env:i})).env});try{await o.transaction(async e=>{await e.execute(r`drop schema if exists public cascade`),await e.execute(r`drop schema if exists drizzle cascade`),await e.execute(r`create schema public`)}),console.log(`Reset local PostgreSQL schema`)}finally{await o.$client.end()}}catch(e){a.e=e}finally{await a.d()}}export{i as resetLocalDb};
|
package/dist/runner.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{join as e}from"node:path";import{tmpdir as t}from"node:os";import*as n from"cmd-ts";import{mkdtempSync as r,writeFileSync as i}from"node:fs";import{inspect as a}from"node:util";function o(n,{formatMessage:a,temporaryDirectory:o=t(),write:s=e=>console.error(e)}={}){let u=c(n,a);try{let t=e(r(e(o,`coreframe-error-`)),`error.log`);return i(t,`${l(n)}\n`,{mode:384}),s(`Error: ${
|
|
1
|
+
import{join as e}from"node:path";import{tmpdir as t}from"node:os";import*as n from"cmd-ts";import{mkdtempSync as r,writeFileSync as i}from"node:fs";import{inspect as a}from"node:util";function o(n,{formatMessage:a,temporaryDirectory:o=t(),write:s=e=>console.error(e)}={}){let u=f(n),d=m(c(n,a),u);try{let t=e(r(e(o,`coreframe-error-`)),`error.log`);return i(t,`${m(l(n),u)}\n`,{mode:384}),s(`Error: ${d}\nFull diagnostic: ${t}`),t}catch{s(`Error: ${d}\nThe full diagnostic could not be written to the temporary directory.`);return}}function s(e,t={}){let r=typeof e==`function`?e:()=>n.run(n.binary(e),process.argv),i=!1,a=e=>{i||(i=!0,o(e,t),process.exit(1))};process.once(`uncaughtException`,a),process.once(`unhandledRejection`,a),Promise.resolve().then(r).catch(a)}function c(e,t){try{return t?.(e)||(e instanceof Error?e.message:String(e)).split(/\r?\n/,1)[0]||`Unknown error`}catch{return`Unknown error`}}function l(e){try{let t=u(e);if(!(e instanceof Error)||!d(t))return a(t,{customInspect:!1,depth:10});let n=typeof t.stack==`string`?t.stack:`${e.name}: ${e.message}`;return delete t.name,delete t.message,delete t.stack,`${n}${Reflect.ownKeys(t).length?`\n${a(t,{customInspect:!1,depth:10})}`:``}`}catch{return`The thrown value could not be inspected.`}}function u(e,t=new WeakMap){if((typeof e!=`object`||!e)&&typeof e!=`function`)return e;let n=e,r=t.get(n);if(r)return r;if(typeof e==`function`)return`[Function${e.name?`: ${e.name}`:``}]`;let i=Array.isArray(e)?[]:{};t.set(n,i),e instanceof Error&&(i.name=e.name,i.message=e.message,i.stack=e.stack??`${e.name}: ${e.message}`);for(let r of Reflect.ownKeys(n)){if(typeof r!=`string`||r.toLowerCase()===`env`||Array.isArray(e)&&r===`length`||e instanceof Error&&(r===`name`||r===`message`||r===`stack`))continue;let a=Object.getOwnPropertyDescriptor(n,r);!a||!(`value`in a)||Object.defineProperty(i,r,{configurable:!0,enumerable:!0,value:u(a.value,t),writable:!0})}return i}function d(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function f(e,t=new WeakSet){let n=new Set;function r(e){if((typeof e!=`object`||!e)&&typeof e!=`function`)return;let i=e;if(!t.has(i)){t.add(i);for(let e of Reflect.ownKeys(i)){if(typeof e!=`string`)continue;let t=Object.getOwnPropertyDescriptor(i,e);!t||!(`value`in t)||(e.toLowerCase()===`env`?p(t.value,n):r(t.value))}}}try{r(e)}catch{}return n}function p(e,t){if(!(typeof e!=`object`||!e))for(let n of Reflect.ownKeys(e)){let r=Object.getOwnPropertyDescriptor(e,n);r&&`value`in r&&typeof r.value==`string`&&r.value&&t.add(r.value)}}function m(e,t){return[...t].sort((e,t)=>t.length-e.length).reduce((e,t)=>e.replaceAll(t,`[redacted environment value]`),e)}export{o as reportCliError,s as run};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coreframe/scripts",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.37",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/airlock-labs/coreframe.git",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"cross-keychain": "1.1.0",
|
|
28
28
|
"drizzle-orm": "1.0.0-rc.4",
|
|
29
29
|
"import-meta-resolve": "^4.2.0",
|
|
30
|
-
"local-postgres": "0.3.
|
|
30
|
+
"local-postgres": "0.3.1",
|
|
31
31
|
"nano-spawn": "^2.1.0",
|
|
32
32
|
"procband": "^0.3.7",
|
|
33
33
|
"tinyglobby": "^0.2.17",
|