From e75478d10913e7e7072736efff8ac36e59240e3d Mon Sep 17 00:00:00 2001 From: Pablo Giraud-Carrier Date: Mon, 8 Jun 2026 16:00:52 +0200 Subject: [PATCH] chore: modernize packaging and standardize repo config - add conditional exports map (source/types/default) + publishConfig - add .swiftformat and ktlint rules in .editorconfig for native formatting - add .nvmrc, .watchmanconfig, .gitattributes --- .editorconfig | 6 ++++++ .gitattributes | 18 ++++++++++++++++++ .nvmrc | 1 + .swiftformat | 2 ++ .watchmanconfig | 1 + package.json | 11 +++++++++++ 6 files changed, 39 insertions(+) create mode 100644 .gitattributes create mode 100644 .nvmrc create mode 100644 .swiftformat create mode 100644 .watchmanconfig diff --git a/.editorconfig b/.editorconfig index c374e4d..18b18c3 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,3 +12,9 @@ indent_size = 4 [*.md] trim_trailing_whitespace = false + +# Picked up natively by ktlint (no Gradle plugin required) +[*.{kt,kts}] +indent_size = 4 +ktlint_standard_no-wildcard-imports = enabled +ktlint_standard_filename = disabled diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..0f87496 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,18 @@ +# Normalize line endings on checkin +* text=auto eol=lf + +# Binary assets — never normalize or diff +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.keystore binary + +# Keep generated lockfiles out of diffs and language stats +package-lock.json -diff linguist-generated +example/package-lock.json -diff linguist-generated + +# Don't let vendored/example/native code skew the repo language breakdown +example/** linguist-vendored +ios/** linguist-language=Swift +android/** linguist-language=Kotlin diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..a45fd52 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +24 diff --git a/.swiftformat b/.swiftformat new file mode 100644 index 0000000..7010410 --- /dev/null +++ b/.swiftformat @@ -0,0 +1,2 @@ +--swift-version 5.9 +--indent 2 diff --git a/.watchmanconfig b/.watchmanconfig new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/.watchmanconfig @@ -0,0 +1 @@ +{} diff --git a/package.json b/package.json index 5b005bc..3b5fe71 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,17 @@ "type": "commonjs", "main": "build/index.js", "types": "build/index.d.ts", + "exports": { + ".": { + "source": "./src/index.ts", + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json" + }, + "publishConfig": { + "registry": "https://registry.npmjs.org" + }, "files": [ "src", "build",