@powerhousedao/codegen 6.2.0-dev.20 → 6.2.0-dev.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{file-builders-kIBA6RCN.mjs → file-builders-NNaY31PO.mjs} +25 -13
- package/dist/file-builders-NNaY31PO.mjs.map +1 -0
- package/dist/index-DtbVU1fc.d.mts.map +1 -1
- package/dist/index.mjs +82 -68
- package/dist/index.mjs.map +1 -1
- package/dist/src/file-builders/index.mjs +1 -1
- package/dist/src/name-builders/index.mjs +1 -1
- package/dist/src/templates/index.mjs +1 -1
- package/dist/src/utils/index.mjs +1 -1
- package/package.json +3 -3
- package/dist/file-builders-kIBA6RCN.mjs.map +0 -1
|
@@ -1803,7 +1803,7 @@ export function CreateDocument() {
|
|
|
1803
1803
|
return (
|
|
1804
1804
|
<div>
|
|
1805
1805
|
{/* Customize section title here */}
|
|
1806
|
-
<h3 className="mb-3 mt-4 text-sm font-bold text-
|
|
1806
|
+
<h3 className="mb-3 mt-4 text-sm font-bold text-muted-foreground">
|
|
1807
1807
|
Create document
|
|
1808
1808
|
</h3>
|
|
1809
1809
|
{/* Customize layout by changing flex-wrap, gap, or grid layout */}
|
|
@@ -1832,7 +1832,7 @@ function CreateDocumentButton({ documentModelModule }: Props) {
|
|
|
1832
1832
|
documentModelModule.documentModel.global.description;
|
|
1833
1833
|
return (
|
|
1834
1834
|
<button
|
|
1835
|
-
className="cursor-pointer rounded-md bg-
|
|
1835
|
+
className="cursor-pointer rounded-md bg-secondary py-2 px-3 hover:hover-effect"
|
|
1836
1836
|
title={documentModelName}
|
|
1837
1837
|
aria-description={documentModelDescription}
|
|
1838
1838
|
onClick={() => showCreateDocumentModal(documentType)}
|
|
@@ -1910,7 +1910,7 @@ export function EmptyState() {
|
|
|
1910
1910
|
if (hasNodes) return null;
|
|
1911
1911
|
|
|
1912
1912
|
return (
|
|
1913
|
-
<div className="py-12 text-center text-
|
|
1913
|
+
<div className="py-12 text-center text-muted-foreground">
|
|
1914
1914
|
<p className="text-lg">This folder is empty</p>
|
|
1915
1915
|
<p className="mt-2 text-sm">Create your first document or folder below</p>
|
|
1916
1916
|
</div>
|
|
@@ -1936,7 +1936,7 @@ export function Files() {
|
|
|
1936
1936
|
|
|
1937
1937
|
return (
|
|
1938
1938
|
<div>
|
|
1939
|
-
<h3 className="mb-2 text-sm font-semibold text-
|
|
1939
|
+
<h3 className="mb-2 text-sm font-semibold text-muted-foreground">Documents</h3>
|
|
1940
1940
|
<div className="flex flex-wrap gap-4">
|
|
1941
1941
|
{fileNodes.map((fileNode) => (
|
|
1942
1942
|
<FileItem key={fileNode.id} fileNode={fileNode} />
|
|
@@ -1965,7 +1965,7 @@ export function Folders() {
|
|
|
1965
1965
|
|
|
1966
1966
|
return (
|
|
1967
1967
|
<div>
|
|
1968
|
-
<h3 className="mb-2 text-sm font-bold text-
|
|
1968
|
+
<h3 className="mb-2 text-sm font-bold text-muted-foreground">Folders</h3>
|
|
1969
1969
|
<div className="flex flex-wrap gap-4">
|
|
1970
1970
|
{folderNodes.map((folderNode) => (
|
|
1971
1971
|
<FolderItem key={folderNode.id} folderNode={folderNode} />
|
|
@@ -2091,7 +2091,7 @@ import { Breadcrumbs } from "@powerhousedao/design-system/connect";
|
|
|
2091
2091
|
/** Shows the navigation breadcrumbs for the selected drive or folder */
|
|
2092
2092
|
export function NavigationBreadcrumbs() {
|
|
2093
2093
|
return (
|
|
2094
|
-
<div className="border-b border-
|
|
2094
|
+
<div className="border-b border-border pb-3 space-y-3">
|
|
2095
2095
|
<Breadcrumbs />
|
|
2096
2096
|
</div>
|
|
2097
2097
|
);
|
|
@@ -2125,7 +2125,7 @@ export default function Editor(props: EditorProps) {
|
|
|
2125
2125
|
// you can update these configs in \`./config.ts\`
|
|
2126
2126
|
useSetPHAppConfig(editorConfig);
|
|
2127
2127
|
return (
|
|
2128
|
-
<div className="bg-
|
|
2128
|
+
<div className="bg-background p-6">
|
|
2129
2129
|
<DriveExplorer {...props} />
|
|
2130
2130
|
</div>
|
|
2131
2131
|
);
|
|
@@ -5001,7 +5001,7 @@ export default function Editor() {
|
|
|
5001
5001
|
};
|
|
5002
5002
|
|
|
5003
5003
|
return (
|
|
5004
|
-
<div className="mx-auto max-w-4xl bg-
|
|
5004
|
+
<div className="mx-auto max-w-4xl bg-background p-6">
|
|
5005
5005
|
<DocumentToolbar />
|
|
5006
5006
|
|
|
5007
5007
|
{/* "ph-default-styles" sets default styles for basic UI elements */}
|
|
@@ -6753,6 +6753,9 @@ function getPreviousVersionSourceFile(args) {
|
|
|
6753
6753
|
const previousVersion = version - 1;
|
|
6754
6754
|
if (previousVersion < 1) return;
|
|
6755
6755
|
const previousVersionFilePath = filePath.replace(`/v${version}/`, `/v${previousVersion}/`);
|
|
6756
|
+
try {
|
|
6757
|
+
project.addSourceFileAtPath(previousVersionFilePath);
|
|
6758
|
+
} catch {}
|
|
6756
6759
|
return project.getSourceFile(previousVersionFilePath);
|
|
6757
6760
|
}
|
|
6758
6761
|
//#endregion
|
|
@@ -6882,8 +6885,10 @@ function getDefaultProjectOptions(tsConfigFilePath) {
|
|
|
6882
6885
|
/** Instantiates a ts-morph Project using the default typescript config and nearest tsconfig.json file */
|
|
6883
6886
|
function buildTsMorphProject(projectDir) {
|
|
6884
6887
|
process.chdir(projectDir);
|
|
6888
|
+
const tsConfigFilePath = path.join(projectDir, "tsconfig.json");
|
|
6885
6889
|
return new Project({
|
|
6886
|
-
|
|
6890
|
+
...DEFAULT_PROJECT_OPTIONS,
|
|
6891
|
+
tsConfigFilePath,
|
|
6887
6892
|
skipFileDependencyResolution: true
|
|
6888
6893
|
});
|
|
6889
6894
|
}
|
|
@@ -7010,6 +7015,7 @@ async function makeEditorModuleFile({ project, editorDirPath, editorName, docume
|
|
|
7010
7015
|
}
|
|
7011
7016
|
async function makeEditorsFile(args) {
|
|
7012
7017
|
const { project, editorsDirPath } = args;
|
|
7018
|
+
project.addSourceFilesAtPaths(path.join(editorsDirPath, "**", "module.ts"));
|
|
7013
7019
|
const sourceFile = project.createSourceFile(path.join(editorsDirPath, "editors.ts"), editorsTemplate, { overwrite: true });
|
|
7014
7020
|
const editorsArray = sourceFile.getVariableDeclarationOrThrow("editors").getFirstDescendantByKindOrThrow(SyntaxKind.ArrayLiteralExpression);
|
|
7015
7021
|
pipe(project.getDirectoryOrThrow(editorsDirPath).getDescendantSourceFiles(), filter((sourceFile) => sourceFile.getBaseName() === "module.ts"), uniqueBy((sourceFile) => sourceFile.getFilePath()), map((sourceFile) => getVariableDeclarationByTypeName(sourceFile, "EditorModule")), filter(isTruthy), map((variableDeclaration) => ({
|
|
@@ -7030,6 +7036,7 @@ async function makeEditorsFile(args) {
|
|
|
7030
7036
|
}
|
|
7031
7037
|
async function makeEditorsIndexFile(args) {
|
|
7032
7038
|
const { project, editorsDirPath } = args;
|
|
7039
|
+
project.addSourceFilesAtPaths(path.join(editorsDirPath, "**", "module.ts"));
|
|
7033
7040
|
const sourceFile = project.createSourceFile(path.join(editorsDirPath, "index.ts"), "", { overwrite: true });
|
|
7034
7041
|
pipe(project.getDirectoryOrThrow(editorsDirPath).getDescendantSourceFiles(), filter((sourceFile) => sourceFile.getBaseName() === "module.ts"), uniqueBy((sourceFile) => sourceFile.getFilePath()), map((sourceFile) => getVariableDeclarationByTypeName(sourceFile, "EditorModule")), filter(isTruthy), map((variableDeclaration) => ({
|
|
7035
7042
|
name: variableDeclaration.getName(),
|
|
@@ -7722,7 +7729,7 @@ async function makeReducerOperationHandlersForModules(fileMakerArgs) {
|
|
|
7722
7729
|
module
|
|
7723
7730
|
});
|
|
7724
7731
|
}
|
|
7725
|
-
async function makeReducerOperationHandlerForModule({ project, module, version, srcDirPath, versionImportPath, pascalCaseDocumentType, camelCaseDocumentType }) {
|
|
7732
|
+
async function makeReducerOperationHandlerForModule({ project, module, version, srcDirPath, genDirPath, versionImportPath, pascalCaseDocumentType, camelCaseDocumentType }) {
|
|
7726
7733
|
const kebabCaseModuleName = kebabCase(module.name);
|
|
7727
7734
|
const pascalCaseModuleName = pascalCase(module.name);
|
|
7728
7735
|
const filePath = path.join(srcDirPath, "reducers", `${kebabCaseModuleName}.ts`);
|
|
@@ -7739,11 +7746,13 @@ async function makeReducerOperationHandlerForModule({ project, module, version,
|
|
|
7739
7746
|
const operationsInterfaceVariableName = `${camelCaseDocumentType}${pascalCaseModuleName}Operations`;
|
|
7740
7747
|
const existingOperationsInterfaceTypeImport = sourceFile.getImportDeclaration((importDeclaration) => !!importDeclaration.getNamedImports().find((importSpecifier) => importSpecifier.getName() === operationsInterfaceTypeName));
|
|
7741
7748
|
if (existingOperationsInterfaceTypeImport) existingOperationsInterfaceTypeImport.remove();
|
|
7742
|
-
|
|
7749
|
+
sourceFile.addImportDeclaration({
|
|
7743
7750
|
namedImports: [operationsInterfaceTypeName],
|
|
7744
7751
|
moduleSpecifier: versionImportPath,
|
|
7745
7752
|
isTypeOnly: true
|
|
7746
|
-
})
|
|
7753
|
+
});
|
|
7754
|
+
const operationsInterface = project.getSourceFile(path.join(genDirPath, kebabCaseModuleName, "operations.ts"))?.getInterface(operationsInterfaceTypeName);
|
|
7755
|
+
const operationsInterfaceTypeProperties = operationsInterface ? [...operationsInterface.getProperties(), ...operationsInterface.getMethods()].map((member) => member.getName()) : void 0;
|
|
7747
7756
|
if (!operationsInterfaceTypeProperties) throw new Error("Failed to create operation handler object");
|
|
7748
7757
|
let operationsInterfaceVariableStatement = sourceFile.getVariableStatement(operationsInterfaceVariableName);
|
|
7749
7758
|
if (!operationsInterfaceVariableStatement) operationsInterfaceVariableStatement = sourceFile.addVariableStatement({
|
|
@@ -8122,6 +8131,7 @@ async function tsMorphGenerateDocumentModel(documentModelState, project) {
|
|
|
8122
8131
|
documentModelDirPath,
|
|
8123
8132
|
latestVersion
|
|
8124
8133
|
});
|
|
8134
|
+
project.addSourceFilesAtPaths([join$1(documentModelsDirPath, "**", "module.ts"), join$1(documentModelsDirPath, "**", "upgrade-manifest.ts")]);
|
|
8125
8135
|
await makeDocumentModelsFile({
|
|
8126
8136
|
project,
|
|
8127
8137
|
documentModelsDirPath
|
|
@@ -8451,6 +8461,7 @@ async function tsMorphGenerateProcessor(args) {
|
|
|
8451
8461
|
const processorsDirPath = processorsDir.getPath();
|
|
8452
8462
|
const dirPath = path.join(processorsDirPath, kebabCaseName);
|
|
8453
8463
|
await ensureDirectoriesExist(project, processorsDirPath, dirPath);
|
|
8464
|
+
project.addSourceFilesAtPaths(path.join(dirPath, "*.ts"));
|
|
8454
8465
|
if (isCustomizedProcessorDir(project.getDirectory(dirPath))) {
|
|
8455
8466
|
const relativePath = path.relative(projectDir, path.join(dirPath, "index.ts"));
|
|
8456
8467
|
console.warn(`[codegen] Skipping processor scaffold for "${kebabCaseName}": legacy layout detected "${relativePath}"`);
|
|
@@ -8565,6 +8576,7 @@ async function makeCustomSubgraphFiles(project, dirPath, v) {
|
|
|
8565
8576
|
}
|
|
8566
8577
|
async function makeSubgraphsIndexFile(args) {
|
|
8567
8578
|
const { project, subgraphsDir } = args;
|
|
8579
|
+
project.addSourceFilesAtPaths(path.join(subgraphsDir, "**", "index.ts"));
|
|
8568
8580
|
const { sourceFile } = getOrCreateSourceFile(project, path.join(subgraphsDir, "index.ts"));
|
|
8569
8581
|
const existingExportNames = pipe(sourceFile.getExportDeclarations(), map((exportDeclaration) => exportDeclaration.getNamespaceExport()?.getName()), filter(isTruthy));
|
|
8570
8582
|
const exportDeclarations = pipe(project.getDirectoryOrThrow(subgraphsDir).getDescendantSourceFiles(), filter((sourceFile) => sourceFile.getBaseName() === "index.ts"), uniqueBy((sourceFile) => sourceFile.getFilePath()), map((sourceFile) => sourceFile.getClasses().find((c) => c.getBaseClass()?.getText().includes("BaseSubgraph"))), filter(isTruthy), map((classDeclaration) => ({
|
|
@@ -8580,4 +8592,4 @@ async function makeSubgraphsIndexFile(args) {
|
|
|
8580
8592
|
//#endregion
|
|
8581
8593
|
export { buildStringLiteral as $, cursorMcpTemplate as $n, getModuleExportType as $t, writeModuleFiles as A, pnpmWorkspaceTemplate as An, analyticsFactoryTemplate as At, buildTsMorphProject as B, gitIgnoreTemplate as Bn, documentModelSrcIndexFileTemplate as Bt, writeAllGeneratedProjectFiles as C, subgraphsIndexTemplate as Cn, relationalDbIndexTemplate as Ct, writeGeneratedProcessorsFiles as D, buildPowerhouseConfigTemplate as Dn, factoryBuildersTemplate as Dt, writeGeneratedEditorsFiles as E, ManifestTemplate as En, processorsFactoryTemplate as Et, makeEditorsIndexFile as F, mainTsxTemplate as Fn, makeOperationImportNames as Ft, getObjectLiteral as G, editorsTemplate as Gn, documentModelGenTypesTemplate as Gt, getAllImportModuleSpecifiers as H, geminiSettingsTemplate as Hn, documentModelIndexTemplate as Ht, validateDocumentModelState as I, licenseTemplate as In, makeOperationsImports as It, getStringArrayPropertyElements as J, documentModelsTemplate as Jn, documentModelPhFactoriesFileTemplate as Jt, getObjectProperty as K, upgradeManifestsTemplate as Kn, documentModelSchemaIndexTemplate as Kt, updateVersionedImports as L, indexTsTemplate as Ln, makeTestCaseForOperation as Lt, tsMorphGenerateApp as M, packageJsonTemplate as Mn, upgradeTransitionTemplate as Mt, makeEditorModuleFile as N, npmrcTemplate as Nn, upgradeManifestTemplate as Nt, writeGeneratedProjectRootFiles as O, packageJsonExportsTemplate as On, analyticsProcessorTemplate as Ot, makeEditorsFile as P, mcpTemplate as Pn, documentModelOperationsModuleTestFileTemplate as Pt, buildObjectLiteral as Q, connectEntrypointTemplate as Qn, documentModelOperationModuleActionsFileTemplate as Qt, getInitialStates as R, legacyIndexHtmlTemplate as Rn, documentModelTestFileTemplate as Rt, writeAiConfigFiles as S, tsconfigPathsTemplate as Sn, relationalDbMigrationsTemplate as St, writeGeneratedDocumentModelsFiles as T, readmeTemplate as Tn, processorsIndexTemplate as Tt, getAllImportNames as U, eslintConfigTemplate as Un, documentModelHooksFileTemplate as Ut, getDefaultProjectOptions as V, syncAndPublishWorkflowTemplate as Vn, documentModelModuleFileTemplate as Vt, getBooleanPropertyValue as W, editorsIndexTemplate as Wn, documentModelGenUtilsTemplate as Wt, getVariableDeclarationByTypeName as X, nginxConfTemplate as Xn, documentModelOperationsModuleErrorFileTemplate as Xt, getStringPropertyValue as Y, switchboardEntrypointTemplate as Yn, documentModelOperationsModuleOperationsFileTemplate as Yt, loadDocumentModelInDir as Z, dockerfileTemplate as Zn, documentModelOperationsModuleCreatorsFileTemplate as Zt, getCommandsHelpInfo as _, documentEditorModuleFileTemplate as _n, customSubgraphSchemaTemplate as _t, getOrCreateManifestFile as a, getLatestDocumentModelSpecVersionNumber as an, folderTreeFileTemplate as ar, getProcessorMetadata as at, buildBoilerplatePackageJson as b, vitestConfigTemplate as bn, relationalDbSchemaTemplate as bt, operationHasEmptyInput as c, getActionType as cn, emptyStateFileTemplate as cr, formatSafe as ct, generateDocumentModelZodSchemas as d, documentModelDocumentTypeTemplate as dn, createDocumentFileTemplate as dr, getDocumentTypeMetadata as dt, getDocumentModelDirName as en, claudeSettingsLocalTemplate as er, ensureDirectoriesExist as et, generateTypesAndZodSchemasFromGraphql as f, documentModelDocumentSchemaFileTemplate as fn, documentModelDocumentTypeMetadata as ft, getCommandHelpInfo as g, documentModelRootActionsFileTemplate as gn, customSubgraphResolversTemplate as gt, tsMorphGenerateDocumentEditor as h, documentModelGenActionsFileTemplate as hn, parseConfig as ht, createOrUpdateManifest as i, getLatestDocumentModelSpec as in, driveExplorerNavigationBreadcrumbsFileTemplate as ir, getSubgraphMetadata as it, writeProjectRootFiles as j, exportsTemplate as jn, documentModelUtilsTemplate as jt, writeGeneratedSubgraphsFiles as k, packageJsonScriptsTemplate as kn, analyticsIndexTemplate as kt, operationHasInput as l, getActionTypeName as ln, driveExplorerFileTemplate as lr, formatSourceFileWithPrettier as lt, scalarsValidation as m, documentModelGenControllerFileTemplate as mn, parseArgs as mt, tsMorphGenerateSubgraph as n, getDocumentModelVariableNames as nn, appEditorFileTemplate as nr, getOrCreateSourceFile as nt, pruneManifestSection as o, getActionInputName as on, appFoldersFileTemplate as or, getAppMetadata as ot, scalars as p, documentModelGenCreatorsFileTemplate as pn, configSpec as pt, getProperyAssignmentByName as q, documentModelsIndexTemplate as qn, documentModelGenReducerFileTemplate as qt, tsMorphGenerateProcessor as r, getEditorVariableNames as rn, appConfigFileTemplate as rr, getPreviousVersionSourceFile as rt, makeModulesIndexFile as s, getActionInputTypeNames as sn, appFilesFileTemplate as sr, getEditorMetadata as st, makeSubgraphsIndexFile as t, getDocumentModelSpecByVersionNumber as tn, agentsTemplate as tr, getOrCreateDirectory as tt, tsMorphGenerateDocumentModel as u, documentModelGenIndexFileTemplate as un, appDriveContentsFileTemplate as ur, runPrettier as ut, makeCliDocsFromHelp as v, documentEditorEditorFileTemplate as vn, subgraphLibFileTemplate as vt, writeCIFiles as w, styleTemplate as wn, relationalDbFactoryTemplate as wt, applyProjectCustomizations as x, tsConfigTemplate as xn, relationalDbProcessorTemplate as xt, writeCliDocsMarkdownFile as y, docsFromCliHelpTemplate as yn, subgraphIndexFileTemplate as yt, DEFAULT_PROJECT_OPTIONS as z, indexHtmlTemplate as zn, documentModelSrcUtilsTemplate as zt };
|
|
8582
8594
|
|
|
8583
|
-
//# sourceMappingURL=file-builders-
|
|
8595
|
+
//# sourceMappingURL=file-builders-NNaY31PO.mjs.map
|