openxiangda 1.0.264 → 2.0.0-alpha.2
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/README.md +11 -666
- package/bin/run.js +11 -0
- package/dist/browser/AuthoritativeSelector.d.ts +37 -0
- package/dist/browser/AuthoritativeSelector.d.ts.map +1 -0
- package/dist/browser/AuthoritativeSelector.js +357 -0
- package/dist/browser/AuthoritativeSelector.js.map +1 -0
- package/dist/browser/FilePreviewPage.d.ts +2 -0
- package/dist/browser/FilePreviewPage.d.ts.map +1 -0
- package/dist/browser/FilePreviewPage.js +191 -0
- package/dist/browser/FilePreviewPage.js.map +1 -0
- package/dist/browser/Shell.d.ts +6 -0
- package/dist/browser/Shell.d.ts.map +1 -0
- package/dist/browser/Shell.js +198 -0
- package/dist/browser/Shell.js.map +1 -0
- package/dist/browser/appearance.d.ts +12 -0
- package/dist/browser/appearance.d.ts.map +1 -0
- package/dist/browser/appearance.js +100 -0
- package/dist/browser/appearance.js.map +1 -0
- package/dist/browser/application.d.ts +8 -0
- package/dist/browser/application.d.ts.map +1 -0
- package/dist/browser/application.js +42 -0
- package/dist/browser/application.js.map +1 -0
- package/dist/browser/components/platform-fields/AddressField.d.ts +12 -0
- package/dist/browser/components/platform-fields/AddressField.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/AddressField.js +179 -0
- package/dist/browser/components/platform-fields/AddressField.js.map +1 -0
- package/dist/browser/components/platform-fields/AttachmentFileList.d.ts +9 -0
- package/dist/browser/components/platform-fields/AttachmentFileList.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/AttachmentFileList.js +164 -0
- package/dist/browser/components/platform-fields/AttachmentFileList.js.map +1 -0
- package/dist/browser/components/platform-fields/CascadeField.d.ts +13 -0
- package/dist/browser/components/platform-fields/CascadeField.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/CascadeField.js +14 -0
- package/dist/browser/components/platform-fields/CascadeField.js.map +1 -0
- package/dist/browser/components/platform-fields/DateTimeField.d.ts +16 -0
- package/dist/browser/components/platform-fields/DateTimeField.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/DateTimeField.js +51 -0
- package/dist/browser/components/platform-fields/DateTimeField.js.map +1 -0
- package/dist/browser/components/platform-fields/JsonField.d.ts +11 -0
- package/dist/browser/components/platform-fields/JsonField.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/JsonField.js +40 -0
- package/dist/browser/components/platform-fields/JsonField.js.map +1 -0
- package/dist/browser/components/platform-fields/LocationField.d.ts +11 -0
- package/dist/browser/components/platform-fields/LocationField.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/LocationField.js +73 -0
- package/dist/browser/components/platform-fields/LocationField.js.map +1 -0
- package/dist/browser/components/platform-fields/PlatformDirectoryPicker.d.ts +12 -0
- package/dist/browser/components/platform-fields/PlatformDirectoryPicker.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/PlatformDirectoryPicker.js +269 -0
- package/dist/browser/components/platform-fields/PlatformDirectoryPicker.js.map +1 -0
- package/dist/browser/components/platform-fields/ResourceReferenceField.d.ts +12 -0
- package/dist/browser/components/platform-fields/ResourceReferenceField.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/ResourceReferenceField.js +22 -0
- package/dist/browser/components/platform-fields/ResourceReferenceField.js.map +1 -0
- package/dist/browser/components/platform-fields/RichTextField.d.ts +14 -0
- package/dist/browser/components/platform-fields/RichTextField.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/RichTextField.js +214 -0
- package/dist/browser/components/platform-fields/RichTextField.js.map +1 -0
- package/dist/browser/components/platform-fields/SignatureField.d.ts +15 -0
- package/dist/browser/components/platform-fields/SignatureField.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/SignatureField.js +179 -0
- package/dist/browser/components/platform-fields/SignatureField.js.map +1 -0
- package/dist/browser/components/platform-fields/SubtableField.d.ts +18 -0
- package/dist/browser/components/platform-fields/SubtableField.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/SubtableField.js +236 -0
- package/dist/browser/components/platform-fields/SubtableField.js.map +1 -0
- package/dist/browser/components/platform-fields/address-value.d.ts +13 -0
- package/dist/browser/components/platform-fields/address-value.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/address-value.js +70 -0
- package/dist/browser/components/platform-fields/address-value.js.map +1 -0
- package/dist/browser/components/platform-fields/cascade-value.d.ts +6 -0
- package/dist/browser/components/platform-fields/cascade-value.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/cascade-value.js +47 -0
- package/dist/browser/components/platform-fields/cascade-value.js.map +1 -0
- package/dist/browser/components/platform-fields/directory-value.d.ts +7 -0
- package/dist/browser/components/platform-fields/directory-value.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/directory-value.js +35 -0
- package/dist/browser/components/platform-fields/directory-value.js.map +1 -0
- package/dist/browser/components/platform-fields/field-form-codec.d.ts +10 -0
- package/dist/browser/components/platform-fields/field-form-codec.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/field-form-codec.js +82 -0
- package/dist/browser/components/platform-fields/field-form-codec.js.map +1 -0
- package/dist/browser/components/platform-fields/location-value.d.ts +20 -0
- package/dist/browser/components/platform-fields/location-value.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/location-value.js +57 -0
- package/dist/browser/components/platform-fields/location-value.js.map +1 -0
- package/dist/browser/components/platform-fields/resource-query.d.ts +14 -0
- package/dist/browser/components/platform-fields/resource-query.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/resource-query.js +102 -0
- package/dist/browser/components/platform-fields/resource-query.js.map +1 -0
- package/dist/browser/components/platform-fields/rich-text-value.d.ts +12 -0
- package/dist/browser/components/platform-fields/rich-text-value.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/rich-text-value.js +83 -0
- package/dist/browser/components/platform-fields/rich-text-value.js.map +1 -0
- package/dist/browser/components/platform-fields/subtable-value.d.ts +31 -0
- package/dist/browser/components/platform-fields/subtable-value.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/subtable-value.js +120 -0
- package/dist/browser/components/platform-fields/subtable-value.js.map +1 -0
- package/dist/browser/components/resource/GeneratedResourceCrud.d.ts +8 -0
- package/dist/browser/components/resource/GeneratedResourceCrud.d.ts.map +1 -0
- package/dist/browser/components/resource/GeneratedResourceCrud.js +580 -0
- package/dist/browser/components/resource/GeneratedResourceCrud.js.map +1 -0
- package/dist/browser/components/resource/ResourceBatchActions.d.ts +25 -0
- package/dist/browser/components/resource/ResourceBatchActions.d.ts.map +1 -0
- package/dist/browser/components/resource/ResourceBatchActions.js +168 -0
- package/dist/browser/components/resource/ResourceBatchActions.js.map +1 -0
- package/dist/browser/components/resource/StandardResourcePages.d.ts +57 -0
- package/dist/browser/components/resource/StandardResourcePages.d.ts.map +1 -0
- package/dist/browser/components/resource/StandardResourcePages.js +89 -0
- package/dist/browser/components/resource/StandardResourcePages.js.map +1 -0
- package/dist/browser/components/resource/SurfaceFields.d.ts +88 -0
- package/dist/browser/components/resource/SurfaceFields.d.ts.map +1 -0
- package/dist/browser/components/resource/SurfaceFields.js +497 -0
- package/dist/browser/components/resource/SurfaceFields.js.map +1 -0
- package/dist/browser/components/resource/generated-resource-definition.d.ts +19 -0
- package/dist/browser/components/resource/generated-resource-definition.d.ts.map +1 -0
- package/dist/browser/components/resource/generated-resource-definition.js +2 -0
- package/dist/browser/components/resource/generated-resource-definition.js.map +1 -0
- package/dist/browser/components/resource/resource-import.d.ts +15 -0
- package/dist/browser/components/resource/resource-import.d.ts.map +1 -0
- package/dist/browser/components/resource/resource-import.js +197 -0
- package/dist/browser/components/resource/resource-import.js.map +1 -0
- package/dist/browser/data-provider.d.ts +4 -0
- package/dist/browser/data-provider.d.ts.map +1 -0
- package/dist/browser/data-provider.js +45 -0
- package/dist/browser/data-provider.js.map +1 -0
- package/dist/browser/platform-client.d.ts +81 -0
- package/dist/browser/platform-client.d.ts.map +1 -0
- package/dist/browser/platform-client.js +422 -0
- package/dist/browser/platform-client.js.map +1 -0
- package/dist/browser/resource-definitions.d.ts +8 -0
- package/dist/browser/resource-definitions.d.ts.map +1 -0
- package/dist/browser/resource-definitions.js +14 -0
- package/dist/browser/resource-definitions.js.map +1 -0
- package/dist/browser/runtime-meta.d.ts +22 -0
- package/dist/browser/runtime-meta.d.ts.map +1 -0
- package/dist/browser/runtime-meta.js +79 -0
- package/dist/browser/runtime-meta.js.map +1 -0
- package/dist/browser/runtime.d.ts +13 -0
- package/dist/browser/runtime.d.ts.map +1 -0
- package/dist/browser/runtime.js +47 -0
- package/dist/browser/runtime.js.map +1 -0
- package/dist/browser/styles.css +1941 -0
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +2 -0
- package/dist/config.js.map +1 -0
- package/dist/core.d.ts +6 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +4 -0
- package/dist/core.js.map +1 -0
- package/dist/field-kit.d.ts +22 -0
- package/dist/field-kit.d.ts.map +1 -0
- package/dist/field-kit.js +22 -0
- package/dist/field-kit.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/nest.d.ts +10 -0
- package/dist/nest.d.ts.map +1 -0
- package/dist/nest.js +9 -0
- package/dist/nest.js.map +1 -0
- package/dist/react.d.ts +12 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +11 -0
- package/dist/react.js.map +1 -0
- package/dist/testing.d.ts +4 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +4 -0
- package/dist/testing.js.map +1 -0
- package/package.json +95 -200
- package/skills/manifest.json +10 -0
- package/skills/openxiangda-v2/SKILL.md +55 -0
- package/skills/openxiangda-v2/references/architecture.md +7 -0
- package/skills/openxiangda-v2/references/backend.md +116 -0
- package/skills/openxiangda-v2/references/data-authz.md +93 -0
- package/skills/openxiangda-v2/references/delivery.md +11 -0
- package/skills/openxiangda-v2/references/discovery.md +15 -0
- package/skills/openxiangda-v2/references/frontend.md +10 -0
- package/skills/openxiangda-v2/references/testing.md +16 -0
- package/skills/openxiangda-v2/references/workflow-notification.md +69 -0
- package/skills/openxiangda-v2/references/workspace.md +21 -0
- package/bin/openxiangda.js +0 -26
- package/lib/app-function-invoke.js +0 -28
- package/lib/application-environments.js +0 -1134
- package/lib/change-baseline.js +0 -1359
- package/lib/cli.js +0 -31084
- package/lib/config.js +0 -450
- package/lib/content-cache.js +0 -97
- package/lib/delivery-v2-cli.js +0 -329
- package/lib/delivery-v2-executor.js +0 -1703
- package/lib/delivery-v2-package.js +0 -1176
- package/lib/dependency-capsule.js +0 -246
- package/lib/design-gates.js +0 -668
- package/lib/design-review.js +0 -220
- package/lib/developer-center.js +0 -160
- package/lib/form-field-contract.js +0 -79
- package/lib/form-schema-loader.js +0 -181
- package/lib/git-remote-identity.js +0 -89
- package/lib/http.js +0 -196
- package/lib/integration-bundle.js +0 -225
- package/lib/js-code-build.js +0 -175
- package/lib/open-api.js +0 -256
- package/lib/policy.js +0 -137
- package/lib/publish-context.js +0 -98
- package/lib/publish-lease-heartbeat.js +0 -182
- package/lib/publish-lease.js +0 -221
- package/lib/release-error-classification.js +0 -41
- package/lib/release-explain.js +0 -75
- package/lib/release-mainline.js +0 -654
- package/lib/release-plan.js +0 -550
- package/lib/release-telemetry.js +0 -182
- package/lib/resource-binding-contract.js +0 -210
- package/lib/role-resolution.js +0 -57
- package/lib/runtime-lineage.js +0 -326
- package/lib/sdd.js +0 -3306
- package/lib/skills.js +0 -453
- package/lib/source-dependencies.js +0 -921
- package/lib/task-status.js +0 -330
- package/lib/utils.js +0 -178
- package/lib/workspace-bootstrap.js +0 -268
- package/lib/workspace-init.js +0 -202
- package/lib/worktree-cleanup.js +0 -631
- package/lib/worktree-owner.js +0 -354
- package/openxiangda-skills/SKILL.md +0 -226
- package/openxiangda-skills/references/architecture-design.md +0 -409
- package/openxiangda-skills/references/architecture-patterns.md +0 -264
- package/openxiangda-skills/references/automation-v3.md +0 -349
- package/openxiangda-skills/references/best-practices.md +0 -272
- package/openxiangda-skills/references/component-guide.md +0 -287
- package/openxiangda-skills/references/connector-resources.md +0 -80
- package/openxiangda-skills/references/data-views.md +0 -360
- package/openxiangda-skills/references/forms/component-registry.md +0 -90
- package/openxiangda-skills/references/forms/form-schema.md +0 -146
- package/openxiangda-skills/references/forms/layout-and-rules.md +0 -24
- package/openxiangda-skills/references/notifications.md +0 -227
- package/openxiangda-skills/references/openxiangda-api.md +0 -971
- package/openxiangda-skills/references/pages/app-shell.md +0 -66
- package/openxiangda-skills/references/pages/page-sdk.md +0 -401
- package/openxiangda-skills/references/pages/publish-flow.md +0 -84
- package/openxiangda-skills/references/pages/workspace-structure.md +0 -41
- package/openxiangda-skills/references/permission-design-patterns.md +0 -313
- package/openxiangda-skills/references/permissions-settings.md +0 -468
- package/openxiangda-skills/references/platform-data-model.md +0 -340
- package/openxiangda-skills/references/resource-manifest-cheatsheet.md +0 -936
- package/openxiangda-skills/references/school-contact-relations.md +0 -224
- package/openxiangda-skills/references/style-system.md +0 -218
- package/openxiangda-skills/references/troubleshooting.md +0 -271
- package/openxiangda-skills/references/workflow-v3.md +0 -441
- package/openxiangda-skills/references/workspace-state.md +0 -115
- package/openxiangda-skills/skills/openxiangda-app/SKILL.md +0 -118
- package/openxiangda-skills/skills/openxiangda-architecture-design/SKILL.md +0 -137
- package/openxiangda-skills/skills/openxiangda-core/SKILL.md +0 -222
- package/openxiangda-skills/skills/openxiangda-form/SKILL.md +0 -184
- package/openxiangda-skills/skills/openxiangda-inspect/SKILL.md +0 -63
- package/openxiangda-skills/skills/openxiangda-open-api/SKILL.md +0 -57
- package/openxiangda-skills/skills/openxiangda-open-api/agents/openai.yaml +0 -4
- package/openxiangda-skills/skills/openxiangda-open-api/references/backend-authentication.md +0 -63
- package/openxiangda-skills/skills/openxiangda-open-api/references/dingtalk-api.openapi.json +0 -15653
- package/openxiangda-skills/skills/openxiangda-page/SKILL.md +0 -154
- package/openxiangda-skills/skills/openxiangda-permission-settings/SKILL.md +0 -209
- package/openxiangda-skills/skills/openxiangda-workflow-automation/SKILL.md +0 -201
- package/packages/sdk/bin/lowcode-workspace.mjs +0 -4
- package/packages/sdk/dist/ProcessPreview-DSUIJi5V.d.mts +0 -1292
- package/packages/sdk/dist/ProcessPreview-DSUIJi5V.d.ts +0 -1292
- package/packages/sdk/dist/build/index.cjs +0 -1
- package/packages/sdk/dist/build/index.d.mts +0 -60
- package/packages/sdk/dist/build/index.d.ts +0 -60
- package/packages/sdk/dist/build/index.mjs +0 -1
- package/packages/sdk/dist/components/index.cjs +0 -148
- package/packages/sdk/dist/components/index.d.mts +0 -970
- package/packages/sdk/dist/components/index.d.ts +0 -970
- package/packages/sdk/dist/components/index.mjs +0 -148
- package/packages/sdk/dist/dataManagementApi-Ro9itwm8.d.ts +0 -142
- package/packages/sdk/dist/dataManagementApi-p_HOhQnA.d.mts +0 -142
- package/packages/sdk/dist/runtime/index.cjs +0 -148
- package/packages/sdk/dist/runtime/index.d.mts +0 -171
- package/packages/sdk/dist/runtime/index.d.ts +0 -171
- package/packages/sdk/dist/runtime/index.mjs +0 -148
- package/packages/sdk/dist/runtime/react.cjs +0 -148
- package/packages/sdk/dist/runtime/react.d.mts +0 -3202
- package/packages/sdk/dist/runtime/react.d.ts +0 -3202
- package/packages/sdk/dist/runtime/react.mjs +0 -148
- package/packages/sdk/dist/styles/antd-theme.cjs +0 -1
- package/packages/sdk/dist/styles/antd-theme.d.mts +0 -6
- package/packages/sdk/dist/styles/antd-theme.d.ts +0 -6
- package/packages/sdk/dist/styles/antd-theme.mjs +0 -1
- package/packages/sdk/dist/styles/tailwind-preset.cjs +0 -1
- package/packages/sdk/dist/styles/tailwind-preset.d.mts +0 -74
- package/packages/sdk/dist/styles/tailwind-preset.d.ts +0 -74
- package/packages/sdk/dist/styles/tailwind-preset.mjs +0 -1
- package/packages/sdk/dist/styles/tokens.css +0 -74
- package/packages/sdk/dist/workflow/index.cjs +0 -3
- package/packages/sdk/dist/workflow/index.d.mts +0 -291
- package/packages/sdk/dist/workflow/index.d.ts +0 -291
- package/packages/sdk/dist/workflow/index.mjs +0 -3
- package/packages/sdk/source/admin-list/AdminList.tsx +0 -1734
- package/packages/sdk/source/admin-list/README.md +0 -12
- package/packages/sdk/source/admin-list/dataSources.ts +0 -345
- package/packages/sdk/source/admin-list/index.ts +0 -42
- package/packages/sdk/source/admin-list/preferences.ts +0 -174
- package/packages/sdk/source/admin-list/types.ts +0 -273
- package/packages/sdk/src/build-source/README.md +0 -9
- package/packages/sdk/src/build-source/bin/lowcode-workspace.mjs +0 -7
- package/packages/sdk/src/build-source/package.json +0 -34
- package/packages/sdk/src/build-source/scripts/build-forms.mjs +0 -1129
- package/packages/sdk/src/build-source/scripts/build-pages.mjs +0 -897
- package/packages/sdk/src/build-source/scripts/build-workspace.mjs +0 -89
- package/packages/sdk/src/build-source/scripts/publish-all.mjs +0 -190
- package/packages/sdk/src/build-source/scripts/publish-oss.mjs +0 -144
- package/packages/sdk/src/build-source/scripts/register-bundle.mjs +0 -1
- package/packages/sdk/src/build-source/scripts/register.mjs +0 -362
- package/packages/sdk/src/build-source/scripts/sync-schema.mjs +0 -381
- package/packages/sdk/src/build-source/scripts/utils/form-api.mjs +0 -1058
- package/packages/sdk/src/build-source/scripts/utils/form-runtime-assets.mjs +0 -57
- package/packages/sdk/src/build-source/scripts/utils/incremental.mjs +0 -348
- package/packages/sdk/src/build-source/scripts/utils/load-config.mjs +0 -331
- package/packages/sdk/src/build-source/scripts/utils/mime-types.mjs +0 -70
- package/packages/sdk/src/build-source/scripts/utils/namespace-css.mjs +0 -77
- package/packages/sdk/src/build-source/scripts/utils/oss-client.mjs +0 -128
- package/packages/sdk/src/build-source/scripts/utils/pages.mjs +0 -150
- package/packages/sdk/src/build-source/scripts/utils/progress.mjs +0 -57
- package/packages/sdk/src/build-source/scripts/utils/publish-oss-patterns.mjs +0 -20
- package/packages/sdk/src/build-source/scripts/utils/register-payload.mjs +0 -90
- package/packages/sdk/src/build-source/scripts/utils/runtime-css-check.mjs +0 -44
- package/packages/sdk/src/build-source/scripts/utils/schema-transform.mjs +0 -142
- package/packages/sdk/src/build-source/scripts/utils/static-assets.mjs +0 -165
- package/packages/sdk/src/build-source/scripts/utils/tailwind-config.mjs +0 -283
- package/packages/sdk/src/build-source/scripts/utils/tailwind-token-warnings.mjs +0 -146
- package/packages/sdk/src/build-source/scripts/utils/workspace-style-entry.mjs +0 -29
- package/packages/sdk/src/build-source/src/cli.mjs +0 -735
- package/policy/openxiangda-policy.json +0 -72
- package/templates/openxiangda-react-spa/.cursor/rules/openxiangda-form.mdc +0 -24
- package/templates/openxiangda-react-spa/.cursor/rules/openxiangda-page.mdc +0 -25
- package/templates/openxiangda-react-spa/.cursor/rules/openxiangda-resources.mdc +0 -32
- package/templates/openxiangda-react-spa/.cursor/rules/openxiangda-workflow-automation.mdc +0 -26
- package/templates/openxiangda-react-spa/.cursor/rules/openxiangda.mdc +0 -68
- package/templates/openxiangda-react-spa/.env.example +0 -4
- package/templates/openxiangda-react-spa/.qoder/rules/openxiangda-form.md +0 -37
- package/templates/openxiangda-react-spa/.qoder/rules/openxiangda-page.md +0 -29
- package/templates/openxiangda-react-spa/.qoder/rules/openxiangda-resources.md +0 -32
- package/templates/openxiangda-react-spa/.qoder/rules/openxiangda-workflow-automation.md +0 -34
- package/templates/openxiangda-react-spa/.qoder/rules/openxiangda.md +0 -66
- package/templates/openxiangda-react-spa/AGENTS.md +0 -192
- package/templates/openxiangda-react-spa/DELIVERY.md +0 -43
- package/templates/openxiangda-react-spa/app-workspace.config.ts +0 -50
- package/templates/openxiangda-react-spa/index.html +0 -12
- package/templates/openxiangda-react-spa/package.json +0 -53
- package/templates/openxiangda-react-spa/postcss.config.cjs +0 -6
- package/templates/openxiangda-react-spa/scripts/build-js-code.mjs +0 -600
- package/templates/openxiangda-react-spa/scripts/deploy.mjs +0 -18
- package/templates/openxiangda-react-spa/scripts/guard-publish.mjs +0 -21
- package/templates/openxiangda-react-spa/src/app/navigation.ts +0 -73
- package/templates/openxiangda-react-spa/src/app/router.tsx +0 -146
- package/templates/openxiangda-react-spa/src/app/starter-content.ts +0 -144
- package/templates/openxiangda-react-spa/src/forms/.gitkeep +0 -1
- package/templates/openxiangda-react-spa/src/layouts/AdminShell.tsx +0 -570
- package/templates/openxiangda-react-spa/src/main.tsx +0 -21
- package/templates/openxiangda-react-spa/src/pages/admin/AdminDashboardPage.tsx +0 -170
- package/templates/openxiangda-react-spa/src/pages/admin/LoginLogPage.tsx +0 -425
- package/templates/openxiangda-react-spa/src/pages/defaults/DataRoutePage.tsx +0 -36
- package/templates/openxiangda-react-spa/src/pages/defaults/FilePreviewRoutePage.tsx +0 -65
- package/templates/openxiangda-react-spa/src/pages/defaults/FormRoutePage.tsx +0 -235
- package/templates/openxiangda-react-spa/src/pages/public/PublicRegisterPage.tsx +0 -15
- package/templates/openxiangda-react-spa/src/pages/states/NotFoundPage.tsx +0 -31
- package/templates/openxiangda-react-spa/src/resources/menus/menus.json +0 -22
- package/templates/openxiangda-react-spa/src/resources/permissions/page-groups/app-admin.json +0 -8
- package/templates/openxiangda-react-spa/src/resources/permissions/page-groups/public-visitor.json +0 -8
- package/templates/openxiangda-react-spa/src/resources/public-access/public-register.json +0 -14
- package/templates/openxiangda-react-spa/src/resources/roles/roles.json +0 -15
- package/templates/openxiangda-react-spa/src/resources/routes/public-register.json +0 -8
- package/templates/openxiangda-react-spa/src/runtime/default-page-overrides.tsx +0 -35
- package/templates/openxiangda-react-spa/src/runtime/default-routes.ts +0 -16
- package/templates/openxiangda-react-spa/src/shared/form-schema.ts +0 -135
- package/templates/openxiangda-react-spa/src/shared/mac-admin.tsx +0 -651
- package/templates/openxiangda-react-spa/src/shared/ui.tsx +0 -22
- package/templates/openxiangda-react-spa/src/styles/index.css +0 -105
- package/templates/openxiangda-react-spa/tailwind.config.cjs +0 -37
- package/templates/openxiangda-react-spa/tsconfig.app.json +0 -36
- package/templates/openxiangda-react-spa/tsconfig.js-code-nodes.json +0 -19
- package/templates/openxiangda-react-spa/tsconfig.json +0 -7
- package/templates/openxiangda-react-spa/tsconfig.node.json +0 -10
- package/templates/openxiangda-react-spa/vite.config.ts +0 -209
- package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda-form.mdc +0 -24
- package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda-page.mdc +0 -21
- package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda-resources.mdc +0 -40
- package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda-workflow-automation.mdc +0 -21
- package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda.mdc +0 -81
- package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda-form.md +0 -38
- package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda-page.md +0 -39
- package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda-resources.md +0 -59
- package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda-workflow-automation.md +0 -46
- package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda.md +0 -82
- package/templates/sy-lowcode-app-workspace/AGENTS.md +0 -158
- package/templates/sy-lowcode-app-workspace/DELIVERY.md +0 -43
- package/templates/sy-lowcode-app-workspace/app-workspace.config.ts +0 -51
- package/templates/sy-lowcode-app-workspace/examples/best-practices/README.md +0 -43
- package/templates/sy-lowcode-app-workspace/examples/best-practices/access-governance.md +0 -239
- package/templates/sy-lowcode-app-workspace/examples/best-practices/catalog.json +0 -99
- package/templates/sy-lowcode-app-workspace/examples/best-practices/decision-guide.md +0 -94
- package/templates/sy-lowcode-app-workspace/examples/best-practices/design-style.md +0 -91
- package/templates/sy-lowcode-app-workspace/examples/best-practices/module-structure.md +0 -48
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/role-governance/index.ts +0 -2
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/role-governance/permissions.test.ts +0 -52
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/role-governance/permissions.ts +0 -37
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/role-governance/types.ts +0 -19
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/index.ts +0 -4
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/permissions.test.ts +0 -42
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/permissions.ts +0 -25
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/state-machine.test.ts +0 -63
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/state-machine.ts +0 -73
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/ticket-query.test.ts +0 -34
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/ticket-query.ts +0 -73
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/types.ts +0 -66
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/app-role/page.tsx +0 -1
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/app-role/schema.ts +0 -109
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/customer-profile/page.tsx +0 -1
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/customer-profile/schema.ts +0 -92
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/service-ticket/page.tsx +0 -1
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/service-ticket/schema.ts +0 -153
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/ticket-action-log/page.tsx +0 -1
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/ticket-action-log/schema.ts +0 -65
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/js-code-nodes/daily_ticket_digest/index.ts +0 -44
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/js-code-nodes/sync_roles_to_platform/index.ts +0 -33
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/App.tsx +0 -8
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/GlassHomeDashboard.tsx +0 -232
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/index.tsx +0 -10
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/page.config.ts +0 -14
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/styles.css +0 -196
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/App.tsx +0 -7
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/WorkbenchPage.tsx +0 -36
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/components/ConfigPanel.tsx +0 -34
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/components/PreviewPanel.tsx +0 -17
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/index.tsx +0 -10
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/page.config.ts +0 -9
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/reducer.ts +0 -29
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/styles.css +0 -24
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/App.tsx +0 -8
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/MintAnalyticsDashboard.tsx +0 -279
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/index.tsx +0 -10
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/page.config.ts +0 -14
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/styles.css +0 -163
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/App.tsx +0 -7
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/MobilePortalShell.tsx +0 -31
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/index.tsx +0 -10
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/modules/MobileHome.tsx +0 -13
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/page.config.ts +0 -14
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/routes.ts +0 -13
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/styles.css +0 -11
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/App.tsx +0 -8
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/OpsMonitorDashboard.tsx +0 -306
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/index.tsx +0 -10
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/page.config.ts +0 -14
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/styles.css +0 -248
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/App.tsx +0 -7
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/PcPortalShell.tsx +0 -35
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/components/PortalMetric.tsx +0 -11
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/index.tsx +0 -10
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/modules/HomeModule.tsx +0 -25
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/modules/TicketsModule.tsx +0 -14
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/page.config.ts +0 -14
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/routes.ts +0 -19
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/styles.css +0 -35
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/App.tsx +0 -7
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/TicketOpsPage.tsx +0 -105
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/components/TicketActionTimeline.tsx +0 -22
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/components/TicketDetailDrawer.tsx +0 -44
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/components/TicketTableActions.tsx +0 -57
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/index.tsx +0 -10
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/page.config.ts +0 -9
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/styles.css +0 -35
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/App.tsx +0 -8
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/WorkOrderListDrawerPage.tsx +0 -371
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/index.tsx +0 -10
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/page.config.ts +0 -14
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/styles.css +0 -182
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/automations/daily-ticket-digest/automation.json +0 -25
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/automations/daily-ticket-digest/trigger.json +0 -9
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/notifications/daily-ticket-digest.json +0 -24
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/permissions/form-groups/service-ticket-college.json +0 -21
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/permissions/roles.json +0 -17
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/workflows/expense-approval-workflow.json +0 -48
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/ConfirmAction.tsx +0 -22
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/QueryState.tsx +0 -37
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/StatusTag.tsx +0 -20
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/DashboardPrimitives.tsx +0 -832
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/chartOptions.ts +0 -140
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/sampleData.ts +0 -466
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/styles.css +0 -874
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/types.ts +0 -150
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/hooks/useTicketOps.ts +0 -96
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/services/role-governance.ts +0 -48
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/services/service-ticket.ts +0 -113
- package/templates/sy-lowcode-app-workspace/examples/forms/customer/page.tsx +0 -1
- package/templates/sy-lowcode-app-workspace/examples/forms/customer/schema.ts +0 -36
- package/templates/sy-lowcode-app-workspace/index.html +0 -12
- package/templates/sy-lowcode-app-workspace/package.json +0 -58
- package/templates/sy-lowcode-app-workspace/postcss.config.cjs +0 -9
- package/templates/sy-lowcode-app-workspace/scripts/build-js-code.mjs +0 -600
- package/templates/sy-lowcode-app-workspace/scripts/guard-publish.mjs +0 -29
- package/templates/sy-lowcode-app-workspace/src/dev/App.tsx +0 -820
- package/templates/sy-lowcode-app-workspace/src/forms/.gitkeep +0 -1
- package/templates/sy-lowcode-app-workspace/src/forms/README.md +0 -52
- package/templates/sy-lowcode-app-workspace/src/index.css +0 -26
- package/templates/sy-lowcode-app-workspace/src/js-code-nodes/.gitkeep +0 -1
- package/templates/sy-lowcode-app-workspace/src/js-code-nodes/types.d.ts +0 -3
- package/templates/sy-lowcode-app-workspace/src/main.tsx +0 -29
- package/templates/sy-lowcode-app-workspace/src/pages/.gitkeep +0 -1
- package/templates/sy-lowcode-app-workspace/src/runtime/builtin-overrides.tsx +0 -8
- package/templates/sy-lowcode-app-workspace/src/shared/form-schema.ts +0 -135
- package/templates/sy-lowcode-app-workspace/src/types/app-workspace.types.ts +0 -88
- package/templates/sy-lowcode-app-workspace/tailwind.config.cjs +0 -31
- package/templates/sy-lowcode-app-workspace/tsconfig.app.json +0 -40
- package/templates/sy-lowcode-app-workspace/tsconfig.examples.json +0 -24
- package/templates/sy-lowcode-app-workspace/tsconfig.js-code-nodes.json +0 -19
- package/templates/sy-lowcode-app-workspace/tsconfig.json +0 -7
- package/templates/sy-lowcode-app-workspace/tsconfig.node.json +0 -10
- package/templates/sy-lowcode-app-workspace/vite.config.ts +0 -85
- package/v2/README.md +0 -35
- package/v2/skills/manifest.json +0 -45
- package/v2/skills/openxiangda-v1-maintenance/SKILL.md +0 -21
- package/v2/skills/openxiangda-v1-maintenance/agents/openai.yaml +0 -4
- package/v2/skills/openxiangda-v2/SKILL.md +0 -38
- package/v2/skills/openxiangda-v2-architecture/SKILL.md +0 -29
- package/v2/skills/openxiangda-v2-architecture/agents/openai.yaml +0 -4
- package/v2/skills/openxiangda-v2-backend/SKILL.md +0 -28
- package/v2/skills/openxiangda-v2-backend/agents/openai.yaml +0 -4
- package/v2/skills/openxiangda-v2-data-authz/SKILL.md +0 -28
- package/v2/skills/openxiangda-v2-data-authz/agents/openai.yaml +0 -4
- package/v2/skills/openxiangda-v2-delivery/SKILL.md +0 -30
- package/v2/skills/openxiangda-v2-delivery/agents/openai.yaml +0 -4
- package/v2/skills/openxiangda-v2-frontend/SKILL.md +0 -21
- package/v2/skills/openxiangda-v2-frontend/agents/openai.yaml +0 -4
- package/v2/skills/openxiangda-v2-workflow-events/SKILL.md +0 -28
- package/v2/skills/openxiangda-v2-workflow-events/agents/openai.yaml +0 -4
- /package/{v2/skills → skills}/openxiangda-v2/agents/openai.yaml +0 -0
|
@@ -1,735 +0,0 @@
|
|
|
1
|
-
import { spawnSync } from "node:child_process";
|
|
2
|
-
import {
|
|
3
|
-
existsSync,
|
|
4
|
-
mkdirSync,
|
|
5
|
-
readdirSync,
|
|
6
|
-
readFileSync,
|
|
7
|
-
rmSync,
|
|
8
|
-
statSync,
|
|
9
|
-
writeFileSync,
|
|
10
|
-
} from "node:fs";
|
|
11
|
-
import { basename, dirname, join, resolve } from "node:path";
|
|
12
|
-
import { fileURLToPath } from "node:url";
|
|
13
|
-
import { createRequire } from "node:module";
|
|
14
|
-
import {
|
|
15
|
-
ensureWorkspaceTailwindConfig,
|
|
16
|
-
validateWorkspaceTailwindConfig,
|
|
17
|
-
} from "../scripts/utils/tailwind-config.mjs";
|
|
18
|
-
|
|
19
|
-
const require = createRequire(import.meta.url);
|
|
20
|
-
const packageRoot = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
21
|
-
const managedScriptDir = join(packageRoot, "scripts");
|
|
22
|
-
const managedCommands = new Map([
|
|
23
|
-
["build", "build-workspace.mjs"],
|
|
24
|
-
["build-forms", "build-forms.mjs"],
|
|
25
|
-
["build-pages", "build-pages.mjs"],
|
|
26
|
-
["sync-schema", "sync-schema.mjs"],
|
|
27
|
-
["publish-oss", "publish-oss.mjs"],
|
|
28
|
-
["register", "register.mjs"],
|
|
29
|
-
["publish-all", "publish-all.mjs"],
|
|
30
|
-
]);
|
|
31
|
-
const wrapperScripts = new Map([
|
|
32
|
-
["build-workspace.mjs", "build"],
|
|
33
|
-
["build-forms.mjs", "build-forms"],
|
|
34
|
-
["build-pages.mjs", "build-pages"],
|
|
35
|
-
["sync-schema.mjs", "sync-schema"],
|
|
36
|
-
["publish-oss.mjs", "publish-oss"],
|
|
37
|
-
["register.mjs", "register"],
|
|
38
|
-
["publish-all.mjs", "publish-all"],
|
|
39
|
-
]);
|
|
40
|
-
const textExtensions = new Set([
|
|
41
|
-
".js",
|
|
42
|
-
".jsx",
|
|
43
|
-
".ts",
|
|
44
|
-
".tsx",
|
|
45
|
-
".mjs",
|
|
46
|
-
".cjs",
|
|
47
|
-
".json",
|
|
48
|
-
".md",
|
|
49
|
-
".css",
|
|
50
|
-
".scss",
|
|
51
|
-
".yml",
|
|
52
|
-
".yaml",
|
|
53
|
-
]);
|
|
54
|
-
const ignoredDirs = new Set([
|
|
55
|
-
".git",
|
|
56
|
-
"node_modules",
|
|
57
|
-
"dist",
|
|
58
|
-
"build",
|
|
59
|
-
"coverage",
|
|
60
|
-
".vite",
|
|
61
|
-
"packages",
|
|
62
|
-
]);
|
|
63
|
-
const runtimePackages = ["openxiangda"];
|
|
64
|
-
const runtimePackageRegistry =
|
|
65
|
-
process.env.APP_WORKSPACE_NPM_REGISTRY || "https://registry.npmjs.org/";
|
|
66
|
-
const legacyTemplateTiptapOverrideVersion = "3.23.6";
|
|
67
|
-
const legacyTemplateTiptapOverrideKeys = new Set([
|
|
68
|
-
"@tiptap/core",
|
|
69
|
-
"@tiptap/pm",
|
|
70
|
-
"@tiptap/react",
|
|
71
|
-
"@tiptap/starter-kit",
|
|
72
|
-
"@tiptap/extensions",
|
|
73
|
-
"@tiptap/extension-list",
|
|
74
|
-
"@tiptap/extension-blockquote",
|
|
75
|
-
"@tiptap/extension-bold",
|
|
76
|
-
"@tiptap/extension-bubble-menu",
|
|
77
|
-
"@tiptap/extension-bullet-list",
|
|
78
|
-
"@tiptap/extension-character-count",
|
|
79
|
-
"@tiptap/extension-code",
|
|
80
|
-
"@tiptap/extension-document",
|
|
81
|
-
"@tiptap/extension-floating-menu",
|
|
82
|
-
"@tiptap/extension-hard-break",
|
|
83
|
-
"@tiptap/extension-heading",
|
|
84
|
-
"@tiptap/extension-horizontal-rule",
|
|
85
|
-
"@tiptap/extension-italic",
|
|
86
|
-
"@tiptap/extension-list-item",
|
|
87
|
-
"@tiptap/extension-list-keymap",
|
|
88
|
-
"@tiptap/extension-ordered-list",
|
|
89
|
-
"@tiptap/extension-paragraph",
|
|
90
|
-
"@tiptap/extension-placeholder",
|
|
91
|
-
"@tiptap/extension-strike",
|
|
92
|
-
"@tiptap/extension-text",
|
|
93
|
-
]);
|
|
94
|
-
|
|
95
|
-
function usage() {
|
|
96
|
-
return `
|
|
97
|
-
lowcode-workspace <command> [options]
|
|
98
|
-
|
|
99
|
-
Commands:
|
|
100
|
-
build | build-forms | build-pages | sync-schema | publish-oss | register | publish-all
|
|
101
|
-
update Update workspace runtime dependencies and managed wrappers
|
|
102
|
-
migrate Convert old local SDK workspace to npm package mode
|
|
103
|
-
smoke Run workspace runtime smoke checks
|
|
104
|
-
|
|
105
|
-
Update options:
|
|
106
|
-
--workspace <path> Workspace root, defaults to cwd
|
|
107
|
-
--channel <tag> npm dist-tag, defaults to latest
|
|
108
|
-
--check Validate only; do not mutate
|
|
109
|
-
--strict-lock Compare lockfile and installed versions with npm latest
|
|
110
|
-
--commit Commit update changes
|
|
111
|
-
--push Push after commit
|
|
112
|
-
--no-commit Do not commit, even if changes exist
|
|
113
|
-
--allow-dirty Allow updates with existing worktree changes
|
|
114
|
-
--skip-install Do not run pnpm install/update
|
|
115
|
-
--skip-gate Do not run typecheck smoke gate
|
|
116
|
-
--gate <quick|full> Gate depth after update, defaults to quick
|
|
117
|
-
|
|
118
|
-
Smoke options:
|
|
119
|
-
--workspace <path> Workspace root, defaults to cwd
|
|
120
|
-
--mode <quick|full> quick validates commands/manifests; full builds shared runtimes
|
|
121
|
-
`;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
function parseArgs(argv) {
|
|
125
|
-
const result = { _: [] };
|
|
126
|
-
for (let index = 0; index < argv.length; index += 1) {
|
|
127
|
-
const arg = argv[index];
|
|
128
|
-
if (!arg.startsWith("--")) {
|
|
129
|
-
result._.push(arg);
|
|
130
|
-
continue;
|
|
131
|
-
}
|
|
132
|
-
const key = arg.slice(2);
|
|
133
|
-
if (["workspace", "channel", "mode", "gate"].includes(key)) {
|
|
134
|
-
result[key] = argv[index + 1];
|
|
135
|
-
index += 1;
|
|
136
|
-
} else {
|
|
137
|
-
result[key] = true;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
return result;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
function run(command, args, options = {}) {
|
|
144
|
-
const result = spawnSync(command, args, {
|
|
145
|
-
cwd: options.cwd,
|
|
146
|
-
env: options.env || process.env,
|
|
147
|
-
stdio: options.capture ? "pipe" : "inherit",
|
|
148
|
-
encoding: "utf-8",
|
|
149
|
-
});
|
|
150
|
-
if (result.status !== 0) {
|
|
151
|
-
const output = [result.stdout, result.stderr].filter(Boolean).join("\n");
|
|
152
|
-
throw new Error(
|
|
153
|
-
`command failed: ${[command, ...args].join(" ")}${output ? `\n${output}` : ""}`,
|
|
154
|
-
);
|
|
155
|
-
}
|
|
156
|
-
return result;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
function runManagedScript(command, args, workspaceRoot) {
|
|
160
|
-
const scriptName = managedCommands.get(command);
|
|
161
|
-
if (!scriptName) throw new Error(`unknown managed command: ${command}`);
|
|
162
|
-
const scriptPath = join(managedScriptDir, scriptName);
|
|
163
|
-
const tsxCli = require.resolve("tsx/cli");
|
|
164
|
-
run(process.execPath, [tsxCli, scriptPath, ...args], {
|
|
165
|
-
cwd: workspaceRoot,
|
|
166
|
-
env: {
|
|
167
|
-
...process.env,
|
|
168
|
-
LOWCODE_WORKSPACE_ROOT: workspaceRoot,
|
|
169
|
-
},
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
function readJson(path) {
|
|
174
|
-
return JSON.parse(readFileSync(path, "utf-8"));
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
function writeJson(path, value) {
|
|
178
|
-
writeFileSync(path, `${JSON.stringify(value, null, 2)}\n`, "utf-8");
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
function getLegacyTemplateTiptapOverrideKeys(overrides = {}) {
|
|
182
|
-
const tiptapKeys = Object.keys(overrides).filter((key) =>
|
|
183
|
-
key.startsWith("@tiptap/"),
|
|
184
|
-
);
|
|
185
|
-
if (tiptapKeys.length === 0) return [];
|
|
186
|
-
const isLegacyTemplateSet = tiptapKeys.every(
|
|
187
|
-
(key) =>
|
|
188
|
-
legacyTemplateTiptapOverrideKeys.has(key) &&
|
|
189
|
-
overrides[key] === legacyTemplateTiptapOverrideVersion,
|
|
190
|
-
);
|
|
191
|
-
return isLegacyTemplateSet ? tiptapKeys : [];
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
function escapeRegExp(value) {
|
|
195
|
-
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
function readOptionalJson(path) {
|
|
199
|
-
if (!existsSync(path)) return null;
|
|
200
|
-
try {
|
|
201
|
-
return readJson(path);
|
|
202
|
-
} catch {
|
|
203
|
-
return null;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
function npmLatestVersion(packageName, channel) {
|
|
208
|
-
const result = run(
|
|
209
|
-
"npm",
|
|
210
|
-
[
|
|
211
|
-
"view",
|
|
212
|
-
`${packageName}@${channel}`,
|
|
213
|
-
"version",
|
|
214
|
-
"--registry",
|
|
215
|
-
runtimePackageRegistry,
|
|
216
|
-
],
|
|
217
|
-
{
|
|
218
|
-
capture: true,
|
|
219
|
-
env: runtimeDependencyInstallEnv(),
|
|
220
|
-
},
|
|
221
|
-
);
|
|
222
|
-
return String(result.stdout || "").trim();
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
function runtimeDependencyInstallEnv() {
|
|
226
|
-
return {
|
|
227
|
-
...process.env,
|
|
228
|
-
npm_config_registry: runtimePackageRegistry,
|
|
229
|
-
PNPM_CONFIG_MINIMUM_RELEASE_AGE: "0",
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
function readInstalledVersion(workspaceRoot, packageName) {
|
|
234
|
-
const packagePath = join(
|
|
235
|
-
workspaceRoot,
|
|
236
|
-
"node_modules",
|
|
237
|
-
packageName,
|
|
238
|
-
"package.json",
|
|
239
|
-
);
|
|
240
|
-
const pkg = readOptionalJson(packagePath);
|
|
241
|
-
return typeof pkg?.version === "string" ? pkg.version : null;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
function readLockVersion(workspaceRoot, packageName) {
|
|
245
|
-
const lockPath = join(workspaceRoot, "pnpm-lock.yaml");
|
|
246
|
-
if (!existsSync(lockPath)) return null;
|
|
247
|
-
const content = readFileSync(lockPath, "utf-8");
|
|
248
|
-
const packagePattern = new RegExp(
|
|
249
|
-
`(?:^|\\n)\\s{2,}/?${escapeRegExp(packageName)}@([^:\\n(]+)(?:\\([^\\n]*\\))?:`,
|
|
250
|
-
);
|
|
251
|
-
const packageMatch = content.match(packagePattern);
|
|
252
|
-
if (packageMatch?.[1]) return packageMatch[1].trim();
|
|
253
|
-
|
|
254
|
-
const dependencyPattern = new RegExp(
|
|
255
|
-
`(?:^|\\n)\\s{6}${escapeRegExp(packageName)}:\\n\\s{8}specifier:\\s*[^\\n]+\\n\\s{8}version:\\s*([^\\s(]+)`,
|
|
256
|
-
);
|
|
257
|
-
const dependencyMatch = content.match(dependencyPattern);
|
|
258
|
-
return dependencyMatch?.[1]?.trim() || null;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
function validateRuntimeManifest(
|
|
262
|
-
workspaceRoot,
|
|
263
|
-
manifestPath,
|
|
264
|
-
expectedProtocol,
|
|
265
|
-
expectedMajorVersion,
|
|
266
|
-
) {
|
|
267
|
-
if (!existsSync(manifestPath)) return;
|
|
268
|
-
const manifest = readJson(manifestPath);
|
|
269
|
-
const errors = [];
|
|
270
|
-
if (manifest.protocol !== expectedProtocol) {
|
|
271
|
-
errors.push(`protocol must be ${expectedProtocol}`);
|
|
272
|
-
}
|
|
273
|
-
if (manifest.majorVersion !== expectedMajorVersion) {
|
|
274
|
-
errors.push(`majorVersion must be ${expectedMajorVersion}`);
|
|
275
|
-
}
|
|
276
|
-
if (!manifest.version) errors.push("version is required");
|
|
277
|
-
if (!manifest.files?.entry) errors.push("files.entry is required");
|
|
278
|
-
if (errors.length) {
|
|
279
|
-
throw new Error(
|
|
280
|
-
`${manifestPath.replace(`${workspaceRoot}/`, "")} is invalid: ${errors.join("; ")}`,
|
|
281
|
-
);
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
function gitStatus(workspaceRoot) {
|
|
286
|
-
const result = run("git", ["status", "--porcelain"], {
|
|
287
|
-
cwd: workspaceRoot,
|
|
288
|
-
capture: true,
|
|
289
|
-
});
|
|
290
|
-
return String(result.stdout || "").trim();
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
function hasGit(workspaceRoot) {
|
|
294
|
-
return (
|
|
295
|
-
existsSync(join(workspaceRoot, ".git")) ||
|
|
296
|
-
existsSync(join(workspaceRoot, "..", ".git"))
|
|
297
|
-
);
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
function updatePackageJson(workspaceRoot, channel) {
|
|
301
|
-
const packagePath = join(workspaceRoot, "package.json");
|
|
302
|
-
if (!existsSync(packagePath))
|
|
303
|
-
throw new Error(`package.json not found: ${packagePath}`);
|
|
304
|
-
const pkg = readJson(packagePath);
|
|
305
|
-
pkg.scripts = {
|
|
306
|
-
...(pkg.scripts || {}),
|
|
307
|
-
build: "lowcode-workspace build",
|
|
308
|
-
"build:forms": "lowcode-workspace build-forms",
|
|
309
|
-
"build:pages": "lowcode-workspace build-pages",
|
|
310
|
-
"sync-schema": "lowcode-workspace sync-schema",
|
|
311
|
-
"publish:oss": "lowcode-workspace publish-oss",
|
|
312
|
-
register: "lowcode-workspace register",
|
|
313
|
-
"register-bundle": "lowcode-workspace register",
|
|
314
|
-
"publish:all": "lowcode-workspace publish-all",
|
|
315
|
-
"ai:update": `pnpm dlx openxiangda@${channel} lowcode-workspace update --channel ${channel}`,
|
|
316
|
-
"ai:migrate": `pnpm dlx openxiangda@${channel} lowcode-workspace migrate`,
|
|
317
|
-
};
|
|
318
|
-
pkg.dependencies = pkg.dependencies || {};
|
|
319
|
-
delete pkg.dependencies["@sy/page-sdk"];
|
|
320
|
-
delete pkg.dependencies["sy-form-components"];
|
|
321
|
-
delete pkg.dependencies["sy-page-sdk"];
|
|
322
|
-
delete pkg.dependencies["sy-lowcode-workspace-tools"];
|
|
323
|
-
pkg.dependencies["openxiangda"] = channel;
|
|
324
|
-
if (pkg.pnpm?.patchedDependencies) {
|
|
325
|
-
for (const packageName of [
|
|
326
|
-
"@sy/page-sdk",
|
|
327
|
-
"sy-form-components",
|
|
328
|
-
"sy-page-sdk",
|
|
329
|
-
"sy-lowcode-workspace-tools",
|
|
330
|
-
]) {
|
|
331
|
-
for (const key of Object.keys(pkg.pnpm.patchedDependencies)) {
|
|
332
|
-
if (key === packageName || key.startsWith(`${packageName}@`)) {
|
|
333
|
-
delete pkg.pnpm.patchedDependencies[key];
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
if (Object.keys(pkg.pnpm.patchedDependencies).length === 0) {
|
|
338
|
-
delete pkg.pnpm.patchedDependencies;
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
if (pkg.pnpm?.overrides) {
|
|
342
|
-
for (const key of getLegacyTemplateTiptapOverrideKeys(pkg.pnpm.overrides)) {
|
|
343
|
-
delete pkg.pnpm.overrides[key];
|
|
344
|
-
}
|
|
345
|
-
if (Object.keys(pkg.pnpm.overrides).length === 0) {
|
|
346
|
-
delete pkg.pnpm.overrides;
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
if (pkg.pnpm && Object.keys(pkg.pnpm).length === 0) {
|
|
350
|
-
delete pkg.pnpm;
|
|
351
|
-
}
|
|
352
|
-
writeJson(packagePath, pkg);
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
function wrapperContent(command) {
|
|
356
|
-
return `#!/usr/bin/env node
|
|
357
|
-
import { spawnSync } from "node:child_process";
|
|
358
|
-
|
|
359
|
-
const result = spawnSync("lowcode-workspace", [${JSON.stringify(command)}, ...process.argv.slice(2)], {
|
|
360
|
-
stdio: "inherit",
|
|
361
|
-
shell: process.platform === "win32",
|
|
362
|
-
});
|
|
363
|
-
process.exit(result.status ?? 1);
|
|
364
|
-
`;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
function ensureWrapperScripts(workspaceRoot) {
|
|
368
|
-
const scriptsDir = join(workspaceRoot, "scripts");
|
|
369
|
-
mkdirSync(scriptsDir, { recursive: true });
|
|
370
|
-
for (const [fileName, command] of wrapperScripts) {
|
|
371
|
-
writeFileSync(join(scriptsDir, fileName), wrapperContent(command), "utf-8");
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
function replaceInFile(path, replacer) {
|
|
376
|
-
const before = readFileSync(path, "utf-8");
|
|
377
|
-
const after = replacer(before);
|
|
378
|
-
if (after !== before) writeFileSync(path, after, "utf-8");
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
function rewriteImports(workspaceRoot) {
|
|
382
|
-
walkFiles(workspaceRoot, (filePath) => {
|
|
383
|
-
if (
|
|
384
|
-
["pnpm-lock.yaml", "package-lock.json", "yarn.lock"].includes(
|
|
385
|
-
basename(filePath),
|
|
386
|
-
)
|
|
387
|
-
) {
|
|
388
|
-
return;
|
|
389
|
-
}
|
|
390
|
-
if (!textExtensions.has(filePath.slice(filePath.lastIndexOf(".")))) return;
|
|
391
|
-
replaceInFile(filePath, (content) =>
|
|
392
|
-
content
|
|
393
|
-
.replaceAll("@sy/page-sdk", "openxiangda/runtime")
|
|
394
|
-
.replaceAll("sy-page-sdk/react", "openxiangda/runtime")
|
|
395
|
-
.replaceAll("sy-page-sdk", "openxiangda/runtime")
|
|
396
|
-
.replaceAll("sy-form-components/tailwind-preset", "openxiangda/tailwind-preset")
|
|
397
|
-
.replaceAll("sy-form-components", "openxiangda")
|
|
398
|
-
.replaceAll("sy-lowcode-workspace-tools", "openxiangda"),
|
|
399
|
-
);
|
|
400
|
-
});
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
function rewriteLocalSdkConfig(workspaceRoot) {
|
|
404
|
-
const viteConfig = join(workspaceRoot, "vite.config.ts");
|
|
405
|
-
if (existsSync(viteConfig)) {
|
|
406
|
-
replaceInFile(viteConfig, (content) =>
|
|
407
|
-
content
|
|
408
|
-
.replace(/\s*\{[^{}]*packages\/page-sdk[^{}]*\},?/g, "")
|
|
409
|
-
.replace(
|
|
410
|
-
/\s*\{\s*find:\s*["']sy-page-sdk\/react["'][\s\S]*?\n\s*\},\n/g,
|
|
411
|
-
"",
|
|
412
|
-
)
|
|
413
|
-
.replace(/\s*\{\s*find:\s*["']sy-page-sdk["'][\s\S]*?\n\s*\},\n/g, ""),
|
|
414
|
-
);
|
|
415
|
-
}
|
|
416
|
-
const vitestConfig = join(workspaceRoot, "vitest.config.ts");
|
|
417
|
-
if (existsSync(vitestConfig)) {
|
|
418
|
-
replaceInFile(vitestConfig, (content) =>
|
|
419
|
-
content
|
|
420
|
-
.replace(/\s*\{[^{}]*packages\/page-sdk[^{}]*\},?/g, "")
|
|
421
|
-
.replace(
|
|
422
|
-
/\s*\{\s*find:\s*["']sy-page-sdk\/react["'][\s\S]*?\n\s*\},\n/g,
|
|
423
|
-
"",
|
|
424
|
-
)
|
|
425
|
-
.replace(/\s*\{\s*find:\s*["']sy-page-sdk["'][\s\S]*?\n\s*\},\n/g, "")
|
|
426
|
-
.replace(/,\s*["']sy-page-sdk["']/g, ""),
|
|
427
|
-
);
|
|
428
|
-
}
|
|
429
|
-
const tsconfig = join(workspaceRoot, "tsconfig.app.json");
|
|
430
|
-
if (existsSync(tsconfig)) {
|
|
431
|
-
try {
|
|
432
|
-
const config = readJson(tsconfig);
|
|
433
|
-
if (config.compilerOptions?.paths) {
|
|
434
|
-
delete config.compilerOptions.paths["sy-page-sdk"];
|
|
435
|
-
delete config.compilerOptions.paths["sy-page-sdk/react"];
|
|
436
|
-
}
|
|
437
|
-
if (Array.isArray(config.include)) {
|
|
438
|
-
config.include = config.include.filter(
|
|
439
|
-
(item) => !String(item).includes("packages/page-sdk"),
|
|
440
|
-
);
|
|
441
|
-
}
|
|
442
|
-
writeJson(tsconfig, config);
|
|
443
|
-
} catch {
|
|
444
|
-
replaceInFile(tsconfig, (content) =>
|
|
445
|
-
content
|
|
446
|
-
.replace(/\s*["']sy-page-sdk["']:\s*\[[^\n]*\],?\n/g, "")
|
|
447
|
-
.replace(/\s*["']sy-page-sdk\/react["']:\s*\[[^\n]*\],?\n/g, "")
|
|
448
|
-
.replace(/,\s*["']packages\/page-sdk\/src["']/g, "")
|
|
449
|
-
.replace(/["']packages\/page-sdk\/src["'],?\s*/g, ""),
|
|
450
|
-
);
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
const tailwindConfig = join(workspaceRoot, "tailwind.config.cjs");
|
|
454
|
-
if (existsSync(tailwindConfig)) {
|
|
455
|
-
replaceInFile(tailwindConfig, (content) =>
|
|
456
|
-
content
|
|
457
|
-
.replace(/,\s*["'][^"']*packages\/page-sdk[^"']*["']/g, "")
|
|
458
|
-
.replace(/["'][^"']*packages\/page-sdk[^"']*["']\s*,?/g, ""),
|
|
459
|
-
);
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
function rewriteCssIsolationDefault(workspaceRoot) {
|
|
464
|
-
const configPath = join(workspaceRoot, "app-workspace.config.ts");
|
|
465
|
-
if (!existsSync(configPath)) return;
|
|
466
|
-
replaceInFile(configPath, (content) =>
|
|
467
|
-
content.replace(
|
|
468
|
-
/cssIsolation:\s*\n\s*process\.env\.APP_PAGE_CSS_ISOLATION === ["']none["']\s*\n\s*\?\s*["']none["']\s*\n\s*:\s*process\.env\.APP_PAGE_CSS_ISOLATION === ["']shadow["']\s*\n\s*\?\s*["']shadow["']\s*\n\s*:\s*["']namespace["']/g,
|
|
469
|
-
`cssIsolation:
|
|
470
|
-
process.env.APP_PAGE_CSS_ISOLATION === "namespace"
|
|
471
|
-
? "namespace"
|
|
472
|
-
: process.env.APP_PAGE_CSS_ISOLATION === "shadow"
|
|
473
|
-
? "shadow"
|
|
474
|
-
: "none"`,
|
|
475
|
-
),
|
|
476
|
-
);
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
function walkFiles(root, onFile) {
|
|
480
|
-
for (const entry of readdirSync(root)) {
|
|
481
|
-
if (ignoredDirs.has(entry)) continue;
|
|
482
|
-
const path = join(root, entry);
|
|
483
|
-
const stat = statSync(path);
|
|
484
|
-
if (stat.isDirectory()) {
|
|
485
|
-
walkFiles(path, onFile);
|
|
486
|
-
} else if (stat.isFile()) {
|
|
487
|
-
onFile(path);
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
function removeLocalSdk(workspaceRoot) {
|
|
493
|
-
const localSdkPath = join(workspaceRoot, "packages", "page-sdk");
|
|
494
|
-
if (existsSync(localSdkPath)) {
|
|
495
|
-
rmSync(localSdkPath, { recursive: true, force: true });
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
function validateWorkspace(workspaceRoot, channel = "latest", options = {}) {
|
|
500
|
-
const errors = [];
|
|
501
|
-
const warnings = [];
|
|
502
|
-
const pkg = readJson(join(workspaceRoot, "package.json"));
|
|
503
|
-
const deps = pkg.dependencies || {};
|
|
504
|
-
if (deps["@sy/page-sdk"])
|
|
505
|
-
errors.push("package.json still depends on @sy/page-sdk");
|
|
506
|
-
for (const oldName of [
|
|
507
|
-
"sy-form-components",
|
|
508
|
-
"sy-page-sdk",
|
|
509
|
-
"sy-lowcode-workspace-tools",
|
|
510
|
-
]) {
|
|
511
|
-
if (deps[oldName]) errors.push(`package.json still depends on ${oldName}`);
|
|
512
|
-
}
|
|
513
|
-
for (const name of runtimePackages) {
|
|
514
|
-
if (deps[name] !== channel)
|
|
515
|
-
errors.push(`package.json dependency ${name} must be ${channel}`);
|
|
516
|
-
}
|
|
517
|
-
const isWorkspaceToolsSourceRepo = existsSync(
|
|
518
|
-
join(workspaceRoot, "packages", "workspace-tools", "package.json"),
|
|
519
|
-
);
|
|
520
|
-
if (
|
|
521
|
-
existsSync(join(workspaceRoot, "packages", "page-sdk")) &&
|
|
522
|
-
!isWorkspaceToolsSourceRepo
|
|
523
|
-
) {
|
|
524
|
-
errors.push(
|
|
525
|
-
"local packages/page-sdk must be removed from application workspaces",
|
|
526
|
-
);
|
|
527
|
-
}
|
|
528
|
-
errors.push(...validateWorkspaceTailwindConfig(workspaceRoot));
|
|
529
|
-
walkFiles(workspaceRoot, (filePath) => {
|
|
530
|
-
if (!textExtensions.has(filePath.slice(filePath.lastIndexOf(".")))) return;
|
|
531
|
-
if (
|
|
532
|
-
["pnpm-lock.yaml", "package-lock.json", "yarn.lock"].includes(
|
|
533
|
-
basename(filePath),
|
|
534
|
-
)
|
|
535
|
-
) {
|
|
536
|
-
return;
|
|
537
|
-
}
|
|
538
|
-
const content = readFileSync(filePath, "utf-8");
|
|
539
|
-
for (const oldName of [
|
|
540
|
-
"@sy/page-sdk",
|
|
541
|
-
"sy-form-components",
|
|
542
|
-
"sy-page-sdk",
|
|
543
|
-
"sy-lowcode-workspace-tools",
|
|
544
|
-
]) {
|
|
545
|
-
if (content.includes(oldName)) {
|
|
546
|
-
errors.push(`${filePath} still references ${oldName}`);
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
if (content.includes("packages/page-sdk")) {
|
|
550
|
-
errors.push(`${filePath} still references packages/page-sdk`);
|
|
551
|
-
}
|
|
552
|
-
});
|
|
553
|
-
if (errors.length) {
|
|
554
|
-
throw new Error(`workspace update check failed:\n- ${errors.join("\n- ")}`);
|
|
555
|
-
}
|
|
556
|
-
if (options.strictLock) {
|
|
557
|
-
const versionRows = [];
|
|
558
|
-
for (const packageName of runtimePackages) {
|
|
559
|
-
const latest = npmLatestVersion(packageName, channel);
|
|
560
|
-
const installed = readInstalledVersion(workspaceRoot, packageName);
|
|
561
|
-
const locked = readLockVersion(workspaceRoot, packageName);
|
|
562
|
-
versionRows.push({ packageName, latest, installed, locked });
|
|
563
|
-
if (latest && locked && locked !== latest) {
|
|
564
|
-
errors.push(
|
|
565
|
-
`pnpm-lock.yaml locks ${packageName}@${locked}, latest is ${latest}`,
|
|
566
|
-
);
|
|
567
|
-
}
|
|
568
|
-
if (latest && installed && installed !== latest) {
|
|
569
|
-
errors.push(
|
|
570
|
-
`node_modules has ${packageName}@${installed}, latest is ${latest}`,
|
|
571
|
-
);
|
|
572
|
-
}
|
|
573
|
-
if (!locked) {
|
|
574
|
-
warnings.push(
|
|
575
|
-
`pnpm-lock.yaml does not contain ${packageName}; run pnpm install after update`,
|
|
576
|
-
);
|
|
577
|
-
}
|
|
578
|
-
if (!installed) {
|
|
579
|
-
warnings.push(
|
|
580
|
-
`node_modules does not contain ${packageName}; run pnpm install`,
|
|
581
|
-
);
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
if (versionRows.length) {
|
|
585
|
-
console.log("[lowcode-workspace] runtime dependency versions:");
|
|
586
|
-
for (const row of versionRows) {
|
|
587
|
-
console.log(
|
|
588
|
-
` - ${row.packageName}: latest=${row.latest || "unknown"} locked=${row.locked || "missing"} installed=${row.installed || "missing"}`,
|
|
589
|
-
);
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
if (errors.length) {
|
|
594
|
-
throw new Error(`workspace update check failed:\n- ${errors.join("\n- ")}`);
|
|
595
|
-
}
|
|
596
|
-
for (const warning of warnings) {
|
|
597
|
-
console.warn(`[lowcode-workspace] warning: ${warning}`);
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
function runUpdateInstall(workspaceRoot, channel) {
|
|
602
|
-
const installEnv = runtimeDependencyInstallEnv();
|
|
603
|
-
run("pnpm", ["install"], { cwd: workspaceRoot, env: installEnv });
|
|
604
|
-
run(
|
|
605
|
-
"pnpm",
|
|
606
|
-
[
|
|
607
|
-
"update",
|
|
608
|
-
"--latest",
|
|
609
|
-
"openxiangda",
|
|
610
|
-
],
|
|
611
|
-
{ cwd: workspaceRoot, env: installEnv },
|
|
612
|
-
);
|
|
613
|
-
updatePackageJson(workspaceRoot, channel);
|
|
614
|
-
run("pnpm", ["install"], { cwd: workspaceRoot, env: installEnv });
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
function runSmoke(workspaceRoot, mode = "quick") {
|
|
618
|
-
const normalizedMode = String(mode || "quick").trim();
|
|
619
|
-
if (!["quick", "full"].includes(normalizedMode)) {
|
|
620
|
-
throw new Error(`unsupported smoke mode: ${mode}`);
|
|
621
|
-
}
|
|
622
|
-
const pkg = readJson(join(workspaceRoot, "package.json"));
|
|
623
|
-
if (pkg.scripts?.typecheck) {
|
|
624
|
-
run("pnpm", ["typecheck"], { cwd: workspaceRoot });
|
|
625
|
-
}
|
|
626
|
-
if (normalizedMode === "full") {
|
|
627
|
-
runManagedScript("build-pages", [], workspaceRoot);
|
|
628
|
-
runManagedScript("build-forms", [], workspaceRoot);
|
|
629
|
-
} else {
|
|
630
|
-
runManagedScript("build-pages", ["--help"], workspaceRoot);
|
|
631
|
-
runManagedScript("build-forms", ["--help"], workspaceRoot);
|
|
632
|
-
}
|
|
633
|
-
validateRuntimeManifest(
|
|
634
|
-
workspaceRoot,
|
|
635
|
-
join(workspaceRoot, "dist", "page-runtime", "manifest.json"),
|
|
636
|
-
"sy-page-runtime",
|
|
637
|
-
1,
|
|
638
|
-
);
|
|
639
|
-
validateRuntimeManifest(
|
|
640
|
-
workspaceRoot,
|
|
641
|
-
join(workspaceRoot, "dist", "form-runtime", "manifest.json"),
|
|
642
|
-
"sy-form-runtime",
|
|
643
|
-
2,
|
|
644
|
-
);
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
function commitAndMaybePush(workspaceRoot, push) {
|
|
648
|
-
if (!hasGit(workspaceRoot)) return;
|
|
649
|
-
run("git", ["add", "-A"], { cwd: workspaceRoot });
|
|
650
|
-
const status = gitStatus(workspaceRoot);
|
|
651
|
-
if (!status) return;
|
|
652
|
-
run(
|
|
653
|
-
"git",
|
|
654
|
-
["commit", "-m", "chore: update lowcode workspace runtime dependencies"],
|
|
655
|
-
{
|
|
656
|
-
cwd: workspaceRoot,
|
|
657
|
-
},
|
|
658
|
-
);
|
|
659
|
-
if (push) {
|
|
660
|
-
run("git", ["push", "origin", "HEAD"], { cwd: workspaceRoot });
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
async function updateWorkspace(argv, { migrate = false } = {}) {
|
|
665
|
-
const args = parseArgs(argv);
|
|
666
|
-
const workspaceRoot = resolve(args.workspace || process.cwd());
|
|
667
|
-
const channel = String(
|
|
668
|
-
args.channel || process.env.APP_WORKSPACE_UPDATE_CHANNEL || "latest",
|
|
669
|
-
);
|
|
670
|
-
const checkOnly = Boolean(args.check);
|
|
671
|
-
const strictLock = Boolean(args["strict-lock"]);
|
|
672
|
-
const allowDirty = Boolean(args["allow-dirty"]);
|
|
673
|
-
const shouldCommit = Boolean(args.commit) && !args["no-commit"];
|
|
674
|
-
const shouldPush = Boolean(args.push);
|
|
675
|
-
const gateMode = String(args.gate || "quick");
|
|
676
|
-
|
|
677
|
-
if (checkOnly) {
|
|
678
|
-
validateWorkspace(workspaceRoot, channel, { strictLock });
|
|
679
|
-
console.log("[lowcode-workspace] update check passed");
|
|
680
|
-
return;
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
if (hasGit(workspaceRoot) && !allowDirty) {
|
|
684
|
-
const before = gitStatus(workspaceRoot);
|
|
685
|
-
if (before) {
|
|
686
|
-
throw new Error(
|
|
687
|
-
"workspace has uncommitted changes; commit/stash them first or pass --allow-dirty",
|
|
688
|
-
);
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
updatePackageJson(workspaceRoot, channel);
|
|
693
|
-
rewriteImports(workspaceRoot);
|
|
694
|
-
rewriteCssIsolationDefault(workspaceRoot);
|
|
695
|
-
ensureWorkspaceTailwindConfig(workspaceRoot);
|
|
696
|
-
ensureWrapperScripts(workspaceRoot);
|
|
697
|
-
rewriteLocalSdkConfig(workspaceRoot);
|
|
698
|
-
if (migrate || existsSync(join(workspaceRoot, "packages", "page-sdk"))) {
|
|
699
|
-
removeLocalSdk(workspaceRoot);
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
if (!args["skip-install"]) runUpdateInstall(workspaceRoot, channel);
|
|
703
|
-
validateWorkspace(workspaceRoot, channel, { strictLock: !args["skip-install"] });
|
|
704
|
-
if (!args["skip-gate"]) runSmoke(workspaceRoot, gateMode);
|
|
705
|
-
if (shouldCommit) commitAndMaybePush(workspaceRoot, shouldPush);
|
|
706
|
-
console.log("[lowcode-workspace] workspace update completed");
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
export async function main(argv = process.argv.slice(2)) {
|
|
710
|
-
const [command, ...rest] = argv;
|
|
711
|
-
if (!command || command === "--help" || command === "-h") {
|
|
712
|
-
console.log(usage());
|
|
713
|
-
return;
|
|
714
|
-
}
|
|
715
|
-
if (command === "update") {
|
|
716
|
-
await updateWorkspace(rest);
|
|
717
|
-
return;
|
|
718
|
-
}
|
|
719
|
-
if (command === "migrate") {
|
|
720
|
-
await updateWorkspace(rest, { migrate: true });
|
|
721
|
-
return;
|
|
722
|
-
}
|
|
723
|
-
if (command === "smoke") {
|
|
724
|
-
const args = parseArgs(rest);
|
|
725
|
-
runSmoke(resolve(args.workspace || process.cwd()), args.mode || "quick");
|
|
726
|
-
console.log("[lowcode-workspace] smoke check passed");
|
|
727
|
-
return;
|
|
728
|
-
}
|
|
729
|
-
if (managedCommands.has(command)) {
|
|
730
|
-
const args = parseArgs(rest);
|
|
731
|
-
runManagedScript(command, rest, resolve(args.workspace || process.cwd()));
|
|
732
|
-
return;
|
|
733
|
-
}
|
|
734
|
-
throw new Error(`unknown command: ${command}`);
|
|
735
|
-
}
|