-
Notifications
You must be signed in to change notification settings - Fork 6
feat(GenPage): redesign as first-class project type with SCF packing #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
TomProkop
wants to merge
7
commits into
master
Choose a base branch
from
feat/genpage-multipage-redesign
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3fff16b
feat: redesign GenPage build support
TomProkop 258b37d
fix: run GenPage build hooks on plain build
TomProkop 4ed088d
Fix GenPage uxagentproject export layout
TomProkop ce80d3e
refactor(GenPage): prefix project-specific task names
TomProkop d26cff7
feat(Tasks): add RunNodeTool task, unify Node/npm invocation across a…
TomProkop 9ef507e
fix(GenPage): address PR review — firstPrompt, target naming, npm ins…
TomProkop b5e30f1
refactor(Tasks): extract shared NodeBuild.targets; unify node/npm inf…
TomProkop File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,63 +1,24 @@ | ||
| # TALXIS.DevKit.Build.Dataverse.GenPage | ||
| # TALXIS DevKit Dataverse GenPage build support | ||
|
|
||
| MSBuild integration for Dataverse generative page (GenPage) projects. Transpiles TSX source files via TypeScript, patches in RuntimeTypes, generates config metadata, and exposes output targets for Solution projects to discover and integrate GenPages as `uxagentprojects`. | ||
| MSBuild integration for Dataverse GenPage projects. | ||
|
|
||
| ## Installation | ||
| A GenPage project is a project-type marker only. It carries no Dataverse IDs or page metadata. Every `*.tsx` file at the project root is treated as a page, and the page name is the file name without extension. Subfolders are regular source folders and never become pages. | ||
|
|
||
| ```xml | ||
| <PackageReference Include="TALXIS.DevKit.Build.Dataverse.GenPage" Version="0.0.0.1" PrivateAssets="All" /> | ||
| ``` | ||
|
|
||
| Or use the SDK approach: | ||
| ## Project contract | ||
|
|
||
| ```xml | ||
| <Project Sdk="TALXIS.DevKit.Build.Sdk/0.0.0.1"> | ||
| <PropertyGroup> | ||
| <ProjectType>GenPage</ProjectType> | ||
| <GenPageId>{your-genpage-guid}</GenPageId> | ||
| <GenPageDataSources>datasource1,datasource2</GenPageDataSources> | ||
| </PropertyGroup> | ||
| </Project> | ||
| <PropertyGroup> | ||
| <ProjectType>GenPage</ProjectType> | ||
| </PropertyGroup> | ||
| ``` | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - **Node.js** must be available on `PATH` | ||
| - **npx** must be available on `PATH` | ||
|
|
||
| The build will fail with a descriptive error if either is missing. | ||
|
|
||
| ## How It Works | ||
|
|
||
| The package sets `ProjectType` to `GenPage` and disables `GenerateAssemblyInfo` by default since this is not a traditional .NET assembly project. | ||
|
|
||
| ### Build-time targets | ||
|
|
||
| 1. **CheckGenPagePrereqs** — validates that the main TSX file exists and `node`/`npx` are on `PATH`. | ||
| 2. **TranspileGenPage** (runs before `Build`) — executes `tsc` via `npx` to transpile TSX to JS, then patches the output by stripping `RuntimeTypes` imports and prepending `RuntimeTypes.js` content if present. | ||
| 3. **GenerateGenPageConfig** — generates `config.json` from project properties (`GenPageDataSources`). | ||
| 4. **CopyGenPageOutputs** (runs after `Build`) — copies `page.tsx`, `page.compiled`, and `config.json` to the output directory. | ||
|
|
||
| ### Integration targets | ||
|
|
||
| Called by `TALXIS.DevKit.Build.Dataverse.Solution` via `ProjectReference`: | ||
|
|
||
| - **GetProjectType** — returns `GenPage`. | ||
| - **GetGenPageOutputs** — exposes the compiled output folder and metadata for the solution to copy into `uxagentprojects/`. | ||
| Optional source files: | ||
|
|
||
| ## MSBuild Properties | ||
| - `<PageName>.config.json`, otherwise shared `genpage.config.json` | ||
| - `<PageName>.firstPrompt.json`, otherwise shared `firstPrompt.json` | ||
|
TomProkop marked this conversation as resolved.
Outdated
|
||
|
|
||
| | Property | Default | Description | | ||
| |----------|---------|-------------| | ||
| | `ProjectType` | `GenPage` | Marks the project for reference discovery by Solution projects. | | ||
| | `GenPageMainFile` | `page.tsx` | Main TSX source file to transpile. | | ||
| | `GenPageName` | `$(MSBuildProjectName)` | Name used for the output folder and metadata. | | ||
| | `GenPageId` | _(required)_ | GUID identifying this GenPage in Dataverse. | | ||
| | `GenPageDataSources` | _(empty)_ | Comma-separated list of data source identifiers. | | ||
| | `LangVersion` | `latest` | C# language version for the project. | | ||
| | `GenerateAssemblyInfo` | `false` | Disables auto-generated assembly info. | | ||
| Build output is normalized to `$(TargetDir)<PageName>.js` for each root page. | ||
|
|
||
| ## Related Packages | ||
| ## Solution integration | ||
|
|
||
| - **Depends on**: `TALXIS.DevKit.Build.Dataverse.Tasks` | ||
| - **Consumed by**: `TALXIS.DevKit.Build.Dataverse.Solution` projects via `ProjectReference` | ||
| Solution projects discover referenced GenPage projects, call `GetGenPageOutputs`, ensure XML-only `uxagentprojects/<page-guid>/...` declarations exist in solution source, then project native `filecontent/` only into the SolutionPackager metadata working directory under `obj`. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.