nginxwebnodeplugin 1.0.249 → 1.0.252

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.
Files changed (4) hide show
  1. package/index.d.ts +43 -0
  2. package/package.json +26 -12
  3. package/readme.md +20 -15
  4. package/type.d.ts +32 -0
package/index.d.ts ADDED
@@ -0,0 +1,43 @@
1
+ import { CheckReachabilityOptions, RecursivePartial } from 'clientnode/type';
2
+ import { PluginHandler } from 'web-node/type';
3
+ import { Configuration, Service, ServicePromises, Services } from './type';
4
+ /**
5
+ * Launches an application server und triggers all some pluginable hooks on
6
+ * an event.
7
+ */
8
+ export declare class Nginx implements PluginHandler {
9
+ /**
10
+ * Start nginx's child process and return a Promise which observes this
11
+ * service.
12
+ * @param servicePromises - An object with stored service promise
13
+ * instances.
14
+ * @param services - An object with stored service instances.
15
+ * @param configuration - Mutable by plugins extended configuration object.
16
+ *
17
+ * @returns A promise which correspond to the plugin specific continues
18
+ * service.
19
+ */
20
+ static loadService(servicePromises: ServicePromises, services: Services, configuration: Configuration): Promise<null | Service>;
21
+ /**
22
+ * Application will be closed soon.
23
+ * @param services - An object with stored service instances.
24
+ * @param configuration - Mutable by plugins extended configuration object.
25
+ *
26
+ * @returns Given object of services.
27
+ */
28
+ static shouldExit(services: Services, configuration: Configuration): Promise<Services>;
29
+ /**
30
+ * Check if a nginx server is currently (not) running.
31
+ * @param serverConfiguration - Mutable by plugins extended configuration
32
+ * object.
33
+ * @param inverse - Boolean indicating if we should check for reachability
34
+ * or un-reachability.
35
+ * @param givenOptions - Tools reachability options to configure how to
36
+ * check for reachability.
37
+ *
38
+ * @returns A promise which will be resolved if a request to given url has
39
+ * (not) finished. Otherwise returned promise will be rejected.
40
+ */
41
+ static checkReachability(serverConfiguration: Configuration['applicationServer'], inverse?: boolean, givenOptions?: RecursivePartial<CheckReachabilityOptions>): Promise<Response | Error | null | Promise<Error | null>>;
42
+ }
43
+ export default Nginx;
package/package.json CHANGED
@@ -1,13 +1,7 @@
1
1
  {
2
2
  "name": "nginxwebnodeplugin",
3
- "version": "1.0.249",
4
- "license": "CC-BY-3.0",
3
+ "version": "1.0.252",
5
4
  "description": "A nginx proxy server configuration template for webNode.",
6
- "homepage": "https://torben.website/nginx-web-node-plugin",
7
- "documentationWebsite": {
8
- "name": "nginx-web-node-plugin",
9
- "trackingCode": "UA-40192634-23"
10
- },
11
5
  "keywords": [
12
6
  "web",
13
7
  "backend",
@@ -16,6 +10,17 @@
16
10
  "configuration",
17
11
  "template"
18
12
  ],
13
+ "homepage": "https://torben.website/nginx-web-node-plugin",
14
+ "bugs": {
15
+ "email": "info@torben.website",
16
+ "url": "https://github.com/thaibault/nginx-web-node-plugin/issues"
17
+ },
18
+ "license": "CC-BY-3.0",
19
+ "author": {
20
+ "name": "Torben Sickert",
21
+ "email": "info@torben.website",
22
+ "url": "https://torben.website"
23
+ },
19
24
  "files": [
20
25
  "index.d.ts",
21
26
  "index.js",
@@ -26,21 +31,25 @@
26
31
  "url": "https://github.com/thaibault/nginx-web-node-plugin.git"
27
32
  },
28
33
  "scripts": {
29
- "build": "weboptimizer build",
34
+ "build": "weboptimizer build:types && weboptimizer build",
30
35
  "check": "yarn check:types; yarn lint",
31
36
  "check:types": "weboptimizer check:types",
32
37
  "clear": "weboptimizer clear",
33
38
  "document": "weboptimizer document",
34
39
  "lint": "weboptimizer lint",
35
40
  "prepare": "yarn build",
36
- "report:coverage": "nyc report --reporter=text-lcov | coveralls",
37
41
  "serve": "yarn build && yarn start",
38
42
  "start": "web-node '{plugin: {hotReloading: true}}'",
39
43
  "test": "weboptimizer test",
44
+ "test:coverage": "yarn clear && weboptimizer test:coverage",
45
+ "test:coverage:report": "yarn clear && weboptimizer test:coverage:report",
40
46
  "update": "yarn version --patch && yarn publish",
41
47
  "update:documentation": "documentationWebsite --log-level info",
42
48
  "watch": "weboptimizer build --watch"
43
49
  },
50
+ "dependencies": {
51
+ "@types/webpack": "https://registry.yarnpkg.com/@favware/skip-dependency/-/skip-dependency-1.1.1.tgz"
52
+ },
44
53
  "devDependencies": {
45
54
  "@babel/eslint-parser": "*",
46
55
  "@types/jest": "*",
@@ -70,11 +79,19 @@
70
79
  "optional": true
71
80
  }
72
81
  },
82
+ "engines": {
83
+ "node": ">=17",
84
+ "npm": ">=7"
85
+ },
73
86
  "resolutions": {
74
87
  "@types/webpack": "https://registry.yarnpkg.com/@favware/skip-dependency/-/skip-dependency-1.1.1.tgz",
75
88
  "colors": "1.4.0"
76
89
  },
77
90
  "sideEffects": false,
91
+ "documentationWebsite": {
92
+ "name": "nginx-web-node-plugin",
93
+ "trackingCode": "UA-40192634-23"
94
+ },
78
95
  "webNode": {
79
96
  "applicationServer": {
80
97
  "proxy": {
@@ -133,8 +150,5 @@
133
150
  }
134
151
  }
135
152
  }
136
- },
137
- "dependencies": {
138
- "@types/webpack": "https://registry.yarnpkg.com/@favware/skip-dependency/-/skip-dependency-1.1.1.tgz"
139
153
  }
140
154
  }
package/readme.md CHANGED
@@ -1,32 +1,37 @@
1
- <!-- #!/usr/bin/env markdown
1
+ <!-- !/usr/bin/env markdown
2
2
  -*- coding: utf-8 -*-
3
3
  region header
4
4
  Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
5
5
 
6
6
  License
7
- This library written by Torben Sickert stand under a creative commons
8
- naming 3.0 unported license.
9
- See https://creativecommons.org/licenses/by/3.0/deed.de
7
+ -------
8
+
9
+ This library written by Torben Sickert stand under a creative commons naming
10
+ 3.0 unported license. See https://creativecommons.org/licenses/by/3.0/deed.de
10
11
  endregion -->
11
12
 
12
13
  Project status
13
14
  --------------
14
15
 
15
- [![npm version](https://badge.fury.io/js/nginxwebnodeplugin.svg)](https://www.npmjs.com/package/nginxwebnodeplugin)
16
- [![downloads](https://img.shields.io/npm/dy/nginxwebnodeplugin.svg)](https://www.npmjs.com/package/nginxwebnodeplugin)
17
- [![build status](https://travis-ci.org/thaibault/nginx-web-node-plugin.svg?branch=master)](https://travis-ci.org/thaibault/nginx-web-node-plugin)
16
+ [![npm](https://img.shields.io/npm/v/nginxwebnodeplugin?color=%23d55e5d&label=npm%20package%20version&logoColor=%23d55e5d)](https://www.npmjs.com/package/nginxwebnodeplugin)
17
+ [![npm downloads](https://img.shields.io/npm/dy/nginxwebnodeplugin.svg)](https://www.npmjs.com/package/nginxwebnodeplugin)
18
+
19
+ [![<LABEL>](https://github.com/thaibault/nginx-web-node-plugin/actions/workflows/build.yaml/badge.svg)](https://github.com/thaibault/nginx-web-node-plugin/actions/workflows/build.yaml)
20
+ [![<LABEL>](https://github.com/thaibault/nginx-web-node-plugin/actions/workflows/test.yaml/badge.svg)](https://github.com/thaibault/nginx-web-node-plugin/actions/workflows/test.yaml)
21
+ [![<LABEL>](https://github.com/thaibault/nginx-web-node-plugin/actions/workflows/test:coverage:report.yaml/badge.svg)](https://github.com/thaibault/nginx-web-node-plugin/actions/workflows/test:coverage:report.yaml)
22
+ [![<LABEL>](https://github.com/thaibault/nginx-web-node-plugin/actions/workflows/check:types.yaml/badge.svg)](https://github.com/thaibault/nginx-web-node-plugin/actions/workflows/check:types.yaml)
23
+ [![<LABEL>](https://github.com/thaibault/nginx-web-node-plugin/actions/workflows/lint.yaml/badge.svg)](https://github.com/thaibault/nginx-web-node-plugin/actions/workflows/lint.yaml)
24
+
18
25
  [![code coverage](https://coveralls.io/repos/github/thaibault/nginx-web-node-plugin/badge.svg)](https://coveralls.io/github/thaibault/nginx-web-node-plugin)
19
- [![dependencies](https://img.shields.io/david/thaibault/nginxwebnodeplugin.svg)](https://david-dm.org/thaibault/nginxwebnodeplugin)
20
- [![development dependencies](https://img.shields.io/david/dev/thaibault/nginxwebnodeplugin.svg)](https://david-dm.org/thaibault/nginxwebnodeplugin?type=dev)
21
- [![peer dependencies](https://img.shields.io/david/peer/thaibault/nginxwebnodeplugin.svg)](https://david-dm.org/thaibault/nginxwebnodeplugin?type=peer)
26
+
27
+ <!-- Too unstable yet
28
+ [![dependencies](https://img.shields.io/david/thaibault/nginx-web-node-plugin.svg)](https://david-dm.org/thaibault/nginx-web-node-plugin)
29
+ [![development dependencies](https://img.shields.io/david/dev/thaibault/nginx-web-node-plugin.svg)](https://david-dm.org/thaibault/nginx-web-node-plugin?type=dev)
30
+ [![peer dependencies](https://img.shields.io/david/peer/thaibault/nginx-web-node-plugin.svg)](https://david-dm.org/thaibault/nginx-web-node-plugin?type=peer)
31
+ -->
22
32
  [![documentation website](https://img.shields.io/website-up-down-green-red/https/torben.website/nginx-web-node-plugin.svg?label=documentation-website)](https://torben.website/nginx-web-node-plugin)
23
33
 
24
34
  Use case
25
35
  --------
26
36
 
27
37
  Nginx server as web-node plugin.
28
-
29
- <!-- region vim modline
30
- vim: set tabstop=4 shiftwidth=4 expandtab:
31
- vim: foldmethod=marker foldmarker=region,endregion:
32
- endregion -->
package/type.d.ts ADDED
@@ -0,0 +1,32 @@
1
+ /// <reference types="node" />
2
+ import { ChildProcess } from 'child_process';
3
+ import { Mapping, ProcessCloseReason } from 'clientnode/type';
4
+ import { Configuration as BaseConfiguration, Services as BaseServices, ServicePromises as BaseServicePromises } from 'application-server-web-node-plugin/type';
5
+ import { Service as BaseService } from 'web-node/type';
6
+ export declare type Configuration<PluginConfigurationType = Mapping<unknown>> = BaseConfiguration<{
7
+ applicationServer: {
8
+ proxy: {
9
+ optional: boolean;
10
+ logFilePath: {
11
+ access: string;
12
+ error: string;
13
+ };
14
+ ports: {
15
+ backend: Mapping<number>;
16
+ };
17
+ };
18
+ };
19
+ }> & PluginConfigurationType;
20
+ export interface Service extends BaseService {
21
+ name: 'nginx';
22
+ promise: null | Promise<ProcessCloseReason>;
23
+ }
24
+ export interface ServiceProcess extends ChildProcess {
25
+ reload(): Promise<string>;
26
+ }
27
+ export declare type ServicePromises<ServicePromiseType = Mapping<unknown>> = BaseServicePromises<{
28
+ nginx: Promise<ProcessCloseReason>;
29
+ }> & ServicePromiseType;
30
+ export declare type Services<ServiceType = Mapping<unknown>> = BaseServices<{
31
+ nginx: null | ServiceProcess;
32
+ }> & ServiceType;