Skip to content

Commit

Permalink
Merge pull request #35 from Ubugeeei/1-pnpm-workspace
Browse files Browse the repository at this point in the history
#1 pnpm workspace
  • Loading branch information
ubugeeei authored Oct 15, 2023
2 parents 6fd61f3 + c62c72a commit 8b3cda1
Show file tree
Hide file tree
Showing 37 changed files with 298 additions and 101 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules
dist
.cspellcache
bin
temp
22 changes: 10 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,25 @@
"path": "git-cz"
}
},
"engines": {
"node": ">=16.15.0",
"pnpm": "8",
"npm": "please_use_pnpm_instead"
},
"volta": {
"node": "18.18.2"
},
"scripts": {
"prepare": "husky install",
"build": "pnpm run bundle && pnpm run build:types",
"build": "pnpm run bundle && pnpm run build:dts",
"bundle": "node scripts/build.js",
"build:types": "tsc --project tsconfig.json",
"build:dts": "tsc -p tsconfig.build.json && node scripts/dts.js",
"fmt": "prettier",
"lint": "ESLINT_USE_FLAT_CONFIG=true eslint",
"spell-check": "cspell lint \"**\" --no-progress --show-suggestions --show-context --cache",
"play": "cd examples/_basic && pnpm run dev"
},
"devDependencies": {
"@types/adm-zip": "^0.5.2",
"@types/node": "^20.8.6",
"cspell": "^7.3.8",
"esbuild": "^0.19.4",
"eslint": "^8.51.0",
Expand All @@ -32,13 +38,5 @@
"prettier": "^3.0.3",
"rimraf": "^5.0.5",
"typescript": "^5.2.2"
},
"volta": {
"node": "18.18.2"
},
"dependencies": {
"adm-zip": "^0.5.10",
"citty": "^0.1.4",
"consola": "^3.2.3"
}
}
9 changes: 9 additions & 0 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "@tegaki/backend",
"version": "0.0.1",
"description": "@tegaki/backend",
"main": "dist/index.js",
"keywords": [],
"author": "Ubugeeei <ubuge1122@gmail.com>",
"license": "MIT"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Position, Stroke, TegakiStroke } from "@tegaki/types/index";
import type { Position, Stroke, TegakiStroke } from "tegaki";

type M10 = (pattern: Array<Stroke>) => number;
type M01 = (pattern: Array<Stroke>) => number;
Expand Down
17 changes: 17 additions & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "@tegaki/cli",
"version": "0.0.1",
"description": "@tegaki/cli",
"bin": "./bin/bin.cjs",
"author": "Ubugeeei <ubuge1122@gmail.com>",
"license": "MIT",
"dependencies": {
"adm-zip": "^0.5.10",
"citty": "^0.1.4",
"consola": "^3.2.3"
},
"devDependencies": {
"@types/adm-zip": "^0.5.2",
"@types/node": "^20.8.6"
}
}
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions packages/cli/src/cmd/datagen/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const datagen: import("citty").CommandDef<import("citty").ArgsDef>;
File renamed without changes.
1 change: 1 addition & 0 deletions packages/cli/src/cmd/jTegaki/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare const openJTegaki: import("citty").CommandDef<import("citty").ArgsDef>;
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions packages/cli/src/cmd/unicodegen/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export declare const unicodegen: import("citty").CommandDef<{
map: {
type: "boolean";
alias: string[];
description: string;
required: false;
};
separator: {
type: "string";
alias: string[];
description: string;
default: string;
};
}>;
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions packages/dataset/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "@tegaki/dataset",
"version": "0.0.1",
"description": "",
"main": "dist/index.js",
"keywords": [],
"author": "Ubugeeei <ubuge1122@gmail.com>",
"license": "MIT"
}
File renamed without changes.
1 change: 1 addition & 0 deletions packages/dataset/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { KANJI_DATA_SET } from "./kanji";
2 changes: 2 additions & 0 deletions packages/dataset/src/kanji.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { type TegakiStroke } from "tegaki";
export declare const KANJI_DATA_SET: Array<TegakiStroke>;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type TegakiStroke } from "@tegaki/types/index";
import { type TegakiStroke } from "tegaki";

// prettier-ignore
export const KANJI_DATA_SET: Array<TegakiStroke> = [
Expand Down
9 changes: 9 additions & 0 deletions packages/frontend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "@tegaki/frontend",
"version": "0.0.1",
"description": "",
"main": "dist/index.js",
"keywords": [],
"author": "Ubugeeei <ubuge1122@gmail.com>",
"license": "MIT"
}
File renamed without changes.
4 changes: 2 additions & 2 deletions packages/frontend/index.ts → packages/frontend/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Position, Stroke, TegakiStroke } from "@tegaki/types/index";
import { CandidateContainerNotFoundError, CanvasCtxNotFoundError, InitializeError } from "./errors";
import type { Stroke } from "tegaki";
import { CanvasCtxNotFoundError, InitializeError } from "./errors";

// TODO: private properties
// TODO: map
Expand Down
9 changes: 9 additions & 0 deletions packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "@tegaki/shared",
"version": "0.0.1",
"description": "",
"main": "dist/index.js",
"keywords": [],
"author": "Ubugeeei <ubuge1122@gmail.com>",
"license": "MIT"
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Stroke } from "@tegaki/types";
import { Stroke } from "tegaki";
import { hexToNumber, numberToHex } from "./general";

export const STROKE_SEPARATOR = "\n";
Expand Down
3 changes: 0 additions & 3 deletions packages/tegaki/index.ts

This file was deleted.

12 changes: 12 additions & 0 deletions packages/tegaki/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "tegaki",
"version": "0.0.1",
"description": "tegaki is a simple drawing library for the web.",
"main": "dist/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "Ubugeeei <ubuge1122@gmail.com>",
"license": "ISC"
}
7 changes: 7 additions & 0 deletions packages/tegaki/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export * from "@tegaki/dataset";
export * from "@tegaki/frontend";
export * from "@tegaki/backend";
export * from "@tegaki/shared";
export type * from "./stroke";

// NOTE: @tegaki/cli is not exported because it is not a library.
File renamed without changes.
98 changes: 56 additions & 42 deletions pnpm-lock.yaml

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

2 changes: 2 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packages:
- "packages/*"
Loading

0 comments on commit 8b3cda1

Please sign in to comment.