diff --git a/README.md b/README.md index d8792e6..dce926f 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,12 @@ npm run build ``` +Release check: + +```bash +npm run release:check +``` + Vue adapter only: ```bash @@ -83,6 +89,13 @@ - `dist/index.html` - `dist/assets/*` +```bash +npm run release:check +``` + +Runs the Vue adapter smoke build and package smoke validation from a packed +tarball. See [`docs/release.md`](docs/release.md). + ## Использование Для подключения kit в обычную HTML-страницу нужны CSS, иконки и JS bundle: diff --git a/docs/index.md b/docs/index.md index b3abd38..22757d8 100644 --- a/docs/index.md +++ b/docs/index.md @@ -12,6 +12,7 @@ - [Vue Component API](vue/component-api.md) - props, emits, slots и короткие примеры. - [Vue Cookbook](vue/cookbook.md) - практичные сценарии экранов. - [Vue Migration Policy](vue/migration-policy.md) - правила совместимости Vue adapter. +- [Release Flow](release.md) - проверки, pack validation и публикация пакета. ## Компоненты diff --git a/docs/release.md b/docs/release.md new file mode 100644 index 0000000..9629838 --- /dev/null +++ b/docs/release.md @@ -0,0 +1,74 @@ +# Release Flow + +This package is prepared for registry publishing. Publishing is still a manual +step and should only happen after the release checks pass. + +## Before Release + +Install root and Vue example dependencies: + +```bash +npm install +npm --prefix examples/vue install +``` + +Run the release gate: + +```bash +npm run release:check +``` + +This runs: + +- Vue adapter build and example build; +- full package build; +- `npm pack` into a temporary directory; +- a temporary Vue/Vite consumer app that imports `gnexus-ui-kit/vue` from the + packed tarball. + +Expected Vite warnings: + +```text +/assets/fonts/... didn't resolve at build time +``` + +These warnings are acceptable while `kit.css` keeps the `/assets` runtime asset +contract. + +## Version + +Use SemVer for adapter and CSS changes: + +- patch: bug fixes, accessibility fixes, docs, and compatible component fixes; +- minor: new Vue components, new props, new slots, or new CSS components; +- major: renamed/removed exports, props, emits, slots, classes, or asset paths. + +Update `package.json` and `package-lock.json` together. + +## Publish + +Build and inspect the tarball before publish: + +```bash +npm run release:check +npm pack --pack-destination /tmp +``` + +The tarball must include: + +- `dist/css/kit.css`; +- `dist/js/gnexus-ui-kit.js`; +- `dist/vue/index.js`; +- `dist/assets/`; +- `docs/`; +- `README.md`. + +Publish only after the tarball contents match the expected runtime contract: + +```bash +npm publish +``` + +The package is marked `UNLICENSED`; change `license` and add a `LICENSE` file +before publishing as an open-source package. + diff --git a/docs/vue/release-checklist.md b/docs/vue/release-checklist.md index 3ced72d..da32c8e 100644 --- a/docs/vue/release-checklist.md +++ b/docs/vue/release-checklist.md @@ -2,12 +2,12 @@ Run this checklist before publishing or consuming a new Vue adapter version. +Full release flow: [Release Flow](../release.md). + ## Build Checks ```bash -npm run build -npm run test:vue-adapter -npm run test:vue-package +npm run release:check ``` Expected Vite warnings: diff --git a/package-lock.json b/package-lock.json index 739bb97..c914924 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,7 @@ "": { "name": "gnexus-ui-kit", "version": "0.2.0", + "license": "UNLICENSED", "devDependencies": { "autoprefixer": "^10.4.27", "browser-sync": "^3.0.4", @@ -1049,7 +1050,7 @@ "version": "10.4.27", "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.27.tgz", "integrity": "sha512-NP9APE+tO+LuJGn7/9+cohklunJsXWiaWEfV3si4Gi/XHDwVNgkwr1J3RQYFIvPy76GmJ9/bW8vyoU1LcxwKHA==", - "dev": true, + "devOptional": true, "funding": [ { "type": "opencollective", @@ -1361,14 +1362,14 @@ "version": "1.3.4", "resolved": "https://registry.npmjs.org/bs-recipes/-/bs-recipes-1.3.4.tgz", "integrity": "sha512-BXvDkqhDNxXEjeGM8LFkSbR+jzmP/CYpCiVKYn+soB1dDldeU15EBNDkwVXndKuX35wnNUaPd0qSoQEAkmQtMw==", - "dev": true, + "devOptional": true, "license": "ISC" }, "node_modules/buffer": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "dev": true, + "devOptional": true, "funding": [ { "type": "github", @@ -3084,7 +3085,7 @@ "version": "3.3.11", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", - "devOptional": true, + "dev": true, "funding": [ { "type": "github", @@ -3291,7 +3292,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "devOptional": true, + "dev": true, "license": "ISC" }, "node_modules/picomatch": { @@ -3342,7 +3343,7 @@ "version": "8.5.14", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.14.tgz", "integrity": "sha512-SoSL4+OSEtR99LHFZQiJLkT59C5B1amGO1NzTwj7TT1qCUgUO6hxOvzkOYxD+vMrXBM3XJIKzokoERdqQq/Zmg==", - "devOptional": true, + "dev": true, "funding": [ { "type": "opencollective", @@ -4007,7 +4008,7 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, + "devOptional": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" @@ -4017,7 +4018,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", - "devOptional": true, + "dev": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" diff --git a/package.json b/package.json index 0b7fcc4..f6d8226 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,15 @@ { "name": "gnexus-ui-kit", "version": "0.2.0", - "private": true, + "description": "GNexus UI Kit CSS, browser JS, and Vue 3 adapter.", + "license": "UNLICENSED", + "main": "dist/js/gnexus-ui-kit.js", + "module": "dist/js/gnexus-ui-kit.js", "style": "dist/css/kit.css", + "sideEffects": [ + "dist/css/*.css", + "dist/assets/**" + ], "files": [ "dist/", "docs/", @@ -21,6 +28,7 @@ "build:example:vue": "npm --prefix examples/vue run build", "build:vue": "gulp vue", "dev": "gulp serve", + "release:check": "npm run test:vue-adapter && npm run test:vue-package", "start": "gulp serve", "test:vue-adapter": "npm run build:vue && npm run build:example:vue", "test:vue-package": "node scripts/vue-package-smoke.mjs" diff --git a/scripts/vue-package-smoke.mjs b/scripts/vue-package-smoke.mjs index b29795c..b48fbba 100644 --- a/scripts/vue-package-smoke.mjs +++ b/scripts/vue-package-smoke.mjs @@ -1,4 +1,4 @@ -import { mkdtempSync, rmSync, writeFileSync, mkdirSync, readFileSync, symlinkSync } from "node:fs"; +import { existsSync, mkdtempSync, rmSync, writeFileSync, mkdirSync, readFileSync, symlinkSync } from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path"; import { spawnSync } from "node:child_process"; @@ -10,6 +10,10 @@ const exampleNodeModules = join(root, "examples/vue/node_modules"); const packageJson = JSON.parse(readFileSync(join(root, "package.json"), "utf8")); +if (!existsSync(join(exampleNodeModules, "vue")) || !existsSync(join(exampleNodeModules, "vite"))) { + throw new Error("Run npm --prefix examples/vue install before npm run test:vue-package"); +} + function run(command, args, options = {}) { const result = spawnSync(command, args, { cwd: options.cwd || root,