Skip to content
Merged
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
9 changes: 4 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# editorconfig.org
root = true

[*]
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
indent_size = 2
indent_style = space
trim_trailing_whitespace = true
tab_width = 2
end_of_line = lf
charset = utf-8
tab_width = 2
indent_size = 2
25 changes: 0 additions & 25 deletions .eslintrc.json

This file was deleted.

27 changes: 17 additions & 10 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,27 @@ name: CD
on:
release:
types: [published]
workflow_dispatch:

jobs:
CD:
name: CD
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
node-version: 16
registry-url: "https://registry.npmjs.org"
- run: yarn install
- run: yarn test
- run: yarn build
- run: yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
bun-version: latest
- uses: actions/setup-node@v4
with:
node-version: 22
- run: bun install --frozen-lockfile
- run: bun run test
- run: bun run build
- name: Stage release to npm
run: |
npm install -g npm@latest
npm stage publish
44 changes: 20 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
name: CI

on: [pull_request]

jobs:
test-build:
name: Continuous Integration
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: pnpm/action-setup@v2
with:
version: 8.2.0
- run: pnpm install
- run: pnpm test -- --coverage
- run: pnpm build
- name: Upload coverage reports to Codecov
run: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -t ${CODECOV_TOKEN}
name: CI

on: [push, pull_request]

jobs:
test-build:
name: Continuous Integration
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: bun install --frozen-lockfile
- run: bun run coverage
- run: bun run build
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
6 changes: 4 additions & 2 deletions __tests__/entities/manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ describe("EntitiesManager class", () => {
expect(m.stringify()).toBe("");
});

it("should be able to add a line entity", () => {
it("should be able to add a line entity", async () => {
const mg = new EntitiesManager({ blockRecord, seeder });
mg.addLine({
start: point(),
end: point(100, 100),
});
const m = new TagsManager();
mg.tagify(m);
expect(m.stringify()).toMatchFileSnapshot("__snapshots__line.test.ts.snap");
await expect(m.stringify()).toMatchFileSnapshot(
"__snapshots__/manager.line.snap",
);
});
});
35 changes: 35 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"$schema": "https://biomejs.dev/schemas/2.5.13/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"includes": ["**", "!!**/dist", "!!**/dist"]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2
},
"linter": {
"enabled": true,
"rules": {
"preset": "recommended"
}
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
},
"assist": {
"enabled": true,
"actions": {
"source": {
"organizeImports": "on"
}
}
}
}
994 changes: 994 additions & 0 deletions bun.lock

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
coverage:
status:
project:
default:
target: 80%
threshold: 1%
patch:
default:
informational: true

ignore:
- "__tests__"
- "docs"
- "examples"
- "lib"
- "**/*.test.ts"

comment:
layout: "reach, diff, files"
require_changes: false
43 changes: 17 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@tarikjabiri/dxf",
"version": "3.0.0-alpha.13",
"version": "3.0.0-alpha.14",
"type": "module",
"description": "A DXF writer written in TypeScript.",
"main": "./lib/index.cjs",
"module": "./lib/index.js",
"module": "./lib/index.mjs",
"types": "./lib/index.d.ts",
"repository": {
"type": "git",
Expand All @@ -20,32 +20,31 @@
"scripts": {
"test": "vitest",
"coverage": "vitest run --coverage",
"build": "tsc --noEmit && tsup",
"examples": "tsx ./examples",
"build": "tsdown",
"dev": "tsdown --watch",
"lint": "biome check",
"examples": "bun run ./examples/index.ts",
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:serve": "vitepress serve docs",
"eslint": "eslint . --fix",
"commit": "cz"
},
"files": [
"lib/**/*"
],
"devDependencies": {
"@types/node": "^20.5.4",
"@types/opentype.js": "^1.3.4",
"@typescript-eslint/eslint-plugin": "^6.4.1",
"@typescript-eslint/parser": "^6.4.1",
"@vitest/coverage-v8": "^0.34.2",
"@biomejs/biome": "2.5.13",
"@types/node": "^22.20.3",
"@types/opentype.js": "^1.3.10",
"@vitest/coverage-v8": "^5.0.1",
"commitizen": "^4.3.0",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^9.26.0",
"tsup": "^7.2.0",
"tsx": "^3.12.7",
"typescript": "5.1.*",
"vitepress": "1.0.0-rc.4",
"vitest": "^0.34.2",
"vue": "^3.3.4"
"tsdown": "^0.23.0",
"typescript": "^7.0.2",
"vite": "^7.3.6",
"vitepress": "^1.6.4",
"vitest": "^5.0.1",
"vue": "^3.5.42"
},
"funding": "https://github.com/sponsors/dxfjs",
"keywords": [
Expand All @@ -56,15 +55,7 @@
"js",
"ts"
],
"pnpm": {
"peerDependencyRules": {
"ignoreMissing": [
"@algolia/client-search"
]
}
},
"engines": {
"node": ">=16",
"pnpm": ">=8"
"node": ">=18"
}
}
Loading
Loading