Skip to content
This repository has been archived by the owner on Apr 2, 2023. It is now read-only.

Commit

Permalink
feat: initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
tdreyno committed Mar 4, 2021
1 parent c52d393 commit 8ec1bcc
Show file tree
Hide file tree
Showing 9 changed files with 4,129 additions and 445 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: "CodeQL"

on:
push:
branches: [main, ]
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
schedule:
- cron: '0 2 * * 6'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java

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

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
6 changes: 6 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@ jobs:
- run: yarn install --ignore-engines
- run: yarn test
- run: yarn build
- name: Code Climate Coverage Action
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: 8aa5d9788684e976d2052500db739d506f554674994055ea137ebaef947e59d5
with:
coverageCommand: yarn coverage
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release
on:
push:
branches:
- main
jobs:
release:
name: Release
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 14
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn semantic-release
35 changes: 35 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"branches": [
"main"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/npm",
{
"pkgRoot": "pkg"
}
],
[
"@semantic-release/git",
{
"assets": [
"package.json"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
[
"@semantic-release/github",
{
"assets": [
{
"path": "pkg/dist-web/index.min.js",
"label": "Minified Web Distribution"
}
]
}
]
]
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# pii

[![Test Coverage](https://api.codeclimate.com/v1/badges/1c788782dac545f74307/test_coverage)](https://codeclimate.com/github/tdreyno/pii/test_coverage)
[![npm latest version](https://img.shields.io/npm/v/@tdreyno/pii/latest.svg)](https://www.npmjs.com/package/@tdreyno/pii)
[![Minified Size](https://badgen.net/bundlephobia/minzip/@tdreyno/pii)](https://bundlephobia.com/result?p=@tdreyno/pii)

Expand Down
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ["@commitlint/config-conventional"] };
25 changes: 23 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
"build": "pika build && yarn compress",
"compress": "terser pkg/dist-web/index.js -o pkg/dist-web/index.min.js --source-map --mangle --compress passes=2 --toplevel --mangle-props regex=/_$/ && gzip-size pkg/dist-web/index.min.js",
"test": "jest --runInBand",
"version": "yarn run build"
"version": "yarn run build",
"coverage": "jest --runInBand --coverage --coverageDirectory '../coverage'",
"commit": "git-cz",
"semantic-release": "semantic-release"
},
"@pika/pack": {
"pipeline": [
Expand All @@ -32,6 +35,9 @@
]
]
},
"engines": {
"node": ">=10"
},
"lint-staged": {
"*.{ts,tsx}": [
"eslint -c .eslintrc.js --ext .ts src --fix",
Expand All @@ -43,6 +49,7 @@
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-commit": "lint-staged"
}
},
Expand All @@ -51,13 +58,21 @@
"yarn": "1.22.4"
},
"devDependencies": {
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@commitlint/prompt": "^11.0.0",
"@pika/pack": "^0.5.0",
"@pika/plugin-build-node": "^0.9.2",
"@pika/plugin-build-web": "^0.9.2",
"@pika/plugin-ts-standard-pkg": "^0.9.2",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/git": "^9.0.0",
"@semantic-release/github": "^7.2.0",
"@types/jest": "^26.0.20",
"@typescript-eslint/eslint-plugin": "^4.16.1",
"@typescript-eslint/parser": "^4.16.1",
"commitizen": "^4.2.3",
"cz-conventional-changelog": "3.3.0",
"eslint": "^7.21.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-prettier": "^3.3.1",
Expand All @@ -66,11 +81,17 @@
"jest": "^26.6.3",
"lint-staged": "^10.5.4",
"prettier": "^2.2.1",
"semantic-release": "^17.3.8",
"terser": "^5.6.0",
"ts-jest": "^26.5.2",
"ts-toolbelt": "^9.5.3",
"typescript": "^4.2.2"
},
"dependencies": {},
"peerDependencies": {}
"peerDependencies": {},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
}
4 changes: 2 additions & 2 deletions src/pii.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
class PII<T> {
constructor(
private _fire_me_if_you_see_me_accessing_this_property_outside_pii_ts: T,
) {}
) { }

toString() {
return "PII<REDACTED>"
Expand Down Expand Up @@ -102,7 +102,7 @@ export const unwrapObject = (input: unknown): unknown =>
return sum
}, {} as Record<string, unknown>),
array: a => a.map(unwrapObject),
primitive: p => (p instanceof PII ? unwrap(p) : p),
primitive: p => p,
})

export default markPII
Loading

0 comments on commit 8ec1bcc

Please sign in to comment.