Skip to content

Commit

Permalink
feat: add files-to-consul command
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Sep 27, 2022
1 parent e3d8ba4 commit 8ba2faf
Show file tree
Hide file tree
Showing 56 changed files with 23,585 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
35 changes: 35 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": ["*"]
}
]
}
]
}
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"rules": {}
}
]
}
11 changes: 11 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
github: [EndyKaufman]
patreon: EndyKaufman
# open_collective: # Replace with a single Open Collective username
ko_fi: endykaufman
# tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: EndyKaufman
issuehunt: endykaufman
# otechie: # Replace with a single Otechie username
# lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
# custom: # [https://yoomoney.ru/to/41001220209977]
39 changes: 39 additions & 0 deletions .github/workflows/check-code.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Check code

on:
push:
branches:
- 'master'
- 'develop'
- 'feature/**'
tags-ignore:
- v*

jobs:
check-code:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Node.js 16.x to publish to npmjs.org
uses: actions/setup-node@v1
with:
node-version: '16.13.1'
registry-url: 'https://registry.npmjs.org'

- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Packages
run: npm i --force

- name: Lint
run: npm run lint
env:
CI: true
44 changes: 44 additions & 0 deletions .github/workflows/check-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Check pull request

on:
pull_request:

jobs:
check-code:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Node.js 16.x to publish to npmjs.org
uses: actions/setup-node@v1
with:
node-version: '16.13.1'
registry-url: 'https://registry.npmjs.org'

- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Packages
run: npm i --force

- name: Lint
run: npm run lint
env:
CI: true

- name: Test
run: npm run test
env:
CI: true

- uses: tanmen/jest-reporter@v1
if: always()
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-file: jest.result.json
45 changes: 45 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish

on:
push:
tags:
- v*

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Node.js 16.x to publish to npmjs.org
uses: actions/setup-node@v1
with:
node-version: '16.13.1'
registry-url: 'https://registry.npmjs.org'

- name: Install Packages
run: npm i --force

- name: Build
run: npm run build

- name: Test
run: npm run test
env:
CI: true

- name: Generate Release Body
run: npx extract-changelog-release > RELEASE_BODY.md

- name: Publish to NPM
run: npm run publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
bodyFile: 'RELEASE_BODY.md'
token: ${{ secrets.GITHUB_TOKEN }}
43 changes: 43 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/out-tsc

# dependencies
/node_modules

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# System Files
.DS_Store
Thumbs.db

# Envs
.env
jest.result.json
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Add files here to ignore them from prettier formatting

/dist
/coverage
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
12 changes: 12 additions & 0 deletions .versionrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"bumpFiles": [
{
"filename": "./libs/ilink/package.json",
"type": "json"
},
{
"filename": "./package.json",
"type": "json"
}
]
}
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"nrwl.angular-console",
"esbenp.prettier-vscode",
"firsttris.vscode-jest-runner",
"dbaeumer.vscode-eslint"
]
}
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"workbench.colorCustomizations": {
"activityBar.background": "#0F0F58",
"titleBar.activeBackground": "#FC1B43",
"titleBar.activeForeground": "#FFFBF8"
}
}
Empty file added CHANGELOG.md
Empty file.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# ilink

Console ilink tools

[![npm version](https://badge.fury.io/js/ilink.svg)](https://badge.fury.io/js/ilink)
[![monthly downloads](https://badgen.net/npm/dm/ilink)](https://www.npmjs.com/package/ilink)

## env-to-consul - Copy content of .env file(s) to consul

> npx ilink "env-to-consul" "--help"
```sh
Usage: ilink env-to-consul [options]

Copy content of .env file(s) to consul

Options:
-f,--path [string] path to file with .env variables or path to folder with many .env files (default: .env)
-h,--consul-host [string] host of consul server (default: localhost)
-p,--consul-port [string] port of consul server (default: 8500)
-k,--consul-key [string] root key to append .env file(s)
-t,--consul-token [string] token for work with consul server
-c,--consul-clear [boolean] clear all values and sub values in consul key (default: false)
-d,--consul-dc [string] dc of consul server
-s,--consul-secure [boolean] work in secure mode (default: false)
--help display help for command
```
Empty file added apps/.gitkeep
Empty file.
1 change: 1 addition & 0 deletions example.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONVENTIONAL_GITHUB_RELEASER_TOKEN=token
5 changes: 5 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const { getJestProjects } = require('@nrwl/jest');

export default {
projects: getJestProjects(),
};
3 changes: 3 additions & 0 deletions jest.preset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const nxPreset = require('@nrwl/jest/preset').default;

module.exports = { ...nxPreset };
Empty file added libs/.gitkeep
Empty file.
3 changes: 3 additions & 0 deletions libs/ilink/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": [["@nrwl/web/babel", { "useBuiltIns": "usage" }]]
}
18 changes: 18 additions & 0 deletions libs/ilink/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}
25 changes: 25 additions & 0 deletions libs/ilink/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Console ilink tools

[![npm version](https://badge.fury.io/js/ilink.svg)](https://badge.fury.io/js/ilink)
[![monthly downloads](https://badgen.net/npm/dm/ilink)](https://www.npmjs.com/package/ilink)

## env-to-consul - Copy content of .env file(s) to consul

> npx ilink "env-to-consul" "--help"
```sh
Usage: ilink env-to-consul [options]

Copy content of .env file(s) to consul

Options:
-f,--path [string] path to file with .env variables or path to folder with many .env files (default: .env)
-h,--consul-host [string] host of consul server (default: localhost)
-p,--consul-port [string] port of consul server (default: 8500)
-k,--consul-key [string] root key to append .env file(s)
-t,--consul-token [string] token for work with consul server
-c,--consul-clear [boolean] clear all values and sub values in consul key (default: false)
-d,--consul-dc [string] dc of consul server
-s,--consul-secure [boolean] work in secure mode (default: false)
--help display help for command
```
16 changes: 16 additions & 0 deletions libs/ilink/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* eslint-disable */
export default {
displayName: 'ilink',
preset: '../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
testEnvironment: 'node',
transform: {
'^.+\\.[tj]sx?$': 'ts-jest',
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/ilink',
};
Loading

0 comments on commit 8ba2faf

Please sign in to comment.