Skip to content

Commit b877f5b

Browse files
committed
feat(@sirutils/nuts): init
1 parent 910bed8 commit b877f5b

File tree

13 files changed

+122
-0
lines changed

13 files changed

+122
-0
lines changed

bun.lockb

504 Bytes
Binary file not shown.

packages/nuts/moon.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
language: "typescript"
2+
type: "library"
3+
platform: "bun"
4+
5+
tasks:
6+
build:
7+
command: "bun x sirbuilder build -a"
8+
deps:
9+
- "builder:build"
10+
- "core:build"
11+
- "toolbox:build"
12+
- "schema:build"
13+
inputs:
14+
- "src/**/*"
15+
outputs:
16+
- "dist/**"

packages/nuts/package.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "@sirutils/nuts",
3+
"version": "0.2.3",
4+
5+
"type": "module",
6+
"files": ["dist"],
7+
"exports": {
8+
".": {
9+
"default": "./dist/index.js",
10+
"types": "./dist/index.d.ts"
11+
}
12+
},
13+
14+
"author": "giveerr (https://github.com/giveerr)",
15+
"homepage": "https://sirutils.com/",
16+
"repository": {
17+
"type": "git",
18+
"url": "https://github.com/sirius-tedarik/sirutils.git"
19+
},
20+
21+
"devDependencies": {
22+
"@sirutils/builder": "workspace:*"
23+
},
24+
"dependencies": {
25+
"@sirutils/core": "workspace:*",
26+
"@sirutils/schema": "workspace:*",
27+
"@sirutils/toolbox": "workspace:*"
28+
}
29+
}
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="@sirutils/core" />
2+
/// <reference types="@sirutils/toolbox" />
3+
/// <reference types="@sirutils/schema" />
4+
5+
import './nuts'

packages/nuts/src/definitions/nuts.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import type { NutsTags } from '../tag'
2+
3+
declare global {
4+
namespace Sirutils {
5+
interface CustomErrors {
6+
nuts: NutsTags
7+
}
8+
9+
interface PluginDefinitions {}
10+
}
11+
}

packages/nuts/src/index.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import './definitions'
2+
3+
export * from './plugin/create'
4+
5+
export * from './tag'

packages/nuts/src/internal/logger.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { createLogger } from '@sirutils/core'
2+
3+
import { nutsTags } from '../tag'
4+
5+
export const logger = createLogger(nutsTags.logger)

packages/nuts/src/internal/tag.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { tagBuilder } from '@sirutils/core'
2+
3+
export const createTag = tagBuilder('@sirutils/nuts')

packages/nuts/src/plugin/create.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { createPlugin } from '@sirutils/core'
2+
import { nutsTags } from '../tag'
3+
4+
export const createNuts = createPlugin(
5+
{
6+
name: 'nuts',
7+
version: '0.2.3',
8+
},
9+
() => ({}),
10+
nutsTags.plugin
11+
)

packages/nuts/src/tag.ts

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { createTag } from './internal/tag'
2+
3+
export const nutsTags = {
4+
// internal
5+
logger: createTag('logger'),
6+
7+
plugin: createTag('plugin'),
8+
} as const
9+
10+
export type NutsTags = (typeof nutsTags)[keyof typeof nutsTags]

packages/nuts/test/app.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { createNuts } from '../src'
2+
3+
export const nuts = await createNuts()

packages/nuts/tsconfig.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"extends": "../../tsconfig.base.json",
3+
"include": ["src", "test", "package.json"],
4+
"references": [
5+
{
6+
"path": "../../tools/builder"
7+
},
8+
{
9+
"path": "../core"
10+
},
11+
{
12+
"path": "../safe-toolbox"
13+
},
14+
{
15+
"path": "../schema"
16+
},
17+
{
18+
"path": "../toolbox"
19+
}
20+
]
21+
}

tsconfig.json

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
{
1717
"path": "packages/driver-scylla"
1818
},
19+
{
20+
"path": "packages/nuts"
21+
},
1922
{
2023
"path": "packages/safe-toolbox"
2124
},

0 commit comments

Comments
 (0)