├── .github
├── FUNDING.yml
├── boring-cyborg.yml
├── CODEOWNERS
├── PULL_REQUEST_TEMPLATE.md
└── workflows
│ ├── build.yml
│ ├── lint.yml
│ ├── release.yml
│ └── tests.yml
├── .husky
├── commit-msg
└── prepare-commit-msg
├── jest.setup.ts
├── CHANGELOG.md
├── src
└── index.ts
├── .vscode
├── extensions.json
└── settings.json
├── commitlint.config.js
├── tsconfig.eslint.json
├── .schemas
└── ext-project.env.schema.json
├── tsconfig.json
├── .all-contributorsrc
├── jest.config.js
├── LICENSE
├── logo.svg
├── .gitignore
├── README.md
├── package.json
└── .eslintrc.js
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | custom:
2 | - https://paypal.me/thatkookooguy?locale.x=en_US
--------------------------------------------------------------------------------
/.husky/commit-msg:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | . "$(dirname "$0")/_/husky.sh"
3 |
4 | npx --no-install commitlint --edit "$1"
--------------------------------------------------------------------------------
/.husky/prepare-commit-msg:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | . "$(dirname "$0")/_/husky.sh"
3 | exec < /dev/tty && node_modules/.bin/cz --hook || true
--------------------------------------------------------------------------------
/.github/boring-cyborg.yml:
--------------------------------------------------------------------------------
1 | labelPRBasedOnFilePath:
2 |
3 | Tools:
4 | - .github/**/*
5 | - .vscode/**/*
6 | - .husky/**/*
--------------------------------------------------------------------------------
/jest.setup.ts:
--------------------------------------------------------------------------------
1 | import findRoot from 'find-root';
2 |
3 |
4 | jest.mock('fs-extra');
5 | jest.mock('find-root');
6 |
7 | const findRootMock = findRoot as jest.Mock;
8 |
9 | findRootMock.mockReturnValue('/');
10 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | achievibit changelog
2 |
3 | # 1.0.0-beta.1 (2021-12-24)
4 |
5 |
6 | ### Features
7 |
8 | * **app:** initial implementation ([2b25ced](https://github.com/Kibibit/nconf-hjson/commit/2b25ced91228c4e50dd28587e0baf5d5aafa82cc))
9 |
--------------------------------------------------------------------------------
/src/index.ts:
--------------------------------------------------------------------------------
1 | import {
2 | parse as hjsonParse,
3 | stringify as hjsonStrigify } from 'hjson';
4 |
5 | export function stringify(obj: Record) {
6 | return hjsonStrigify(obj, {
7 | quotes: 'min',
8 | space: 2
9 | });
10 | }
11 |
12 | export function parse(text: string) {
13 | return hjsonParse(text);
14 | }
15 |
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": [
3 | "actboy168.tasks",
4 | "codeandstuff.package-json-upgrade",
5 | "dbaeumer.vscode-eslint",
6 | "eamodio.gitlens",
7 | "jock.svg",
8 | "mhutchie.git-graph",
9 | "wayou.vscode-todo-highlight",
10 | "wix.vscode-import-cost",
11 | "laktak.hjson"
12 | ]
13 | }
--------------------------------------------------------------------------------
/commitlint.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | extends: [ '@commitlint/config-angular' ],
3 | rules: {
4 | 'type-enum': [
5 | 2,
6 | 'always', [
7 | 'build',
8 | 'chore',
9 | 'ci',
10 | 'docs',
11 | 'feat',
12 | 'fix',
13 | 'perf',
14 | 'refactor',
15 | 'revert',
16 | 'style',
17 | 'test'
18 | ]
19 | ]
20 | }
21 | };
22 |
--------------------------------------------------------------------------------
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | # Each line is a file pattern followed by one or more owners.
2 |
3 | # These owners will be the default owners for everything in
4 | # the repo. Unless a later match takes precedence,
5 | # @global-owner1 and @global-owner2 will be requested for
6 | # review when someone opens a pull request.
7 | * @thatkookooguy
8 |
9 | # Build\Github Actions Owners
10 | /tools/ @thatkookooguy
11 | /.github/ @thatkookooguy
12 | /.devcontainer/ @thatkookooguy
13 | /.vscode/ @thatkookooguy
--------------------------------------------------------------------------------
/tsconfig.eslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "commonjs",
4 | "declaration": true,
5 | "declarationMap": true,
6 | "removeComments": true,
7 | "emitDecoratorMetadata": true,
8 | "experimentalDecorators": true,
9 | "allowSyntheticDefaultImports": true,
10 | "target": "es2017",
11 | "sourceMap": true,
12 | "esModuleInterop": true,
13 | "baseUrl": "./",
14 | "paths": {
15 | },
16 | "incremental": true,
17 | "skipLibCheck": true
18 | },
19 | "exclude": [ "node_modules", "test", "dist", "lib" ]
20 | }
--------------------------------------------------------------------------------
/.schemas/ext-project.env.schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "properties": {
3 | "PORT": {
4 | "type": "string",
5 | "description": "Server port"
6 | },
7 | "SLACK_ORGANIZATION_NAME": {
8 | "type": "string",
9 | "description": "This is the slack organization to talk to"
10 | },
11 | "SLACK_API_KEY": {
12 | "type": "string",
13 | "description": "This is the slack API to talk and report to channel \"hello\""
14 | }
15 | },
16 | "type": "object",
17 | "required": [
18 | "PORT",
19 | "SLACK_ORGANIZATION_NAME",
20 | "SLACK_API_KEY"
21 | ]
22 | }
23 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "commonjs",
4 | "declaration": true,
5 | "declarationMap": true,
6 | "removeComments": true,
7 | "emitDecoratorMetadata": true,
8 | "experimentalDecorators": true,
9 | "allowSyntheticDefaultImports": true,
10 | "target": "es2017",
11 | "sourceMap": true,
12 | "esModuleInterop": true,
13 | "outDir": "./lib",
14 | "baseUrl": "./",
15 | "paths": {
16 | },
17 | "incremental": true,
18 | "skipLibCheck": true
19 | },
20 | "exclude": [
21 | "node_modules",
22 | "test",
23 | "dist",
24 | "lib",
25 | "examples",
26 | "**/*spec.ts",
27 | "**/*mock.ts",
28 | "jest.config.js",
29 | "jest.setup.ts"
30 | ]
31 | }
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ### Description
2 | 🚨 Review the [guidelines for contributing](../CONTRIBUTING.md) to this repository. 🚨
3 |
4 | Please explain the changes you made here.
5 |
6 | You can explain individual changes as a list:
7 |
8 | - [ ] feature name: extra details
9 | - [ ] bug: extra details (resolves #`issue_number`)
10 |
11 | ### Checklist
12 | Please check if your PR fulfills the following requirements:
13 | - [ ] Code compiles correctly (`npm run build`)
14 | - [ ] Code is linted
15 | - [ ] Created tests which fail without the change (if possible)
16 | - All **relevant** tests are passing
17 | - [ ] Server Unit Tests
18 | - [ ] Client Unit Tests
19 | - [ ] Achievements Unit Tests
20 | - [ ] API Tests
21 | - [ ] E2E Tests
22 | - [ ] Extended the README / documentation, if necessary
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: Build
2 |
3 | on:
4 | pull_request:
5 | push:
6 | branches:
7 | - main
8 | - beta
9 |
10 | jobs:
11 | build:
12 | name: Build Production
13 | runs-on: ubuntu-latest
14 | steps:
15 | - name: Checkout commit
16 | uses: actions/checkout@v2
17 | - name: Setup Node.js
18 | uses: actions/setup-node@v1
19 | with:
20 | node-version: 14
21 | - name: Cache node modules
22 | uses: actions/cache@v2
23 | env:
24 | cache-name: cache-node-modules
25 | with:
26 | path: '**/node_modules'
27 | key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
28 | restore-keys: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.lock') }}
29 | - name: Install Dependencies
30 | run: npm install
31 | - name: Build
32 | run: npm run build
--------------------------------------------------------------------------------
/.all-contributorsrc:
--------------------------------------------------------------------------------
1 | {
2 | "projectName": "configit",
3 | "projectOwner": "Kibibit",
4 | "repoType": "github",
5 | "repoHost": "https://github.com",
6 | "files": [
7 | "README.md"
8 | ],
9 | "badgeTemplate": "
-orange.svg?style=flat-square\" alt=\"All Contributors\">",
10 | "imageSize": 100,
11 | "commit": false,
12 | "commitConvention": "angular",
13 | "contributors": [
14 | {
15 | "login": "Thatkookooguy",
16 | "name": "Neil Kalman",
17 | "avatar_url": "https://avatars3.githubusercontent.com/u/10427304?v=4",
18 | "profile": "http://thatkookooguy.kibibit.io/",
19 | "contributions": [
20 | "code",
21 | "doc",
22 | "design",
23 | "maintenance",
24 | "infra",
25 | "test"
26 | ]
27 | }
28 | ],
29 | "contributorsPerLine": 7,
30 | "skipCi": true
31 | }
--------------------------------------------------------------------------------
/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | testEnvironment: 'node',
3 | roots: [
4 | '/src'
5 | ],
6 | setupFilesAfterEnv: [
7 | './jest.setup.ts'
8 | ],
9 | testMatch: [
10 | '**/__tests__/**/*.+(ts|tsx|js)',
11 | '**/?(*.)+(spec|test).+(ts|tsx|js)'
12 | ],
13 | transform: {
14 | '^.+\\.(ts|tsx)$': 'ts-jest'
15 | },
16 | collectCoverageFrom: [
17 | '**/*.(t|j)s',
18 | '!**/*.decorator.ts',
19 | '!**/*.mock.ts',
20 | '!**/index.ts',
21 | '!**/dev-tools/**/*.ts'
22 | ],
23 | reporters: [
24 | 'default',
25 | [
26 | 'jest-stare',
27 | {
28 | 'resultDir': './test-results',
29 | 'reportTitle': 'jest-stare!',
30 | 'additionalResultsProcessors': [
31 | 'jest-junit'
32 | ],
33 | 'coverageLink': './coverage/lcov-report/index.html'
34 | }
35 | ]
36 | ],
37 | coverageReporters: [
38 | 'json',
39 | 'lcov',
40 | 'text',
41 | 'clover',
42 | 'html'
43 | ],
44 | coverageDirectory: './test-results/coverage'
45 | };
46 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 kibibit
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "editor.tabSize": 2,
3 | "editor.insertSpaces": true,
4 | "editor.detectIndentation": false,
5 | "editor.rulers": [120],
6 | "editor.matchBrackets": "always",
7 | "editor.bracketPairColorization.enabled": true,
8 | "editor.guides.bracketPairs":"active",
9 | "debug.javascript.autoAttachFilter": "onlyWithFlag",
10 | "editor.codeActionsOnSave": {
11 | "source.fixAll.eslint": true,
12 | },
13 | "eslint.format.enable": true,
14 | "bracketPairColorizer.colorMode": "Consecutive",
15 | "bracketPairColorizer.forceUniqueOpeningColor": true,
16 | "bracketPairColorizer.showBracketsInGutter": true,
17 | "window.title": "${activeEditorShort}${separator}${rootName} [kibibit]",
18 | "debug.javascript.terminalOptions": {
19 | "skipFiles": [
20 | "/**"
21 | ]
22 | },
23 | "svg.preview.background": "black",
24 | "todotodohighlight.isEnable": true,
25 | "todohighlight.keywordsPattern": "TODO(@\\w+?)?:",
26 | "todohighlight.defaultStyle": {
27 | "color": "black",
28 | "backgroundColor": "rgba(255, 221, 87, .8)",
29 | "overviewRulerColor": "rgba(255, 221, 87, .8)",
30 | "fontWeight": "bold",
31 | "borderRadius": "2px",
32 | "isWholeLine": true,
33 | }
34 | }
--------------------------------------------------------------------------------
/.github/workflows/lint.yml:
--------------------------------------------------------------------------------
1 | name: Lint
2 |
3 | on:
4 | workflow_dispatch:
5 | pull_request:
6 | push:
7 | branches:
8 | - main
9 | - beta
10 |
11 | jobs:
12 | run-linters:
13 | name: Run linters Server
14 | runs-on: ubuntu-latest
15 |
16 | steps:
17 | - name: Checkout Commit
18 | uses: actions/checkout@v2
19 | with:
20 | fetch-depth: 0
21 | - name: Setup Node.js
22 | uses: actions/setup-node@v1
23 | with:
24 | node-version: 14
25 | - name: Cache node modules
26 | uses: actions/cache@v2
27 | env:
28 | cache-name: cache-node-modules
29 | with:
30 | path: '**/node_modules'
31 | key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
32 | restore-keys: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.lock') }}
33 | - name: Install Dependencies
34 | run: npm install
35 | - name: Run linters
36 | uses: wearerequired/lint-action@v1.9.0
37 | with:
38 | # github_token: ${{ secrets.BOT_TOKEN }}
39 | # Enable linters
40 | eslint: true
41 | # Eslint options
42 | # eslint_dir: server/
43 | eslint_extensions: js,ts
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Release
2 | on:
3 | push:
4 | branches:
5 | - main
6 | - beta
7 | jobs:
8 | release:
9 | name: Release
10 | runs-on: ubuntu-18.04
11 | steps:
12 | - name: Checkout Commit
13 | uses: actions/checkout@v2
14 | with:
15 | fetch-depth: 0
16 | token: ${{ secrets.BOT_TOKEN }}
17 | - name: Setup Node.js
18 | uses: actions/setup-node@v1
19 | with:
20 | node-version: 14
21 | - name: Cache node modules
22 | uses: actions/cache@v2
23 | env:
24 | cache-name: cache-node-modules
25 | with:
26 | path: '**/node_modules'
27 | key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
28 | restore-keys: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.lock') }}
29 | - name: Install Dependencies
30 | run: npm install
31 | - name: Build
32 | run: npm run build --if-present
33 | - name: Release
34 | env:
35 | GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
36 | GIT_AUTHOR_NAME: k1b1b0t
37 | GIT_AUTHOR_EMAIL: k1b1b0t@kibibit.io
38 | GIT_COMMITTER_NAME: k1b1b0t
39 | GIT_COMMITTER_EMAIL: k1b1b0t@kibibit.io
40 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
41 | run: npm run semantic-release
--------------------------------------------------------------------------------
/.github/workflows/tests.yml:
--------------------------------------------------------------------------------
1 | name: Tests
2 | on:
3 | workflow_dispatch:
4 | pull_request:
5 | push:
6 | branches:
7 | - main
8 | - beta
9 |
10 | jobs:
11 | serverunittest:
12 | name: Tests
13 | runs-on: ubuntu-18.04
14 | steps:
15 | - name: Checkout Commit
16 | uses: actions/checkout@v2
17 | with:
18 | fetch-depth: 0
19 | - name: Setup Node.js
20 | uses: actions/setup-node@v1
21 | with:
22 | node-version: 14
23 | - name: Cache node modules
24 | uses: actions/cache@v2
25 | env:
26 | cache-name: cache-node-modules
27 | with:
28 | path: '**/node_modules'
29 | key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
30 | restore-keys: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.lock') }}
31 | - name: Install Dependencies
32 | run: npm install
33 | - name: Run Tests
34 | env:
35 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
37 | run: npm run test:cov
38 | - name: Archive test results & coverage
39 | uses: actions/upload-artifact@v2
40 | with:
41 | name: tests
42 | path: test-results
43 | - name: Upload coverage to Codecov
44 | uses: codecov/codecov-action@v1
45 | with:
46 | token: ${{ secrets.CODECOV_TOKEN }}
47 | directory: ./test-results/coverage
48 | fail_ci_if_error: true
--------------------------------------------------------------------------------
/logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | lib
2 | test-results
3 |
4 | # Logs
5 | logs
6 | *.log
7 | npm-debug.log*
8 | yarn-debug.log*
9 | yarn-error.log*
10 | lerna-debug.log*
11 |
12 | # Diagnostic reports (https://nodejs.org/api/report.html)
13 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
14 |
15 | # Runtime data
16 | pids
17 | *.pid
18 | *.seed
19 | *.pid.lock
20 |
21 | # Directory for instrumented libs generated by jscoverage/JSCover
22 | lib-cov
23 |
24 | # Coverage directory used by tools like istanbul
25 | coverage
26 | *.lcov
27 |
28 | # nyc test coverage
29 | .nyc_output
30 |
31 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
32 | .grunt
33 |
34 | # Bower dependency directory (https://bower.io/)
35 | bower_components
36 |
37 | # node-waf configuration
38 | .lock-wscript
39 |
40 | # Compiled binary addons (https://nodejs.org/api/addons.html)
41 | build/Release
42 |
43 | # Dependency directories
44 | node_modules/
45 | jspm_packages/
46 |
47 | # TypeScript v1 declaration files
48 | typings/
49 |
50 | # TypeScript cache
51 | *.tsbuildinfo
52 |
53 | # Optional npm cache directory
54 | .npm
55 |
56 | # Optional eslint cache
57 | .eslintcache
58 |
59 | # Microbundle cache
60 | .rpt2_cache/
61 | .rts2_cache_cjs/
62 | .rts2_cache_es/
63 | .rts2_cache_umd/
64 |
65 | # Optional REPL history
66 | .node_repl_history
67 |
68 | # Output of 'npm pack'
69 | *.tgz
70 |
71 | # Yarn Integrity file
72 | .yarn-integrity
73 |
74 | # dotenv environment variables file
75 | .env
76 | .env.test
77 |
78 | # parcel-bundler cache (https://parceljs.org/)
79 | .cache
80 |
81 | # Next.js build output
82 | .next
83 |
84 | # Nuxt.js build / generate output
85 | .nuxt
86 | dist
87 |
88 | # Gatsby files
89 | .cache/
90 | # Comment in the public line in if your project uses Gatsby and *not* Next.js
91 | # https://nextjs.org/blog/next-9-1#public-directory-support
92 | # public
93 |
94 | # vuepress build output
95 | .vuepress/dist
96 |
97 | # Serverless directories
98 | .serverless/
99 |
100 | # FuseBox cache
101 | .fusebox/
102 |
103 | # DynamoDB Local files
104 | .dynamodb/
105 |
106 | # TernJS port file
107 | .tern-port
108 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | @kibibit/nconf-hjson
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | Support hjson files for nconf
19 |
20 |
21 |
22 |
23 | ## Usage
24 | ```javascript
25 | const nconfHjson = require('@kibibit/nconf-hjson');
26 |
27 | nconf.file({
28 | file: '/path/to/some/file.hjson',
29 | format: nconfHjson
30 | });
31 | ```
32 |
33 | ## Contributors ✨
34 |
35 | Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
36 |
37 |
38 |
39 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind are welcome!
51 |
52 |
53 |
54 |
55 | ## Stay in touch
56 |
57 | - Author - [Neil Kalman](https://github.com/thatkookooguy)
58 | - Website - [https://github.com/kibibit](https://github.com/kibibit)
59 | - StackOverflow - [thatkookooguy](https://stackoverflow.com/users/1788884/thatkookooguy)
60 | - Twitter - [@thatkookooguy](https://twitter.com/thatkookooguy)
61 | - Twitter - [@kibibit_opensrc](https://twitter.com/kibibit_opensrc)
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@kibibit/nconf-hjson",
3 | "version": "1.0.0-beta.1",
4 | "description": "Add support for json with comments files in nconf",
5 | "main": "lib/index.js",
6 | "scripts": {
7 | "prebuild": "rimraf lib",
8 | "build": "tsc",
9 | "lint": "eslint -c ./.eslintrc.js \"{src,apps,libs,test,examples}/**/*.ts\"",
10 | "lint:fix": "eslint -c ./.eslintrc.js \"{src,apps,libs,test,examples}/**/*.ts\" --fix",
11 | "contributors:all": "cross-env HUSKY=0 node ./tools/get-all-contributors.js",
12 | "contributors:add": "cross-env HUSKY=0 all-contributors add",
13 | "contributors:generate": "cross-env HUSKY=1 all-contributors generate",
14 | "prepare": "husky install",
15 | "semantic-release": "cross-env HUSKY=0 semantic-release",
16 | "test": "jest",
17 | "test:watch": "jest --watch --verbose",
18 | "test:cov": "jest --coverage --verbose",
19 | "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand"
20 | },
21 | "repository": {
22 | "type": "git",
23 | "url": "https://github.com/Kibibit/nconf-hjson.git"
24 | },
25 | "keywords": [
26 | "nconf",
27 | "jsonc"
28 | ],
29 | "author": "thatkookooguy ",
30 | "license": "MIT",
31 | "bugs": {
32 | "url": "https://github.com/Kibibit/nconf-hjson/issues"
33 | },
34 | "homepage": "https://github.com/Kibibit/nconf-hjson#readme",
35 | "dependencies": {
36 | "hjson": "^3.2.2"
37 | },
38 | "devDependencies": {
39 | "@commitlint/cli": "^13.2.1",
40 | "@commitlint/config-angular": "^13.2.0",
41 | "@commitlint/config-conventional": "^13.2.0",
42 | "@semantic-release/changelog": "^6.0.0",
43 | "@semantic-release/commit-analyzer": "^9.0.1",
44 | "@semantic-release/git": "^10.0.0",
45 | "@semantic-release/github": "^8.0.1",
46 | "@semantic-release/npm": "^8.0.0",
47 | "@semantic-release/release-notes-generator": "^10.0.2",
48 | "@types/hjson": "^2.4.3",
49 | "@types/jest": "^27.0.2",
50 | "@types/nconf": "^0.10.1",
51 | "@types/node": "^16.10.3",
52 | "@typescript-eslint/eslint-plugin": "^4.33.0",
53 | "@typescript-eslint/parser": "^4.33.0",
54 | "all-contributors-cli": "^6.20.0",
55 | "commitizen": "^4.2.4",
56 | "cross-env": "^7.0.3",
57 | "cz-conventional-changelog": "^3.3.0",
58 | "cz-conventional-changelog-emoji": "^0.1.0",
59 | "eslint": "^7.32.0",
60 | "eslint-plugin-import": "^2.24.2",
61 | "eslint-plugin-simple-import-sort": "^7.0.0",
62 | "eslint-plugin-unused-imports": "^1.1.5",
63 | "husky": "^7.0.2",
64 | "jest": "^27.3.1",
65 | "jest-mock-process": "^1.4.1",
66 | "jest-stare": "^2.3.0",
67 | "rimraf": "^3.0.2",
68 | "semantic-release": "^18.0.1",
69 | "semantic-release-cli": "^5.4.4",
70 | "ts-jest": "^27.0.7",
71 | "ts-node": "^10.2.1",
72 | "typescript": "^4.4.4"
73 | },
74 | "publishConfig": {
75 | "access": "public"
76 | },
77 | "config": {
78 | "commitizen": {
79 | "path": "./node_modules/cz-conventional-changelog-emoji"
80 | }
81 | },
82 | "release": {
83 | "branches": [
84 | {
85 | "name": "main"
86 | },
87 | {
88 | "name": "beta",
89 | "channel": "beta",
90 | "prerelease": "beta"
91 | }
92 | ],
93 | "plugins": [
94 | [
95 | "@semantic-release/commit-analyzer",
96 | {
97 | "preset": "angular",
98 | "parserOpts": {
99 | "noteKeywords": [
100 | "BREAKING CHANGE",
101 | "BREAKING CHANGES",
102 | "BREAKING"
103 | ]
104 | }
105 | }
106 | ],
107 | [
108 | "@semantic-release/release-notes-generator",
109 | {
110 | "preset": "angular",
111 | "parserOpts": {
112 | "noteKeywords": [
113 | "BREAKING CHANGE",
114 | "BREAKING CHANGES",
115 | "BREAKING"
116 | ]
117 | },
118 | "writerOpts": {
119 | "commitsSort": [
120 | "subject",
121 | "scope"
122 | ]
123 | }
124 | }
125 | ],
126 | [
127 | "@semantic-release/changelog",
128 | {
129 | "changelogFile": "CHANGELOG.md",
130 | "changelogTitle": "achievibit changelog"
131 | }
132 | ],
133 | [
134 | "@semantic-release/git",
135 | {
136 | "assets": [
137 | "CHANGELOG.md"
138 | ]
139 | }
140 | ],
141 | "@semantic-release/npm",
142 | "@semantic-release/git",
143 | "@semantic-release/github"
144 | ]
145 | }
146 | }
147 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | parser: '@typescript-eslint/parser',
3 | parserOptions: {
4 | project: [
5 | './tsconfig.eslint.json'
6 | ],
7 | sourceType: 'module',
8 | },
9 | plugins: [
10 | '@typescript-eslint/eslint-plugin',
11 | 'unused-imports',
12 | 'simple-import-sort',
13 | 'import'
14 | ],
15 | extends: [
16 | 'plugin:@typescript-eslint/eslint-recommended',
17 | 'plugin:@typescript-eslint/recommended',
18 | ],
19 | ignorePatterns: [
20 | '.eslintrc.js',
21 | '**/*.event.ts',
22 | '**/lib/**/*.ts'
23 | ],
24 | root: true,
25 | env: {
26 | node: true,
27 | jest: true,
28 | },
29 | rules: {
30 | 'unused-imports/no-unused-imports': 'error',
31 | 'simple-import-sort/imports': ['error', {
32 | groups: [
33 | // 1. built-in node.js modules
34 | [`^(${require("module").builtinModules.join("|")})(/|$)`],
35 | // 2.1. package that start without @
36 | // 2.2. package that start with @
37 | ['^\\w', '^@\\w'],
38 | // 3. @nestjs packages
39 | ['^@nestjs\/'],
40 | // 4. @kibibit external packages
41 | ['^@kibibit\/'],
42 | // 5. Internal kibibit packages (inside this project)
43 | ['^@kb-'],
44 | // 6. Parent imports. Put `..` last.
45 | // Other relative imports. Put same-folder imports and `.` last.
46 | ["^\\.\\.(?!/?$)", "^\\.\\./?$", "^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
47 | // 7. Side effect imports.
48 | // https://riptutorial.com/javascript/example/1618/importing-with-side-effects
49 | ["^\\u0000"]
50 | ]
51 | }],
52 | 'import/first': 'error',
53 | 'import/newline-after-import': 'error',
54 | 'import/no-duplicates': 'error',
55 | 'eol-last': [ 2, 'windows' ],
56 | 'comma-dangle': [ 'error', 'never' ],
57 | 'max-len': [ 'error', { 'code': 80, "ignoreComments": true } ],
58 | 'quotes': ["error", "single"],
59 | '@typescript-eslint/no-empty-interface': 'error',
60 | '@typescript-eslint/member-delimiter-style': 'error',
61 | '@typescript-eslint/explicit-function-return-type': 'off',
62 | '@typescript-eslint/explicit-module-boundary-types': 'off',
63 | '@typescript-eslint/naming-convention': [
64 | "error",
65 | {
66 | "selector": "interface",
67 | "format": ["PascalCase"],
68 | "custom": {
69 | "regex": "^I[A-Z]",
70 | "match": true
71 | }
72 | }
73 | ],
74 | "semi": "off",
75 | "@typescript-eslint/semi": ["error"],
76 | 'space-infix-ops': 'error',
77 | 'array-bracket-newline': 'off',
78 | 'array-bracket-spacing': [ 'error', 'always' ],
79 | 'array-element-newline': 'off',
80 | 'block-spacing': [ 'error', 'always' ],
81 | 'brace-style': [ 'error', '1tbs', {
82 | 'allowSingleLine': true
83 | } ],
84 | 'camelcase': [ 'error', {
85 | 'properties': 'never'
86 | } ],
87 | 'comma-dangle': [ 'error', 'never' ],
88 | 'comma-spacing': [ 'error', {
89 | 'after': true,
90 | 'before': false
91 | } ],
92 | 'comma-style': 'error',
93 | 'computed-property-spacing': 'error',
94 | 'curly': [ 'error', 'multi-line' ],
95 | 'eol-last': 'error',
96 | 'func-call-spacing': 'error',
97 | 'indent': [ 'error', 2, {
98 | 'CallExpression': {
99 | 'arguments': 1
100 | },
101 | 'FunctionDeclaration': {
102 | 'body': 1,
103 | 'parameters': 1
104 | },
105 | 'FunctionExpression': {
106 | 'body': 1,
107 | 'parameters': 1
108 | },
109 | 'ignoredNodes': [ 'ConditionalExpression' ],
110 | 'MemberExpression': 1,
111 | 'ObjectExpression': 1,
112 | 'SwitchCase': 1
113 | } ],
114 | 'key-spacing': 'error',
115 | 'keyword-spacing': 'error',
116 | 'linebreak-style': 'error',
117 | 'max-len': [ 'error', {
118 | // starting small (forcing 120), but later we should force 80
119 | code: 120,
120 | ignoreComments: true,
121 | ignoreUrls: true,
122 | ignoreStrings: true,
123 | tabWidth: 2
124 | } ],
125 | 'no-array-constructor': 'error',
126 | 'no-caller': 'error',
127 | 'no-extend-native': 'error',
128 | 'no-extra-bind': 'error',
129 | 'no-invalid-this': 'error',
130 | 'no-irregular-whitespace': 'error',
131 | 'no-mixed-spaces-and-tabs': 'error',
132 | 'no-multi-spaces': 'error',
133 | 'no-multi-str': 'error',
134 |
135 | 'no-multiple-empty-lines': [ 'error', {
136 | max: 2
137 | } ],
138 | 'no-new-object': 'error',
139 | 'no-new-wrappers': 'error',
140 | 'no-tabs': 'error',
141 | 'no-throw-literal': 'error',
142 | 'no-trailing-spaces': 'error',
143 | 'no-unused-vars': [ 'error', {
144 | args: 'none'
145 | } ],
146 |
147 | 'no-with': 'error',
148 | 'object-curly-spacing': [ 'error', 'always' ],
149 | 'one-var': [ 'error', {
150 | const: 'never',
151 | let: 'never',
152 | var: 'never'
153 | } ],
154 | 'operator-linebreak': [ 'error', 'after' ],
155 | 'padded-blocks': [ 'error', 'never' ],
156 | 'prefer-promise-reject-errors': 'error',
157 | 'quotes': [ 'error', 'single', {
158 | allowTemplateLiterals: true
159 | } ],
160 | 'semi': [ 'error' ],
161 | 'semi-spacing': 'error',
162 | 'space-before-blocks': 'error',
163 | 'space-before-function-paren': [ 'error', {
164 | asyncArrow: 'always',
165 | anonymous: 'never',
166 | named: 'never'
167 | } ],
168 | 'spaced-comment': [ 'error', 'always' ],
169 | 'switch-colon-spacing': 'error',
170 | 'arrow-parens': [ 'error', 'always' ],
171 | 'constructor-super': 'error', // eslint:recommended
172 | 'generator-star-spacing': [ 'error', 'after' ],
173 | 'no-new-symbol': 'error', // eslint:recommended
174 | 'no-this-before-super': 'error', // eslint:recommended
175 | 'no-var': 'error',
176 | 'prefer-const': [ 'error', { destructuring: 'all' } ],
177 | 'prefer-rest-params': 'error',
178 | 'prefer-spread': 'error',
179 | 'rest-spread-spacing': 'error',
180 | 'yield-star-spacing': [ 'error', 'after' ],
181 | 'no-await-in-loop': 'warn',
182 | 'no-unreachable-loop': 'error',
183 | 'require-atomic-updates': 'error',
184 | 'dot-notation': 'error',
185 | 'require-await': 'warn',
186 | 'no-undefined': 'error',
187 | 'line-comment-position': [ 'error', { position: 'above' } ],
188 | 'template-curly-spacing': [ 'error', 'always' ]
189 | }
190 | };
--------------------------------------------------------------------------------