@takumi-rs/core 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -0
- package/package.json +50 -0
- package/tsconfig.json +29 -0
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# @takumi-rs/core
|
|
2
|
+
|
|
3
|
+
## Usage
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { Renderer } from "@takumi-rs/core";
|
|
7
|
+
import { container, image } from "@takumi-rs/helpers";
|
|
8
|
+
import { writeFile } from "fs/promises";
|
|
9
|
+
|
|
10
|
+
const render = new Renderer();
|
|
11
|
+
|
|
12
|
+
const buffer = await render.renderAsync(
|
|
13
|
+
container({
|
|
14
|
+
children: [
|
|
15
|
+
image("https://yeecord.com/img/logo.png", {
|
|
16
|
+
width: 128,
|
|
17
|
+
height: 128,
|
|
18
|
+
}),
|
|
19
|
+
],
|
|
20
|
+
background_color: 0xffffff,
|
|
21
|
+
width: percentage(100),
|
|
22
|
+
height: percentage(100),
|
|
23
|
+
}),
|
|
24
|
+
1200,
|
|
25
|
+
630
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
await writeFile("./demo.webp", buffer);
|
|
29
|
+
```
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@takumi-rs/core",
|
|
3
|
+
"version": "0.6.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": ">= 12.22.0 < 13 || >= 14.17.0 < 15 || >= 15.12.0 < 16 || >= 16.0.0"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"url": "git+https://github.com/kane50613/takumi.git"
|
|
10
|
+
},
|
|
11
|
+
"author": {
|
|
12
|
+
"email": "me@kane.tw",
|
|
13
|
+
"name": "Kane Wang",
|
|
14
|
+
"url": "https://kane.tw"
|
|
15
|
+
},
|
|
16
|
+
"type": "commonjs",
|
|
17
|
+
"main": "index.js",
|
|
18
|
+
"types": "index.d.ts",
|
|
19
|
+
"browser": "browser.js",
|
|
20
|
+
"napi": {
|
|
21
|
+
"binaryName": "core",
|
|
22
|
+
"targets": [
|
|
23
|
+
"aarch64-apple-darwin",
|
|
24
|
+
"aarch64-unknown-linux-gnu",
|
|
25
|
+
"aarch64-unknown-linux-musl",
|
|
26
|
+
"x86_64-unknown-linux-gnu",
|
|
27
|
+
"x86_64-unknown-linux-musl"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "napi build --release --platform --strip",
|
|
32
|
+
"build:debug": "napi build",
|
|
33
|
+
"prepublishOnly": "bunx napi prepublish -t npm --no-gh-release",
|
|
34
|
+
"artifacts": "napi create-npm-dirs && napi artifacts",
|
|
35
|
+
"version": "napi version"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@napi-rs/cli": "^3.0.0-alpha.89",
|
|
39
|
+
"@takumi-rs/helpers": "workspace:*",
|
|
40
|
+
"@types/bun": "^1.2.17",
|
|
41
|
+
"typescript": "^5.8.3"
|
|
42
|
+
},
|
|
43
|
+
"optionalDependencies": {
|
|
44
|
+
"@takumi-rs/core-darwin-arm64": "0.6.0",
|
|
45
|
+
"@takumi-rs/core-linux-arm64-gnu": "0.6.0",
|
|
46
|
+
"@takumi-rs/core-linux-arm64-musl": "0.6.0",
|
|
47
|
+
"@takumi-rs/core-linux-x64-gnu": "0.6.0",
|
|
48
|
+
"@takumi-rs/core-linux-x64-musl": "0.6.0"
|
|
49
|
+
}
|
|
50
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
// Environment setup & latest features
|
|
4
|
+
"lib": ["ESNext"],
|
|
5
|
+
"target": "ESNext",
|
|
6
|
+
"module": "Preserve",
|
|
7
|
+
"moduleDetection": "force",
|
|
8
|
+
"jsx": "react-jsx",
|
|
9
|
+
"allowJs": true,
|
|
10
|
+
|
|
11
|
+
// Bundler mode
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"allowImportingTsExtensions": true,
|
|
14
|
+
"verbatimModuleSyntax": true,
|
|
15
|
+
"noEmit": true,
|
|
16
|
+
|
|
17
|
+
// Best practices
|
|
18
|
+
"strict": true,
|
|
19
|
+
"skipLibCheck": true,
|
|
20
|
+
"noFallthroughCasesInSwitch": true,
|
|
21
|
+
"noUncheckedIndexedAccess": true,
|
|
22
|
+
"noImplicitOverride": true,
|
|
23
|
+
|
|
24
|
+
// Some stricter flags (disabled by default)
|
|
25
|
+
"noUnusedLocals": false,
|
|
26
|
+
"noUnusedParameters": false,
|
|
27
|
+
"noPropertyAccessFromIndexSignature": false
|
|
28
|
+
}
|
|
29
|
+
}
|