@projectinvicta/nails 3.0.8 → 3.0.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@projectinvicta/nails",
3
- "version": "3.0.8",
3
+ "version": "3.0.10",
4
4
  "description": "A node.js webserver scaffold",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -1,9 +1,7 @@
1
- import { type DbConfig } from '@projectinvicta/nails';
2
-
3
1
  let DB_ADDRESS = process.env.NAILS_SQLITE_DB_FILE;
4
2
  if (!DB_ADDRESS) DB_ADDRESS = 'sqlite://' + import.meta.dirname + '/development.db';
5
3
 
6
- const db: DbConfig = {
4
+ const db = {
7
5
  /** Sequelize Connector */
8
6
  address: process.env.NAILS_RELEASE_STAGE == 'test'
9
7
  ? 'sqlite::memory:'
@@ -1,6 +1,4 @@
1
- import { type MimesConfig } from '@projectinvicta/nails';
2
-
3
- const mimes: MimesConfig = {
1
+ const mimes = {
4
2
  html: {
5
3
  type: 'page',
6
4
  contentType: 'text/html'
@@ -1,6 +1,4 @@
1
- import { type RoutesConfig } from '@projectinvicta/nails';
2
-
3
- const routes: RoutesConfig = [
1
+ const routes = [
4
2
  // Routes the root request to index.html, as well as all other requests to static
5
3
  ['get', "/", {controller: 'home'}],
6
4
  // Routes all requests starting with /public as static requests to the public folder.
@@ -1,8 +1,8 @@
1
1
  // Initializes application before server starts
2
2
  // Each of these is REQUIRED
3
- import routes from './routes.js';
4
- import mimes from './mimes.js';
5
- import db from './db.js';
3
+ import routes from './routes.ts';
4
+ import mimes from './mimes.ts';
5
+ import db from './db.ts';
6
6
 
7
7
  import path from 'node:path';
8
8
  var SERVER_ROOT = path.resolve(import.meta.dirname, '..');
@@ -9,6 +9,10 @@ export const schema = {
9
9
 
10
10
  export default class User extends Model {};
11
11
 
12
- export async function defer() {
12
+ export async function afterInitialize() {
13
+ // Add hooks here
14
+ }
15
+
16
+ export async function afterInitializeAll() {
13
17
  await User.hasMany(Dog);
14
18
  }
@@ -8,6 +8,6 @@ export const schema = {
8
8
 
9
9
  export default class Dog extends Model {};
10
10
 
11
- export async function finalize() {
11
+ export async function afterInitializeAll() {
12
12
  Dog.belongsTo(Owner);
13
13
  }
@@ -7,6 +7,6 @@ export const schema = {
7
7
  };
8
8
  export default class Owner extends Model {};
9
9
 
10
- export async function defer() {
10
+ export async function afterInitializeAll() {
11
11
  Owner.hasMany(Dog);
12
12
  }