@azure-tools/typespec-ts 0.54.2 → 0.55.0-dev.10
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/CHANGELOG.md +0 -9
- package/README.md +68 -105
- package/dist/src/framework/hooks/binder.d.ts +1 -1
- package/dist/src/framework/hooks/binder.d.ts.map +1 -1
- package/dist/src/framework/hooks/binder.js +3 -4
- package/dist/src/framework/hooks/binder.js.map +1 -1
- package/dist/src/framework/hooks/sdk-types.d.ts +2 -3
- package/dist/src/framework/hooks/sdk-types.d.ts.map +1 -1
- package/dist/src/framework/hooks/sdk-types.js +2 -3
- package/dist/src/framework/hooks/sdk-types.js.map +1 -1
- package/dist/src/framework/load-static-helpers.d.ts +4 -1
- package/dist/src/framework/load-static-helpers.d.ts.map +1 -1
- package/dist/src/framework/load-static-helpers.js +26 -34
- package/dist/src/framework/load-static-helpers.js.map +1 -1
- package/dist/src/framework/sample.js +1 -1
- package/dist/src/framework/sample.js.map +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +104 -170
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +2 -18
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +30 -124
- package/dist/src/lib.js.map +1 -1
- package/dist/src/modular/build-classical-client.js +2 -2
- package/dist/src/modular/build-classical-client.js.map +1 -1
- package/dist/src/modular/build-client-context.d.ts.map +1 -1
- package/dist/src/modular/build-client-context.js +6 -15
- package/dist/src/modular/build-client-context.js.map +1 -1
- package/dist/src/modular/build-project-files.d.ts.map +1 -1
- package/dist/src/modular/build-project-files.js +4 -4
- package/dist/src/modular/build-project-files.js.map +1 -1
- package/dist/src/modular/build-restore-poller.js +2 -2
- package/dist/src/modular/build-restore-poller.js.map +1 -1
- package/dist/src/modular/build-root-index.d.ts.map +1 -1
- package/dist/src/modular/build-root-index.js +9 -13
- package/dist/src/modular/build-root-index.js.map +1 -1
- package/dist/src/modular/build-subpath-index.d.ts.map +1 -1
- package/dist/src/modular/build-subpath-index.js +4 -4
- package/dist/src/modular/build-subpath-index.js.map +1 -1
- package/dist/src/modular/emit-logger-file.d.ts.map +1 -1
- package/dist/src/modular/emit-logger-file.js +0 -3
- package/dist/src/modular/emit-logger-file.js.map +1 -1
- package/dist/src/modular/emit-models-options.js +2 -2
- package/dist/src/modular/emit-models-options.js.map +1 -1
- package/dist/src/modular/emit-models.d.ts.map +1 -1
- package/dist/src/modular/emit-models.js +7 -22
- package/dist/src/modular/emit-models.js.map +1 -1
- package/dist/src/modular/emit-samples.d.ts.map +1 -1
- package/dist/src/modular/emit-samples.js +10 -28
- package/dist/src/modular/emit-samples.js.map +1 -1
- package/dist/src/modular/emit-tests.d.ts +2 -1
- package/dist/src/modular/emit-tests.d.ts.map +1 -1
- package/dist/src/modular/emit-tests.js +21 -11
- package/dist/src/modular/emit-tests.js.map +1 -1
- package/dist/src/modular/helpers/client-helpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/client-helpers.js +6 -16
- package/dist/src/modular/helpers/client-helpers.js.map +1 -1
- package/dist/src/modular/helpers/example-value-helpers.d.ts +1 -1
- package/dist/src/modular/helpers/example-value-helpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/example-value-helpers.js +11 -28
- package/dist/src/modular/helpers/example-value-helpers.js.map +1 -1
- package/dist/src/modular/serialization/serialize-utils.js +2 -2
- package/dist/src/modular/serialization/serialize-utils.js.map +1 -1
- package/dist/src/rlc-common/helpers/imports-util.d.ts +3 -4
- package/dist/src/rlc-common/helpers/imports-util.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/imports-util.js +43 -56
- package/dist/src/rlc-common/helpers/imports-util.js.map +1 -1
- package/dist/src/rlc-common/helpers/name-constructors.d.ts +0 -9
- package/dist/src/rlc-common/helpers/name-constructors.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/name-constructors.js +1 -17
- package/dist/src/rlc-common/helpers/name-constructors.js.map +1 -1
- package/dist/src/rlc-common/index.d.ts +0 -18
- package/dist/src/rlc-common/index.d.ts.map +1 -1
- package/dist/src/rlc-common/index.js +0 -18
- package/dist/src/rlc-common/index.js.map +1 -1
- package/dist/src/rlc-common/interfaces.d.ts +2 -20
- package/dist/src/rlc-common/interfaces.d.ts.map +1 -1
- package/dist/src/rlc-common/interfaces.js.map +1 -1
- package/dist/src/rlc-common/metadata/build-api-extractor-config.d.ts +1 -1
- package/dist/src/rlc-common/metadata/build-api-extractor-config.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/build-api-extractor-config.js +5 -42
- package/dist/src/rlc-common/metadata/build-api-extractor-config.js.map +1 -1
- package/dist/src/rlc-common/metadata/build-es-lint-config.d.ts +2 -2
- package/dist/src/rlc-common/metadata/build-es-lint-config.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/build-es-lint-config.js +3 -41
- package/dist/src/rlc-common/metadata/build-es-lint-config.js.map +1 -1
- package/dist/src/rlc-common/metadata/build-package-file.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/build-package-file.js +25 -73
- package/dist/src/rlc-common/metadata/build-package-file.js.map +1 -1
- package/dist/src/rlc-common/metadata/build-readme-file.d.ts +2 -2
- package/dist/src/rlc-common/metadata/build-readme-file.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/build-readme-file.js +18 -108
- package/dist/src/rlc-common/metadata/build-readme-file.js.map +1 -1
- package/dist/src/rlc-common/metadata/build-sample-env-file.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/build-sample-env-file.js +1 -2
- package/dist/src/rlc-common/metadata/build-sample-env-file.js.map +1 -1
- package/dist/src/rlc-common/metadata/build-test-config.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/build-test-config.js +1 -4
- package/dist/src/rlc-common/metadata/build-test-config.js.map +1 -1
- package/dist/src/rlc-common/metadata/build-ts-config.d.ts +2 -2
- package/dist/src/rlc-common/metadata/build-ts-config.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/build-ts-config.js +19 -60
- package/dist/src/rlc-common/metadata/build-ts-config.js.map +1 -1
- package/dist/src/rlc-common/metadata/build-warp-config.d.ts +1 -1
- package/dist/src/rlc-common/metadata/build-warp-config.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/build-warp-config.js +0 -3
- package/dist/src/rlc-common/metadata/build-warp-config.js.map +1 -1
- package/dist/src/rlc-common/metadata/package-json/azure-package-common.d.ts +1 -38
- package/dist/src/rlc-common/metadata/package-json/azure-package-common.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/package-json/azure-package-common.js +1 -108
- package/dist/src/rlc-common/metadata/package-json/azure-package-common.js.map +1 -1
- package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.d.ts +0 -39
- package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.js +4 -20
- package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.js.map +1 -1
- package/dist/src/rlc-common/metadata/package-json/package-common.d.ts +1 -22
- package/dist/src/rlc-common/metadata/package-json/package-common.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/package-json/package-common.js +21 -98
- package/dist/src/rlc-common/metadata/package-json/package-common.js.map +1 -1
- package/dist/src/rlc-common/static/polling-content.d.ts +1 -1
- package/dist/src/rlc-common/static/polling-content.d.ts.map +1 -1
- package/dist/src/rlc-common/static/polling-content.js +1 -1
- package/dist/src/rlc-common/test/build-recorded-client.d.ts +1 -1
- package/dist/src/rlc-common/test/build-recorded-client.d.ts.map +1 -1
- package/dist/src/rlc-common/test/build-recorded-client.js +2 -5
- package/dist/src/rlc-common/test/build-recorded-client.js.map +1 -1
- package/dist/src/rlc-common/test/build-sample-test.d.ts +1 -1
- package/dist/src/rlc-common/test/build-sample-test.d.ts.map +1 -1
- package/dist/src/rlc-common/test/build-sample-test.js +2 -5
- package/dist/src/rlc-common/test/build-sample-test.js.map +1 -1
- package/dist/src/rlc-common/test/build-snippets.d.ts +1 -1
- package/dist/src/rlc-common/test/build-snippets.d.ts.map +1 -1
- package/dist/src/rlc-common/test/build-snippets.js +2 -6
- package/dist/src/rlc-common/test/build-snippets.js.map +1 -1
- package/dist/src/rlc-common/test/template.d.ts +3 -3
- package/dist/src/rlc-common/test/template.d.ts.map +1 -1
- package/dist/src/rlc-common/test/template.js +1 -35
- package/dist/src/rlc-common/test/template.js.map +1 -1
- package/dist/src/transform/transform-helper-function-details.d.ts +2 -2
- package/dist/src/transform/transform-helper-function-details.d.ts.map +1 -1
- package/dist/src/transform/transform-helper-function-details.js +1 -9
- package/dist/src/transform/transform-helper-function-details.js.map +1 -1
- package/dist/src/transform/transform-schemas.js +1 -1
- package/dist/src/transform/transform-schemas.js.map +1 -1
- package/dist/src/transform/transform.d.ts.map +1 -1
- package/dist/src/transform/transform.js +9 -16
- package/dist/src/transform/transform.js.map +1 -1
- package/dist/src/transform/transfrom-rlc-options.d.ts +2 -2
- package/dist/src/transform/transfrom-rlc-options.d.ts.map +1 -1
- package/dist/src/transform/transfrom-rlc-options.js +29 -94
- package/dist/src/transform/transfrom-rlc-options.js.map +1 -1
- package/dist/src/utils/client-utils.d.ts +1 -1
- package/dist/src/utils/client-utils.d.ts.map +1 -1
- package/dist/src/utils/client-utils.js +4 -5
- package/dist/src/utils/client-utils.js.map +1 -1
- package/dist/src/utils/emit-util.d.ts +0 -1
- package/dist/src/utils/emit-util.d.ts.map +1 -1
- package/dist/src/utils/emit-util.js +13 -24
- package/dist/src/utils/emit-util.js.map +1 -1
- package/dist/src/utils/file-system-utils.d.ts +4 -4
- package/dist/src/utils/file-system-utils.d.ts.map +1 -1
- package/dist/src/utils/file-system-utils.js +14 -16
- package/dist/src/utils/file-system-utils.js.map +1 -1
- package/dist/src/utils/import-helper.js +3 -3
- package/dist/src/utils/import-helper.js.map +1 -1
- package/dist/src/utils/model-utils.d.ts +1 -1
- package/dist/src/utils/model-utils.d.ts.map +1 -1
- package/dist/src/utils/model-utils.js +4 -11
- package/dist/src/utils/model-utils.js.map +1 -1
- package/dist/src/utils/resolve-project-root.d.ts +6 -4
- package/dist/src/utils/resolve-project-root.d.ts.map +1 -1
- package/dist/src/utils/resolve-project-root.js +11 -18
- package/dist/src/utils/resolve-project-root.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +44 -59
- package/src/framework/hooks/binder.ts +4 -5
- package/src/framework/hooks/sdk-types.ts +2 -3
- package/src/framework/load-static-helpers.ts +38 -41
- package/src/framework/sample.ts +1 -1
- package/src/index.ts +126 -204
- package/src/lib.ts +32 -143
- package/src/modular/build-classical-client.ts +2 -2
- package/src/modular/build-client-context.ts +6 -14
- package/src/modular/build-project-files.ts +11 -4
- package/src/modular/build-restore-poller.ts +2 -2
- package/src/modular/build-root-index.ts +9 -13
- package/src/modular/build-subpath-index.ts +4 -4
- package/src/modular/emit-logger-file.ts +0 -3
- package/src/modular/emit-models-options.ts +2 -2
- package/src/modular/emit-models.ts +7 -23
- package/src/modular/emit-samples.ts +10 -26
- package/src/modular/emit-tests.ts +28 -11
- package/src/modular/helpers/client-helpers.ts +7 -17
- package/src/modular/helpers/example-value-helpers.ts +11 -26
- package/src/modular/serialization/serialize-utils.ts +2 -2
- package/src/rlc-common/helpers/imports-util.ts +44 -56
- package/src/rlc-common/helpers/name-constructors.ts +1 -23
- package/src/rlc-common/index.ts +0 -18
- package/src/rlc-common/interfaces.ts +2 -23
- package/src/rlc-common/metadata/build-api-extractor-config.ts +5 -47
- package/src/rlc-common/metadata/build-es-lint-config.ts +3 -42
- package/src/rlc-common/metadata/build-package-file.ts +24 -86
- package/src/rlc-common/metadata/build-readme-file.ts +19 -121
- package/src/rlc-common/metadata/build-sample-env-file.ts +1 -4
- package/src/rlc-common/metadata/build-test-config.ts +1 -6
- package/src/rlc-common/metadata/build-ts-config.ts +30 -72
- package/src/rlc-common/metadata/build-warp-config.ts +0 -4
- package/src/rlc-common/metadata/package-json/azure-package-common.ts +2 -134
- package/src/rlc-common/metadata/package-json/build-azure-monorepo-package.ts +4 -24
- package/src/rlc-common/metadata/package-json/package-common.ts +22 -120
- package/src/rlc-common/static/polling-content.ts +1 -1
- package/src/rlc-common/test/build-recorded-client.ts +2 -5
- package/src/rlc-common/test/build-sample-test.ts +2 -5
- package/src/rlc-common/test/build-snippets.ts +2 -6
- package/src/rlc-common/test/template.ts +1 -35
- package/src/transform/transform-helper-function-details.ts +1 -10
- package/src/transform/transform-schemas.ts +1 -1
- package/src/transform/transform.ts +8 -19
- package/src/transform/transfrom-rlc-options.ts +29 -127
- package/src/utils/client-utils.ts +4 -5
- package/src/utils/emit-util.ts +14 -39
- package/src/utils/file-system-utils.ts +14 -15
- package/src/utils/import-helper.ts +3 -3
- package/src/utils/model-utils.ts +4 -17
- package/src/utils/resolve-project-root.ts +11 -24
- package/dist/src/rlc-common/build-client-definitions.d.ts +0 -6
- package/dist/src/rlc-common/build-client-definitions.d.ts.map +0 -1
- package/dist/src/rlc-common/build-client-definitions.js +0 -157
- package/dist/src/rlc-common/build-client-definitions.js.map +0 -1
- package/dist/src/rlc-common/build-client.d.ts +0 -9
- package/dist/src/rlc-common/build-client.d.ts.map +0 -1
- package/dist/src/rlc-common/build-client.js +0 -391
- package/dist/src/rlc-common/build-client.js.map +0 -1
- package/dist/src/rlc-common/build-index-file.d.ts +0 -6
- package/dist/src/rlc-common/build-index-file.d.ts.map +0 -1
- package/dist/src/rlc-common/build-index-file.js +0 -241
- package/dist/src/rlc-common/build-index-file.js.map +0 -1
- package/dist/src/rlc-common/build-is-unexpected-helper.d.ts +0 -6
- package/dist/src/rlc-common/build-is-unexpected-helper.d.ts.map +0 -1
- package/dist/src/rlc-common/build-is-unexpected-helper.js +0 -223
- package/dist/src/rlc-common/build-is-unexpected-helper.js.map +0 -1
- package/dist/src/rlc-common/build-logger.d.ts +0 -6
- package/dist/src/rlc-common/build-logger.d.ts.map +0 -1
- package/dist/src/rlc-common/build-logger.js +0 -31
- package/dist/src/rlc-common/build-logger.js.map +0 -1
- package/dist/src/rlc-common/build-method-shortcuts.d.ts +0 -5
- package/dist/src/rlc-common/build-method-shortcuts.d.ts.map +0 -1
- package/dist/src/rlc-common/build-method-shortcuts.js +0 -54
- package/dist/src/rlc-common/build-method-shortcuts.js.map +0 -1
- package/dist/src/rlc-common/build-object-types.d.ts +0 -29
- package/dist/src/rlc-common/build-object-types.d.ts.map +0 -1
- package/dist/src/rlc-common/build-object-types.js +0 -412
- package/dist/src/rlc-common/build-object-types.js.map +0 -1
- package/dist/src/rlc-common/build-paginate-helper.d.ts +0 -6
- package/dist/src/rlc-common/build-paginate-helper.d.ts.map +0 -1
- package/dist/src/rlc-common/build-paginate-helper.js +0 -27
- package/dist/src/rlc-common/build-paginate-helper.js.map +0 -1
- package/dist/src/rlc-common/build-parameter-types.d.ts +0 -14
- package/dist/src/rlc-common/build-parameter-types.d.ts.map +0 -1
- package/dist/src/rlc-common/build-parameter-types.js +0 -391
- package/dist/src/rlc-common/build-parameter-types.js.map +0 -1
- package/dist/src/rlc-common/build-polling-helper.d.ts +0 -6
- package/dist/src/rlc-common/build-polling-helper.d.ts.map +0 -1
- package/dist/src/rlc-common/build-polling-helper.js +0 -61
- package/dist/src/rlc-common/build-polling-helper.js.map +0 -1
- package/dist/src/rlc-common/build-response-types.d.ts +0 -6
- package/dist/src/rlc-common/build-response-types.d.ts.map +0 -1
- package/dist/src/rlc-common/build-response-types.js +0 -143
- package/dist/src/rlc-common/build-response-types.js.map +0 -1
- package/dist/src/rlc-common/build-samples.d.ts +0 -3
- package/dist/src/rlc-common/build-samples.d.ts.map +0 -1
- package/dist/src/rlc-common/build-samples.js +0 -30
- package/dist/src/rlc-common/build-samples.js.map +0 -1
- package/dist/src/rlc-common/build-schema-type.d.ts +0 -20
- package/dist/src/rlc-common/build-schema-type.d.ts.map +0 -1
- package/dist/src/rlc-common/build-schema-type.js +0 -71
- package/dist/src/rlc-common/build-schema-type.js.map +0 -1
- package/dist/src/rlc-common/build-serialize-helper.d.ts +0 -6
- package/dist/src/rlc-common/build-serialize-helper.d.ts.map +0 -1
- package/dist/src/rlc-common/build-serialize-helper.js +0 -36
- package/dist/src/rlc-common/build-serialize-helper.js.map +0 -1
- package/dist/src/rlc-common/build-top-level-index-file.d.ts +0 -6
- package/dist/src/rlc-common/build-top-level-index-file.d.ts.map +0 -1
- package/dist/src/rlc-common/build-top-level-index-file.js +0 -48
- package/dist/src/rlc-common/build-top-level-index-file.js.map +0 -1
- package/dist/src/rlc-common/helpers/package-util.d.ts +0 -7
- package/dist/src/rlc-common/helpers/package-util.d.ts.map +0 -1
- package/dist/src/rlc-common/helpers/package-util.js +0 -10
- package/dist/src/rlc-common/helpers/package-util.js.map +0 -1
- package/dist/src/rlc-common/helpers/path-utils.d.ts +0 -2
- package/dist/src/rlc-common/helpers/path-utils.d.ts.map +0 -1
- package/dist/src/rlc-common/helpers/path-utils.js +0 -10
- package/dist/src/rlc-common/helpers/path-utils.js.map +0 -1
- package/dist/src/rlc-common/helpers/shortcut-methods.d.ts +0 -4
- package/dist/src/rlc-common/helpers/shortcut-methods.d.ts.map +0 -1
- package/dist/src/rlc-common/helpers/shortcut-methods.js +0 -49
- package/dist/src/rlc-common/helpers/shortcut-methods.js.map +0 -1
- package/dist/src/rlc-common/helpers/value-generation-util.d.ts +0 -12
- package/dist/src/rlc-common/helpers/value-generation-util.d.ts.map +0 -1
- package/dist/src/rlc-common/helpers/value-generation-util.js +0 -161
- package/dist/src/rlc-common/helpers/value-generation-util.js.map +0 -1
- package/dist/src/rlc-common/metadata/build-rollup-config.d.ts +0 -6
- package/dist/src/rlc-common/metadata/build-rollup-config.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/build-rollup-config.js +0 -140
- package/dist/src/rlc-common/metadata/build-rollup-config.js.map +0 -1
- package/dist/src/rlc-common/metadata/package-json/build-azure-standalone-package.d.ts +0 -8
- package/dist/src/rlc-common/metadata/package-json/build-azure-standalone-package.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/package-json/build-azure-standalone-package.js +0 -101
- package/dist/src/rlc-common/metadata/package-json/build-azure-standalone-package.js.map +0 -1
- package/dist/src/rlc-common/metadata/package-json/build-flavorless-package.d.ts +0 -57
- package/dist/src/rlc-common/metadata/package-json/build-flavorless-package.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/package-json/build-flavorless-package.js +0 -53
- package/dist/src/rlc-common/metadata/package-json/build-flavorless-package.js.map +0 -1
- package/dist/src/rlc-common/transform-sample-groups.d.ts +0 -9
- package/dist/src/rlc-common/transform-sample-groups.d.ts.map +0 -1
- package/dist/src/rlc-common/transform-sample-groups.js +0 -313
- package/dist/src/rlc-common/transform-sample-groups.js.map +0 -1
- package/dist/src/utils/dirname.d.ts +0 -9
- package/dist/src/utils/dirname.d.ts.map +0 -1
- package/dist/src/utils/dirname.js +0 -12
- package/dist/src/utils/dirname.js.map +0 -1
- package/src/rlc-common/build-client-definitions.ts +0 -235
- package/src/rlc-common/build-client.ts +0 -490
- package/src/rlc-common/build-index-file.ts +0 -344
- package/src/rlc-common/build-is-unexpected-helper.ts +0 -248
- package/src/rlc-common/build-logger.ts +0 -43
- package/src/rlc-common/build-method-shortcuts.ts +0 -71
- package/src/rlc-common/build-object-types.ts +0 -603
- package/src/rlc-common/build-paginate-helper.ts +0 -31
- package/src/rlc-common/build-parameter-types.ts +0 -554
- package/src/rlc-common/build-polling-helper.ts +0 -83
- package/src/rlc-common/build-response-types.ts +0 -180
- package/src/rlc-common/build-samples.ts +0 -32
- package/src/rlc-common/build-schema-type.ts +0 -89
- package/src/rlc-common/build-serialize-helper.ts +0 -49
- package/src/rlc-common/build-top-level-index-file.ts +0 -58
- package/src/rlc-common/helpers/package-util.ts +0 -13
- package/src/rlc-common/helpers/path-utils.ts +0 -10
- package/src/rlc-common/helpers/shortcut-methods.ts +0 -58
- package/src/rlc-common/helpers/value-generation-util.ts +0 -234
- package/src/rlc-common/metadata/build-rollup-config.ts +0 -147
- package/src/rlc-common/metadata/package-json/build-azure-standalone-package.ts +0 -123
- package/src/rlc-common/metadata/package-json/build-flavorless-package.ts +0 -68
- package/src/rlc-common/transform-sample-groups.ts +0 -407
- package/src/utils/dirname.ts +0 -12
package/package.json
CHANGED
|
@@ -1,23 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure-tools/typespec-ts",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "An experimental TypeSpec emitter for TypeScript
|
|
3
|
+
"version": "0.55.0-dev.10",
|
|
4
|
+
"description": "An experimental TypeSpec emitter for TypeScript",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
|
-
"
|
|
10
|
-
"
|
|
9
|
+
"types": "./dist/src/index.d.ts",
|
|
10
|
+
"default": "./dist/src/index.js"
|
|
11
11
|
},
|
|
12
12
|
"./testing": {
|
|
13
|
-
"
|
|
14
|
-
"
|
|
13
|
+
"types": "./dist/src/testing/index.d.ts",
|
|
14
|
+
"default": "./dist/src/testing/index.js"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"author": "Jose Heredia <joheredi@microsoft.com>",
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@azure-rest/core-client": "^2.3.1",
|
|
21
|
+
"@typespec/http-specs": "^0.1.0-alpha.38 || >=0.1.0-alpha.39-dev <0.1.0-alpha.39",
|
|
22
|
+
"@typespec/spector": "^0.1.0-alpha.25 || >=0.1.0-alpha.26-dev <0.1.0-alpha.26",
|
|
23
|
+
"@typespec/spec-api": "^0.1.0-alpha.14 || >=0.1.0-alpha.15-dev <0.1.0-alpha.15",
|
|
24
|
+
"@typespec/tspd": "^0.75.0 || >=0.76.0-dev <0.76.0",
|
|
25
|
+
"@azure-tools/azure-http-specs": "^0.1.0-alpha.42 || >=0.1.0-alpha.43-dev <0.1.0-alpha.43",
|
|
26
|
+
"@azure-tools/typespec-autorest": "^0.69.1 || >=0.70.0-dev <0.70.0",
|
|
27
|
+
"@azure-tools/typespec-azure-core": "^0.69.0 || >=0.70.0-dev <0.70.0",
|
|
28
|
+
"@azure-tools/typespec-azure-resource-manager": "^0.69.1 || >=0.70.0-dev <0.70.0",
|
|
29
|
+
"@azure-tools/typespec-client-generator-core": "^0.69.0 || >=0.70.0-dev <0.70.0",
|
|
21
30
|
"@azure/abort-controller": "^2.1.2",
|
|
22
31
|
"@azure/core-auth": "^1.6.0",
|
|
23
32
|
"@azure/core-lro": "^3.1.0",
|
|
@@ -25,7 +34,13 @@
|
|
|
25
34
|
"@azure/core-rest-pipeline": "^1.14.0",
|
|
26
35
|
"@azure/core-util": "^1.4.0",
|
|
27
36
|
"@azure/logger": "^1.0.4",
|
|
28
|
-
"@typespec/
|
|
37
|
+
"@typespec/compiler": "^1.13.0",
|
|
38
|
+
"@typespec/http": "^1.13.0",
|
|
39
|
+
"@typespec/openapi": "^1.13.0",
|
|
40
|
+
"@typespec/rest": "^0.83.0 || >=0.84.0-dev <0.84.0",
|
|
41
|
+
"@typespec/versioning": "^0.83.0 || >=0.84.0-dev <0.84.0",
|
|
42
|
+
"@typespec/xml": "^0.83.0 || >=0.84.0-dev <0.84.0",
|
|
43
|
+
"@typespec/ts-http-runtime": "0.3.6",
|
|
29
44
|
"cross-env": "^10.1.0",
|
|
30
45
|
"mkdirp": "^3.0.1",
|
|
31
46
|
"npm-run-all": "~4.1.5",
|
|
@@ -34,32 +49,16 @@
|
|
|
34
49
|
"vite": "^8.0.8",
|
|
35
50
|
"@vitest/coverage-v8": "^4.1.3",
|
|
36
51
|
"@microsoft/api-extractor": "^7.58.1",
|
|
37
|
-
"
|
|
38
|
-
"yaml": "^2.8.3",
|
|
39
|
-
"@typespec/tspd": "^0.75.0",
|
|
40
|
-
"@typespec/spec-api": "^0.1.0-alpha.14",
|
|
41
|
-
"@typespec/spector": "^0.1.0-alpha.25",
|
|
42
|
-
"@azure-tools/typespec-autorest": "^0.69.1",
|
|
43
|
-
"@azure-tools/azure-http-specs": "^0.1.0-alpha.42",
|
|
44
|
-
"@typespec/http-specs": "^0.1.0-alpha.38",
|
|
45
|
-
"@azure-tools/typespec-azure-core": "^0.69.0",
|
|
46
|
-
"@azure-tools/typespec-client-generator-core": "^0.69.0",
|
|
47
|
-
"@typespec/compiler": "^1.13.0",
|
|
48
|
-
"@typespec/openapi": "^1.13.0",
|
|
49
|
-
"@typespec/rest": "^0.83.0",
|
|
50
|
-
"@typespec/http": "^1.13.0",
|
|
51
|
-
"@typespec/versioning": "^0.83.0",
|
|
52
|
-
"@typespec/xml": "^0.83.0",
|
|
53
|
-
"@azure-tools/typespec-azure-resource-manager": "^0.69.1"
|
|
52
|
+
"yaml": "^2.8.3"
|
|
54
53
|
},
|
|
55
54
|
"peerDependencies": {
|
|
56
|
-
"@azure-tools/typespec-azure-core": "^0.69.0",
|
|
55
|
+
"@azure-tools/typespec-azure-core": "^0.69.0 || >=0.70.0-dev <0.70.0",
|
|
56
|
+
"@azure-tools/typespec-client-generator-core": "^0.69.0 || >=0.70.0-dev <0.70.0",
|
|
57
57
|
"@typespec/compiler": "^1.13.0",
|
|
58
|
-
"@azure-tools/typespec-client-generator-core": "^0.69.0",
|
|
59
|
-
"@typespec/rest": "^0.83.0",
|
|
60
|
-
"@typespec/versioning": "^0.83.0",
|
|
61
58
|
"@typespec/http": "^1.13.0",
|
|
62
|
-
"@typespec/
|
|
59
|
+
"@typespec/rest": "^0.83.0 || >=0.84.0-dev <0.84.0",
|
|
60
|
+
"@typespec/versioning": "^0.83.0 || >=0.84.0-dev <0.84.0",
|
|
61
|
+
"@typespec/xml": "^0.83.0 || >=0.84.0-dev <0.84.0"
|
|
63
62
|
},
|
|
64
63
|
"dependencies": {
|
|
65
64
|
"fast-xml-parser": "^5.7.0",
|
|
@@ -90,43 +89,29 @@
|
|
|
90
89
|
"clean": "rimraf ./dist ./typespec-output",
|
|
91
90
|
"build": "tsc -p .",
|
|
92
91
|
"test": "npm run test-next && npm run unit-test && npm run integration-test-ci",
|
|
93
|
-
"test:azure": "npm run test-next && npm run copy:typespec && npm run integration-test-ci:azure-
|
|
94
|
-
"test:standard": "npm run test-next && npm run copy:typespec && npm run unit-test&& npm run integration-test-ci:rlc && npm run integration-test-ci:modular",
|
|
92
|
+
"test:azure": "npm run test-next && npm run copy:typespec && npm run integration-test-ci:azure-modular",
|
|
95
93
|
"lint": "eslint . --ext .ts --max-warnings=0",
|
|
96
94
|
"lint:fix": "eslint . --fix --ext .ts",
|
|
97
|
-
"check:tree": "
|
|
98
|
-
"test:ts:e2e": "npm run copy:typespec && npm run integration-test-ci:azure-
|
|
99
|
-
"integration-test-ci": "npm-run-all copy:typespec integration-test-ci:
|
|
100
|
-
"integration-test-ci:sequential": "npm-run-all --serial copy:typespec integration-test-ci:
|
|
101
|
-
"integration-test-ci:rlc": "npm-run-all --silent -p start-test-server:rlc --race generate-and-run:rlc",
|
|
102
|
-
"integration-test-ci:azure-rlc": "npm-run-all --silent -p start-test-server:azure-rlc --race generate-and-run:azure-rlc",
|
|
103
|
-
"integration-test-ci:modular": "npm-run-all --silent -p start-test-server:modular --race generate-and-run:modular",
|
|
95
|
+
"check:tree": "node ./test/commands/check-clean-tree.ts",
|
|
96
|
+
"test:ts:e2e": "npm run copy:typespec && npm run integration-test-ci:azure-modular",
|
|
97
|
+
"integration-test-ci": "npm-run-all copy:typespec integration-test-ci:azure-modular",
|
|
98
|
+
"integration-test-ci:sequential": "npm-run-all --serial copy:typespec integration-test-ci:azure-modular",
|
|
104
99
|
"integration-test-ci:azure-modular": "npm-run-all --silent -p start-test-server:azure-modular --race generate-and-run:azure-modular",
|
|
105
100
|
"start-test-server": "mkdirp -p coverage && npx tsp-spector serve ./node_modules/@typespec/http-specs/specs --coverageFile ./coverage/spector-coverage-typescript.json",
|
|
106
|
-
"start-test-server:rlc": "mkdirp -p coverage && npx tsp-spector serve ./node_modules/@typespec/http-specs/specs --coverageFile ./coverage/spector-coverage-typescript-rlc-standard.json",
|
|
107
|
-
"start-test-server:azure-rlc": "mkdirp -p coverage && npx tsp-spector serve ./node_modules/@azure-tools/azure-http-specs/specs ./node_modules/@typespec/http-specs/specs --coverageFile ./coverage/spector-coverage-typescript-rlc-azure.json",
|
|
108
|
-
"start-test-server:modular": "mkdirp -p coverage && npx tsp-spector serve ./node_modules/@typespec/http-specs/specs --port 3002 --coverageFile ./coverage/spector-coverage-typescript-modular-standard.json",
|
|
109
101
|
"start-test-server:azure-modular": "mkdirp -p coverage && npx tsp-spector serve ./node_modules/@azure-tools/azure-http-specs/specs ./node_modules/@typespec/http-specs/specs --port 3002 --coverageFile ./coverage/spector-coverage-typescript-modular-azure.json",
|
|
110
|
-
"copy:typespec": "
|
|
111
|
-
"generate-and-run:
|
|
112
|
-
"generate-
|
|
113
|
-
"generate-
|
|
114
|
-
"generate-
|
|
115
|
-
"generate-tsp-only
|
|
116
|
-
"generate-tsp-only:rlc": "npx tsx ./test/commands/gen-spector.js --tag=rlc",
|
|
117
|
-
"generate-tsp-only:azure-rlc": "npx tsx ./test/commands/gen-spector.js --tag=azure-rlc",
|
|
118
|
-
"generate-tsp-only:modular": "npx tsx ./test/commands/gen-spector.js --tag=modular",
|
|
119
|
-
"generate-tsp-only:azure-modular": "npx tsx ./test/commands/gen-spector.js --tag=azure-modular",
|
|
102
|
+
"copy:typespec": "node ./test/commands/copy-typespec.ts",
|
|
103
|
+
"generate-and-run:azure-modular": "npm run generate-tsp-only:azure-modular:client && npm-run-all -p integration-test:alone:azure-modular generate-tsp-only:azure-modular:declarations && npm run stop-test-server -- -p 3002",
|
|
104
|
+
"generate-tsp-only": "npm run generate-tsp-only:azure-modular",
|
|
105
|
+
"generate-tsp-only:azure-modular": "node ./test/commands/gen-spector.js",
|
|
106
|
+
"generate-tsp-only:azure-modular:client": "node ./test/commands/gen-spector.js --phase=client",
|
|
107
|
+
"generate-tsp-only:azure-modular:declarations": "node ./test/commands/gen-spector.js --phase=declarations",
|
|
120
108
|
"regen-test-baselines": "npm run generate-tsp-only",
|
|
121
|
-
"integration-test:alone": "npm run integration-test:alone:
|
|
122
|
-
"integration-test:alone:rlc": "vitest run --project integration-rlc",
|
|
123
|
-
"integration-test:alone:azure-rlc": "vitest run --project integration-azure-rlc",
|
|
124
|
-
"integration-test:alone:modular": "vitest run --project integration-modular",
|
|
109
|
+
"integration-test:alone": "npm run integration-test:alone:azure-modular",
|
|
125
110
|
"integration-test:alone:azure-modular": "vitest run --project integration-azure-modular",
|
|
126
111
|
"stop-test-server": "npx tsp-spector server stop",
|
|
127
|
-
"unit-test": "npm
|
|
128
|
-
"unit-test:
|
|
129
|
-
"
|
|
130
|
-
"regen-docs": "npm run build && tspd doc . --enable-experimental --output-dir
|
|
112
|
+
"unit-test": "npm run unit-test:modular",
|
|
113
|
+
"unit-test:modular": "cross-env NODE_OPTIONS=--max-old-space-size=1024 vitest run --project unit-modular",
|
|
114
|
+
"gen:scenario-suites": "node ./test/commands/gen-scenario-suites.ts",
|
|
115
|
+
"regen-docs": "npm run build && tspd doc . --enable-experimental --output-dir ../../website/src/content/docs/docs/emitters/clients/typespec-ts/reference --skip-js"
|
|
131
116
|
}
|
|
132
117
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { normalizePath } from "@typespec/compiler";
|
|
2
|
-
import path from "path/posix";
|
|
1
|
+
import { joinPaths, normalizePath } from "@typespec/compiler";
|
|
3
2
|
import {
|
|
4
3
|
ImportDeclarationStructure,
|
|
5
4
|
ImportSpecifierStructure,
|
|
@@ -24,7 +23,7 @@ export interface BinderOptions {
|
|
|
24
23
|
staticHelpers?: Map<string, StaticHelperMetadata>;
|
|
25
24
|
dependencies?: Record<string, ReferenceableSymbol>;
|
|
26
25
|
/** When true, use #platform/ subpath imports for static helpers with platform variants.
|
|
27
|
-
* Should be true for warp
|
|
26
|
+
* Should be true for warp packages; false for tshy packages. */
|
|
28
27
|
useSubpathImports?: boolean;
|
|
29
28
|
}
|
|
30
29
|
|
|
@@ -354,7 +353,7 @@ class BinderImp implements Binder {
|
|
|
354
353
|
|
|
355
354
|
// Also keep files that are imported by any used helper file
|
|
356
355
|
const helperFiles = this.project.getSourceFiles(
|
|
357
|
-
normalizePath(
|
|
356
|
+
normalizePath(joinPaths(sourceRoot, "static-helpers/**/*.*ts")),
|
|
358
357
|
);
|
|
359
358
|
const usedFiles = helperFiles.filter((file) => !isFileUnused(file, usedHelperNames));
|
|
360
359
|
for (const usedFile of usedFiles) {
|
|
@@ -378,7 +377,7 @@ class BinderImp implements Binder {
|
|
|
378
377
|
}
|
|
379
378
|
this.project
|
|
380
379
|
//normalizae the final path to adapt to different systems
|
|
381
|
-
.getSourceFiles(normalizePath(
|
|
380
|
+
.getSourceFiles(normalizePath(joinPaths(testRoot, "test/generated/util/**/*.*ts")))
|
|
382
381
|
.filter((file) => isFileUnused(file, usedHelperNames))
|
|
383
382
|
.forEach((helperFile) => helperFile.delete());
|
|
384
383
|
}
|
|
@@ -23,11 +23,10 @@ export const flattenPropertyModelMap: Map<SdkModelPropertyType, SdkModelType> =
|
|
|
23
23
|
SdkModelType
|
|
24
24
|
>();
|
|
25
25
|
/**
|
|
26
|
-
* Set of paged result models that
|
|
27
|
-
* This includes models used as non-paging method responses or as model properties.
|
|
26
|
+
* Set of paged result models that are also used in non-paging operations.
|
|
28
27
|
* Precomputed during visitPackageTypes for O(1) lookups in normalizeModelName.
|
|
29
28
|
*/
|
|
30
|
-
export const
|
|
29
|
+
export const pagedModelsUsedInNonPagingOps = new Set<SdkType>();
|
|
31
30
|
|
|
32
31
|
export interface SdkTypeContext {
|
|
33
32
|
operations: Map<Type, SdkServiceMethod<SdkHttpOperation>>;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { NoTarget, Program } from "@typespec/compiler";
|
|
2
|
-
import { readdir, readFile, stat } from "fs/promises";
|
|
3
|
-
import * as path from "path";
|
|
1
|
+
import { type CompilerHost, joinPaths, NoTarget, Program } from "@typespec/compiler";
|
|
4
2
|
import {
|
|
5
3
|
ClassDeclaration,
|
|
6
4
|
EnumDeclaration,
|
|
@@ -12,7 +10,6 @@ import {
|
|
|
12
10
|
} from "ts-morph";
|
|
13
11
|
import { reportDiagnostic } from "../lib.js";
|
|
14
12
|
import { ModularEmitterOptions } from "../modular/interfaces.js";
|
|
15
|
-
import { isAzurePackage } from "../rlc-common/index.js";
|
|
16
13
|
import { resolveProjectRoot } from "../utils/resolve-project-root.js";
|
|
17
14
|
import { refkey } from "./refkey.js";
|
|
18
15
|
export const SourceFileSymbol = Symbol("SourceFile");
|
|
@@ -39,6 +36,9 @@ export interface LoadStaticHelpersOptions extends Partial<ModularEmitterOptions>
|
|
|
39
36
|
sourcesDir?: string;
|
|
40
37
|
rootDir?: string;
|
|
41
38
|
program?: Program;
|
|
39
|
+
host?: CompilerHost;
|
|
40
|
+
/** The emitter package root directory (where static/ lives). */
|
|
41
|
+
packageRoot?: string;
|
|
42
42
|
/** When true, also load test helpers from static/test-helpers/ into test/generated/util/ */
|
|
43
43
|
loadTestHelpers?: boolean;
|
|
44
44
|
}
|
|
@@ -54,27 +54,29 @@ export async function loadStaticHelpers(
|
|
|
54
54
|
options: LoadStaticHelpersOptions = {},
|
|
55
55
|
): Promise<Map<string, StaticHelperMetadata>> {
|
|
56
56
|
const helpersMap = new Map<string, StaticHelperMetadata>();
|
|
57
|
+
const host = options.host ?? options.program?.host;
|
|
58
|
+
if (!host) {
|
|
59
|
+
throw new Error(
|
|
60
|
+
"loadStaticHelpers requires either a host or program in options to access the file system.",
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const packageRoot = options.packageRoot ?? resolveProjectRoot();
|
|
65
|
+
|
|
57
66
|
// Load static helpers used in sources code
|
|
58
|
-
const defaultStaticHelpersPath =
|
|
59
|
-
resolveProjectRoot(),
|
|
60
|
-
DEFAULT_SOURCES_STATIC_HELPERS_PATH,
|
|
61
|
-
);
|
|
67
|
+
const defaultStaticHelpersPath = joinPaths(packageRoot, DEFAULT_SOURCES_STATIC_HELPERS_PATH);
|
|
62
68
|
const filesInSources = await traverseDirectory(
|
|
63
69
|
options.helpersAssetDirectory ?? defaultStaticHelpersPath,
|
|
70
|
+
host,
|
|
64
71
|
options.program,
|
|
65
72
|
);
|
|
66
73
|
await loadFiles(filesInSources, options.sourcesDir ?? "");
|
|
67
74
|
// Load static helpers used in testing code (only when loadTestHelpers is enabled)
|
|
68
|
-
if (
|
|
69
|
-
|
|
70
|
-
(options.options?.generateTest && isAzurePackage({ options: options.options }))
|
|
71
|
-
) {
|
|
72
|
-
const defaultTestingHelpersPath = path.join(
|
|
73
|
-
resolveProjectRoot(),
|
|
74
|
-
DEFAULT_SOURCES_TESTING_HELPERS_PATH,
|
|
75
|
-
);
|
|
75
|
+
if (options.loadTestHelpers ?? options.options?.generateTest) {
|
|
76
|
+
const defaultTestingHelpersPath = joinPaths(packageRoot, DEFAULT_SOURCES_TESTING_HELPERS_PATH);
|
|
76
77
|
const filesInTestings = await traverseDirectory(
|
|
77
78
|
defaultTestingHelpersPath,
|
|
79
|
+
host,
|
|
78
80
|
options.program,
|
|
79
81
|
[],
|
|
80
82
|
"",
|
|
@@ -86,34 +88,25 @@ export async function loadStaticHelpers(
|
|
|
86
88
|
|
|
87
89
|
async function loadFiles(files: FileMetadata[], generateDir: string) {
|
|
88
90
|
for (const file of files) {
|
|
89
|
-
const targetPath =
|
|
90
|
-
const
|
|
91
|
+
const targetPath = joinPaths(generateDir, file.target);
|
|
92
|
+
const sourceFile = await host!.readFile(file.source);
|
|
93
|
+
const contents = sourceFile.text;
|
|
91
94
|
const addedFile = project.createSourceFile(targetPath, contents, {
|
|
92
95
|
overwrite: true,
|
|
93
96
|
});
|
|
94
97
|
addedFile.getImportDeclarations().map((i) => {
|
|
95
|
-
if (!isAzurePackage({ options: options.options })) {
|
|
96
|
-
if (i.getModuleSpecifier().getFullText().includes("@azure/core-rest-pipeline")) {
|
|
97
|
-
i.setModuleSpecifier("@typespec/ts-http-runtime");
|
|
98
|
-
}
|
|
99
|
-
if (i.getModuleSpecifier().getFullText().includes("@azure-rest/core-client")) {
|
|
100
|
-
i.setModuleSpecifier("@typespec/ts-http-runtime");
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
98
|
// Rewrite relative platform-types imports to #platform/ specifiers
|
|
104
99
|
// so that browser/react-native variants are resolved via subpath imports.
|
|
105
100
|
// Only rewrite imports to the default variant (not -browser/-react-native variants
|
|
106
101
|
// which are already platform-specific direct imports).
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
)
|
|
115
|
-
i.setModuleSpecifier("#platform/static-helpers/platform-types");
|
|
116
|
-
}
|
|
102
|
+
const specifier = i.getModuleSpecifierValue();
|
|
103
|
+
if (
|
|
104
|
+
specifier.startsWith(".") &&
|
|
105
|
+
specifier.includes("platform-types") &&
|
|
106
|
+
!specifier.includes("-browser") &&
|
|
107
|
+
!specifier.includes("-react-native")
|
|
108
|
+
) {
|
|
109
|
+
i.setModuleSpecifier("#platform/static-helpers/platform-types");
|
|
117
110
|
}
|
|
118
111
|
});
|
|
119
112
|
|
|
@@ -187,32 +180,36 @@ function getDeclarationByMetadata(
|
|
|
187
180
|
}
|
|
188
181
|
}
|
|
189
182
|
|
|
183
|
+
type FsHost = Pick<CompilerHost, "readFile" | "readDir" | "stat">;
|
|
184
|
+
|
|
190
185
|
const _targetStaticHelpersBaseDir = "static-helpers";
|
|
191
186
|
async function traverseDirectory(
|
|
192
187
|
directory: string,
|
|
188
|
+
host: FsHost,
|
|
193
189
|
program?: Program,
|
|
194
190
|
result: { source: string; target: string }[] = [],
|
|
195
191
|
relativePath: string = "",
|
|
196
192
|
targetBaseDir: string = _targetStaticHelpersBaseDir,
|
|
197
193
|
): Promise<{ source: string; target: string }[]> {
|
|
198
194
|
try {
|
|
199
|
-
const files = await
|
|
195
|
+
const files = await host.readDir(directory);
|
|
200
196
|
|
|
201
197
|
await Promise.all(
|
|
202
198
|
files.map(async (file) => {
|
|
203
|
-
const filePath =
|
|
204
|
-
const fileStat = await stat(filePath);
|
|
199
|
+
const filePath = joinPaths(directory, file);
|
|
200
|
+
const fileStat = await host.stat(filePath);
|
|
205
201
|
|
|
206
202
|
if (fileStat.isDirectory()) {
|
|
207
203
|
await traverseDirectory(
|
|
208
204
|
filePath,
|
|
205
|
+
host,
|
|
209
206
|
program,
|
|
210
207
|
result,
|
|
211
|
-
|
|
208
|
+
joinPaths(relativePath, file),
|
|
212
209
|
targetBaseDir,
|
|
213
210
|
);
|
|
214
211
|
} else if (fileStat.isFile() && !file.endsWith(".d.ts") && /.*\..?ts$/.test(file)) {
|
|
215
|
-
const target =
|
|
212
|
+
const target = joinPaths(targetBaseDir, relativePath, file);
|
|
216
213
|
result.push({ source: filePath, target });
|
|
217
214
|
}
|
|
218
215
|
}),
|
package/src/framework/sample.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { useBinder } from "./hooks/binder.js";
|
|
|
9
9
|
import { resolveReference } from "./reference.js";
|
|
10
10
|
|
|
11
11
|
// Create a new ts-morph project
|
|
12
|
-
const project = new Project();
|
|
12
|
+
const project = new Project({ useInMemoryFileSystem: true });
|
|
13
13
|
|
|
14
14
|
// Create a source file
|
|
15
15
|
const sourceFile = project.createSourceFile("test.ts", "", { overwrite: true });
|