Skip to content

Commit 1fcfd30

Browse files
ilyafainbergCopilot
andcommitted
Distribute CodeAppsCompact kit as ZIP
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 46cf7b6 commit 1fcfd30

18 files changed

Lines changed: 146 additions & 90 deletions

File tree

‎.claude-plugin/marketplace.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"name": "codeappscompact",
1212
"source": "./plugins/codeappscompact",
1313
"description": "Configure existing generated services with the included prebuilt kit; no separate kit download or build.",
14-
"version": "0.1.2",
14+
"version": "0.1.3",
1515
"repository": "https://github.com/ilyafainberg/CodeAppsCompact",
1616
"license": "MIT",
1717
"keywords": ["agent-skills", "power-apps", "code-apps", "power-platform", "react", "typescript"]

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
node-version: '24'
2222
cache: npm
2323
cache-dependency-path: kit/package-lock.json
24+
- run: pwsh -NoProfile -Command '$PSVersionTable.PSVersion.ToString()'
2425
- run: npm ci --ignore-scripts --no-audit --no-fund
2526
- run: npm run typecheck
2627
- run: npm test
2728
- run: npm run build:demo
28-
- run: npm pack --dry-run --ignore-scripts

‎.gitignore‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ demo-dist/
44
coverage/
55
.vite/
66
*.tgz
7-
!/plugins/codeappscompact/skills/codeappscompact/assets/*.tgz
7+
*.zip
8+
!/plugins/codeappscompact/skills/codeappscompact/assets/*.zip
89
*.log
910
.env
1011
.env.*

‎README.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# CodeAppsCompact
22

3-
**Install one skill. Its record-screen kit is already included.**
3+
**Install one skill. Its record-screen kit is already included as a ZIP.**
44

55
CodeAppsCompact helps an agent build Power Platform Code Apps by configuring a reusable React/TypeScript screen instead of rewriting its list, form, paging, validation, and error handling.
66

7-
**0.1.2 - experimental, MIT-licensed.** Distributed through GitHub, not the npm registry. Live Power Apps-host and tenant compatibility remain unverified. This release changes packaging, not component behavior.
7+
**0.1.3 - experimental, MIT-licensed.** Distributed through GitHub, not the npm registry. Live Power Apps-host and tenant compatibility remain unverified. This release changes packaging, not component behavior.
88

99
## Install the skill
1010

@@ -24,7 +24,7 @@ copilot plugin install codeappscompact@codeappscompact
2424
/plugin install codeappscompact@codeappscompact
2525
```
2626

27-
**Other Agent Skills hosts:** import [codeappscompact-skill-0.1.2.zip](https://github.com/ilyafainberg/CodeAppsCompact/releases/download/v0.1.2/codeappscompact-skill-0.1.2.zip), or copy the complete [skill folder](plugins/codeappscompact/skills/codeappscompact) through your host's supported mechanism. Preserve `assets` and `references`; importing only the text of `SKILL.md` is insufficient. Existing users must update or reinstall the complete skill to receive the bundle. Reload the host if it requires a new session.
27+
**Other Agent Skills hosts:** import [codeappscompact-skill-0.1.3.zip](https://github.com/ilyafainberg/CodeAppsCompact/releases/download/v0.1.3/codeappscompact-skill-0.1.3.zip), or copy the complete [skill folder](plugins/codeappscompact/skills/codeappscompact) through your host's supported mechanism. Preserve `assets` and `references`; importing only the text of `SKILL.md` is insufficient. Existing users must update or reinstall the complete skill to receive the ZIP bundle. Reload the host if it requires a new session.
2828

2929
The skill contains everything specific to CodeAppsCompact:
3030

@@ -36,18 +36,18 @@ codeappscompact/
3636
install.md
3737
kit.json
3838
assets/
39-
codeappscompact-0.1.2.tgz
39+
codeappscompact-0.1.3.zip
4040
```
4141

42-
The archive includes prebuilt JavaScript, TypeScript declarations, `API.txt`, a synthetic example, package metadata, and the MIT license. No separate kit download or source build is needed.
42+
The ZIP includes prebuilt JavaScript, TypeScript declarations, `API.txt`, a synthetic example, package metadata, and the MIT license. No separate kit download or source build is needed.
4343

4444
## Use it
4545

4646
In an existing React/TypeScript Code App, ask:
4747

4848
> Use CodeAppsCompact to add a service-request screen using our existing generated service. Include summary, owner email, priority, and estimated hours. Support creating, editing, paging, and searching loaded records. Preserve the theme and do not deploy.
4949
50-
The agent reuses a supported installed kit. If absent, it verifies the bundled archive, copies it into the app's `vendor` directory, and installs that local file with the app's package manager. It then reads the installed API and writes only your fields, columns, validation, and typed service adapter. Keep the vendored archive, dependency manifest, and lockfile together in the app repository.
50+
The agent reuses a supported installed kit. If absent, it verifies the bundled ZIP, extracts it into the app's `vendor` directory, and installs the extracted package folder with the app's package manager. npm cannot install a ZIP directly. The agent then reads the installed API and writes only your fields, columns, validation, and typed service adapter. Keep the entire extracted package directory, dependency manifest, and lockfile together in the app repository; the skill's ZIP is not needed for subsequent restores.
5151

5252
The skill assumes its assets are present. An incomplete or corrupt installation is an error: reinstall the complete skill rather than fetching a substitute or regenerating the component. Existing locked dependencies and custom packages are not silently replaced.
5353

@@ -61,7 +61,7 @@ Delete, relationships, uploads, nested drafts, backend-wide search, and cross-sy
6161

6262
## Repository layout
6363

64-
- [Skill](plugins/codeappscompact/skills/codeappscompact/SKILL.md): instructions, local installation reference, and bundled kit.
64+
- [Skill](plugins/codeappscompact/skills/codeappscompact/SKILL.md): instructions, local installation reference, and bundled ZIP.
6565
- [kit](kit/README.md): maintainer-only source, API, example, tests, and build tools. Consumers do not need this directory.
6666
- `marketplace.json` and `.claude-plugin`: discovery metadata for supported hosts.
6767

‎kit/README.md‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# CodeAppsCompact kit maintenance
22

3-
This directory is for maintainers. Consumers install the self-contained skill from [CodeAppsCompact](https://github.com/ilyafainberg/CodeAppsCompact), which already includes the built kit. They do not clone or build this directory.
3+
This directory is for maintainers. Consumers install the self-contained skill from [CodeAppsCompact](https://github.com/ilyafainberg/CodeAppsCompact), which already includes the built kit as a ZIP. They do not clone or build this directory.
44

55
The `codeappscompact` package exports `RecordScreen` and its TypeScript contracts. See [API.txt](API.txt) for the full behavior and [examples/App.tsx](examples/App.tsx) for configuration. [examples/main.tsx](examples/main.tsx) supplies the caller-owned query provider; [examples/service.ts](examples/service.ts) is synthetic. The package injects no styles, creates no query client, and performs no direct network requests.
66

77
## Develop
88

9-
Use Node.js >=22.12.0; CI uses Node.js 24. From this directory:
9+
Use Node.js >=22.12.0 and PowerShell 7 (`pwsh`); both are available in the Linux CI image. ZIP creation and distribution tests use PowerShell's built-in .NET ZIP support, with no additional archive package. Consumers can use any safe ZIP extractor. From this directory:
1010

1111
```powershell
1212
npm ci --ignore-scripts --no-audit --no-fund
@@ -16,23 +16,23 @@ npm run build:demo
1616
npm run dev
1717
```
1818

19-
The synthetic demo runs at Vite's loopback URL, uses in-memory data, makes no tenant requests, and resets on reload. These commands do not publish or deploy. `npm test` builds the library before comparing the checked-in skill archive to the current source. After intentional package changes, regenerate that archive with `npm run bundle:skill` before testing.
19+
The synthetic demo runs at Vite's loopback URL, uses in-memory data, makes no tenant requests, and resets on reload. These commands do not publish or deploy. `npm test` builds the library before comparing the checked-in skill ZIP to the current source. After intentional package changes, regenerate that ZIP with `npm run bundle:skill` before testing.
2020

2121
## Update the bundle
2222

2323
1. Update the package/lockfile, both marketplace catalogs, both plugin manifests, skill version, documentation filenames, and skill's `references\kit.json` together. Review supported installed versions instead of assuming compatibility. Keep npm publishing disabled (`private: true`).
24-
2. Remove only the previous tracked kit archive when changing its version. Run `npm run bundle:skill`. It builds the library, packs the allowlisted consumer files into the skill's `assets` directory, and records their SHA-256 in `kit.json`. The component, declarations, API, example, README, and license all travel inside that archive; no separate kit release is needed.
25-
3. Run type checking, tests, and the demo build. Review the archive and the git diff, including the generated manifest. Distribution tests compare the archive to the current build and documentation, verify its digest and metadata, and reject extra packaged files. They use the system `tar` command (available in current Windows and the Linux CI image).
26-
4. Commit the complete skill bundle with its source. Package the entire skill directory into `codeappscompact-skill-<version>.zip`, with one top-level `codeappscompact` folder. Include `assets`, `references`, `SKILL.md`, and LICENSE. Exercise installation from that ZIP in an isolated consumer, including a clean lockfile restore without the original skill directory.
24+
2. Remove only the previous tracked kit archive when changing its version. Run `npm run bundle:skill`. It builds the library, packages the explicit consumer-file allowlist into the skill's `assets` ZIP, and records its SHA-256 in `kit.json`. ZIP entries use a fixed timestamp. The component, declarations, API, example, README, and license all travel inside that ZIP; no separate kit release is needed.
25+
3. Run type checking, tests, and the demo build. Review the ZIP and the git diff, including the generated manifest. Distribution tests open the ZIP, compare its contents to the current build and documentation, verify its digest and metadata, and reject extra packaged files and links.
26+
4. Commit the complete skill bundle with its source. Package the entire skill directory into `codeappscompact-skill-<version>.zip`, with one top-level `codeappscompact` folder. Include `assets`, `references`, `SKILL.md`, and LICENSE. Exercise ZIP extraction and local-directory installation in an isolated consumer, including a clean lockfile restore without the original skill directory or ZIP.
2727
5. Publish the skill ZIP on a new GitHub release tag pointing to the reviewed commit. Do not replace an existing release's artifacts. Confirm the public ZIP matches the reviewed bundle. Marketplace installs receive the same checked-in assets; portable users need only the skill ZIP. No npm publishing, automatic updates, install hooks, telemetry, or tenant changes are involved.
2828

2929
The repository-root `marketplace.json` and `.claude-plugin\marketplace.json` represent the same catalog. The plugin has Agent Plugins 1.0 and legacy manifests. Keep both pairs synchronized.
3030

3131
## Consumer boundaries
3232

33-
The skill verifies and copies its local archive into the app's `vendor` directory, then uses the app's package manager. Retain that archive with the app's manifest and lockfile; do not reference the agent's installation directory. Ordinary React, TanStack React Query, and Power Apps SDK dependencies remain external. The package is not published to npm; a registry package with the same name is not evidence of this project's provenance.
33+
The skill verifies and extracts its local ZIP into the app's `vendor` directory, then installs the extracted package directory with the app's package manager. npm does not install ZIP files directly. Retain the complete extracted directory with the app's manifest and lockfile; do not reference the agent's installation directory or rely on a ZIP for lockfile restores. Ordinary React, TanStack React Query, and Power Apps SDK dependencies remain external. The package is not published to npm; a registry package with the same name is not evidence of this project's provenance.
3434

35-
Only flat string/number record drafts and read/create/update screens are supplied. Authentication, SDK setup, connections, permissions, schema, styling, query-provider ownership, and deployment belong to the app. Neither the example nor these tests establish live Power Apps-host or tenant compatibility. Version 0.1.2 changes packaging, not component behavior.
35+
Only flat string/number record drafts and read/create/update screens are supplied. Authentication, SDK setup, connections, permissions, schema, styling, query-provider ownership, and deployment belong to the app. Neither the example nor these tests establish live Power Apps-host or tenant compatibility. Version 0.1.3 changes packaging, not component behavior.
3636

3737
## Token evidence and limits
3838

‎kit/package-lock.json‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎kit/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codeappscompact",
3-
"version": "0.1.2",
3+
"version": "0.1.3",
44
"description": "Bundled React/TypeScript record-screen kit for Power Platform Code Apps",
55
"license": "MIT",
66
"type": "module",
@@ -32,7 +32,7 @@
3232
"dev": "vite --host 127.0.0.1",
3333
"build:demo": "vite build",
3434
"prepack": "npm run build",
35-
"bundle:skill": "npm run build && node scripts/bundle-skill.mjs"
35+
"bundle:skill": "npm run build && cd scripts && pwsh -NoProfile -NonInteractive -File bundle-skill.ps1"
3636
},
3737
"peerDependencies": {
3838
"@microsoft/power-apps": "^1.5.0",

‎kit/scripts/bundle-skill.mjs‎

Lines changed: 0 additions & 38 deletions
This file was deleted.

‎kit/scripts/bundle-skill.ps1‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
Set-StrictMode -Version Latest
2+
$ErrorActionPreference = 'Stop'
3+
4+
$kitRoot = Split-Path -Parent $PSScriptRoot
5+
$skillRoot = Join-Path (Split-Path -Parent $kitRoot) 'plugins' 'codeappscompact' 'skills' 'codeappscompact'
6+
$pkg = Get-Content -LiteralPath (Join-Path $kitRoot 'package.json') -Raw | ConvertFrom-Json -AsHashtable
7+
$manifestPath = Join-Path $skillRoot 'references' 'kit.json'
8+
$manifest = Get-Content -LiteralPath $manifestPath -Raw | ConvertFrom-Json -AsHashtable
9+
$filename = "$($pkg.name)-$($pkg.version).zip"
10+
$archive = "assets/$filename"
11+
$assets = Join-Path $skillRoot 'assets'
12+
13+
if ($pkg.name -ne 'codeappscompact' -or $pkg.private -ne $true) {
14+
throw 'Expected the private codeappscompact package; npm publication must remain disabled.'
15+
}
16+
if ($manifest.name -ne $pkg.name -or $manifest.version -ne $pkg.version -or $manifest.archive -ne $archive -or
17+
$manifest.compatibleInstalledVersions -notcontains $pkg.version) {
18+
throw 'Update kit.json identity, local ZIP path, and reviewed compatibility before bundling.'
19+
}
20+
[void][IO.Directory]::CreateDirectory($assets)
21+
if (Get-ChildItem -LiteralPath $assets -Force | Where-Object Name -ne $filename) {
22+
throw 'Remove the previous tracked kit archive explicitly; assets must contain only the current kit.'
23+
}
24+
25+
$files = @(
26+
'API.txt', 'LICENSE', 'README.md', 'dist/index.d.ts', 'dist/index.js',
27+
'examples/App.tsx', 'examples/main.tsx', 'examples/service.ts', 'examples/style.css', 'package.json'
28+
)
29+
$memory = [IO.MemoryStream]::new()
30+
try {
31+
$zip = [IO.Compression.ZipArchive]::new($memory, [IO.Compression.ZipArchiveMode]::Create, $true)
32+
try {
33+
foreach ($path in $files) {
34+
$source = Get-Item -LiteralPath (Join-Path $kitRoot $path)
35+
if ($source.PSIsContainer -or ($source.Attributes -band [IO.FileAttributes]::ReparsePoint)) {
36+
throw "Expected a regular consumer file: $path"
37+
}
38+
$bytes = [IO.File]::ReadAllBytes($source.FullName)
39+
$entry = $zip.CreateEntry("package/$path", [IO.Compression.CompressionLevel]::Optimal)
40+
$entry.LastWriteTime = [DateTimeOffset]::new(2000, 1, 1, 0, 0, 0, [TimeSpan]::Zero)
41+
$output = $entry.Open()
42+
try { $output.Write($bytes, 0, $bytes.Length) }
43+
finally { $output.Dispose() }
44+
}
45+
}
46+
finally { $zip.Dispose() }
47+
$bundle = $memory.ToArray()
48+
}
49+
finally { $memory.Dispose() }
50+
51+
$destination = Join-Path $assets $filename
52+
[IO.File]::WriteAllBytes($destination, $bundle)
53+
$manifest.sha256 = (Get-FileHash -LiteralPath $destination -Algorithm SHA256).Hash.ToLowerInvariant()
54+
$json = ($manifest | ConvertTo-Json -Depth 10).Replace("`r`n", "`n")
55+
[IO.File]::WriteAllText($manifestPath, $json + "`n")
56+
Write-Output "Bundled $filename ($($bundle.Length) bytes); updated kit.json SHA-256."

0 commit comments

Comments
 (0)