Skip to content

Commit

Permalink
chore: update yarn and deps
Browse files Browse the repository at this point in the history
  • Loading branch information
awlayton committed Jun 11, 2024
1 parent 4660921 commit fef9804
Show file tree
Hide file tree
Showing 29 changed files with 1,251 additions and 1,118 deletions.
33 changes: 30 additions & 3 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
root: true

extends:
- plugin:@typescript-eslint/recommended
- plugin:node/recommended
- plugin:github/recommended
- plugin:promise/recommended
Expand All @@ -11,10 +12,12 @@ extends:
- plugin:unicorn/recommended
#- plugin:security/recommended
#- plugin:sonarjs/recommended
- plugin:ava/recommended
- xo
- plugin:prettier/recommended

plugins:
- '@typescript-eslint'
- node
- github
- promise
Expand All @@ -27,6 +30,7 @@ plugins:
- security
- no-secrets
- sonarjs
- ava
- notice

parser: '@typescript-eslint/parser'
Expand All @@ -47,10 +51,15 @@ overrides:
project: ./tsconfig*.json
rules:
prettier/prettier: off
unicorn/import-style:
- warn
- styles:
node:path: false
'@typescript-eslint/naming-convention':
[
error,
{ selector: default, format: [camelCase] },
{ selector: import, modifiers: [default], format: null },
{ selector: objectLiteralProperty, format: null },
{ selector: enumMember, format: [PascalCase] },
{ selector: typeProperty, format: null },
Expand All @@ -60,6 +69,7 @@ overrides:
format: [camelCase, UPPER_CASE],
leadingUnderscore: allow,
},
{ selector: variable, modifiers: [destructured], format: null },
{
selector: parameter,
format: [camelCase],
Expand All @@ -74,6 +84,7 @@ overrides:
},

{ selector: typeLike, format: [PascalCase] },
{ selector: parameter, modifiers: [destructured], format: null },
]
'@typescript-eslint/restrict-template-expressions': 0
'@typescript-eslint/no-shadow': warn
Expand Down Expand Up @@ -112,8 +123,6 @@ rules:
*/
onNonMatchingHeader: append
nonMatchingTolerance: 0.7
unicorn/prevent-abbreviations:
[warn, { replacements: { db: false, req: false, doc: false, docs: false } }]
'@typescript-eslint/no-shadow': [warn, { allow: [_] }]
sonarjs/no-duplicate-string: [warn, { threshold: 5 }]
sonarjs/cognitive-complexity: warn
Expand All @@ -123,15 +132,33 @@ rules:
spaced-comment: [error, always, markers: [/, //]]
filenames/match-regex: off
unicorn/filename-case: off
unicorn/import-style:
- warn
- styles:
node:path: false
i18n-text/no-en: off
eslint-comments/no-use: off
no-secrets/no-secrets: error
no-secrets/no-secrets: [error, { tolerance: 5 }]
no-empty-label: off
no-return-await: 0
no-warning-comments: 0
node/no-missing-import: off
import/no-unresolved: off
unicorn/prefer-spread: off
unicorn/prevent-abbreviations:
- warn
- replacements:
db: false
req: false
res: false
err: false
doc: false
docs: false
no-constructor-bind/no-constructor-bind: error
no-constructor-bind/no-constructor-state: error
sort-imports: [warn, { allowSeparatedGroups: true }]
ava/no-ignored-test-files: off
ava/no-import-test-files: off
ava/no-skip-test: warn
ava/no-skip-assert: warn
ava/use-test: off
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
- package-ecosystem: github-actions
directory: /
schedule:
interval: 'daily'
interval: daily
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: 'CodeQL'
name: CodeQL

on:
push:
Expand All @@ -18,7 +18,7 @@ on:
# The branches below must be a subset of the branches above
branches: [master]
schedule:
- cron: '25 20 * * 4'
- cron: 25 20 * * 4

jobs:
analyze:
Expand All @@ -28,7 +28,7 @@ jobs:
strategy:
fail-fast: false
matrix:
language: ['javascript']
language: [javascript]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
Expand Down
7 changes: 4 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
".yarn": true,
".pnp.*": true,
".vim": true,
"tags.*": true,
"**/.yarn": true,
"**/.pnp.*": true
"tags.*": true
},
"prettier.prettierPath": ".yarn/sdks/prettier/index.cjs",
"typescript.tsdk": ".yarn/sdks/typescript/lib",
Expand Down Expand Up @@ -58,11 +56,14 @@
"HACCP",
"ksuid",
"lcov",
"lfdynamic",
"masterid",
"paaco",
"pdfs",
"pfgia",
"pino",
"reaudit",
"rowguid",
"Snyk",
"sonarjs",
"trellisfw",
Expand Down
610 changes: 305 additions & 305 deletions .yarn/releases/yarn-4.2.2.cjs → .yarn/releases/yarn-4.3.0.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ packageExtensions:
dependencies:
pkg-conf: ^3.0.0

yarnPath: .yarn/releases/yarn-4.2.2.cjs
yarnPath: .yarn/releases/yarn-4.3.0.cjs
57 changes: 28 additions & 29 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,45 +13,44 @@
# limitations under the License.

ARG NODE_VER=20-alpine
ARG SERVICE=Qlever-LLC/lf-sync
ARG DIR=/usr/src/app/

FROM node:$NODE_VER AS install
ARG SERVICE

WORKDIR /$SERVICE

COPY ./.yarn /$SERVICE/.yarn
COPY ./package.json ./yarn.lock ./.yarnrc.yml /$SERVICE/

RUN yarn workspaces focus --all --production

FROM install AS build
ARG SERVICE

# Install dev deps too
RUN yarn install --immutable

COPY . /$SERVICE/

# Build code and remove dev deps
RUN yarn build --verbose && rm -rfv .yarn .pnp*

FROM node:$NODE_VER AS production
ARG SERVICE
FROM node:$NODE_VER AS base
ARG DIR

# Install needed packages
RUN apk add --no-cache \
dumb-init

WORKDIR ${DIR}

COPY ./.yarn ${DIR}.yarn
COPY ./package.json ./yarn.lock ./.yarnrc.yml ${DIR}

RUN chown -R node:node ${DIR}
# Do not run service as root
USER node

WORKDIR /$SERVICE

COPY --from=install /$SERVICE/ /$SERVICE/
COPY --from=build /$SERVICE/ /$SERVICE/
RUN yarn workspaces focus --all --production

# Launch entrypoint with dumb-init
# Remap SIGTERM to SIGINT https://github.com/Yelp/dumb-init#signal-rewriting
ENTRYPOINT ["/usr/bin/dumb-init", "--rewrite", "15:2", "--", "yarn", "run"]
CMD ["start"]
CMD ["start"]

FROM base AS build
ARG DIR

# Install dev deps too
RUN yarn install --immutable

COPY . ${DIR}

# Build code
RUN yarn build --verbose

FROM base AS production
ARG DIR

# Copy in build code
COPY --from=build ${DIR}/dist ${DIR}/dist
58 changes: 31 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "dist/index.js",
"type": "module",
"engines": {
"node": ">=14.0.0"
"node": ">=20.0.0"
},
"scripts": {
"build": "tsc -b",
Expand Down Expand Up @@ -60,33 +60,33 @@
"@oada/types": "^3.5.3",
"bs58": "^5.0.0",
"convict": "^6.2.4",
"cron": "^2.4.4",
"debug": "^4.3.4",
"cron": "^3.1.7",
"debug": "^4.3.5",
"deep-equal": "^2.2.3",
"dotenv": "^16.0.3",
"formdata-node": "^5.0.0",
"got": "^12.6.0",
"dotenv": "^16.4.5",
"formdata-node": "^6.0.3",
"got": "^14.4.1",
"json-ptr": "^3.1.1",
"ksuid": "^3.0.0",
"mssql": "^9.3.2",
"mssql": "^10.0.2",
"p-queue": "^8.0.1"
},
"devDependencies": {
"@ava/typescript": "^4.1.0",
"@tsconfig/node16": "^1.0.3",
"@types/convict": "^6.1.1",
"@types/cron": "^2.0.1",
"@types/debug": "^4.1.7",
"@ava/typescript": "^5.0.0",
"@tsconfig/node20": "^20.1.4",
"@types/convict": "^6.1.6",
"@types/cron": "^2.4.0",
"@types/debug": "^4.1.12",
"@types/deep-equal": "^1.0.4",
"@types/mssql": "^8.1.2",
"@types/node": "^20.12.12",
"@typescript-eslint/eslint-plugin": "^7.9.0",
"@typescript-eslint/parser": "^7.9.0",
"@yarnpkg/sdks": "^3.1.2",
"@types/mssql": "^9.1.5",
"@types/node": "^20.14.2",
"@typescript-eslint/eslint-plugin": "^7.13.0",
"@typescript-eslint/parser": "^7.13.0",
"@yarnpkg/sdks": "^3.1.3",
"ava": "6.1.3",
"ava-nock": "^2.1.0",
"browserslist": "^4.23.0",
"c8": "^9.1.0",
"browserslist": "^4.23.1",
"c8": "^10.0.0",
"cross-env": "^7.0.3",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
Expand All @@ -95,10 +95,11 @@
"eslint-formatter-pretty": "^6.0.1",
"eslint-import-resolver-node": "^0.3.9",
"eslint-plugin-array-func": "^5.0.1",
"eslint-plugin-ava": "^15.0.1",
"eslint-plugin-escompat": "^3.4.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-filenames": "^1.3.2",
"eslint-plugin-github": "^4.10.2",
"eslint-plugin-github": "^5.0.1",
"eslint-plugin-i18n-text": "^1.0.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-no-constructor-bind": "^2.0.4",
Expand All @@ -108,19 +109,22 @@
"eslint-plugin-notice": "^0.9.10",
"eslint-plugin-optimize-regex": "^1.2.1",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-regexp": "^2.5.0",
"eslint-plugin-promise": "^6.2.0",
"eslint-plugin-regexp": "^2.6.0",
"eslint-plugin-security": "^3.0.0",
"eslint-plugin-sonarjs": "^1.0.3",
"eslint-plugin-unicorn": "^53.0.0",
"prettier": "^3.2.5",
"tslib": "^2.6.2",
"type-fest": "^4.18.2",
"prettier": "^3.3.2",
"tslib": "^2.6.3",
"type-fest": "^4.20.0",
"typescript": "5.4.5",
"update-browserslist-db": "^1.0.16"
},
"packageManager": "[email protected]",
"resolutions": {
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz"
},
"packageManager": "[email protected]",
"volta": {
"node": "20.13.1"
}
}
}
2 changes: 1 addition & 1 deletion scripts/count-imported.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

/* eslint-disable no-console */

import config from '../dist/config.js';
import { config } from '../dist/config.js';

import { join } from 'node:path';

Expand Down
2 changes: 1 addition & 1 deletion scripts/fix-duplicates.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

/* eslint-disable no-console */

import config from '../dist/config.js';
import { config } from '../dist/config.js';

import { join } from 'node:path';

Expand Down
2 changes: 1 addition & 1 deletion scripts/fix-old-type-vdoc-pdfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

/* eslint-disable no-console */

import config from '../dist/config.js';
import { config } from '../dist/config.js';

import { join } from 'node:path';

Expand Down
2 changes: 1 addition & 1 deletion scripts/make-by-lf-id.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

/* eslint-disable no-console */

import config from '../dist/config.js';
import { config } from '../dist/config.js';

import { connect } from '@oada/client';

Expand Down
2 changes: 1 addition & 1 deletion scripts/redrop-unsynced.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

/* eslint-disable no-console */

import config from '../dist/config.js';
import { config } from '../dist/config.js';

import { join } from 'node:path';

Expand Down
Loading

0 comments on commit fef9804

Please sign in to comment.