diff --git a/.gitignore b/.gitignore index ccc2930..9188137 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /coverage /node_modules +/types diff --git a/.prettierignore b/.prettierignore index c8066dd..a8f7b4b 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,5 +1,6 @@ /coverage /node_modules /package-lock.json +/types .claude/ CLAUDE.md diff --git a/Makefile b/Makefile index 8b3de8c..f8028a4 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,20 @@ COVERAGE_DIR := coverage NODE_MODULES := node_modules +SRC_FILES := $(wildcard src/*.mjs) TEST_GLOB := tests/**/*.test.mjs +TYPES_DIR := types $(NODE_MODULES): package.json package-lock.json npm install touch $(NODE_MODULES) +$(TYPES_DIR): $(SRC_FILES) tsconfig.build.json $(NODE_MODULES) + npx tsc --project tsconfig.build.json + touch $(TYPES_DIR) + .PHONY: clean clean: - rm -rf $(COVERAGE_DIR) + rm -rf $(COVERAGE_DIR) $(TYPES_DIR) .PHONY: coverage coverage: $(NODE_MODULES) diff --git a/README.md b/README.md index 37fa0ce..21d50e3 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,12 @@ Layouting and tiling engine. +## Installation + +```sh +npm install glazur +``` + ## Radial layout `RadialLayout` grows a rooted tree outward from its root as an evenly spaced radial burst: diff --git a/package-lock.json b/package-lock.json index 774d0c5..2dcaa2a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "": { "name": "glazur", "version": "0.1.0", - "license": "MIT", + "license": "Apache-2.0", "devDependencies": { "@types/node": "25.8.0", "c8": "11.0.0", diff --git a/package.json b/package.json index 3f18554..225b230 100644 --- a/package.json +++ b/package.json @@ -2,19 +2,28 @@ "name": "glazur", "version": "0.1.0", "description": "Layouting and tiling engine", + "files": [ + "src", + "types" + ], + "types": "./types/index.d.mts", "exports": { - ".": "./src/index.mjs" + ".": { + "types": "./types/index.d.mts", + "default": "./src/index.mjs" + } }, "scripts": { "coverage": "make coverage", + "prepack": "make types", "test": "make test" }, "repository": { "type": "git", "url": "git+https://github.com/intentee/glazur.git" }, - "author": "", - "license": "MIT", + "author": "Mateusz Charytoniuk ", + "license": "Apache-2.0", "bugs": { "url": "https://github.com/intentee/glazur/issues" }, diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 0000000..400f64b --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "declaration": true, + "emitDeclarationOnly": true, + "noEmit": false, + "outDir": "types", + "rootDir": "src" + } +}