@trackunit/iris-app 2.16.15 → 2.16.16

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/migrations/entry.js.map +1 -0
  3. package/migrations/p-content-space-codemod/invent-content-space.js.map +1 -0
  4. package/migrations/p-content-space-codemod/orchestrator.js.map +1 -0
  5. package/migrations/p-content-space-codemod/remove-redundant-padding.js.map +1 -0
  6. package/migrations/p-content-space-codemod/report-run-messaging.js.map +1 -0
  7. package/migrations/p-content-space-codemod/report-unresolved.js.map +1 -0
  8. package/migrations/p-content-space-codemod/resolve-content-shell.js.map +1 -0
  9. package/migrations/p-content-space-codemod/rewrite-page-content.js.map +1 -0
  10. package/migrations/p-content-space-codemod/shell-skip-reason.js.map +1 -0
  11. package/migrations/repair-tsconfig/repair-tsconfig.js +205 -0
  12. package/migrations/repair-tsconfig/repair-tsconfig.js.map +1 -0
  13. package/migrations/utils/classname-ast-rewrite.js.map +1 -0
  14. package/migrations/utils/resolve-extension-types.js.map +1 -0
  15. package/migrations.json +5 -0
  16. package/package.json +14 -1
  17. package/src/executors/submit/executor.js.map +1 -0
  18. package/src/executors/unpublish/executor.js.map +1 -0
  19. package/src/executors/utils/authentication.js.map +1 -0
  20. package/src/executors/utils/irisAppServerSettings.js.map +1 -0
  21. package/src/executors/utils/src/index.js.map +1 -0
  22. package/src/generators/ai-agent-sync/generator.js.map +1 -0
  23. package/src/generators/create/files/tsconfig.app.json__template__ +1 -0
  24. package/src/generators/create/generator.js +13 -21
  25. package/src/generators/create/generator.js.map +1 -0
  26. package/src/generators/extend/dependencies.js.map +1 -0
  27. package/src/generators/extend/generator.js +26 -34
  28. package/src/generators/extend/generator.js.map +1 -0
  29. package/src/generators/preset/generator.js +3 -7
  30. package/src/generators/preset/generator.js.map +1 -0
  31. package/src/generators/utils/get-package-manifest.js.map +1 -0
  32. package/src/generators/utils/link-claude-skills.js.map +1 -0
  33. package/src/generators/utils/own-package-json/own-package-json.d.ts +14 -0
  34. package/src/generators/utils/own-package-json/own-package-json.js +29 -0
  35. package/src/generators/utils/own-package-json/own-package-json.js.map +1 -0
  36. package/src/generators/utils/pinned-versions/pinned-versions.d.ts +30 -0
  37. package/src/generators/utils/pinned-versions/pinned-versions.js +45 -0
  38. package/src/generators/utils/pinned-versions/pinned-versions.js.map +1 -0
  39. package/src/generators/utils/uses-trackunit-eslint-plugin.js.map +1 -0
  40. package/src/generators/utils/write-trackunit-project-eslint-config.js.map +1 -0
  41. package/src/index.js.map +1 -0
  42. package/src/utils/ast/astUtils.js.map +1 -0
  43. package/src/utils/fileUpdater.js.map +1 -0
@@ -6,8 +6,8 @@ const devkit_1 = require("@nx/devkit");
6
6
  const js_1 = require("@nx/js");
7
7
  const react_1 = require("@nx/react");
8
8
  const path_1 = tslib_1.__importDefault(require("path"));
9
- const get_package_manifest_1 = require("../utils/get-package-manifest");
10
9
  const link_claude_skills_1 = require("../utils/link-claude-skills");
10
+ const pinned_versions_1 = require("../utils/pinned-versions/pinned-versions");
11
11
  const uses_trackunit_eslint_plugin_1 = require("../utils/uses-trackunit-eslint-plugin");
12
12
  /**
13
13
  * Preset generator for Iris apps workspace.
@@ -54,18 +54,14 @@ async function presetGenerator(tree, options) {
54
54
  tsconfig.compilerOptions.strict = true;
55
55
  return tsconfig;
56
56
  });
57
- const [migrationsManifest, eslintPluginTrackunitManifest] = await Promise.all([
58
- (0, get_package_manifest_1.getPackageManifest)("@trackunit/migrations"),
59
- (0, get_package_manifest_1.getPackageManifest)(uses_trackunit_eslint_plugin_1.TRACKUNIT_ESLINT_PLUGIN),
60
- ]);
61
57
  (0, devkit_1.addDependenciesToPackageJson)(tree, {
62
58
  react: "19.3.0",
63
59
  "react-dom": "19.3.0",
64
60
  }, {
65
61
  // Ships the generator that upgrades every @trackunit/* dependency, so a new
66
62
  // workspace can run the documented upgrade flow without installing it first.
67
- "@trackunit/migrations": migrationsManifest.version,
68
- [uses_trackunit_eslint_plugin_1.TRACKUNIT_ESLINT_PLUGIN]: eslintPluginTrackunitManifest.version,
63
+ "@trackunit/migrations": (0, pinned_versions_1.getPinnedVersion)("@trackunit/migrations"),
64
+ [uses_trackunit_eslint_plugin_1.TRACKUNIT_ESLINT_PLUGIN]: (0, pinned_versions_1.getPinnedVersion)(uses_trackunit_eslint_plugin_1.TRACKUNIT_ESLINT_PLUGIN),
69
65
  "@typescript-eslint/parser": "8.71.2",
70
66
  eslint: "9.33.0",
71
67
  "@nx/eslint": "23.3.0",
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/generators/preset/generator.ts"],"names":[],"mappings":";;AAuBA,0CAgGC;;AAvHD,uCASoB;AACpB,+BAA0D;AAC1D,qCAA+C;AAC/C,wDAAwB;AACxB,oEAA+D;AAC/D,8EAA4E;AAC5E,wFAAgF;AAGhF;;;;GAIG;AACI,KAAK,UAAU,eAAe,CAAC,IAAU,EAAE,OAA8B;IAC9E,kBAAkB;IAClB,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAC5B,IAAI,CAAC,KAAK,CACR,gBAAgB,EAChB,4LAA4L,CAC7L,CAAC;IACF,IAAI,CAAC,KAAK,CACR,gBAAgB,EAChB,oIAAoI,CACrI,CAAC;IAEF,MAAM,cAAc,GAAG,yBAAyB,CAAC;IAEjD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC;QACjC,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,IAAA,sBAAa,EAAC,IAAI,EAAE,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;IAC5D,IAAA,sBAAa,EAAC,IAAI,EAAE,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,EAAE,GAAG,EAAE,EA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IAAI,EAAE,MAAM,CAAC,CAAC;AAC7B,CAAC;AAED,0FAA0F;AAC1F,SAAS,oBAAoB,CAAC,IAAU;IACtC,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACtC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;IACrC,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAC/B,MAAM,CAAC,EAAE,CAAC,CAAC,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,mBAAmB,CACxF,CAAC;IACF,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,MAAM,CAAC,OAAO,GAAG,CAAC,GAAG,OAAO,EAAE,EAAE,MAAM,EAAE,mBAAmB,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;IAClG,CAAC;IACD,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,EAAE,UAAU,CAAC;IAClD,IAAI,MAAM,CAAC,WAAW,IAAI,UAAU,EAAE,CAAC;QACrC,MAAM,CAAC,WAAW,CAAC,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,UAAU,EAAE,kCAAkC,CAAC,CAAC,CAAC,CAAC;IAC3G,CAAC;IACD,IAAA,qBAAY,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC7B,CAAC","sourcesContent":["import {\n Tree,\n addDependenciesToPackageJson,\n generateFiles,\n logger,\n readNxJson,\n runTasksInSerial,\n updateJson,\n updateNxJson,\n} from \"@nx/devkit\";\nimport { initGenerator as jsInitGenerator } from \"@nx/js\";\nimport { reactInitGenerator } from \"@nx/react\";\nimport path from \"path\";\nimport { linkClaudeSkills } from \"../utils/link-claude-skills\";\nimport { getPinnedVersion } from \"../utils/pinned-versions/pinned-versions\";\nimport { TRACKUNIT_ESLINT_PLUGIN } from \"../utils/uses-trackunit-eslint-plugin\";\nimport { PresetGeneratorSchema } from \"./schema\";\n\n/**\n * Preset generator for Iris apps workspace.\n * Use with create-nx-workspace to create a new workspace for developing Iris apps.\n * ```npx create-nx-workspace --preset=iris-app```\n */\nexport async function presetGenerator(tree: Tree, options: PresetGeneratorSchema) {\n // setup workspace\n updateWorkspaceLayout(tree);\n tree.write(\n \"apps/readme.md\",\n `# Apps\\n\\nThis folder contains all apps in the workspace.\\n\\nApps are the main entry point for the Iris App SDK.\\nCreate an app by running \\`nx g @trackunit/iris-app:create <app-name>\\`.`\n );\n tree.write(\n \"libs/readme.md\",\n `# Libs\\n\\nThis folder contains all libs in the workspace.\\nCreate a lib by running \\`nx g @trackunit/iris-app:extend <lib-name>\\`.`\n );\n\n const extensionsPath = \".vscode/extensions.json\";\n\n if (!tree.exists(extensionsPath)) {\n tree.write(extensionsPath, \"{}\");\n }\n\n generateFiles(tree, path.join(__dirname, \"files\"), \".\", {});\n generateFiles(tree, path.join(__dirname, \"root-files\"), \".\", { template: \"\" });\n if (!tree.exists(\"vitest.empty-stub.ts\")) {\n tree.write(\"vitest.empty-stub.ts\", \"export default {};\\n\");\n }\n\n updateJson(tree, extensionsPath, value => {\n if (!value.recommendations) {\n value.recommendations = [];\n }\n value.recommendations = value.recommendations.filter(\n (recommendation: string) => recommendation !== \"firsttris.vscode-jest-runner\"\n );\n value.recommendations.push(\n \"graphql.vscode-graphql\",\n \"graphql.vscode-graphql-syntax\",\n \"bradlc.vscode-tailwindcss\",\n \"vitest.explorer\",\n \"dbaeumer.vscode-eslint\"\n );\n return value;\n });\n\n const jsInitTask = await jsInitGenerator(tree, {\n ...options,\n tsConfigName: \"tsconfig.base.json\",\n // Since Nx 23.3 an unset formatter is detected from the tree, and a fresh workspace has none.\n formatter: \"prettier\",\n skipFormat: true,\n });\n\n updateJson(tree, \"tsconfig.base.json\", (tsconfig: { compilerOptions?: Record<string, unknown> }) => {\n if (!tsconfig.compilerOptions) {\n tsconfig.compilerOptions = {};\n }\n tsconfig.compilerOptions.ignoreDeprecations = \"6.0\";\n tsconfig.compilerOptions.esModuleInterop = true;\n tsconfig.compilerOptions.resolveJsonModule = true;\n tsconfig.compilerOptions.moduleResolution = \"bundler\";\n tsconfig.compilerOptions.strict = true;\n return tsconfig;\n });\n\n addDependenciesToPackageJson(\n tree,\n {\n react: \"19.3.0\",\n \"react-dom\": \"19.3.0\",\n },\n {\n // Ships the generator that upgrades every @trackunit/* dependency, so a new\n // workspace can run the documented upgrade flow without installing it first.\n \"@trackunit/migrations\": getPinnedVersion(\"@trackunit/migrations\"),\n [TRACKUNIT_ESLINT_PLUGIN]: getPinnedVersion(TRACKUNIT_ESLINT_PLUGIN),\n \"@typescript-eslint/parser\": \"8.71.2\",\n eslint: \"9.33.0\",\n \"@nx/eslint\": \"23.3.0\",\n }\n );\n\n registerEslintPlugin(tree);\n\n // This react generator adds react 19 and react-dom 19 to the package.json if we don't add react 18 above.\n const initReact = await reactInitGenerator(tree, {});\n\n // Post-flush task: symlink .claude/skills -> ../.agents/skills so Claude Code\n // auto-discovers the same skills as Cursor/Codex without manual setup.\n const linkSkillsTask = () => {\n const result = linkClaudeSkills(tree.root);\n if (result.status === \"skipped\") {\n logger.warn(\n `[iris-app:preset] Skipped creating .claude/skills symlink: ${result.reason}. ` +\n `Claude Code users may need to create it manually: ln -s ../.agents/skills .claude/skills`\n );\n }\n };\n\n return runTasksInSerial(jsInitTask, initReact, linkSkillsTask);\n}\n\nfunction updateWorkspaceLayout(tree: Tree) {\n const nxJson = readNxJson(tree) ?? {};\n nxJson.workspaceLayout = {\n libsDir: \"libs\",\n appsDir: \"apps\",\n };\n updateNxJson(tree, nxJson);\n}\n\n// Nx's own ESLint init skips this setup once a root config exists, so the preset does it.\nfunction registerEslintPlugin(tree: Tree) {\n const nxJson = readNxJson(tree) ?? {};\n const plugins = nxJson.plugins ?? [];\n const isRegistered = plugins.some(\n plugin => (typeof plugin === \"string\" ? plugin : plugin.plugin) === \"@nx/eslint/plugin\"\n );\n if (!isRegistered) {\n nxJson.plugins = [...plugins, { plugin: \"@nx/eslint/plugin\", options: { targetName: \"lint\" } }];\n }\n const production = nxJson.namedInputs?.production;\n if (nxJson.namedInputs && production) {\n nxJson.namedInputs.production = Array.from(new Set([...production, \"!{projectRoot}/eslint.config.cjs\"]));\n }\n updateNxJson(tree, nxJson);\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-package-manifest.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/generators/utils/get-package-manifest.ts"],"names":[],"mappings":";;;;AAAA,uDAAiC;AAEjC;;GAEG;AACI,MAAM,kBAAkB,GAAG,CAAC,WAAmB,EAAE,EAAE,CACxD,MAAM,CAAC,QAAQ,CACb,WAAW,EACX,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,SAAS,CACpF,CAAC;AAJS,QAAA,kBAAkB,sBAI3B","sourcesContent":["import * as pacote from \"pacote\";\n\n/**\n * Keeps Trackunit registry overrides consistent across package-consuming generators.\n */\nexport const getPackageManifest = (packageName: string) =>\n pacote.manifest(\n packageName,\n process.env.TU_NPM_REGISTRY ? { registry: process.env.TU_NPM_REGISTRY } : undefined\n );\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link-claude-skills.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/generators/utils/link-claude-skills.ts"],"names":[],"mappings":";;AAqBA,4CA0CC;;AA/DD,+CAAyB;AACzB,mDAA6B;AAE7B,MAAM,UAAU,GAAG,SAAS,CAAC;AAC7B,MAAM,kBAAkB,GAAG,QAAQ,CAAC;AACpC,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AAO/D;;;;;;;;GA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,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;QACnD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IAC/B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,MAAM,EAAE,6BAA6B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;SAC9F,CAAC;IACJ,CAAC;AACH,CAAC;AAED,SAAS,SAAS,CAAC,CAAS;IAC1B,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAOD,SAAS,oBAAoB,CAAC,EAAE,aAAa,EAAE,cAAc,EAA6B;IACxF,IAAI,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;QACnC,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC;AACrD,CAAC","sourcesContent":["import * as fs from \"fs\";\nimport * as path from \"path\";\n\nconst CLAUDE_DIR = \".claude\";\nconst CLAUDE_SKILLS_NAME = \"skills\";\nconst AGENTS_SKILLS_REL = path.join(\"..\", \".agents\", \"skills\");\n\nexport type LinkClaudeSkillsResult =\n | { status: \"created\" }\n | { status: \"already-linked\" }\n | { status: \"skipped\"; reason: string };\n\n/**\n * Ensures `.claude/skills` is a symlink to `../.agents/skills` so Claude Code\n * auto-discovers skills shared via `.agents/skills`.\n *\n * Idempotent: leaves an existing valid symlink alone, refuses to overwrite a\n * real `.claude/skills` directory or file. Cross-platform-safe: catches\n * symlink permission errors (e.g. Windows without Developer Mode) and returns\n * a `skipped` result instead of throwing.\n */\nexport function linkClaudeSkills(workspaceRoot: string): LinkClaudeSkillsResult {\n const claudeDir = path.join(workspaceRoot, CLAUDE_DIR);\n const linkPath = path.join(claudeDir, CLAUDE_SKILLS_NAME);\n const agentsSkillsAbs = path.join(workspaceRoot, \".agents\", \"skills\");\n\n if (!fs.existsSync(agentsSkillsAbs)) {\n return { status: \"skipped\", reason: \".agents/skills does not exist\" };\n }\n\n fs.mkdirSync(claudeDir, { recursive: true });\n\n const existingLstat = safeLstat(linkPath);\n if (existingLstat?.isSymbolicLink()) {\n const currentTarget = fs.readlinkSync(linkPath);\n if (\n resolveSymlinkTarget({\n currentTarget,\n linkParentPath: claudeDir,\n }) === path.resolve(agentsSkillsAbs)\n ) {\n return { status: \"already-linked\" };\n }\n return {\n status: \"skipped\",\n reason: `.claude/skills already exists as a symlink to ${currentTarget}`,\n };\n } else if (existingLstat) {\n return {\n status: \"skipped\",\n reason: `.claude/skills already exists as a ${existingLstat.isDirectory() ? \"directory\" : \"file\"}`,\n };\n }\n\n try {\n fs.symlinkSync(AGENTS_SKILLS_REL, linkPath, \"dir\");\n return { status: \"created\" };\n } catch (error) {\n return {\n status: \"skipped\",\n reason: `failed to create symlink: ${error instanceof Error ? error.message : String(error)}`,\n };\n }\n}\n\nfunction safeLstat(p: string): fs.Stats | undefined {\n try {\n return fs.lstatSync(p);\n } catch {\n return undefined;\n }\n}\n\ntype ResolveSymlinkTargetInput = {\n readonly currentTarget: string;\n readonly linkParentPath: string;\n};\n\nfunction resolveSymlinkTarget({ currentTarget, linkParentPath }: ResolveSymlinkTargetInput): string {\n if (path.isAbsolute(currentTarget)) {\n return path.resolve(currentTarget);\n }\n\n return path.resolve(linkParentPath, currentTarget);\n}\n"]}
@@ -0,0 +1,14 @@
1
+ import type { PackageJson } from "nx/src/utils/package-json";
2
+ /** This package's own package.json, the one place in the SDK that locates it. */
3
+ export declare const OWN_PACKAGE_JSON_PATH: string;
4
+ export type OwnPackageJson = PackageJson & {
5
+ engines?: Record<string, string>;
6
+ /** Exact versions of the packages the generators write into workspaces; CI's sync-versions step sets them. */
7
+ pinnedVersions?: Record<string, string | undefined>;
8
+ };
9
+ /**
10
+ * Reads this package's own package.json.
11
+ *
12
+ * @returns {OwnPackageJson} the parsed package.json of `@trackunit/iris-app`
13
+ */
14
+ export declare const readOwnPackageJson: () => OwnPackageJson;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.readOwnPackageJson = exports.OWN_PACKAGE_JSON_PATH = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const devkit_1 = require("@nx/devkit");
6
+ const ts = tslib_1.__importStar(require("typescript"));
7
+ /**
8
+ * Finds this package's own package.json with TypeScript's upward search from this file, so nothing here depends on how
9
+ * deep the file sits. The nearest package.json upward is the package's own in all three layouts: the monorepo source
10
+ * (`libs/iris-app-sdk/iris-app/`), the build (`dist/libs/iris-app-sdk/iris-app/`) and an install
11
+ * (`node_modules/@trackunit/iris-app/`). Nothing under `src/` may get a package.json of its own.
12
+ */
13
+ const findOwnPackageJson = () => {
14
+ const found = ts.findConfigFile(__dirname, ts.sys.fileExists, "package.json");
15
+ if (found === undefined) {
16
+ throw new Error(`Could not find the package.json of @trackunit/iris-app above ${__dirname}. The SDK install is incomplete; reinstall @trackunit/iris-app.`);
17
+ }
18
+ return found;
19
+ };
20
+ /** This package's own package.json, the one place in the SDK that locates it. */
21
+ exports.OWN_PACKAGE_JSON_PATH = findOwnPackageJson();
22
+ /**
23
+ * Reads this package's own package.json.
24
+ *
25
+ * @returns {OwnPackageJson} the parsed package.json of `@trackunit/iris-app`
26
+ */
27
+ const readOwnPackageJson = () => (0, devkit_1.readJsonFile)(exports.OWN_PACKAGE_JSON_PATH);
28
+ exports.readOwnPackageJson = readOwnPackageJson;
29
+ //# sourceMappingURL=own-package-json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"own-package-json.js","sourceRoot":"","sources":["../../../../../../../../libs/iris-app-sdk/iris-app/src/generators/utils/own-package-json/own-package-json.ts"],"names":[],"mappings":";;;;AAAA,uCAA0C;AAE1C,uDAAiC;AAEjC;;;;;GAKG;AACH,MAAM,kBAAkB,GAAG,GAAW,EAAE;IACtC,MAAM,KAAK,GAAG,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IAC9E,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CACb,gEAAgE,SAAS,iEAAiE,CAC3I,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,iFAAiF;AACpE,QAAA,qBAAqB,GAAG,kBAAkB,EAAE,CAAC;AAQ1D;;;;GAIG;AACI,MAAM,kBAAkB,GAAG,GAAmB,EAAE,CAAC,IAAA,qBAAY,EAAiB,6BAAqB,CAAC,CAAC;AAA/F,QAAA,kBAAkB,sBAA6E","sourcesContent":["import { readJsonFile } from \"@nx/devkit\";\nimport type { PackageJson } from \"nx/src/utils/package-json\";\nimport * as ts from \"typescript\";\n\n/**\n * Finds this package's own package.json with TypeScript's upward search from this file, so nothing here depends on how\n * deep the file sits. The nearest package.json upward is the package's own in all three layouts: the monorepo source\n * (`libs/iris-app-sdk/iris-app/`), the build (`dist/libs/iris-app-sdk/iris-app/`) and an install\n * (`node_modules/@trackunit/iris-app/`). Nothing under `src/` may get a package.json of its own.\n */\nconst findOwnPackageJson = (): string => {\n const found = ts.findConfigFile(__dirname, ts.sys.fileExists, \"package.json\");\n if (found === undefined) {\n throw new Error(\n `Could not find the package.json of @trackunit/iris-app above ${__dirname}. The SDK install is incomplete; reinstall @trackunit/iris-app.`\n );\n }\n return found;\n};\n\n/** This package's own package.json, the one place in the SDK that locates it. */\nexport const OWN_PACKAGE_JSON_PATH = findOwnPackageJson();\n\nexport type OwnPackageJson = PackageJson & {\n engines?: Record<string, string>;\n /** Exact versions of the packages the generators write into workspaces; CI's sync-versions step sets them. */\n pinnedVersions?: Record<string, string | undefined>;\n};\n\n/**\n * Reads this package's own package.json.\n *\n * @returns {OwnPackageJson} the parsed package.json of `@trackunit/iris-app`\n */\nexport const readOwnPackageJson = (): OwnPackageJson => readJsonFile<OwnPackageJson>(OWN_PACKAGE_JSON_PATH);\n"]}
@@ -0,0 +1,30 @@
1
+ type PinnedVersionsOptions = {
2
+ /** Absolute path of the package.json to read the pins from. Defaults to this package's own, used by tests. */
3
+ packageJsonPath?: string;
4
+ };
5
+ type PinnedVersions = Readonly<Record<string, string | undefined>>;
6
+ /**
7
+ * Reads the `pinnedVersions` field of a package.json: the exact `@trackunit/*` versions this release of the SDK was
8
+ * built against. The one way to read the pins, so specs read them the way the generators do.
9
+ *
10
+ * @param packageJsonPath absolute path of the package.json to read; defaults to this package's own
11
+ * @returns {PinnedVersions} the pins by package name, empty when the field is missing
12
+ * @throws {Error} naming the file when it is missing (ENOENT) or not valid JSON; devkit's `readJsonFile` puts the path
13
+ * in both messages
14
+ */
15
+ export declare const readPinnedVersions: (packageJsonPath?: string) => PinnedVersions;
16
+ /**
17
+ * Returns the exact version of a `@trackunit/*` package this release of the SDK was built against.
18
+ *
19
+ * The pins live in the `pinnedVersions` field of this package's own package.json, which CI's sync-versions step
20
+ * sets to the to-be-published versions before the package is built and published.
21
+ *
22
+ * Never consults the npm registry and never returns "latest": a missing pin is a broken install and fails loudly,
23
+ * so workspace creation cannot pick a version the developer's npm release-age policy forbids.
24
+ *
25
+ * @param packageName full package name, e.g. `@trackunit/react-components`
26
+ * @param options override location of the package.json, used by tests
27
+ * @returns {string} the exact pinned version, e.g. `6.0.17`
28
+ */
29
+ export declare const getPinnedVersion: (packageName: string, options?: PinnedVersionsOptions) => string;
30
+ export {};
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPinnedVersion = exports.readPinnedVersions = void 0;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const semver_1 = require("semver");
6
+ const own_package_json_1 = require("../own-package-json/own-package-json");
7
+ /**
8
+ * A pin must be an exact version: "", "latest" and ranges would reopen the registry-"latest" problem.
9
+ * `valid` normalises (trims, strips a leading "v"), so only a string it returns unchanged is exact.
10
+ */
11
+ const isExactVersion = (version) => (0, semver_1.valid)(version) === version;
12
+ /**
13
+ * Reads the `pinnedVersions` field of a package.json: the exact `@trackunit/*` versions this release of the SDK was
14
+ * built against. The one way to read the pins, so specs read them the way the generators do.
15
+ *
16
+ * @param packageJsonPath absolute path of the package.json to read; defaults to this package's own
17
+ * @returns {PinnedVersions} the pins by package name, empty when the field is missing
18
+ * @throws {Error} naming the file when it is missing (ENOENT) or not valid JSON; devkit's `readJsonFile` puts the path
19
+ * in both messages
20
+ */
21
+ const readPinnedVersions = (packageJsonPath = own_package_json_1.OWN_PACKAGE_JSON_PATH) => (0, devkit_1.readJsonFile)(packageJsonPath).pinnedVersions ?? {};
22
+ exports.readPinnedVersions = readPinnedVersions;
23
+ /**
24
+ * Returns the exact version of a `@trackunit/*` package this release of the SDK was built against.
25
+ *
26
+ * The pins live in the `pinnedVersions` field of this package's own package.json, which CI's sync-versions step
27
+ * sets to the to-be-published versions before the package is built and published.
28
+ *
29
+ * Never consults the npm registry and never returns "latest": a missing pin is a broken install and fails loudly,
30
+ * so workspace creation cannot pick a version the developer's npm release-age policy forbids.
31
+ *
32
+ * @param packageName full package name, e.g. `@trackunit/react-components`
33
+ * @param options override location of the package.json, used by tests
34
+ * @returns {string} the exact pinned version, e.g. `6.0.17`
35
+ */
36
+ const getPinnedVersion = (packageName, options = {}) => {
37
+ const packageJsonPath = options.packageJsonPath ?? own_package_json_1.OWN_PACKAGE_JSON_PATH;
38
+ const version = (0, exports.readPinnedVersions)(packageJsonPath)[packageName];
39
+ if (!isExactVersion(version)) {
40
+ throw new Error(`No valid pinned version for ${packageName} in the "pinnedVersions" field of ${packageJsonPath}. The SDK install is incomplete; reinstall @trackunit/iris-app.`);
41
+ }
42
+ return version;
43
+ };
44
+ exports.getPinnedVersion = getPinnedVersion;
45
+ //# sourceMappingURL=pinned-versions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pinned-versions.js","sourceRoot":"","sources":["../../../../../../../../libs/iris-app-sdk/iris-app/src/generators/utils/pinned-versions/pinned-versions.ts"],"names":[],"mappings":";;;AAAA,uCAA0C;AAC1C,mCAA+B;AAC/B,2EAAkG;AASlG;;;GAGG;AACH,MAAM,cAAc,GAAG,CAAC,OAA2B,EAAqB,EAAE,CAAC,IAAA,cAAK,EAAC,OAAO,CAAC,KAAK,OAAO,CAAC;AAEtG;;;;;;;;GAQG;AACI,MAAM,kBAAkB,GAAG,CAAC,kBAA0B,wCAAqB,EAAkB,EAAE,CACpG,IAAA,qBAAY,EAAiB,eAAe,CAAC,CAAC,cAAc,IAAI,EAAE,CAAC;AADxD,QAAA,kBAAkB,sBACsC;AAErE;;;;;;;;;;;;GAYG;AACI,MAAM,gBAAgB,GAAG,CAAC,WAAmB,EAAE,UAAiC,EAAE,EAAU,EAAE;IACnG,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,IAAI,wCAAqB,CAAC;IACzE,MAAM,OAAO,GAAG,IAAA,0BAAkB,EAAC,eAAe,CAAC,CAAC,WAAW,CAAC,CAAC;IACjE,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CACb,+BAA+B,WAAW,qCAAqC,eAAe,iEAAiE,CAChK,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AATW,QAAA,gBAAgB,oBAS3B","sourcesContent":["import { readJsonFile } from \"@nx/devkit\";\nimport { valid } from \"semver\";\nimport { OWN_PACKAGE_JSON_PATH, type OwnPackageJson } from \"../own-package-json/own-package-json\";\n\ntype PinnedVersionsOptions = {\n /** Absolute path of the package.json to read the pins from. Defaults to this package's own, used by tests. */\n packageJsonPath?: string;\n};\n\ntype PinnedVersions = Readonly<Record<string, string | undefined>>;\n\n/**\n * A pin must be an exact version: \"\", \"latest\" and ranges would reopen the registry-\"latest\" problem.\n * `valid` normalises (trims, strips a leading \"v\"), so only a string it returns unchanged is exact.\n */\nconst isExactVersion = (version: string | undefined): version is string => valid(version) === version;\n\n/**\n * Reads the `pinnedVersions` field of a package.json: the exact `@trackunit/*` versions this release of the SDK was\n * built against. The one way to read the pins, so specs read them the way the generators do.\n *\n * @param packageJsonPath absolute path of the package.json to read; defaults to this package's own\n * @returns {PinnedVersions} the pins by package name, empty when the field is missing\n * @throws {Error} naming the file when it is missing (ENOENT) or not valid JSON; devkit's `readJsonFile` puts the path\n * in both messages\n */\nexport const readPinnedVersions = (packageJsonPath: string = OWN_PACKAGE_JSON_PATH): PinnedVersions =>\n readJsonFile<OwnPackageJson>(packageJsonPath).pinnedVersions ?? {};\n\n/**\n * Returns the exact version of a `@trackunit/*` package this release of the SDK was built against.\n *\n * The pins live in the `pinnedVersions` field of this package's own package.json, which CI's sync-versions step\n * sets to the to-be-published versions before the package is built and published.\n *\n * Never consults the npm registry and never returns \"latest\": a missing pin is a broken install and fails loudly,\n * so workspace creation cannot pick a version the developer's npm release-age policy forbids.\n *\n * @param packageName full package name, e.g. `@trackunit/react-components`\n * @param options override location of the package.json, used by tests\n * @returns {string} the exact pinned version, e.g. `6.0.17`\n */\nexport const getPinnedVersion = (packageName: string, options: PinnedVersionsOptions = {}): string => {\n const packageJsonPath = options.packageJsonPath ?? OWN_PACKAGE_JSON_PATH;\n const version = readPinnedVersions(packageJsonPath)[packageName];\n if (!isExactVersion(version)) {\n throw new Error(\n `No valid pinned version for ${packageName} in the \"pinnedVersions\" field of ${packageJsonPath}. The SDK install is incomplete; reinstall @trackunit/iris-app.`\n );\n }\n return version;\n};\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uses-trackunit-eslint-plugin.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/generators/utils/uses-trackunit-eslint-plugin.ts"],"names":[],"mappings":";;;AAkBA,8DAUC;AA5BD,uCAA4C;AAE/B,QAAA,uBAAuB,GAAG,oCAAoC,CAAC;AAO5E;;;;;;;;GAQG;AACH,SAAgB,yBAAyB,CAAC,IAAU;IAClD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE,CAAC;QACtE,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,EAAE,YAAY,EAAE,eAAe,EAAE,GAAG,IAAA,iBAAQ,EAAuB,IAAI,EAAE,cAAc,CAAC,CAAC;IAE/F,OAAO,CACL,YAAY,EAAE,CAAC,+BAAuB,CAAC,KAAK,SAAS,IAAI,eAAe,EAAE,CAAC,+BAAuB,CAAC,KAAK,SAAS,CAClH,CAAC;AACJ,CAAC","sourcesContent":["import { readJson, Tree } from \"@nx/devkit\";\n\nexport const TRACKUNIT_ESLINT_PLUGIN = \"@trackunit/eslint-plugin-trackunit\";\n\ntype WorkspacePackageJson = {\n readonly dependencies?: Record<string, string>;\n readonly devDependencies?: Record<string, string>;\n};\n\n/**\n * Returns true when the workspace root `package.json` declares\n * `@trackunit/eslint-plugin-trackunit` in `dependencies` or `devDependencies`\n * and the workspace has a root `eslint.config.cjs`.\n *\n * Generated project configs `require` the root `eslint.config.cjs`, so a workspace\n * with the plugin but another root config (e.g. Nx's `eslint.config.mjs`) is\n * treated as not using it.\n */\nexport function usesTrackunitEslintPlugin(tree: Tree): boolean {\n if (!tree.exists(\"package.json\") || !tree.exists(\"eslint.config.cjs\")) {\n return false;\n }\n\n const { dependencies, devDependencies } = readJson<WorkspacePackageJson>(tree, \"package.json\");\n\n return (\n dependencies?.[TRACKUNIT_ESLINT_PLUGIN] !== undefined || devDependencies?.[TRACKUNIT_ESLINT_PLUGIN] !== undefined\n );\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-trackunit-project-eslint-config.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/generators/utils/write-trackunit-project-eslint-config.ts"],"names":[],"mappings":";;AAUA,8EAOC;AAjBD,uCAAqD;AAErD;;;;;;;GAOG;AACH,SAAgB,iCAAiC,CAAC,IAAU,EAAE,WAAmB,EAAE,cAAsB;IACvG,qEAAqE;IACrE,IAAI,CAAC,MAAM,CAAC,IAAA,0BAAiB,EAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC,CAAC;IACjE,IAAI,CAAC,KAAK,CACR,IAAA,0BAAiB,EAAC,WAAW,EAAE,mBAAmB,CAAC,EACnD,iCAAiC,cAAc,yBAAyB,CACzE,CAAC;AACJ,CAAC","sourcesContent":["import { joinPathFragments, Tree } from \"@nx/devkit\";\n\n/**\n * Writes a project `eslint.config.cjs` that only extends the workspace root\n * `eslint.config.cjs`, for workspaces where `usesTrackunitEslintPlugin` is true.\n *\n * @param tree the nx tree\n * @param projectRoot the project directory, relative to the workspace root\n * @param offsetFromRoot relative path from the project directory to the workspace root, ending in `/`\n */\nexport function writeTrackunitProjectEslintConfig(tree: Tree, projectRoot: string, offsetFromRoot: string): void {\n // ESLint prefers eslint.config.mjs over a sibling eslint.config.cjs.\n tree.delete(joinPathFragments(projectRoot, \"eslint.config.mjs\"));\n tree.write(\n joinPathFragments(projectRoot, \"eslint.config.cjs\"),\n `module.exports = [...require('${offsetFromRoot}eslint.config.cjs')];\\n`\n );\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/iris-app-sdk/iris-app/src/index.ts"],"names":[],"mappings":";;;;AAAA,mEAAkE;AAAzD,gHAAA,cAAc,OAAA;AACvB,iFAAsE;AAA7D,oHAAA,WAAW,OAAA;AAEpB,2DAAiE;AAAxD,6GAAA,gBAAgB,OAAA;AAEzB,2DAA0E;AAAjE,sHAAA,yBAAyB,OAAA;AAElC,+DAAqC;AACrC,8DAAoC","sourcesContent":["export { getAccessToken } from \"./executors/utils/authentication\";\nexport { getSettings } from \"./executors/utils/irisAppServerSettings\";\nexport type { Settings } from \"./executors/utils/irisAppServerSettings\";\nexport { IrisAppGenerator } from \"./generators/create/generator\";\nexport type { IrisAppGeneratorSchema } from \"./generators/create/schema\";\nexport { IrisAppExtensionGenerator } from \"./generators/extend/generator\";\nexport type { IrisAppExtensionGeneratorSchema } from \"./generators/extend/schema\";\nexport * from \"./utils/ast/astUtils\";\nexport * from \"./utils/fileUpdater\";\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"astUtils.js","sourceRoot":"","sources":["../../../../../../../libs/iris-app-sdk/iris-app/src/utils/ast/astUtils.ts"],"names":[],"mappings":";;AAWA,wDAiBC;AAUD,kDAwCC;AAQD,kDA0BC;AASD,kDA2CC;;AApKD,uDAAoD;AACpD,0DAAwD;AACxD,uDAAiC;AAEjC;;;;;;GAMG;AACH,SAAgB,sBAAsB,CAAC,WAAmB,EAAE,GAAG,aAA4B;IACzF,MAAM,UAAU,GAAG,iBAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC5C,MAAM,iBAAiB,GAAG,iBAAO,CAAC,GAAG,CAAC,UAAU,EAAE,yBAAyB,EAAE,IAAI,CAAC,EAAE;QAClF,IAAI,EAAE,CAAC,yBAAyB,CAAC,IAAI,CAAC,EAAE,CAAC;YACvC,gCAAgC;YAChC,MAAM,iBAAiB,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;gBAC1D,OAAO,CAAC,CACN,EAAE,CAAC,oBAAoB,CAAC,QAAQ,CAAC;oBACjC,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC;oBAC9B,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAC3C,CAAC;YACJ,CAAC,CAAC,CAAC;YACH,OAAO,EAAE,CAAC,OAAO,CAAC,6BAA6B,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;QAC3E,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,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Entries } from \"@trackunit/shared-utils\";\nimport * as ts from \"typescript\";\n\n/**\n * This function removes a property with a given name from an object literal\n * provided as a text string.\n *\n * @param {string} fileContent The source code as text\n * @param {string} propertyNames The properties to remove from the object\n */\nexport function removePropertyWithName(fileContent: string, ...propertyNames: Array<string>): string {\n const sourceFile = tsquery.ast(fileContent);\n const updatedSourceFile = tsquery.map(sourceFile, \"ObjectLiteralExpression\", node => {\n if (ts.isObjectLiteralExpression(node)) {\n // Filter out the given property\n const updatedProperties = node.properties.filter(property => {\n return !(\n ts.isPropertyAssignment(property) &&\n ts.isIdentifier(property.name) &&\n propertyNames.includes(property.name.text)\n );\n });\n return ts.factory.createObjectLiteralExpression(updatedProperties, true);\n }\n return node;\n });\n return ts.createPrinter().printFile(updatedSourceFile);\n}\n\n/**\n * This function adds a new property with a given name and value to an object literal\n * provided as a text string.\n *\n * @param {string} fileContent - the source code as text\n * @param {string} propertyName - the name of the property to add\n * @param {string | string[]} propertyValue - the value of the property to add\n */\nexport function addPropertyWithName(\n fileContent: string,\n propertyName: string,\n propertyValue: string | Array<string> | Record<string, string>\n) {\n const sourceFile = tsquery.ast(fileContent);\n const updatedSourceFile = tsquery.map(sourceFile, \"ObjectLiteralExpression\", node => {\n if (ts.isObjectLiteralExpression(node)) {\n // Add a new property to the object literal\n let updatedProperties;\n if (typeof propertyValue === \"string\") {\n updatedProperties = [\n ...node.properties,\n ts.factory.createPropertyAssignment(\n ts.factory.createIdentifier(propertyName),\n ts.factory.createStringLiteral(propertyValue)\n ),\n ];\n } else if (Array.isArray(propertyValue)) {\n const arrayLiteral = ts.factory.createArrayLiteralExpression(\n propertyValue.map(value => ts.factory.createStringLiteral(value))\n );\n updatedProperties = [\n ...node.properties,\n ts.factory.createPropertyAssignment(ts.factory.createIdentifier(propertyName), arrayLiteral),\n ];\n } else if (typeof propertyValue === \"object\") {\n updatedProperties = [\n ...node.properties,\n ts.factory.createPropertyAssignment(\n ts.factory.createIdentifier(propertyName),\n ts.factory.createObjectLiteralExpression(createObjectLiteralElementLike(propertyValue))\n ),\n ];\n }\n return ts.factory.createObjectLiteralExpression(updatedProperties, true);\n }\n return node;\n });\n return ts.createPrinter().printFile(updatedSourceFile);\n}\n\n/**\n * This function adds a spread assignment to an object literal.\n *\n * @param {string} fileContent - the source code as text\n * @param {string} variableName - the name of the variable to spread\n */\nexport function addSpreadAssignment(fileContent: string, variableName: string) {\n const sourceFile = tsquery.ast(fileContent);\n\n // First check if the spread already exists\n const existingSpreads = tsquery(sourceFile, \"SpreadAssignment\");\n const hasExistingSpread = existingSpreads.some(spread => {\n if (ts.isSpreadAssignment(spread)) {\n return spread.expression.getText() === variableName;\n }\n return false;\n });\n\n if (hasExistingSpread) {\n return fileContent; // Already has the spread, no changes needed\n }\n\n const updatedSourceFile = tsquery.map(sourceFile, \"ObjectLiteralExpression\", node => {\n if (ts.isObjectLiteralExpression(node)) {\n // Add the spread assignment to the object literal\n const spreadAssignment = ts.factory.createSpreadAssignment(ts.factory.createIdentifier(variableName));\n const updatedProperties = [...node.properties, spreadAssignment];\n return ts.factory.createObjectLiteralExpression(updatedProperties, true);\n }\n return node;\n });\n return ts.createPrinter().printFile(updatedSourceFile);\n}\n\n/**\n * This function adds a require statement to a file after existing require statements.\n *\n * @param {string} fileContent - the source code as text\n * @param {string} variableName - the name of the variable to assign to\n * @param {string} modulePath - the module path to require\n */\nexport function addRequireStatement(fileContent: string, variableName: string, modulePath: string) {\n const sourceFile = tsquery.ast(fileContent);\n\n // Check if the require statement already exists\n const existingRequires = tsquery(sourceFile, \"CallExpression\");\n const hasExistingRequire = existingRequires.some(call => {\n if (\n ts.isCallExpression(call) &&\n ts.isIdentifier(call.expression) &&\n call.expression.text === \"require\" &&\n call.arguments.length > 0\n ) {\n const firstArg = call.arguments[0];\n if (firstArg && ts.isStringLiteral(firstArg)) {\n return firstArg.text === modulePath;\n }\n }\n return false;\n });\n\n if (hasExistingRequire) {\n return fileContent; // Already has the require, no changes needed\n }\n\n // Find all variable statements with require calls\n const requireStatements = tsquery(sourceFile, \"VariableStatement\").filter(stmt =>\n stmt.getText().includes(\"require(\")\n );\n\n const requireStatement = `const ${variableName} = require(\"${modulePath}\").default;`;\n\n if (requireStatements.length > 0) {\n // Add after the last require statement\n const lastRequire = requireStatements[requireStatements.length - 1];\n if (lastRequire) {\n const lastRequireEnd = lastRequire.getEnd();\n\n return `${fileContent.slice(0, lastRequireEnd)}\\n${requireStatement}${fileContent.slice(lastRequireEnd)}`;\n }\n }\n\n // Add at the beginning if no require statements found\n return `${requireStatement}\\n${fileContent}`;\n}\n\nfunction createObjectLiteralElementLike(obj: Record<string, string>): Array<ts.ObjectLiteralElementLike> {\n const properties: Array<ts.ObjectLiteralElementLike> = [];\n for (const [key, value] of objectEntries(obj)) {\n properties.push(\n ts.factory.createPropertyAssignment(ts.factory.createStringLiteral(key), ts.factory.createStringLiteral(value))\n );\n }\n return properties;\n}\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileUpdater.js","sourceRoot":"","sources":["../../../../../../libs/iris-app-sdk/iris-app/src/utils/fileUpdater.ts"],"names":[],"mappings":";;;AAEA;;;;;GAKG;AACI,MAAM,gBAAgB,GAAG,CAAC,IAAU,EAAE,IAAY,EAAE,OAAwC,EAAE,EAAE;IACrG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,mBAAmB,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC7C,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,kBAAkB,IAAI,EAAE,CAAC,CAAC;IAC5C,CAAC;IACD,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEpC,IAAI,MAAM,KAAK,WAAW,EAAE,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC,CAAC;AAdW,QAAA,gBAAgB,oBAc3B","sourcesContent":["import { Tree } from \"@nx/devkit\";\n\n/**\n *\n * @param tree File system tree\n * @param path Path to source file in the Tree\n * @param updater Function that maps the current file content to a new to be written to the Tree\n */\nexport const updateFileInTree = (tree: Tree, path: string, updater: (fileContent: string) => string) => {\n if (!tree.exists(path)) {\n throw new Error(`File not found: ${path}`);\n }\n\n const fileContent = tree.read(path, \"utf-8\");\n if (!fileContent) {\n throw new Error(`File is empty: ${path}`);\n }\n const result = updater(fileContent);\n\n if (result !== fileContent) {\n tree.write(path, result);\n }\n};\n"]}