Skip to content
This repository was archived by the owner on Mar 8, 2024. It is now read-only.

Commit 21d205e

Browse files
committed
refactored commands from utils
removed defunct server keys commands
1 parent 850fa1f commit 21d205e

40 files changed

Lines changed: 5978 additions & 2 deletions

.eslintignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Do not lint generated files.
2+
src/generated
3+
build
4+
dist
5+
6+
# Don't ever lint node_modules
7+
node_modules

.eslintrc.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
module.exports = {
2+
root: true,
3+
4+
parser: '@typescript-eslint/parser', // Make ESLint compatible with TypeScript
5+
parserOptions: {
6+
// Enable linting rules with type information from our tsconfig
7+
tsconfigRootDir: __dirname,
8+
project: ['./tsconfig.eslint.json'],
9+
10+
sourceType: 'module', // Allow the use of imports / ES modules
11+
12+
ecmaFeatures: {
13+
impliedStrict: true, // Enable global strict mode
14+
},
15+
},
16+
17+
// Specify global variables that are predefined
18+
env: {
19+
node: true, // Enable node global variables & Node.js scoping
20+
es2020: true, // Add all ECMAScript 2020 globals and automatically set the ecmaVersion parser option to ES2020
21+
},
22+
23+
plugins: [],
24+
extends: [
25+
'@xpring-eng/eslint-config-mocha',
26+
'@xpring-eng/eslint-config-base',
27+
],
28+
29+
rules: {},
30+
overrides: [
31+
{
32+
"files": ["*cli.ts"],
33+
"rules": {
34+
"node/shebang": "off"
35+
},
36+
},
37+
{
38+
"files": ["src/commands/*.ts"],
39+
"rules": {
40+
"class-methods-use-this": "off"
41+
},
42+
}],
43+
}

.gitignore

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
2+
# Created by https://www.gitignore.io/api/osx,node
3+
# Edit at https://www.gitignore.io/?templates=osx,node
4+
5+
### Node ###
6+
# Logs
7+
logs
8+
*.log
9+
npm-debug.log*
10+
yarn-debug.log*
11+
yarn-error.log*
12+
lerna-debug.log*
13+
14+
# Diagnostic reports (https://nodejs.org/api/report.html)
15+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
16+
17+
# Runtime data
18+
pids
19+
*.pid
20+
*.seed
21+
*.pid.lock
22+
23+
# Directory for instrumented libs generated by jscoverage/JSCover
24+
lib-cov
25+
26+
# Coverage directory used by tools like istanbul
27+
coverage
28+
*.lcov
29+
30+
# nyc test coverage
31+
.nyc_output
32+
33+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
34+
.grunt
35+
36+
# Bower dependency directory (https://bower.io/)
37+
bower_components
38+
39+
# node-waf configuration
40+
.lock-wscript
41+
42+
# Anything in the build directory
43+
build/
44+
45+
# Dependency directories
46+
node_modules/
47+
jspm_packages/
48+
49+
# TypeScript v1 declaration files
50+
typings/
51+
52+
# TypeScript cache
53+
*.tsbuildinfo
54+
55+
# Optional npm cache directory
56+
.npm
57+
58+
# Optional eslint cache
59+
.eslintcache
60+
61+
# Optional REPL history
62+
.node_repl_history
63+
64+
# Output of 'npm pack'
65+
*.tgz
66+
67+
# Yarn Integrity file
68+
.yarn-integrity
69+
70+
# dotenv environment variables file
71+
.env
72+
.env.test
73+
74+
# parcel-bundler cache (https://parceljs.org/)
75+
.cache
76+
77+
# next.js build output
78+
.next
79+
80+
# nuxt.js build output
81+
.nuxt
82+
83+
# rollup.js default build output
84+
dist/
85+
86+
# Uncomment the public line if your project uses Gatsby
87+
# https://nextjs.org/blog/next-9-1#public-directory-support
88+
# https://create-react-app.dev/docs/using-the-public-folder/#docsNav
89+
# public
90+
91+
# Storybook build outputs
92+
.out
93+
.storybook-out
94+
95+
# vuepress build output
96+
.vuepress/dist
97+
98+
# Serverless directories
99+
.serverless/
100+
101+
# FuseBox cache
102+
.fusebox/
103+
104+
# DynamoDB Local files
105+
.dynamodb/
106+
107+
# Temporary folders
108+
tmp/
109+
temp/
110+
111+
### OSX ###
112+
# General
113+
.DS_Store
114+
.AppleDouble
115+
.LSOverride
116+
117+
# Icon must end with two \r
118+
Icon
119+
120+
# Thumbnails
121+
._*
122+
123+
# Files that might appear in the root of a volume
124+
.DocumentRevisions-V100
125+
.fseventsd
126+
.Spotlight-V100
127+
.TemporaryItems
128+
.Trashes
129+
.VolumeIcon.icns
130+
.com.apple.timemachine.donotpresent
131+
132+
# Directories potentially created on remote AFP share
133+
.AppleDB
134+
.AppleDesktop
135+
Network Trash Folder
136+
Temporary Items
137+
.apdisk
138+
139+
# IntelliJ nonsense
140+
/.idea
141+
142+
# Lefthook
143+
/.lefthook-local
144+
lefthook-local.yml

.gitlab-ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
###
2+
3+
stages:
4+
- test
5+
6+
lint:
7+
stage: test
8+
image:
9+
name: node:12
10+
before_script:
11+
- npm i --cache .npm --prefer-offline --no-audit --progress=false
12+
script:
13+
- npm run lintNoFix
14+
15+
code coverage:
16+
stage: test
17+
image:
18+
name: node:12
19+
before_script:
20+
- npm i --cache .npm --no-audit --progress=false --prefer-offline -g nyc codecov
21+
- npm i --cache .npm --no-audit --progress=false --prefer-offline
22+
script:
23+
- npm run build
24+
- nyc npm test
25+
- mkdir coverage
26+
- nyc report --reporter=text-lcov > coverage/coverage.json
27+
- codecov
28+
29+
link checker:
30+
stage: test
31+
image:
32+
name: golang:1.14-alpine
33+
before_script:
34+
- apk add git
35+
- export GO111MODULE=on
36+
- go get -u github.com/raviqqe/liche
37+
script:
38+
- liche -r ${CI_PROJECT_DIR}

.mocharc.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
'use strict'
2+
3+
module.exports = {
4+
require: ['ts-node/register', 'source-map-support/register'],
5+
extension: ['ts'],
6+
7+
// Do not look for mocha opts file
8+
opts: false,
9+
10+
// Warn if test exceed 75ms duration
11+
slow: 75,
12+
13+
// Fail if tests exceed 10000ms
14+
timeout: 10000,
15+
16+
// Check for global variable leaks
17+
'check-leaks': true,
18+
}

.prettierignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Do not lint generated files.
2+
src/generated
3+
build
4+
dist
5+
.nyc_output
6+
7+
# Don't ever lint node_modules and NPM stuff
8+
.npm
9+
node_modules

.prettierrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
tabWidth: 2,
3+
printWidth: 80,
4+
singleQuote: true,
5+
semi: false,
6+
trailingComma: 'all',
7+
arrowParens: 'always',
8+
}

.vscode/launch.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "launch",
10+
"name": "Mocha All",
11+
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
12+
"skipFiles": ["<node_internals>/**", "node_modules/**/*.js"],
13+
"args": [
14+
"--timeout",
15+
"999999",
16+
"--colors",
17+
"--config",
18+
"${workspaceFolder}/.mocharc.js",
19+
"${workspaceFolder}/test/**/*.test.ts"
20+
],
21+
"console": "integratedTerminal",
22+
"internalConsoleOptions": "neverOpen"
23+
},
24+
{
25+
"type": "node",
26+
"request": "launch",
27+
"name": "Mocha Current File",
28+
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
29+
"skipFiles": ["<node_internals>/**", "node_modules/**/*.js"],
30+
"args": [
31+
"--timeout",
32+
"999999",
33+
"--colors",
34+
"--config",
35+
"${workspaceFolder}/.mocharc.js",
36+
"${file}"
37+
],
38+
"console": "integratedTerminal",
39+
"internalConsoleOptions": "neverOpen"
40+
}
41+
]
42+
}

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @hbergren

Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM node:12-alpine
2+
3+
ADD . / payid-utils/
4+
5+
RUN cd payid-utils/ &&\
6+
npm cache clean --force &&\
7+
npm install &&\
8+
npm run build && \
9+
npm link
10+
11+
FROM node:12-alpine
12+
13+
RUN mkdir /opt/payid-utils
14+
15+
WORKDIR /opt/payid-utils
16+
17+
COPY --from=0 /payid-utils/dist /opt/payid-utils/dist
18+
COPY --from=0 /payid-utils/node_modules /opt/payid-utils/node_modules
19+
20+
CMD ["node", "/opt/payid-utils/dist/cli.js"]

0 commit comments

Comments
 (0)