-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b081dcf
Showing
16 changed files
with
5,893 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Changesets | ||
|
||
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works | ||
with multi-package repos, or single-package repos to help you version and publish your code. You can | ||
find the full documentation for it [in our repository](https://github.com/changesets/changesets) | ||
|
||
We have a quick list of common questions to get you started engaging with this project in | ||
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"changelog": "@changesets/cli/changelog", | ||
"commit": false, | ||
"fixed": [], | ||
"linked": [], | ||
"access": "restricted", | ||
"baseBranch": "main", | ||
"updateInternalDependencies": "patch", | ||
"ignore": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* eslint-env node */ | ||
module.exports = { | ||
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['@typescript-eslint', 'perfectionist', 'unused-imports'], | ||
root: true, | ||
ignorePatterns: ['**.test.ts'], | ||
rules: { | ||
/** | ||
* Unused import and vars: | ||
* https://github.com/sweepline/eslint-plugin-unused-imports | ||
*/ | ||
'unused-imports/no-unused-imports': 'error', | ||
'@typescript-eslint/consistent-type-imports': 'error', | ||
/** | ||
* For config: https://eslint-plugin-perfectionist.azat.io/rules/sort-imports | ||
*/ | ||
'perfectionist/sort-imports': [ | ||
'error', | ||
{ | ||
type: 'line-length', | ||
order: 'asc', | ||
groups: [ | ||
'type', | ||
['builtin', 'external'], | ||
'internal-type', | ||
'internal', | ||
['parent-type', 'sibling-type', 'index-type'], | ||
['parent', 'sibling', 'index'], | ||
'side-effect', | ||
'style', | ||
'object', | ||
'unknown', | ||
], | ||
'newlines-between': 'always', | ||
'internal-pattern': ['@/nammatham/**'], | ||
}, | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- "**" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
cache: "pnpm" | ||
|
||
- run: pnpm install --frozen-lockfile | ||
- run: pnpm run all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Publish | ||
on: | ||
workflow_run: | ||
workflows: ["CI"] | ||
types: | ||
- completed | ||
push: | ||
branches: | ||
- "main" | ||
|
||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
jobs: | ||
publish: | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
cache: "pnpm" | ||
|
||
- run: pnpm install --frozen-lockfile | ||
- name: Create Release Pull Request or Publish | ||
id: changesets | ||
uses: changesets/action@v1 | ||
with: | ||
publish: pnpm run release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
.pnpm-debug.log* | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
*.lcov | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# Snowpack dependency directory (https://snowpack.dev/) | ||
web_modules/ | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional stylelint cache | ||
.stylelintcache | ||
|
||
# Microbundle cache | ||
.rpt2_cache/ | ||
.rts2_cache_cjs/ | ||
.rts2_cache_es/ | ||
.rts2_cache_umd/ | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variable files | ||
.env | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
.env.local | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
.parcel-cache | ||
|
||
# Next.js build output | ||
.next | ||
out | ||
|
||
# Nuxt.js build / generate output | ||
.nuxt | ||
dist | ||
|
||
# Gatsby files | ||
.cache/ | ||
# Comment in the public line in if your project uses Gatsby and not Next.js | ||
# https://nextjs.org/blog/next-9-1#public-directory-support | ||
# public | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# vuepress v2.x temp and cache directory | ||
.temp | ||
.cache | ||
|
||
# Docusaurus cache and generated files | ||
.docusaurus | ||
|
||
# Serverless directories | ||
.serverless/ | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
||
# DynamoDB Local files | ||
.dynamodb/ | ||
|
||
# TernJS port file | ||
.tern-port | ||
|
||
# Stores VSCode versions used for testing VSCode extensions | ||
.vscode-test | ||
|
||
# yarn v2 | ||
.yarn/cache | ||
.yarn/unplugged | ||
.yarn/build-state.yml | ||
.yarn/install-state.gz | ||
.pnp.* | ||
|
||
.tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"trailingComma": "es5", | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"semi": true, | ||
"singleQuote": true, | ||
"printWidth": 120, | ||
"arrowParens": "avoid" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# @mild-ts/npm-typescript-boilerplate | ||
|
||
## 1.0.0 | ||
|
||
### Major Changes | ||
|
||
- cfd28b1: Release first stable version | ||
|
||
## Breaking Changes | ||
|
||
- Type changed from `ServerOptions` to `DataViewerOptions` | ||
- Moved `logger?: LoggerOptions;` from `DataViewerOptions` to `StartOptions` with new option name `loggerOption?: LoggerOptions;` for `start` method | ||
- Used `logger?: Logger;` in `DataViewerOptions` for custom logger | ||
- Moved `port` from `DataViewerOptions` to `start` method (with type `StartOptions`) | ||
`DataViewerOptions` is now dataViewer.addOption | ||
- `TableComponent` interface `data` property is allow `(Record<string, unknown> | object)[];` type. | ||
|
||
## New Features | ||
|
||
## **Create Data Container** | ||
|
||
Sometimes, you may want to create a data container and add data to it later. | ||
|
||
```ts | ||
export function myReport() { | ||
const container = new Container(); | ||
container.addHeader('My Header'); | ||
return container.get(); | ||
} | ||
|
||
dataViewer.addContainer(myReport()); | ||
dataViewer.start(); | ||
``` | ||
|
||
## Support Custom Server | ||
|
||
You can use the `registerMiddleware` method to integrate with your existing server. | ||
|
||
```ts | ||
const getUsers = async () => (await fetch('https://jsonplaceholder.typicode.com/users')).json(); | ||
|
||
const dataViewer = new DataViewer({ | ||
path: '/viewer', | ||
}); | ||
|
||
dataViewer.addHeader('User Table'); | ||
dataViewer.addTable(await getUsers()); | ||
|
||
const app = express(); | ||
dataViewer.registerMiddleware(app); | ||
|
||
app.listen(3000, async () => console.log(`Already servered on http://localhost:3000/viewer`)); | ||
``` | ||
|
||
## Support Custom Logger | ||
|
||
You can use the `logger` option to integrate with your existing log, | ||
this example uses [pino](https://github.com/pinojs/pino) log | ||
|
||
```ts | ||
import pino from 'pino'; | ||
const logger = pino(); | ||
|
||
const stringLogger = { | ||
log: (message: string) => logger.info(message), | ||
debug: (message: string) => logger.debug(message), | ||
info: (message: string) => logger.info(message), | ||
warn: (message: string) => logger.warn(message), | ||
error: (message: string) => logger.error(message), | ||
}; | ||
|
||
const dataViewer = new DataViewer({ | ||
path: '/viewer', | ||
logger: stringLogger, | ||
}).start(); | ||
``` | ||
|
||
## 0.0.2 | ||
|
||
### Patch Changes | ||
|
||
- 1003c11: Setup export default | ||
|
||
## 0.0.1 | ||
|
||
### Patch Changes | ||
|
||
- 6d99ec6: Init boilerplate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Typed Notion Client | ||
|
||
`@notionhq/client` wrapper with better Type-safe for Notion API. |
Oops, something went wrong.