Skip to content

Commit 6feeba3

Browse files
committed
Initial commit
0 parents  commit 6feeba3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+12186
-0
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ "main" ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ "main" ]
20+
schedule:
21+
- cron: '38 16 * * 6'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'javascript' ]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v3
42+
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v2
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
52+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
53+
# queries: security-extended,security-and-quality
54+
55+
56+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
57+
# If this step fails, then you should remove it and run the build manually (see below)
58+
- name: Autobuild
59+
uses: github/codeql-action/autobuild@v2
60+
61+
# ℹ️ Command-line programs to run using the OS shell.
62+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
63+
64+
# If the Autobuild fails above, remove it and uncomment the following three lines.
65+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
66+
67+
# - run: |
68+
# echo "Run, Build Application using script"
69+
# ./location_of_script_within_repo/buildscript.sh
70+
71+
- name: Perform CodeQL Analysis
72+
uses: github/codeql-action/analyze@v2
73+
with:
74+
category: "/language:${{matrix.language}}"

.github/workflows/nodejs.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Node CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v1
12+
- name: Use Node.js 18
13+
uses: actions/setup-node@v3
14+
with:
15+
node-version: 18
16+
- name: npm install, lint, build, and test
17+
run: |
18+
yarn install --immutable
19+
yarn lint
20+
yarn build
21+
yarn test
22+
env:
23+
CI: true

.github/workflows/npmpublish.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Node.js Package
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v1
13+
- uses: actions/setup-node@v3
14+
with:
15+
node-version: 18
16+
- run: yarn install --immutable
17+
- run: yarn lint
18+
- run: yarn test
19+
- run: yarn build
20+
21+
publish-npm:
22+
needs: build
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v1
26+
- uses: actions/setup-node@v3
27+
with:
28+
node-version: 18
29+
registry-url: https://registry.npmjs.org/
30+
- run: yarn install --immutable
31+
- run: yarn build
32+
- run: npm publish
33+
env:
34+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
35+

.gitignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
test_output.log
2+
.idea
3+
node_modules
4+
build
5+
coverage
6+
.nyc_output
7+
*.log
8+
.tap_output
9+
10+
.yarn/*
11+
!.yarn/patches
12+
!.yarn/plugins
13+
!.yarn/releases
14+
!.yarn/sdks
15+
!.yarn/versions
16+
17+
.node_repl_history
18+
19+
# TypeScript incremental compilation cache
20+
*.tsbuildinfo
21+
.eslintcache
22+
23+
# Added by coconfig
24+
.eslintignore
25+
.npmignore
26+
tsconfig.json
27+
tsconfig.build.json
28+
jest.config.js
29+
.prettierrc.js
30+
.eslintrc.js

.husky/pre-commit

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
yarn lint-staged
5+
yarn build
6+
yarn test
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
diff --git a/dist/lib/provider.js b/dist/lib/provider.js
2+
index 3ec01c9a89d0ab60a243361b01266123f2830d98..b7e55de474dd2df02546e13a1dfe8e1c146ec958 100644
3+
--- a/dist/lib/provider.js
4+
+++ b/dist/lib/provider.js
5+
@@ -104,7 +104,7 @@ module.exports = {
6+
for (var _iterator = _core.$for.getIterator(_core.Object.keys(process.env)), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
7+
var env = _step.value;
8+
9+
- //env:env is decided by process.env.NODE_ENV.
10+
+ //env:env is decided by process.env.APP_ENV or process.env.NODE_ENV.
11+
//Not allowing process.env.env to override the env:env value.
12+
if (ignore.indexOf(env) < 0) {
13+
result[env] = process.env[env];
14+
@@ -131,10 +131,10 @@ module.exports = {
15+
convenience: function convenience() {
16+
var nodeEnv, env;
17+
18+
- nodeEnv = process.env.NODE_ENV || "development";
19+
+ nodeEnv = process.env.APP_ENV || process.env.NODE_ENV || "development";
20+
env = {};
21+
22+
- debug("NODE_ENV set to " + nodeEnv);
23+
+ debug("APP_ENV/NODE_ENV set to " + nodeEnv);
24+
25+
// Normalize env and set convenience values.
26+
var _iteratorNormalCompletion = true;
27+
diff --git a/lib/provider.js b/lib/provider.js
28+
index f3ec9377f40e8f9322310598b6104232d36dc0fe..577ca1812e75a3d5bb97e994385ba5d4a4dab6a6 100644
29+
--- a/lib/provider.js
30+
+++ b/lib/provider.js
31+
@@ -49,7 +49,7 @@ module.exports = {
32+
// process.env is not a normal object, so we
33+
// need to map values.
34+
for (let env of Object.keys(process.env)) {
35+
- //env:env is decided by process.env.NODE_ENV.
36+
+ //env:env is decided by process.env.APP_ENV or process.env.NODE_ENV.
37+
//Not allowing process.env.env to override the env:env value.
38+
if (ignore.indexOf(env) < 0) {
39+
result[env] = process.env[env];
40+
@@ -63,10 +63,10 @@ module.exports = {
41+
convenience() {
42+
var nodeEnv, env;
43+
44+
- nodeEnv = process.env.NODE_ENV || 'development';
45+
+ nodeEnv = process.env.APP_ENV || process.env.NODE_ENV || 'development';
46+
env = {};
47+
48+
- debug(`NODE_ENV set to ${nodeEnv}`);
49+
+ debug(`APP_ENV/NODE_ENV set to ${nodeEnv}`);
50+
51+
// Normalize env and set convenience values.
52+
for (let current of Object.keys(Common.env)) {

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Lines changed: 541 additions & 0 deletions
Large diffs are not rendered by default.

.yarn/releases/yarn-3.2.3.cjs

Lines changed: 783 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
nodeLinker: node-modules
2+
3+
plugins:
4+
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
5+
spec: "@yarnpkg/plugin-interactive-tools"
6+
7+
yarnPath: .yarn/releases/yarn-3.2.3.cjs

@types/config.d.ts

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/* eslint-disable import/no-default-export */
2+
declare module 'shortstop-handlers' {
3+
export function require(module: string): ReturnType<NodeRequire>;
4+
export function env(): (envVarName: string) => string | undefined;
5+
export function base64(): (blob: string) => Buffer;
6+
export function path(baseDir?: string): (relativePath: string) => string;
7+
export function file(baseDir?: string): (relativePath: string) => Buffer | string;
8+
}
9+
10+
declare module 'shortstop-yaml' {
11+
export default function yaml<T>(
12+
basepath: string,
13+
): (path: string, callback: (error?: Error, result?: T) => void) => void;
14+
}
15+
16+
declare module 'shortstop-dns' {
17+
export default function dns(opts?: {
18+
family?: number;
19+
all?: boolean;
20+
}): (address: string, callback: (error?: Error, result?: string[]) => void) => void;
21+
}
22+
23+
declare module '@gasbuddy/confit' {
24+
type Json = ReturnType<typeof JSON.parse>
25+
26+
export type ProtocolFn<CallbackType> = (value: Json, callback?: (error?: Error, result?: CallbackType) => void) => void;
27+
28+
interface ProtocolsSetPrivate<C> {
29+
[protocol: string]: ProtocolFn<C> | ProtocolFn<C>[];
30+
}
31+
32+
interface ConfigStore {
33+
get<T>(name: string): T | undefined;
34+
set<T>(name: string, newValue: T): T;
35+
use(newSettings: unknown): void;
36+
}
37+
38+
type Options<C> = {
39+
basedir: string;
40+
protocols: ProtocolsSetPrivate<C>;
41+
};
42+
43+
interface ConfigFactory {
44+
create(callback: (err: Error, config: ConfigStore) => unknown): void;
45+
addOverride(filepathOrSettingsObj: string | object): this;
46+
addDefault(filepathOrSettingsObj: string | object): this;
47+
}
48+
49+
function confit<C>(optionsOrBaseDir: Options<C> | string): ConfigFactory;
50+
51+
namespace confit {
52+
export type ProtocolsSet<C> = ProtocolsSetPrivate<C>
53+
}
54+
55+
export default confit;
56+
}

0 commit comments

Comments
 (0)