build: configure npm package for publication

Phase 4-5 Complete:
-  Updated package.json to v1.0.0 with proper entry points
-  Added peer dependency on marked.js (^11.0.0 || ^12.0.0 || ^13.0.0)
-  Set module type to ESM to fix Rollup warnings
-  Configured files array for distribution (dist/ only)
-  Added prepublishOnly script (build + test)
-  Created .npmignore to exclude dev files
-  Created CHANGELOG.md following Keep a Changelog format

Package details:
- Main: dist/testdrive-jsui.cjs.js (CommonJS)
- Module: dist/testdrive-jsui.esm.js (ES Module)
- Browser: dist/testdrive-jsui.min.js (107KB minified)
- Style: dist/testdrive-jsui.css
- Total package size: 445.9 KB (13 files)

npm pack --dry-run verified successfully!
This commit is contained in:
2025-12-16 22:46:31 +01:00
parent a7856f4b20
commit fa9ae3b9ff
3 changed files with 173 additions and 19 deletions

View File

@@ -1,39 +1,68 @@
{
"name": "testdrive-jsui",
"version": "0.1.0",
"description": "JavaScript UI testing framework capability for MarkiTect",
"main": "js/index.js",
"directories": {
"test": "js/tests"
},
"version": "1.0.0",
"description": "JavaScript-first markdown editor library with interactive UI",
"type": "module",
"main": "dist/testdrive-jsui.cjs.js",
"module": "dist/testdrive-jsui.esm.js",
"browser": "dist/testdrive-jsui.min.js",
"style": "dist/testdrive-jsui.css",
"unpkg": "dist/testdrive-jsui.min.js",
"jsdelivr": "dist/testdrive-jsui.min.js",
"types": "dist/index.d.ts",
"files": [
"dist/",
"README.md",
"LICENSE",
"CHANGELOG.md"
],
"scripts": {
"build": "rollup -c",
"build:watch": "rollup -c -w",
"build:prod": "NODE_ENV=production rollup -c",
"dev": "npm run build:watch",
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage",
"test:verbose": "jest --verbose",
"test:specific": "jest --testNamePattern",
"lint": "eslint js/**/*.js",
"lint:fix": "eslint js/**/*.js --fix",
"dev": "npm run test:watch",
"build": "echo 'No build step required for this package'",
"clean": "rm -rf coverage/ .nyc_output/ node_modules/.cache/"
"prepublishOnly": "npm run build:prod && npm test",
"lint": "eslint js/**/*.js src/**/*.js",
"lint:fix": "eslint js/**/*.js src/**/*.js --fix",
"clean": "rm -rf dist/ coverage/ .nyc_output/ node_modules/.cache/",
"size": "npm run build:prod && du -h dist/*"
},
"repository": {
"type": "git",
"url": "https://github.com/markitect/testdrive-jsui.git"
},
"keywords": [
"markdown",
"editor",
"javascript",
"testing",
"ui",
"framework",
"markitect",
"tdd",
"dom",
"components"
"wysiwyg",
"contenteditable",
"section-editing",
"interactive",
"browser",
"frontend",
"marked",
"markdown-editor"
],
"author": "MarkiTect Project",
"author": "MarkiTect Team <team@markitect.dev>",
"license": "MIT",
"bugs": {
"url": "https://github.com/markitect/testdrive-jsui/issues"
},
"homepage": "https://github.com/markitect/testdrive-jsui#readme",
"peerDependencies": {
"marked": "^11.0.0 || ^12.0.0 || ^13.0.0"
},
"peerDependenciesMeta": {
"marked": {
"optional": false
}
},
"devDependencies": {
"@babel/core": "^7.23.0",
"@babel/preset-env": "^7.23.0",
@@ -57,6 +86,10 @@
"dependencies": {
"jsdom": "^23.0.0"
},
"engines": {
"node": ">=14.0.0",
"npm": ">=6.0.0"
},
"jest": {
"testEnvironment": "jsdom",
"testMatch": [