@projectinvicta/nails 3.0.14 → 3.2.2
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/.github/workflows/npm-publish.yml +33 -0
- package/.github/workflows/release.yml +64 -0
- package/README.md +72 -10
- package/bin/lib/init.js +63 -32
- package/bin/test/test_init.sh +28 -20
- package/dist/Nails.d.ts +13 -6
- package/dist/Nails.js +36 -44
- package/dist/Nails.js.map +1 -1
- package/dist/Server.d.ts +31 -0
- package/dist/Server.js +193 -0
- package/dist/Server.js.map +1 -0
- package/dist/types.d.ts +6 -0
- package/lib/Nails.ts +48 -51
- package/lib/Server.ts +216 -0
- package/lib/types.ts +12 -2
- package/package.json +3 -2
- package/templates/default/bin/console.js +17 -0
- package/templates/default/config/db.js +1 -1
- package/templates/default/package-lock.json +2726 -4217
- package/templates/default/package.json +19 -6
- package/templates/default/spec/User.test.js +1 -1
- package/templates/default/src/app.jsx +7 -3
- package/templates/mcp/bin/console.js +17 -0
- package/templates/mcp/bin/promote.sh +20 -0
- package/templates/mcp/bin/rollout.sh +74 -0
- package/templates/mcp/bin/server.js +6 -0
- package/templates/mcp/bin/start.sh +16 -0
- package/templates/mcp/common/readme_fetcher.js +4 -0
- package/templates/mcp/config/db.js +11 -0
- package/templates/mcp/config/mimes.js +40 -0
- package/templates/mcp/config/routes.js +20 -0
- package/templates/mcp/config/service.js +45 -0
- package/templates/mcp/config/ssl/certificate.pem +22 -0
- package/templates/mcp/config/ssl/csr.csr +17 -0
- package/templates/mcp/config/ssl/key.pem +28 -0
- package/templates/mcp/config/ssl/private_key.pem +30 -0
- package/templates/mcp/config/ssl/public_key.pem +9 -0
- package/templates/mcp/package-lock.json +8032 -0
- package/templates/mcp/package.json +64 -0
- package/templates/mcp/server/controllers/home_controller.js +34 -0
- package/templates/mcp/server/controllers/mcp_controller.js +87 -0
- package/templates/mcp/server/controllers/users_controller.js +29 -0
- package/templates/mcp/server/models/Dog.js +8 -0
- package/templates/mcp/server/models/User.js +18 -0
- package/templates/mcp/server/views/home/index.ejs +14 -0
- package/templates/mcp/server/views/partials/javascripts.ejs +1 -0
- package/templates/mcp/server/views/partials/reactapp.ejs +1 -0
- package/templates/mcp/server/views/partials/styles.ejs +3 -0
- package/templates/mcp/spec/User.test.js +22 -0
- package/templates/mcp/spec/home_controller.test.js +28 -0
- package/templates/mcp/spec/setupTests.js +0 -0
- package/templates/mcp/vite.config.ts +42 -0
- package/templates/mobile/bin/console.js +17 -0
- package/templates/mobile/bin/promote.sh +20 -0
- package/templates/mobile/bin/rollout.sh +74 -0
- package/templates/mobile/bin/server.js +7 -0
- package/templates/mobile/bin/start.sh +16 -0
- package/templates/mobile/capacitor.config.ts +27 -0
- package/templates/mobile/common/constants.js +6 -0
- package/templates/mobile/common/readme_fetcher.js +4 -0
- package/templates/mobile/config/db.js +19 -0
- package/templates/mobile/config/mimes.js +59 -0
- package/templates/mobile/config/routes.js +38 -0
- package/templates/mobile/config/service.js +45 -0
- package/templates/mobile/config/ssl/certificate.pem +22 -0
- package/templates/mobile/config/ssl/csr.csr +17 -0
- package/templates/mobile/config/ssl/key.pem +28 -0
- package/templates/mobile/config/ssl/private_key.pem +30 -0
- package/templates/mobile/config/ssl/public_key.pem +9 -0
- package/templates/mobile/package.json +72 -0
- package/templates/mobile/src/AboutPage.jsx +9 -0
- package/templates/mobile/src/HomePage.jsx +9 -0
- package/templates/mobile/src/Layout.jsx +78 -0
- package/templates/mobile/src/ReadmePage.jsx +7 -0
- package/templates/mobile/src/app.jsx +33 -0
- package/templates/mobile/src/components/ReadmeLoader.jsx +13 -0
- package/templates/mobile/src/index.html +52 -0
- package/templates/mobile/src/styles/appstyles.css +3 -0
- package/templates/mobile/vite-mobile.config.ts +31 -0
- package/tests/bin/init.spec.js +70 -2
- package/tests/healthz.spec.js +300 -0
- package/tests/nails.spec.js +5 -1
- package/tests/services/integration/config/db.ts +1 -1
- package/tests/services.integration.spec.js +5 -1
- package/vite.config.ts +1 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: Publish to npm
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_call:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v6
|
|
13
|
+
- uses: actions/setup-node@v7
|
|
14
|
+
with:
|
|
15
|
+
node-version: 24
|
|
16
|
+
- run: npm ci
|
|
17
|
+
- run: npm run build
|
|
18
|
+
- run: npm test
|
|
19
|
+
|
|
20
|
+
publish-npm:
|
|
21
|
+
needs: build
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v6
|
|
25
|
+
- uses: actions/setup-node@v7
|
|
26
|
+
with:
|
|
27
|
+
node-version: 24
|
|
28
|
+
registry-url: https://registry.npmjs.org/
|
|
29
|
+
- run: npm ci
|
|
30
|
+
- run: npm publish
|
|
31
|
+
# env:
|
|
32
|
+
# Not needed since setting up trusted publisher
|
|
33
|
+
# NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
name: Auto Release on Version Bump
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
- main
|
|
8
|
+
paths:
|
|
9
|
+
- 'package.json'
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
release:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
permissions:
|
|
15
|
+
contents: write
|
|
16
|
+
outputs:
|
|
17
|
+
version_changed: ${{ steps.check_version.outputs.version_changed }}
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout repository
|
|
21
|
+
uses: actions/checkout@v6
|
|
22
|
+
with:
|
|
23
|
+
fetch-depth: 2
|
|
24
|
+
|
|
25
|
+
- name: Setup Node.js
|
|
26
|
+
uses: actions/setup-node@v7
|
|
27
|
+
with:
|
|
28
|
+
node-version: 'lts/*'
|
|
29
|
+
|
|
30
|
+
- name: Check if version changed
|
|
31
|
+
id: check_version
|
|
32
|
+
run: |
|
|
33
|
+
# Get the current version from package.json
|
|
34
|
+
CURRENT_VERSION=$(node -p "require('./package.json').version")
|
|
35
|
+
|
|
36
|
+
# Get the previous version from the last commit
|
|
37
|
+
PREVIOUS_VERSION=$(git show HEAD~1:package.json | node -p "JSON.parse(require('fs').readFileSync(0, 'utf-8')).version")
|
|
38
|
+
|
|
39
|
+
echo "Previous version: $PREVIOUS_VERSION"
|
|
40
|
+
echo "Current version: $CURRENT_VERSION"
|
|
41
|
+
|
|
42
|
+
if [ "$CURRENT_VERSION" != "$PREVIOUS_VERSION" ]; then
|
|
43
|
+
echo "version_changed=true" >> $GITHUB_OUTPUT
|
|
44
|
+
echo "new_version=v$CURRENT_VERSION" >> $GITHUB_OUTPUT
|
|
45
|
+
else
|
|
46
|
+
echo "version_changed=false" >> $GITHUB_OUTPUT
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
- name: Create GitHub Release
|
|
50
|
+
if: steps.check_version.outputs.version_changed == 'true'
|
|
51
|
+
env:
|
|
52
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
53
|
+
run: |
|
|
54
|
+
gh release create ${{ steps.check_version.outputs.new_version }} \
|
|
55
|
+
--title "${{ steps.check_version.outputs.new_version }}" \
|
|
56
|
+
--generate-notes
|
|
57
|
+
|
|
58
|
+
publish:
|
|
59
|
+
needs: release
|
|
60
|
+
if: needs.release.outputs.version_changed == 'true'
|
|
61
|
+
permissions:
|
|
62
|
+
id-token: write
|
|
63
|
+
contents: read
|
|
64
|
+
uses: ./.github/workflows/npm-publish.yml
|
package/README.md
CHANGED
|
@@ -6,32 +6,68 @@ Nails provides the essential building blocks to get your MVC-style application u
|
|
|
6
6
|
|
|
7
7
|
## Getting Started
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Nails supports multiple template types depending on your needs. The two primary initializations are:
|
|
10
|
+
1. **Default Initialization**: A Node/Express server paired with a React frontend.
|
|
11
|
+
2. **MCP Server Initialization**: A Node/Express server configured as a Model Context Protocol (MCP) server for integration with LLMs (e.g., Claude, Cursor, Gemini).
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
You can create a new Nails project without a global installation using `npx`:
|
|
13
|
+
---
|
|
13
14
|
|
|
15
|
+
### 1. Default Initialization (Server with React Frontend)
|
|
16
|
+
|
|
17
|
+
This template sets up a lightweight Node.js web server and a React frontend built with Vite.
|
|
18
|
+
|
|
19
|
+
#### Using NPX (Recommended)
|
|
20
|
+
Create a new project without global installation:
|
|
14
21
|
```bash
|
|
15
22
|
npx @projectinvicta/nails init <app_name>
|
|
16
23
|
```
|
|
17
24
|
|
|
18
|
-
|
|
19
|
-
Alternatively,
|
|
20
|
-
|
|
25
|
+
#### Using Global Install
|
|
26
|
+
Alternatively, install the package globally and initialize your app:
|
|
21
27
|
```bash
|
|
22
28
|
npm install -g @projectinvicta/nails
|
|
23
|
-
|
|
24
29
|
nails init <app_name>
|
|
25
30
|
```
|
|
26
31
|
|
|
27
|
-
|
|
32
|
+
#### Running the Default App
|
|
33
|
+
After initializing:
|
|
34
|
+
```bash
|
|
35
|
+
cd <app_name>
|
|
36
|
+
npm install
|
|
37
|
+
npm start
|
|
38
|
+
```
|
|
39
|
+
The server will start (default port: `3333` for HTTP, `3334` for HTTPS) and build/serve the React frontend located in the `src` directory.
|
|
40
|
+
|
|
41
|
+
---
|
|
28
42
|
|
|
43
|
+
### 2. MCP Server Initialization (For LLM Integration)
|
|
44
|
+
|
|
45
|
+
This template configures a Nails service specifically for Model Context Protocol (MCP), exposing endpoints that allow LLMs to invoke tools and read resources programmatically.
|
|
46
|
+
|
|
47
|
+
#### Initialization
|
|
48
|
+
Initialize a new MCP project using the `--template mcp` option:
|
|
49
|
+
```bash
|
|
50
|
+
npx @projectinvicta/nails init <app_name> --template mcp
|
|
51
|
+
```
|
|
52
|
+
*(Or globally: `nails init <app_name> --template mcp`)*
|
|
53
|
+
|
|
54
|
+
#### Running the MCP Server
|
|
55
|
+
After initializing:
|
|
29
56
|
```bash
|
|
30
57
|
cd <app_name>
|
|
31
58
|
npm install
|
|
32
59
|
npm start
|
|
33
60
|
```
|
|
34
61
|
|
|
62
|
+
#### How it works
|
|
63
|
+
- The MCP server runs on the standard HTTP port (default: `3333`).
|
|
64
|
+
- **Endpoint**: The default MCP tool/resource endpoint is hosted at `http://localhost:3333/mcp`.
|
|
65
|
+
- **Tools**: By default, it registers an example tool called `generate_random` defined in `server/controllers/mcp_controller.js`.
|
|
66
|
+
- You can extend the MCP server with more tools, resources, and custom logic directly in the controller or by using the `@modelcontextprotocol/sdk`.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
|
|
35
71
|
## Getting to know your Nails service
|
|
36
72
|
|
|
37
73
|
For your convenience, here is a quick outline of the main components of a nails service.
|
|
@@ -370,9 +406,9 @@ If no template engine is specified in the service config, Nails will default to
|
|
|
370
406
|
EJS. Nails will always attempt to autorender your views unless a response has
|
|
371
407
|
already been sent to the client.
|
|
372
408
|
|
|
373
|
-
### React Frontend with Vite
|
|
409
|
+
### React Frontend with Vite (Default Template Only)
|
|
374
410
|
|
|
375
|
-
|
|
411
|
+
For the default template, this project uses Vite to build the frontend React application. The source files for the React app are located in the `src` directory. The server is pre-configured to serve the built React application.
|
|
376
412
|
|
|
377
413
|
To rebuild the frontend application, you can run the following command:
|
|
378
414
|
|
|
@@ -380,6 +416,32 @@ To rebuild the frontend application, you can run the following command:
|
|
|
380
416
|
npm run build
|
|
381
417
|
```
|
|
382
418
|
|
|
419
|
+
## Release Stages & Scripts
|
|
420
|
+
|
|
421
|
+
Nails utilizes the `NAILS_RELEASE_STAGE` environment variable to configure the environment stage under which the application is running.
|
|
422
|
+
|
|
423
|
+
### Console Commands
|
|
424
|
+
Nails supports an interactive REPL console (located in `bin/console.js` for each template) which allows developers to interact with the initialized `nails` instance and all models.
|
|
425
|
+
|
|
426
|
+
* **`npm run console`**: Starts the console in the default `development` stage.
|
|
427
|
+
* **`npm run console:dev`**: Starts the console in the `development` stage.
|
|
428
|
+
* **`npm run console:test`**: Starts the console in the `test` stage.
|
|
429
|
+
* **`npm run console:qa`**: Starts the console in the `qa` stage.
|
|
430
|
+
* **`npm run console:staging`**: Starts the console in the `staging` stage.
|
|
431
|
+
* **`npm run console:prod`**: Starts the console in the `production` stage.
|
|
432
|
+
|
|
433
|
+
### Start Commands
|
|
434
|
+
Similarly, start commands are provided to run the application server under different release stages:
|
|
435
|
+
|
|
436
|
+
* **`npm start`**: Starts the server in the default `development` stage.
|
|
437
|
+
* **`npm run start:dev`**: Starts the server in the `development` stage.
|
|
438
|
+
* **`npm run start:test`**: Starts the server in the `test` stage.
|
|
439
|
+
* **`npm run start:qa`**: Starts the server in the `qa` stage.
|
|
440
|
+
* **`npm run start:staging`**: Starts the server in the `staging` stage.
|
|
441
|
+
* **`npm run start:prod`**: Starts the server in the `production` stage.
|
|
442
|
+
|
|
443
|
+
*(Note: The mobile template also includes `start:mobile` for running the Vite dev server for mobile).*
|
|
444
|
+
|
|
383
445
|
## Testing
|
|
384
446
|
|
|
385
447
|
This project uses [Vitest](https://vitest.dev/) for running tests. All test files are located in the `spec` folder. To run the tests, use the following command:
|
package/bin/lib/init.js
CHANGED
|
@@ -2,27 +2,64 @@
|
|
|
2
2
|
// to the path
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import fs from 'node:fs';
|
|
5
|
-
import {copySync} from 'fs-extra/esm';
|
|
5
|
+
import { copySync } from 'fs-extra/esm';
|
|
6
|
+
import { Command } from 'commander';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
const program = new Command();
|
|
11
|
+
|
|
12
|
+
program
|
|
13
|
+
.name('nails')
|
|
14
|
+
.description('CLI to manage your webapp');
|
|
15
|
+
|
|
16
|
+
program
|
|
17
|
+
.command('init <name>')
|
|
18
|
+
.description('Create a new webapp')
|
|
19
|
+
.option('--template <template>')
|
|
20
|
+
.action((name, options) => {
|
|
21
|
+
console.log('Creating new Nails app:', name, options);
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
// program.command('init <name>')
|
|
26
|
+
// .description('Create a new webapp')
|
|
27
|
+
// .action((name) => {
|
|
28
|
+
|
|
29
|
+
// })
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
var args = process.argv.slice(2);
|
|
7
34
|
|
|
35
|
+
var templateStyle = 'default';
|
|
36
|
+
var templateIndex = args.indexOf('--template');
|
|
37
|
+
if (templateIndex === -1) {
|
|
38
|
+
templateIndex = args.indexOf('-t');
|
|
39
|
+
}
|
|
40
|
+
if (templateIndex !== -1 && args[templateIndex + 1]) {
|
|
41
|
+
templateStyle = args[templateIndex + 1];
|
|
42
|
+
args.splice(templateIndex, 2);
|
|
43
|
+
}
|
|
44
|
+
|
|
8
45
|
var appName = args[0];
|
|
9
46
|
var originalDir = process.cwd();
|
|
10
47
|
|
|
11
48
|
// Make sure an app name was passed
|
|
12
|
-
if (
|
|
49
|
+
if (!appName) {
|
|
13
50
|
console.log("Missing argument for the application name");
|
|
14
51
|
process.exit(1);
|
|
15
52
|
}
|
|
16
53
|
|
|
17
54
|
// check to make sure this is not already a nails app directory
|
|
18
|
-
if (
|
|
55
|
+
if (isNailsApp(originalDir)) {
|
|
19
56
|
console.log("You are already in a Nails Application");
|
|
20
57
|
process.exit(1);
|
|
21
58
|
}
|
|
22
59
|
|
|
23
|
-
createApp(appName);
|
|
60
|
+
createApp(appName, templateStyle);
|
|
24
61
|
|
|
25
|
-
function isNailsApp(
|
|
62
|
+
function isNailsApp(originalDir, directory) {
|
|
26
63
|
var dir = directory || originalDir;
|
|
27
64
|
process.chdir('..');
|
|
28
65
|
var nextDir = process.cwd();
|
|
@@ -33,50 +70,44 @@ function isNailsApp( originalDir, directory ) {
|
|
|
33
70
|
process.chdir(originalDir);
|
|
34
71
|
return nailsAppRootHere;
|
|
35
72
|
} else {
|
|
36
|
-
return nailsAppRootHere || isNailsApp(
|
|
73
|
+
return nailsAppRootHere || isNailsApp(originalDir, nextDir);
|
|
37
74
|
}
|
|
38
75
|
}
|
|
39
76
|
|
|
40
|
-
function createApp(
|
|
41
|
-
|
|
42
|
-
var templateRoot = path.resolve(import.meta.dirname, `../../templates/${templateStyle}`);
|
|
77
|
+
function createApp(name, templateStyle) {
|
|
78
|
+
var templateRoot = path.resolve(import.meta.dirname, `../../templates/${templateStyle}`);
|
|
43
79
|
if (!fs.existsSync(name)) fs.mkdirSync(name);
|
|
44
|
-
fs.open(name + '/NAILS','w', 0o666, function(err, fd) {
|
|
80
|
+
fs.open(name + '/NAILS', 'w', 0o666, function (err, fd) {
|
|
45
81
|
if (err) throw err;
|
|
46
82
|
fs.writeFileSync(name + '/NAILS', '/* This marks the root of the NAILS app */');
|
|
47
83
|
fs.closeSync(fd);
|
|
48
84
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
85
|
+
const foldersToCopy = ['server', 'src', 'public', 'config', 'common', 'spec', 'bin'];
|
|
86
|
+
for (const folder of foldersToCopy) {
|
|
87
|
+
const srcFolder = path.resolve(templateRoot, `./${folder}`);
|
|
88
|
+
if (fs.existsSync(srcFolder)) {
|
|
89
|
+
copySync(srcFolder, name + '/' + folder);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
56
92
|
|
|
57
93
|
checkWrites();
|
|
58
94
|
});
|
|
59
95
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
// fs.writeFileSync( name + '/server.js', data );
|
|
68
|
-
// fs.closeSync(fd);
|
|
69
|
-
// checkWrites();
|
|
70
|
-
// });
|
|
71
|
-
// });
|
|
96
|
+
const filesToCopy = ['vite.config.ts', 'vite-mobile.config.ts', 'capacitor.config.ts'];
|
|
97
|
+
for (const file of filesToCopy) {
|
|
98
|
+
const srcFile = path.resolve(templateRoot, `./${file}`);
|
|
99
|
+
if (fs.existsSync(srcFile)) {
|
|
100
|
+
fs.copyFileSync(srcFile, name + '/' + file);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
72
103
|
|
|
73
104
|
//TODO: use toJSON to dynamically create package.json
|
|
74
105
|
//TODO: install dependencies after writing package.json
|
|
75
|
-
fs.open(name + '/package.json','w', 0o666, function(err, fd) {
|
|
106
|
+
fs.open(name + '/package.json', 'w', 0o666, function (err, fd) {
|
|
76
107
|
if (err) throw err;
|
|
77
|
-
fs.readFile(templateRoot + '/package.json', 'utf8', function(err, data) {
|
|
108
|
+
fs.readFile(templateRoot + '/package.json', 'utf8', function (err, data) {
|
|
78
109
|
if (err) throw err;
|
|
79
|
-
fs.writeFileSync(
|
|
110
|
+
fs.writeFileSync(name + '/package.json', data.replace('nails_app', name));
|
|
80
111
|
fs.closeSync(fd);
|
|
81
112
|
checkWrites();
|
|
82
113
|
});
|
package/bin/test/test_init.sh
CHANGED
|
@@ -3,31 +3,39 @@
|
|
|
3
3
|
# Store the fully qualified location of the local nails module directory
|
|
4
4
|
NAILS_MODULE_DIR=$(pwd)
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
DATE_STRING=$(date +%Y%m%d%H%M%S)
|
|
8
|
-
TEST_DIR="/tmp/test_project_$DATE_STRING"
|
|
9
|
-
mkdir -p $TEST_DIR
|
|
6
|
+
TEMPLATES=("default" "mcp" "mobile")
|
|
10
7
|
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
for TEMPLATE in "${TEMPLATES[@]}"; do
|
|
9
|
+
echo "=========================================="
|
|
10
|
+
echo "Testing template: $TEMPLATE"
|
|
11
|
+
echo "=========================================="
|
|
13
12
|
|
|
14
|
-
#
|
|
15
|
-
|
|
13
|
+
# Create a temporary directory for the test project with a datestring
|
|
14
|
+
DATE_STRING=$(date +%Y%m%d%H%M%S)
|
|
15
|
+
TEST_DIR="/tmp/test_project_${TEMPLATE}_$DATE_STRING"
|
|
16
|
+
mkdir -p $TEST_DIR
|
|
16
17
|
|
|
17
|
-
#
|
|
18
|
-
|
|
18
|
+
# Create a new nails project using the local version of nails-boilerplate and specific template
|
|
19
|
+
npx $NAILS_MODULE_DIR/ init $TEST_DIR --template $TEMPLATE
|
|
19
20
|
|
|
20
|
-
#
|
|
21
|
-
|
|
21
|
+
# Change directory to the test project
|
|
22
|
+
cd $TEST_DIR
|
|
22
23
|
|
|
23
|
-
#
|
|
24
|
-
npm
|
|
24
|
+
# Link the local @projectinvicta/nails module
|
|
25
|
+
npm link $NAILS_MODULE_DIR
|
|
25
26
|
|
|
26
|
-
#
|
|
27
|
-
|
|
27
|
+
# Install other dependencies
|
|
28
|
+
npm install --legacy-peer-deps
|
|
28
29
|
|
|
29
|
-
#
|
|
30
|
-
npm
|
|
30
|
+
# Run tests in the new test project (using pool=forks and passWithNoTests in case the template has no tests)
|
|
31
|
+
npm test -- --pool=forks --passWithNoTests
|
|
31
32
|
|
|
32
|
-
#
|
|
33
|
-
|
|
33
|
+
# Return to the original nails module directory
|
|
34
|
+
cd $NAILS_MODULE_DIR
|
|
35
|
+
|
|
36
|
+
# Unlink the local @projectinvicta/nails module
|
|
37
|
+
npm unlink @projectinvicta/nails
|
|
38
|
+
|
|
39
|
+
# Clean up the temporary directory
|
|
40
|
+
rm -rf $TEST_DIR
|
|
41
|
+
done
|
package/dist/Nails.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import https, { type Server as HttpsServer } from 'node:https';
|
|
2
|
-
import { type Server as HttpServer } from 'node:http';
|
|
3
1
|
import { type Application } from 'express-ws';
|
|
4
2
|
import { Model, Sequelize } from 'sequelize';
|
|
5
3
|
import Router from './Router.js';
|
|
4
|
+
import Server from './Server.js';
|
|
6
5
|
import { type Config } from './types.js';
|
|
7
6
|
import Controller from './Controller.js';
|
|
8
7
|
export default class Nails {
|
|
@@ -12,8 +11,11 @@ export default class Nails {
|
|
|
12
11
|
static get initialized(): Promise<void>;
|
|
13
12
|
static get config(): Config;
|
|
14
13
|
static get application(): Application;
|
|
15
|
-
static get
|
|
16
|
-
static get
|
|
14
|
+
static get server(): Server;
|
|
15
|
+
static get httpServer(): import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse> | undefined;
|
|
16
|
+
static get httpsServer(): import("https").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse> | undefined;
|
|
17
|
+
static get lameDuckMode(): boolean;
|
|
18
|
+
static set lameDuckMode(value: boolean);
|
|
17
19
|
ready: Promise<boolean>;
|
|
18
20
|
config: Config;
|
|
19
21
|
application: Application;
|
|
@@ -21,12 +23,17 @@ export default class Nails {
|
|
|
21
23
|
sequelize: Sequelize;
|
|
22
24
|
initialized: Promise<void>;
|
|
23
25
|
router: Router;
|
|
26
|
+
server: Server;
|
|
24
27
|
Model: Model;
|
|
25
28
|
Models: Record<string, typeof Model>;
|
|
26
|
-
httpServer: HttpServer;
|
|
27
|
-
httpsServer: HttpsServer;
|
|
28
29
|
private modelFinalizations;
|
|
29
30
|
private modelMigrations;
|
|
31
|
+
get httpServer(): import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse> | undefined;
|
|
32
|
+
get httpsServer(): import("https").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse> | undefined;
|
|
33
|
+
get lameDuckMode(): boolean;
|
|
34
|
+
set lameDuckMode(value: boolean);
|
|
35
|
+
get healthy(): boolean;
|
|
36
|
+
set healthy(value: boolean);
|
|
30
37
|
constructor(appConfig: Config);
|
|
31
38
|
configure(): Promise<void>;
|
|
32
39
|
initializeModels(): Promise<void>;
|
package/dist/Nails.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import https from 'node:https';
|
|
4
3
|
import { Model, Sequelize } from 'sequelize';
|
|
5
4
|
import expressApp from './application.js';
|
|
6
5
|
import Router from './Router.js';
|
|
6
|
+
import Server from './Server.js';
|
|
7
7
|
import Controller from './Controller.js';
|
|
8
8
|
export default class Nails {
|
|
9
9
|
static Controller = Controller;
|
|
@@ -20,14 +20,41 @@ export default class Nails {
|
|
|
20
20
|
static get application() {
|
|
21
21
|
return this.instance.application;
|
|
22
22
|
}
|
|
23
|
+
static get server() {
|
|
24
|
+
return this.instance.server;
|
|
25
|
+
}
|
|
23
26
|
static get httpServer() {
|
|
24
27
|
return this.instance.httpServer;
|
|
25
28
|
}
|
|
26
29
|
static get httpsServer() {
|
|
27
30
|
return this.instance.httpsServer;
|
|
28
31
|
}
|
|
32
|
+
static get lameDuckMode() {
|
|
33
|
+
return this.instance.lameDuckMode;
|
|
34
|
+
}
|
|
35
|
+
static set lameDuckMode(value) {
|
|
36
|
+
this.instance.lameDuckMode = value;
|
|
37
|
+
}
|
|
29
38
|
modelFinalizations = [];
|
|
30
39
|
modelMigrations = [];
|
|
40
|
+
get httpServer() {
|
|
41
|
+
return this.server.httpServer;
|
|
42
|
+
}
|
|
43
|
+
get httpsServer() {
|
|
44
|
+
return this.server.httpsServer;
|
|
45
|
+
}
|
|
46
|
+
get lameDuckMode() {
|
|
47
|
+
return this.server.lameDuckMode;
|
|
48
|
+
}
|
|
49
|
+
set lameDuckMode(value) {
|
|
50
|
+
this.server.lameDuckMode = value;
|
|
51
|
+
}
|
|
52
|
+
get healthy() {
|
|
53
|
+
return this.server.healthy;
|
|
54
|
+
}
|
|
55
|
+
set healthy(value) {
|
|
56
|
+
this.server.healthy = value;
|
|
57
|
+
}
|
|
31
58
|
constructor(appConfig) {
|
|
32
59
|
Nails.instance = this;
|
|
33
60
|
this.config = appConfig;
|
|
@@ -38,6 +65,12 @@ export default class Nails {
|
|
|
38
65
|
? new Sequelize(this.config.db.address, this.config.db.options)
|
|
39
66
|
: new Sequelize(this.config.db.address);
|
|
40
67
|
this.router = new Router([]);
|
|
68
|
+
this.server = new Server(this.config, this.application, async () => {
|
|
69
|
+
if (this.sequelize) {
|
|
70
|
+
await this.sequelize.authenticate();
|
|
71
|
+
}
|
|
72
|
+
return true;
|
|
73
|
+
});
|
|
41
74
|
this.initialized = this.configure();
|
|
42
75
|
}
|
|
43
76
|
async configure() {
|
|
@@ -60,6 +93,7 @@ export default class Nails {
|
|
|
60
93
|
Controller.setRouter(this.router);
|
|
61
94
|
await this.initializeControllers();
|
|
62
95
|
this.router.addRoutes(this.config.routes);
|
|
96
|
+
this.server.isInitialized = true;
|
|
63
97
|
}
|
|
64
98
|
async initializeModels() {
|
|
65
99
|
await this.loadModels(this.config.service.MODELS_ROOT);
|
|
@@ -70,49 +104,7 @@ export default class Nails {
|
|
|
70
104
|
async startServer() {
|
|
71
105
|
await this.initialized;
|
|
72
106
|
console.log("CONFIGURATION COMPLETE");
|
|
73
|
-
|
|
74
|
-
// Use the router middleware.
|
|
75
|
-
expressApp.use(this.router.expressRouter);
|
|
76
|
-
var host = this.config.service.HOST || 'localhost';
|
|
77
|
-
var port = this.config.service.PORT || 3000;
|
|
78
|
-
let startHttp = 'ENABLE_HTTP' in this.config.service && !!this.config.service.ENABLE_HTTP;
|
|
79
|
-
let startHttps = !!this.config.service.ENABLE_HTTPS;
|
|
80
|
-
if (!startHttp && !startHttps) {
|
|
81
|
-
console.error("Either ENABLE_HTTPS or ENABLE_HTTP must be set for nails to start");
|
|
82
|
-
}
|
|
83
|
-
let atLeastOneServerStarted = false;
|
|
84
|
-
return new Promise((resolve, reject) => {
|
|
85
|
-
if (atLeastOneServerStarted)
|
|
86
|
-
return resolve();
|
|
87
|
-
let serverStartedCallback = () => {
|
|
88
|
-
console.log("Started");
|
|
89
|
-
atLeastOneServerStarted = true;
|
|
90
|
-
resolve();
|
|
91
|
-
};
|
|
92
|
-
if (startHttp) {
|
|
93
|
-
console.log("starting nails HTTP server. listening to ", host + ':' + port);
|
|
94
|
-
if (this.httpServer) {
|
|
95
|
-
console.warn("Attempted to recreate http server");
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
this.httpServer = expressApp.listen(port, host, serverStartedCallback);
|
|
99
|
-
console.log("Done starting HTTP server");
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
if (startHttps) {
|
|
103
|
-
if (this.httpsServer) {
|
|
104
|
-
console.warn("Attempted to recreate HTTPS server");
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
console.log(`starting nails HTTPS server. Listening to ${host}:${this.config.service.SSL_PORT}`);
|
|
108
|
-
this.httpsServer = https.createServer({
|
|
109
|
-
key: this.config.service.PRIVATE_KEY,
|
|
110
|
-
cert: this.config.service.CERTIFICATE
|
|
111
|
-
}, expressApp).listen(this.config.service.SSL_PORT, serverStartedCallback);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
// TODO: Set a startup timeout and reject the promise so it does not hang forever;
|
|
115
|
-
});
|
|
107
|
+
return this.server.start(this.router);
|
|
116
108
|
}
|
|
117
109
|
async loadModels(absolutePath) {
|
|
118
110
|
if (!fs.existsSync(absolutePath))
|
package/dist/Nails.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Nails.js","sourceRoot":"","sources":["../lib/Nails.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Nails.js","sourceRoot":"","sources":["../lib/Nails.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAC1C,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,MAAM,MAAM,aAAa,CAAC;AAGjC,OAAO,UAAU,MAAM,iBAAiB,CAAC;AAEzC,MAAM,CAAC,OAAO,OAAO,KAAK;IACxB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