Skip to content

Commit

Permalink
chore: initialize the environment (#1)
Browse files Browse the repository at this point in the history
* chore: initializing the environment

* chore: fix path typo
  • Loading branch information
wellwelwel authored Apr 10, 2024
1 parent 47cd46f commit be2e6d8
Show file tree
Hide file tree
Showing 15 changed files with 4,058 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
root = true

[*]
indent_size = 2
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/lib
/CHANGELOG.md
109 changes: 109 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "import", "prettier"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"prettier"
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"import/no-cycle": ["error", { "maxDepth": "∞" }],
"prettier/prettier": "error",
"no-restricted-syntax": [
"error",
{
"selector": "ImportDeclaration[source.value=/^\\./][source.value!=/\\.(js)$/]",
"message": "Local imports must have the explicit extension"
}
],
"max-len": [
"error",
{
"code": 80,
"ignoreComments": true,
"ignoreTrailingComments": true,
"ignoreUrls": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true,
"ignoreRegExpLiterals": true
}
],
"eol-last": ["error", "always"],
"import/no-default-export": "error",
"eqeqeq": [2, "always"],
"no-var": 2,
"block-scoped-var": 2,
"no-async-promise-executor": "off",
"no-bitwise": [2, { "allow": ["~"] }],
"no-duplicate-imports": [2, { "includeExports": true }],
"no-eq-null": 2,
"no-multiple-empty-lines": [2, { "max": 1, "maxEOF": 0 }],
"no-template-curly-in-string": 2,
"no-unneeded-ternary": 2,
"quote-props": [2, "as-needed"],
"require-await": 2,
"rest-spread-spacing": [2, "never"],
"semi-spacing": 2,
"space-before-function-paren": [
2,
{ "anonymous": "always", "named": "never", "asyncArrow": "always" }
],
"space-unary-ops": 2,
"yoda": 2,
"no-const-assign": 2,
"no-extra-semi": 2,
"for-direction": 2,
"no-eval": 2,
"no-empty": ["error", { "allowEmptyCatch": true }]
},
"env": {
"browser": false,
"node": true
},
"overrides": [
{
"files": ["*.ts"],
"rules": {
"@typescript-eslint/semi": ["error", "always"],
"@typescript-eslint/quotes": [
"error",
"single",
{ "avoidEscape": true, "allowTemplateLiterals": true }
],
"@typescript-eslint/no-empty-function": [
"error",
{ "allow": ["arrowFunctions"] }
]
}
},
{
"files": ["*.js"],
"parserOptions": {
"project": null
},
"rules": {
"semi": ["error", "always"],
"quotes": [
"error",
"single",
{ "avoidEscape": true, "allowTemplateLiterals": true }
],
"no-unused-vars": 2
}
}
],
"settings": {
"import/resolver": {
"typescript": {
"alwaysTryTypes": true,
"extensions": [".js", ".ts"]
}
}
}
}
80 changes: 80 additions & 0 deletions .github/workflows/ci-codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: 'CodeQL'

on:
push:
branches:
- 'main'
pull_request:
workflow_dispatch:

jobs:
analyze:
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ['javascript-typescript']
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more 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
# queries: security-extended,security-and-quality
config-file: ./.github/codeql/codeql-config.yml

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: '/language:${{matrix.language}}'
35 changes: 35 additions & 0 deletions .github/workflows/ci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Lint
on:
push:
branches:
- 'main'
pull_request:
workflow_dispatch:
jobs:
Lint:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: false
name: Checker
steps:
- name: Actions - Checkout
uses: actions/checkout@v4

- name: Actions - Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: '20.x'

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: npm-linux-${{ hashFiles('package-lock.json') }}
restore-keys: npm-linux-

- name: Installing Dependencies
run: npm ci

- name: Checking Lint Rules
run: npm run lint
37 changes: 37 additions & 0 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: 'CI - Linux'
on:
push:
branches:
- 'main'
pull_request:
workflow_dispatch:
jobs:
node:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
node-version: [20.x]
name: Node.js ${{ matrix.node-version }}
steps:
- name: Actions - Checkout
uses: actions/checkout@v4

- name: Actions - Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: npm-linux-${{ hashFiles('package-lock.json') }}
restore-keys: npm-linux-

- name: Installing Dependencies
run: npm ci

- name: Building the Lib
run: npm run build
56 changes: 56 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: 'Deploy'
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
release-please:
runs-on: ubuntu-latest
timeout-minutes: 5
name: Release Please
steps:
- name: Install release-please
uses: google-github-actions/release-please-action@v3
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
package-name: aws-ssl-profiles
changelog-path: 'CHANGELOG.md'

- name: Actions - Checkout
uses: actions/checkout@v4
if: ${{ steps.release.outputs.releases_created }}

- name: Actions - Setup NodeJS
uses: actions/setup-node@v4
if: ${{ steps.release.outputs.releases_created }}
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'

- name: Cache dependencies
uses: actions/cache@v4
if: ${{ steps.release.outputs.releases_created }}
with:
path: ~/.npm
key: npm-linux-${{ hashFiles('package-lock.json') }}
restore-keys: npm-linux-

- name: Installing Dependencies
if: ${{ steps.release.outputs.releases_created }}
run: npm ci

- name: Building Lib
if: ${{ steps.release.outputs.releases_created }}
run: npm run build

# - name: Publishing Package
# if: ${{ steps.release.outputs.releases_created }}
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# run: npm publish
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
.vscode
.DS_Store
/lib
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/lib
/CHANGELOG.md
17 changes: 17 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"printWidth": 80,
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"quoteProps": "as-needed",
"jsxSingleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"bracketSameLine": false,
"arrowParens": "always",
"proseWrap": "preserve",
"htmlWhitespaceSensitivity": "css",
"endOfLine": "auto",
"embeddedLanguageFormatting": "auto",
"singleAttributePerLine": false
}
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# aws-ssl-profiles
AWS RDS certificates bundles
# AWS SSL Profiles

AWS RDS Certificates Bundles
Loading

0 comments on commit be2e6d8

Please sign in to comment.