Files
clay/package.json
T
Joseph Mearman 7512b6436b Add TypeScript type declarations (#23)
* feat: add ambient module stubs for declaration generation

Provide TypeScript ambient declarations for 'message_keys' (Pebble SDK
module) and './tmp/config-page.html' (build artefact) so tsc can resolve
these imports when generating .d.ts files.

* feat: add tsconfig for declaration generation

Configures tsc --allowJs --emitDeclarationOnly to generate per-file
.d.ts reference output in dist-types/ from the library source files.

* feat: add curated TypeScript declarations for public API

Hand-curated index.d.ts covering Clay, ClayConfig, ClayItem, ClayEvents,
manipulators, and all supporting types. Necessary because tsc cannot
infer the ClayEvents mixin or dynamically-bound manipulator methods.
All types are exported via the Clay namespace.

* test: add type-checking verification for index.d.ts

Exercises the full public API surface — constructor, instance/static
methods, ClayConfig/ClayItem event methods, manipulator methods,
namespace-exported types, and customFn this-context.

* build: add typescript devDependency, types field, and build scripts

Adds typescript 6.0.2 as a devDependency. Sets "types": "index.d.ts"
in package.json. Adds build:types and check:types scripts.

* build: add gulp types task to validate declarations on build

Validates index.d.ts against test/type-checks.ts as part of the default
gulp build. Reference declaration generation via build:types remains
available as a separate manual step.

* chore: update ignore files for TypeScript declarations

Add dist-types/ to .gitignore (build artefact). Whitelist index.d.ts
in .npmignore so type declarations ship with the package.

* ci: add typecheck workflow to validate TypeScript declarations

Runs npm run check:types on push and PR to main, matching the existing
lint/test/build workflow pattern.
2026-05-21 22:33:48 +02:00

97 lines
2.8 KiB
JSON

{
"name": "@rebble/clay",
"version": "1.0.8",
"description": "Pebble Config Framework",
"types": "index.d.ts",
"scripts": {
"test-travis": "./node_modules/.bin/gulp && ./node_modules/.bin/karma start ./test/karma.conf.js --single-run --browsers chromeTravisCI",
"test-debug": "(export DEBUG=true && ./node_modules/.bin/gulp && ./node_modules/.bin/karma start ./test/karma.conf.js --no-single-run)",
"test": "./node_modules/.bin/gulp && ./node_modules/.bin/karma start ./test/karma.conf.js --single-run",
"lint": "./node_modules/.bin/eslint ./",
"build": "gulp",
"build:types": "tsc -p tsconfig.declarations.json",
"check:types": "tsc -p tsconfig.typecheck.json",
"dev": "gulp dev",
"pebble-clean": "rm -rf tmp src/js/index.js && pebble clean",
"pebble-publish": "npm run pebble-clean && npm run build && pebble build && pebble package publish && npm run pebble-clean",
"pebble-build": "npm run build && pebble build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/pebble-dev/clay.git"
},
"keywords": [
"pebble",
"config",
"configuration",
"pebble-package"
],
"author": "Pebble Technology",
"license": "MIT",
"bugs": {
"url": "https://github.com/pebble-dev/clay/issues"
},
"pebble": {
"projectType": "package",
"sdkVersion": "3",
"targetPlatforms": [
"aplite",
"basalt",
"chalk",
"diorite",
"emery",
"flint",
"gabbro"
],
"resources": {
"media": []
},
"capabilities": [
"configurable"
]
},
"homepage": "https://github.com/pebble-dev/clay#readme",
"devDependencies": {
"autoprefixer": "^10.4.23",
"bourbon": "^4.2.6",
"browserify": "^13.0.0",
"browserify-istanbul": "^3.0.1",
"chai": "^3.4.1",
"deamdify": "^0.2.0",
"deepcopy": "^0.6.1",
"del": "^2.0.2",
"eslint": "^1.5.1",
"eslint-config-pebble": "^1.2.0",
"eslint-plugin-standard": "^1.3.1",
"gulp": "^5.0.1",
"gulp-autoprefixer": "^3.1.0",
"gulp-htmlmin": "^1.3.0",
"gulp-inline": "^0.1.3",
"gulp-insert": "^0.5.0",
"gulp-sass": "^6.0.1",
"gulp-sourcemaps": "^1.6.0",
"gulp-uglify": "^1.5.2",
"joi": "^6.10.1",
"karma": "^6.4.0",
"karma-browserify": "^8.1.0",
"karma-chrome-launcher": "^3.2.0",
"karma-coverage": "^2.2.1",
"karma-mocha": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"karma-source-map-support": "^1.4.0",
"karma-threshold-reporter": "^0.1.15",
"mocha": "^11.7.5",
"postcss": "^8.5.6",
"require-from-string": "^2.0.2",
"sass": "^1.94.2",
"sinon": "^1.17.3",
"stringify": "^3.2.0",
"through": "^2.3.8",
"tosource": "^1.0.0",
"typescript": "6.0.2",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^2.0.0",
"watchify": "^3.11.1"
}
}