@stacksjs/cms 0.74.1 → 0.74.3
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/tests/setup.js +2 -2
- package/package.json +8 -8
package/dist/tests/setup.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{existsSync,unlinkSync}from"node:fs";import{tmpdir}from"node:os";import{join}from"node:path";import process from"node:process";const DB_PATH=join(tmpdir(),`stacks-cms-${process.pid}.sqlite`);process.env.DB_CONNECTION="sqlite";process.env.DB_DATABASE_PATH=DB_PATH;process.env.APP_ENV="testing";const{acquireDbConfigLock,db,ensureDatabaseConfigLoaded,initializeDbConfig}=await import("@stacksjs/database")
|
|
1
|
+
import{existsSync,unlinkSync}from"node:fs";import{tmpdir}from"node:os";import{join}from"node:path";import process from"node:process";const DB_PATH=join(tmpdir(),`stacks-cms-${process.pid}.sqlite`);process.env.DB_CONNECTION="sqlite";process.env.DB_DATABASE_PATH=DB_PATH;process.env.APP_ENV="testing";const{acquireDbConfigLock,db,ensureDatabaseConfigLoaded,initializeDbConfig}=await import("@stacksjs/database");async function forceConfig(){const releaseDbConfigLock=await acquireDbConfigLock();try{await ensureDatabaseConfigLoaded();initializeDbConfig({app:{env:"testing"},database:{default:"sqlite",connections:{sqlite:{database:DB_PATH,prefix:""}}}})}finally{releaseDbConfigLock()}}for(const suffix of["","-wal","-shm"])if(existsSync(`${DB_PATH}${suffix}`))unlinkSync(`${DB_PATH}${suffix}`);await forceConfig();await db.unsafe(`
|
|
2
2
|
CREATE TABLE IF NOT EXISTS categorizables (
|
|
3
3
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
4
4
|
name VARCHAR(255) NOT NULL,
|
|
@@ -97,4 +97,4 @@ import{existsSync,unlinkSync}from"node:fs";import{tmpdir}from"node:os";import{jo
|
|
|
97
97
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
98
98
|
updated_at TIMESTAMP
|
|
99
99
|
)
|
|
100
|
-
`).execute();const tableNames=["categorizables","categorizable_models","taggable_models","pages","page_revisions","redirects","menus","menu_items"];export async function refreshDatabase(){await forceConfig();for(const table of tableNames)await db.unsafe(`DELETE FROM ${table}`).execute()}process.on("exit",()=>{for(const suffix of["","-wal","-shm"])try{if(existsSync(`${DB_PATH}${suffix}`))unlinkSync(`${DB_PATH}${suffix}`)}catch{}
|
|
100
|
+
`).execute();const tableNames=["categorizables","categorizable_models","taggable_models","pages","page_revisions","redirects","menus","menu_items"];export async function refreshDatabase(){await forceConfig();for(const table of tableNames)await db.unsafe(`DELETE FROM ${table}`).execute()}process.on("exit",()=>{for(const suffix of["","-wal","-shm"])try{if(existsSync(`${DB_PATH}${suffix}`))unlinkSync(`${DB_PATH}${suffix}`)}catch{}});
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/cms",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.74.
|
|
5
|
+
"version": "0.74.3",
|
|
6
6
|
"description": "Stacks cms utilities.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -58,14 +58,14 @@
|
|
|
58
58
|
"prepublishOnly": "bun run build"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@stacksjs/database": "0.74.
|
|
62
|
-
"@stacksjs/error-handling": "0.74.
|
|
63
|
-
"@stacksjs/orm": "0.74.
|
|
64
|
-
"@stacksjs/path": "0.74.
|
|
65
|
-
"@stacksjs/sites": "0.74.
|
|
66
|
-
"@stacksjs/slug": "0.74.
|
|
61
|
+
"@stacksjs/database": "0.74.3",
|
|
62
|
+
"@stacksjs/error-handling": "0.74.3",
|
|
63
|
+
"@stacksjs/orm": "0.74.3",
|
|
64
|
+
"@stacksjs/path": "0.74.3",
|
|
65
|
+
"@stacksjs/sites": "0.74.3",
|
|
66
|
+
"@stacksjs/slug": "0.74.3",
|
|
67
67
|
"@stacksjs/stx": "^0.2.253",
|
|
68
|
-
"@stacksjs/validation": "0.74.
|
|
68
|
+
"@stacksjs/validation": "0.74.3",
|
|
69
69
|
"ts-slug": "^0.1.0",
|
|
70
70
|
"ts-spreadsheets": "^0.2.0"
|
|
71
71
|
},
|