Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 0 additions & 77 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/node-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ on:

jobs:
node-publish:
uses: fluidware-team/.github/.github/workflows/node-publish.yml@v1
uses: fluidware-team/.github/.github/workflows/node-publish.yml@v2
secrets:
npm_token: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/node-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ on: push

jobs:
node-lint-test-compile:
uses: fluidware-team/.github/.github/workflows/node-test.yml@v1
uses: fluidware-team/.github/.github/workflows/node-test.yml@v2
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
fund=false
engine-strict=true
update-notifier=false
save-exact=true
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"singleQuote": true,
"arrowParens": "avoid",
"printWidth": 120,
"bracketSpacing": true,
"trailingComma": "none"
}
50 changes: 33 additions & 17 deletions ENVIRONMENT.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,36 @@

## Environment variables

| ENV | type | default | required | notes |
| ----------------------------- | -------- | ------------------------------ | -------- | --------------------------------------------------- |
| APP_${appName}_ROLES | string[] | | | roles to assign to appName |
| APP_KEY_${appName} | string | | | pre shared token for appName |
| FW_APP_DEFAULT_ROLES | string[] | admin | | |
| FW_MS_ADDRESS | string | | | |
| FW_MS_ADDRESSES | string[] | | | |
| FW_MS_CERT | string | | | |
| FW_MS_FORWARD_UNKNOWN_BEARER | boolean | false | | forward unknown bearer token to the next middleware |
| FW_MS_HOSTNAME | string | _function_ | | default to hostname() |
| FW_MS_JWT_PUBLIC_KEY | string | | | |
| FW_MS_KEY | string | | | |
| FW_MS_LOG_404 | boolean | false | | |
| FW_MS_MAX_UPLOAD_SIZE | string | 128kb | | |
| FW_MS_PORT | integer | 8080 | | |
| FW_MS_PRE_SHARED_TOKEN_PREFIX | string | | | |
| FW_MS_TRUST_PROXY | string[] | loopback,linklocal,uniquelocal | | |
| ENV | type | default | required | notes |
| ------------------------------- | -------- | ------------------------------ | -------- | --------------------------------------------------- |
| APP_${appName}_ROLES | string[] | | | roles to assign to appName |
| APP_KEY_${appName} | string | | | pre shared token for appName |
| FW_APP_DEFAULT_ROLES | string[] | admin | | |
| FW_MS_ADDRESS | string | | | |
| FW_MS_ADDRESSES | string[] | | | |
| FW_MS_CERT | string | | | full cert for https (wins over FW_MS_CERT_FILE) |
| FW_MS_CERT_FILE | string | | | path to file containing full cert for https |
| FW_MS_FORWARD_UNKNOWN_BEARER | boolean | false | | forward unknown bearer token to the next middleware |
| FW_MS_HOSTNAME | string | _function_ | | default to hostname() |
| FW_MS_JWT_PUBLIC_KEY | string | | | |
| FW_MS_KEY | string | | | full key for https (wins over FW_MS_KEY_FILE) |
| FW_MS_KEY_FILE | string | | | path to file containing full key for https |
| FW_MS_LOG_404 | boolean | false | | |
| FW_MS_MAX_UPLOAD_SIZE | string | 128kb | | |
| FW_MS_OPENAPI_CONTROLLERS_PATH | string | | | |
| FW_MS_OPENAPI_SPEC_FILE | string | | | |
| FW_MS_OPENAPI_VALIDATE_RESPONSE | boolean | true | | |
| FW_MS_PORT | integer | 8080 | | |
| FW_MS_PRE_SHARED_TOKEN_PREFIX | string | | | |
| FW_MS_TRUST_PROXY | string[] | loopback,linklocal,uniquelocal | | |

## @fluidware-it/saddlebag@0.3.0

| ENV | type | default | required | notes |
| ---------------------------- | -------- | ----------------------- | -------- | -------- |
| FW_LOGGER_ISO_TIMESTAMP | boolean | false | | |
| FW_LOGGER_LEVEL | string | info | | |
| FW_LOGGER_NAME | string | _function_ | | |
| FW_LOGGER_REDACT_KEYS | string[] | | | |
| FW_LOGGER_SEVERITY_AS_STRING | boolean | false | | |
| npm_package_name | string | @fluidware-it/saddlebag | | |
101 changes: 101 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';
import pluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import nodePlugin from 'eslint-plugin-n';

/** @type {import('eslint').Linter.Config[]} */
export default [
{
name: 'ignore files',
ignores: ['dist/', 'reports/', 'data/']
},
{
name: 'include files',
files: ['**/*.{js,mjs,cjs,ts}']
},
{
name: 'globals for node',
files: ['**/*.{mjs,cjs,ts}'],
languageOptions: { globals: globals.node }
},
{
...pluginJs.configs.recommended,
name: 'plugin-js recommended'
},
{
...nodePlugin.configs['flat/recommended-module'],
name: 'custom eslint-plugin-n plugin config',
files: ['**/*.ts'],
rules: {
'n/no-process-env': 'error',
'n/no-missing-import': [
'off', // eslint-plugin-n fails to resolve index.ts files
{
tryExtensions: ['.ts', '.d.ts']
}
]
},
languageOptions: {
globals: {
...globals.node,
NodeJS: true
}
}
},
{
...nodePlugin.configs['flat/recommended-module'],
name: 'custom eslint-plugin-n plugin config for tests',
files: ['tests*/**/*.ts'],
// eslint-plugin-n rules
rules: {
'n/no-process-env': 'off'
},
languageOptions: {
globals: {
...globals.jest
}
}
},
...tseslint.configs.recommended.map(config => ({
...config,
files: ['**/*.ts'],
rules: {
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_'
}
]
}
})),
{
// eslint core rules
rules: {
complexity: ['error', 8],
'no-console': 'error',
eqeqeq: ['error', 'smart']
}
},
{
name: 'scripts that run in the browser',
files: ['public/**/*.js'],
languageOptions: {
sourceType: 'script',
globals: {
...globals.browser
}
},
rules: {
'no-unused-vars': [
'error',
{
vars: 'local'
}
]
}
},
pluginPrettierRecommended
];
10 changes: 10 additions & 0 deletions jest.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
export default {
testPathIgnorePatterns: ['build/', 'node_modules/', 'reports/'],
preset: 'ts-jest',
testEnvironment: 'node',
collectCoverage: true,
collectCoverageFrom: ['src/**/*.ts'],
coverageDirectory: 'coverage',
coverageReporters: ['text', 'text-summary', 'cobertura']
};
Loading