Skip to content

Expand YouTrack app and rule scaffolding - #76

Open
Zoran Repić (zoranrepic) wants to merge 2 commits into
JetBrains:mainfrom
zoranrepic:upstream/create-youtrack-app
Open

Expand YouTrack app and rule scaffolding#76
Zoran Repić (zoranrepic) wants to merge 2 commits into
JetBrains:mainfrom
zoranrepic:upstream/create-youtrack-app

Conversation

@zoranrepic

@zoranrepic Zoran Repić (zoranrepic) commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Significant change

Adds parameterized app initialization, workflow-rule generation, improved handlers, endpoints, widgets, settings, consistent entity-action commands, and remote skill installation without bundled skill files.

Main files to review

  • packages/create-youtrack-app/index.js
  • packages/create-youtrack-app/utils/**
  • packages/create-youtrack-app/_templates/**
  • packages/create-youtrack-app/test/**

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands the @jetbrains/create-youtrack-app generator to use a consistent <entity> <action> CLI shape, adds classic workflow rule scaffolding, introduces a “skill” install/status flow for supported AI agents, and updates templates/tests/docs to match the new scaffolding model (including backend-only Enhanced DX and updated workflow locations).

Changes:

  • Add classic workflow rule scaffolding (JS rules in src/, TS Enhanced DX rules in src/workflows/) plus CLI routing to generate them.
  • Add “skill” download/install/status support (Claude Code / Codex CLI / Junie), including a new test suite for the skill installer.
  • Normalize/modernize command shapes across generators (widget/settings/http-handler/endpoint/extension-property), update templates, docs, and tests accordingly.

Reviewed changes

Copilot reviewed 36 out of 36 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/create-youtrack-app/utils/rule-scaffold.js New utilities to validate/render classic workflow rule scaffolds and resolve output paths.
packages/create-youtrack-app/utils/agent-skill.js New implementation for downloading and installing the external agent skill into supported agent config dirs.
packages/create-youtrack-app/index.js Adds public command routing/validation, new skill and rule handling, and expanded generator interception logic.
packages/create-youtrack-app/help.js Rewrites CLI help text to document entity/action commands, endpoints, and skill commands.
packages/create-youtrack-app/README.md Updates usage docs for non-interactive app init, new commands, skill commands, and rule scaffolding.
packages/create-youtrack-app/package.json Updates dev scripts to use the new app init and expands generator test targets.
packages/create-youtrack-app/scripts/generate-test-app.sh Updates the scripted smoke scaffolding flow to the new CLI shape.
packages/create-youtrack-app/test/widget.test.js Updates widget CLI invocations to widget add ....
packages/create-youtrack-app/test/skill-cli.test.js New tests for skill directory discovery, authenticated download behavior, install modes, and status reporting.
packages/create-youtrack-app/test/settings.test.js Updates tests to reflect removed settings aliases and validates canonical registry entries.
packages/create-youtrack-app/test/scaffold-cli.test.js New tests for app init --name ... gate behavior, cwd placement, defaults, and removed legacy forms.
packages/create-youtrack-app/test/sanitize.test.js Migrates test from Vitest-style to node:test + assert.
packages/create-youtrack-app/test/generator-cli.test.js Updates generator command shapes (http-handler/extension-property/endpoint/rule) and adds additional routing regressions.
packages/create-youtrack-app/_templates/widget/add/inject-manifest.js Makes widget injection robust when manifest.widgets is absent/non-array.
packages/create-youtrack-app/_templates/rule/add/index.js New Hygen generator prompt logic for workflow rules (interactive + validated).
packages/create-youtrack-app/_templates/rule/add/rule.js.t New rule template file writer for JS/TS rule outputs based on Enhanced DX.
packages/create-youtrack-app/_templates/http-handler/add/index.js Converts non-Enhanced-DX handler generator to an async prompt flow and adds permissions CSV parsing.
packages/create-youtrack-app/_templates/endpoint/add/index.js Adds non-interactive endpoint generation support via flags with validation and defaults.
packages/create-youtrack-app/_templates/init/vite-app/package.json.t Adds widgetless build path (copy:dist) and updates youtrack-app command usage.
packages/create-youtrack-app/_templates/init/vite-app/manifest.json.t Removes empty widgets array from the default JS manifest scaffold.
packages/create-youtrack-app/_templates/init/enhanced-dx/package.json.t Adds backend-only script set and updates youtrack-app command usage.
packages/create-youtrack-app/_templates/init/enhanced-dx/manifest.json.t Makes widget entry conditional based on backend-only mode.
packages/create-youtrack-app/_templates/init/enhanced-dx/vite.config.backend.ts.t Moves workflow bundle source to src/workflows.
packages/create-youtrack-app/_templates/init/enhanced-dx/vite.config.ts.t Conditional output for frontend Vite config based on backend-only mode.
packages/create-youtrack-app/_templates/init/enhanced-dx/src/widgets/enhanced-dx/app.tsx.t Conditional output + updated inline guidance for backend-only scaffolds.
packages/create-youtrack-app/_templates/init/enhanced-dx/src/widgets/enhanced-dx/app.css.t Conditional output for backend-only scaffolds.
packages/create-youtrack-app/_templates/init/enhanced-dx/src/widgets/enhanced-dx/index.tsx.t Conditional output for backend-only scaffolds.
packages/create-youtrack-app/_templates/init/enhanced-dx/src/widgets/enhanced-dx/index.html.t Conditional output + updated inline guidance for backend-only scaffolds.
packages/create-youtrack-app/_templates/init/enhanced-dx/src/widgets/enhanced-dx/widget-icon.svg.t Conditional output for backend-only scaffolds.
packages/create-youtrack-app/_templates/init/enhanced-dx/src/backend/workflows/notify-on-change.ts.t Relocates sample workflow to src/workflows and updates requirements import path.
packages/create-youtrack-app/_templates/init/enhanced-dx/src/backend/workflows/weekly-digest.ts.t Relocates sample workflow to src/workflows and updates requirements import path.
packages/create-youtrack-app/_templates/init/enhanced-dx/src/backend/workflows/issue-state.ts.t Relocates sample workflow to src/workflows and updates requirements import path.
packages/create-youtrack-app/_templates/init/enhanced-dx/src/backend/workflows/apply-template.ts.t Relocates sample workflow to src/workflows and updates requirements import path.
packages/create-youtrack-app/_templates/init/enhanced-dx/README.md.t Updates generator command examples to the new entity/action CLI shape.
packages/create-youtrack-app/_templates/init/enhanced-dx/AGENTS.md.t Removes bundled AGENTS.md template (skill-based guidance replaces it).
packages/create-youtrack-app/_templates/http-handler/add/enhanced-dx/handler.ts.t Removes the old Enhanced DX handler template file (flow is now handled elsewhere).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/create-youtrack-app/help.js Outdated
Comment on lines +179 to +181
fs.writeFileSync(archivePath, Buffer.from(await response.arrayBuffer()));
fs.mkdirSync(extractDir, { recursive: true });
execFileSync('tar', ['-xf', archivePath, '-C', extractDir], { stdio: 'ignore' });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I back it

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plus one, we already have a customer request that our CLI should be OS agnostic

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
validateRuleType,
} = require('./utils/rule-scaffold');

function routePublicCommand(rawArgv) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

routePublicCommand parses argv with minimist, rebuilds a fake positional argv via buildCommandArgv, strips flags back out with removeOptions string matching, then re-parses — plus a special case to re-read --cwd from the original argv

I think it is quite complex approach, can we think on how to simplify it?

Comment on lines +179 to +181
fs.writeFileSync(archivePath, Buffer.from(await response.arrayBuffer()));
fs.mkdirSync(extractDir, { recursive: true });
execFileSync('tar', ['-xf', archivePath, '-C', extractDir], { stdio: 'ignore' });

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plus one, we already have a customer request that our CLI should be OS agnostic

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can use the https://www.npmjs.com/package/skills instead? it's de-facto industry standard right now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants