Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@withease/logger #41

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/spotty-dodos-argue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@withease/logger': minor
---

Initial release
2 changes: 2 additions & 0 deletions apps/website/docs/.vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default defineConfig({
{ text: 'i18next', link: '/i18next/' },
{ text: 'web-api', link: '/web-api/' },
{ text: 'factories', link: '/factories/' },
{ text: 'logger', link: '/logger/' },
],
},
{ text: 'Magazine', link: '/magazine/' },
Expand Down Expand Up @@ -69,6 +70,7 @@ export default defineConfig({
{ text: 'Motivation', link: '/factories/motivation' },
{ text: 'Important Caveats', link: '/factories/important_caveats' },
]),
...createSidebar('logger', [{ text: 'Get Started', link: '/logger/' }]),
'/magazine/': [
{
text: 'Architecture',
Expand Down
5 changes: 5 additions & 0 deletions apps/website/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ features:
details: Web API bindings — network status, tab visibility, and more
link: /web-api/
linkText: Get Started
- icon: 📜
title: logger
details: Minimalistic backend-agnostic logger for web applications
link: /logger/
linkText: Get Started
- icon: 🪄
title: Farfetched
details: The advanced data fetching tool for web applications
Expand Down
1 change: 1 addition & 0 deletions apps/website/docs/logger/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# logger
10 changes: 10 additions & 0 deletions packages/logger/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"presets": [
[
"@nrwl/js/babel",
{
"useBuiltIns": false
}
]
]
}
18 changes: 18 additions & 0 deletions packages/logger/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*", "node_modules"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}
1 change: 1 addition & 0 deletions packages/logger/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# @withease/logger
11 changes: 11 additions & 0 deletions packages/logger/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# logger

This library was generated with [Nx](https://nx.dev).

## Building

Run `nx build logger` to build the library.

## Running unit tests

Run `nx test logger` to execute the unit tests via [Jest](https://jestjs.io).
1 change: 1 addition & 0 deletions packages/logger/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { t } from './src/t';
5 changes: 5 additions & 0 deletions packages/logger/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "@withease/logger",
"version": "0.0.1",
"type": "commonjs"
}
86 changes: 86 additions & 0 deletions packages/logger/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"name": "logger",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/logger/src",
"projectType": "library",
"targets": {
"pack": {
"executor": "nx:run-commands",
"options": {
"command": "node tools/scripts/typepack.mjs --package logger"
},
"dependsOn": [
{
"projects": "self",
"target": "build"
}
]
},
"build": {
"executor": "@nrwl/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/packages/logger",
"entryFile": "packages/logger/index.ts",
"tsConfig": "packages/logger/tsconfig.build.json",
"project": "packages/logger/package.json",
"format": ["esm", "cjs"],
"generateExportsField": true,
"compiler": "babel"
}
},
"publish": {
"executor": "nx:run-commands",
"options": {
"command": "node tools/scripts/publish.mjs logger"
},
"dependsOn": [
{
"projects": "self",
"target": "pack"
}
]
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["packages/logger/**/*.ts"]
}
},
"test": {
"executor": "@nrwl/vite:test",
"options": {
"config": "vite.config.ts"
}
},
"test_watch": {
"executor": "@nrwl/vite:test",
"options": {
"config": "vite.config.ts",
"watch": true
}
},
"typetest": {
"executor": "@nrwl/vite:test",
"options": {
"config": "vite.config.ts",
"mode": "typecheck"
}
},
"size": {
"executor": "./tools/executors/size-limit:size-limit",
"options": {
"limit": "1 kB",
"outputPath": "dist/packages/logger"
},
"dependsOn": [
{
"projects": "self",
"target": "build"
}
]
}
},
"tags": []
}
1 change: 1 addition & 0 deletions packages/logger/src/t.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const t = 1;
4 changes: 4 additions & 0 deletions packages/logger/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": ["**/*.test.ts", "**/*.test-d.ts"]
}
14 changes: 14 additions & 0 deletions packages/logger/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"declaration": true
},
"files": [],
"include": ["**/*.js", "**/*.ts"]
}
7 changes: 7 additions & 0 deletions packages/logger/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from 'vitest/config';
import tsconfigPaths from 'vite-tsconfig-paths';

export default defineConfig({
test: { typecheck: { ignoreSourceErrors: true } },
plugins: [tsconfigPaths()],
});
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"paths": {
"@withease/i18next": ["packages/i18next/index.ts"],
"@withease/factories": ["packages/factories/index.ts"],
"@withease/web-api": ["packages/web-api/index.ts"]
"@withease/web-api": ["packages/web-api/index.ts"],
"@withease/logger": ["packages/logger/index.ts"]
}
},
"exclude": ["node_modules", "tmp"]
Expand Down
1 change: 1 addition & 0 deletions workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"projects": {
"i18next": "packages/i18next",
"factories": "packages/factories",
"logger": "packages/logger",
"web-api": "packages/web-api",
"web-api-demo": "apps/web-api-demo",
"web-api-demo-e2e": "apps/web-api-demo-e2e",
Expand Down