create-fluxstack 1.0.5 → 1.0.7
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/.claude/settings.local.json +2 -1
- package/create-fluxstack.ts +1 -0
- package/package.json +3 -3
- package/ENV_TESTING_REPORT.md +0 -292
- package/FRAMEWORK_ROADMAP.md +0 -183
- package/FRONTEND_TESTS_README.md +0 -287
- package/TEST_RESULTS.md +0 -130
- package/docs/dynamic-environment-variables.md +0 -380
- package/examples/dynamic-env-usage.ts +0 -283
- package/examples/hybrid-env-strategy.ts +0 -212
- package/examples/simplified-env-usage.ts +0 -251
- package/meu-app-teste/README.md +0 -44
- package/meu-app-teste/app/client/README.md +0 -69
- package/meu-app-teste/app/client/frontend-only.ts +0 -12
- package/meu-app-teste/app/client/index.html +0 -13
- package/meu-app-teste/app/client/public/vite.svg +0 -1
- package/meu-app-teste/app/client/src/App.css +0 -883
- package/meu-app-teste/app/client/src/App.tsx +0 -669
- package/meu-app-teste/app/client/src/assets/react.svg +0 -1
- package/meu-app-teste/app/client/src/components/TestPage.tsx +0 -453
- package/meu-app-teste/app/client/src/index.css +0 -51
- package/meu-app-teste/app/client/src/lib/eden-api.ts +0 -110
- package/meu-app-teste/app/client/src/main.tsx +0 -10
- package/meu-app-teste/app/client/src/vite-env.d.ts +0 -1
- package/meu-app-teste/app/client/tsconfig.app.json +0 -43
- package/meu-app-teste/app/client/tsconfig.json +0 -7
- package/meu-app-teste/app/client/tsconfig.node.json +0 -25
- package/meu-app-teste/app/server/app.ts +0 -10
- package/meu-app-teste/app/server/backend-only.ts +0 -15
- package/meu-app-teste/app/server/controllers/users.controller.ts +0 -69
- package/meu-app-teste/app/server/index.ts +0 -104
- package/meu-app-teste/app/server/routes/index.ts +0 -25
- package/meu-app-teste/app/server/routes/users.routes.ts +0 -121
- package/meu-app-teste/app/server/types/index.ts +0 -1
- package/meu-app-teste/app/shared/types/index.ts +0 -18
- package/meu-app-teste/bun.lock +0 -1053
- package/meu-app-teste/core/__tests__/integration.test.ts +0 -227
- package/meu-app-teste/core/build/index.ts +0 -186
- package/meu-app-teste/core/cli/command-registry.ts +0 -334
- package/meu-app-teste/core/cli/index.ts +0 -394
- package/meu-app-teste/core/cli/plugin-discovery.ts +0 -200
- package/meu-app-teste/core/client/standalone.ts +0 -57
- package/meu-app-teste/core/config/__tests__/config-loader.test.ts +0 -591
- package/meu-app-teste/core/config/__tests__/config-merger.test.ts +0 -657
- package/meu-app-teste/core/config/__tests__/env-converter.test.ts +0 -372
- package/meu-app-teste/core/config/__tests__/env-processor.test.ts +0 -431
- package/meu-app-teste/core/config/__tests__/env.test.ts +0 -452
- package/meu-app-teste/core/config/__tests__/integration.test.ts +0 -418
- package/meu-app-teste/core/config/__tests__/loader.test.ts +0 -331
- package/meu-app-teste/core/config/__tests__/schema.test.ts +0 -129
- package/meu-app-teste/core/config/__tests__/validator.test.ts +0 -318
- package/meu-app-teste/core/config/env-dynamic.ts +0 -326
- package/meu-app-teste/core/config/env.ts +0 -597
- package/meu-app-teste/core/config/index.ts +0 -317
- package/meu-app-teste/core/config/loader.ts +0 -546
- package/meu-app-teste/core/config/runtime-config.ts +0 -322
- package/meu-app-teste/core/config/schema.ts +0 -694
- package/meu-app-teste/core/config/validator.ts +0 -540
- package/meu-app-teste/core/framework/__tests__/server.test.ts +0 -233
- package/meu-app-teste/core/framework/client.ts +0 -132
- package/meu-app-teste/core/framework/index.ts +0 -8
- package/meu-app-teste/core/framework/server.ts +0 -501
- package/meu-app-teste/core/framework/types.ts +0 -63
- package/meu-app-teste/core/plugins/__tests__/built-in.test.ts.disabled +0 -366
- package/meu-app-teste/core/plugins/__tests__/manager.test.ts +0 -398
- package/meu-app-teste/core/plugins/__tests__/monitoring.test.ts +0 -401
- package/meu-app-teste/core/plugins/__tests__/registry.test.ts +0 -335
- package/meu-app-teste/core/plugins/built-in/index.ts +0 -142
- package/meu-app-teste/core/plugins/built-in/logger/index.ts +0 -180
- package/meu-app-teste/core/plugins/built-in/monitoring/README.md +0 -193
- package/meu-app-teste/core/plugins/built-in/monitoring/index.ts +0 -912
- package/meu-app-teste/core/plugins/built-in/static/index.ts +0 -289
- package/meu-app-teste/core/plugins/built-in/swagger/index.ts +0 -229
- package/meu-app-teste/core/plugins/built-in/vite/index.ts +0 -316
- package/meu-app-teste/core/plugins/config.ts +0 -348
- package/meu-app-teste/core/plugins/discovery.ts +0 -350
- package/meu-app-teste/core/plugins/executor.ts +0 -351
- package/meu-app-teste/core/plugins/index.ts +0 -195
- package/meu-app-teste/core/plugins/manager.ts +0 -583
- package/meu-app-teste/core/plugins/registry.ts +0 -424
- package/meu-app-teste/core/plugins/types.ts +0 -254
- package/meu-app-teste/core/server/framework.ts +0 -123
- package/meu-app-teste/core/server/index.ts +0 -8
- package/meu-app-teste/core/server/plugins/database.ts +0 -182
- package/meu-app-teste/core/server/plugins/logger.ts +0 -47
- package/meu-app-teste/core/server/plugins/swagger.ts +0 -34
- package/meu-app-teste/core/server/standalone.ts +0 -91
- package/meu-app-teste/core/templates/create-project.ts +0 -455
- package/meu-app-teste/core/types/api.ts +0 -169
- package/meu-app-teste/core/types/build.ts +0 -174
- package/meu-app-teste/core/types/config.ts +0 -68
- package/meu-app-teste/core/types/index.ts +0 -127
- package/meu-app-teste/core/types/plugin.ts +0 -94
- package/meu-app-teste/core/utils/__tests__/errors.test.ts +0 -139
- package/meu-app-teste/core/utils/__tests__/helpers.test.ts +0 -297
- package/meu-app-teste/core/utils/__tests__/logger.test.ts +0 -141
- package/meu-app-teste/core/utils/env-runtime-v2.ts +0 -232
- package/meu-app-teste/core/utils/env-runtime.ts +0 -252
- package/meu-app-teste/core/utils/errors/codes.ts +0 -115
- package/meu-app-teste/core/utils/errors/handlers.ts +0 -63
- package/meu-app-teste/core/utils/errors/index.ts +0 -81
- package/meu-app-teste/core/utils/helpers.ts +0 -180
- package/meu-app-teste/core/utils/index.ts +0 -18
- package/meu-app-teste/core/utils/logger/index.ts +0 -161
- package/meu-app-teste/core/utils/logger.ts +0 -106
- package/meu-app-teste/core/utils/monitoring/index.ts +0 -212
- package/meu-app-teste/package.json +0 -92
- package/meu-app-teste/tsconfig.json +0 -51
- package/meu-app-teste/vite.config.ts +0 -42
- package/my-final-test/README.md +0 -44
- package/my-final-test/app/client/README.md +0 -69
- package/my-final-test/app/client/frontend-only.ts +0 -12
- package/my-final-test/app/client/index.html +0 -13
- package/my-final-test/app/client/public/vite.svg +0 -1
- package/my-final-test/app/client/src/App.css +0 -883
- package/my-final-test/app/client/src/App.tsx +0 -669
- package/my-final-test/app/client/src/assets/react.svg +0 -1
- package/my-final-test/app/client/src/components/TestPage.tsx +0 -453
- package/my-final-test/app/client/src/index.css +0 -51
- package/my-final-test/app/client/src/lib/eden-api.ts +0 -110
- package/my-final-test/app/client/src/main.tsx +0 -10
- package/my-final-test/app/client/src/vite-env.d.ts +0 -1
- package/my-final-test/app/client/tsconfig.app.json +0 -43
- package/my-final-test/app/client/tsconfig.json +0 -7
- package/my-final-test/app/client/tsconfig.node.json +0 -25
- package/my-final-test/app/server/app.ts +0 -10
- package/my-final-test/app/server/backend-only.ts +0 -15
- package/my-final-test/app/server/controllers/users.controller.ts +0 -69
- package/my-final-test/app/server/index.ts +0 -104
- package/my-final-test/app/server/routes/index.ts +0 -25
- package/my-final-test/app/server/routes/users.routes.ts +0 -121
- package/my-final-test/app/server/types/index.ts +0 -1
- package/my-final-test/app/shared/types/index.ts +0 -18
- package/my-final-test/bun.lock +0 -993
- package/my-final-test/core/__tests__/integration.test.ts +0 -227
- package/my-final-test/core/build/index.ts +0 -186
- package/my-final-test/core/cli/command-registry.ts +0 -334
- package/my-final-test/core/cli/index.ts +0 -394
- package/my-final-test/core/cli/plugin-discovery.ts +0 -200
- package/my-final-test/core/client/standalone.ts +0 -57
- package/my-final-test/core/config/__tests__/config-loader.test.ts +0 -591
- package/my-final-test/core/config/__tests__/config-merger.test.ts +0 -657
- package/my-final-test/core/config/__tests__/env-converter.test.ts +0 -372
- package/my-final-test/core/config/__tests__/env-processor.test.ts +0 -431
- package/my-final-test/core/config/__tests__/env.test.ts +0 -452
- package/my-final-test/core/config/__tests__/integration.test.ts +0 -418
- package/my-final-test/core/config/__tests__/loader.test.ts +0 -331
- package/my-final-test/core/config/__tests__/schema.test.ts +0 -129
- package/my-final-test/core/config/__tests__/validator.test.ts +0 -318
- package/my-final-test/core/config/env-dynamic.ts +0 -326
- package/my-final-test/core/config/env.ts +0 -597
- package/my-final-test/core/config/index.ts +0 -317
- package/my-final-test/core/config/loader.ts +0 -546
- package/my-final-test/core/config/runtime-config.ts +0 -322
- package/my-final-test/core/config/schema.ts +0 -694
- package/my-final-test/core/config/validator.ts +0 -540
- package/my-final-test/core/framework/__tests__/server.test.ts +0 -233
- package/my-final-test/core/framework/client.ts +0 -132
- package/my-final-test/core/framework/index.ts +0 -8
- package/my-final-test/core/framework/server.ts +0 -501
- package/my-final-test/core/framework/types.ts +0 -63
- package/my-final-test/core/plugins/__tests__/built-in.test.ts.disabled +0 -366
- package/my-final-test/core/plugins/__tests__/manager.test.ts +0 -398
- package/my-final-test/core/plugins/__tests__/monitoring.test.ts +0 -401
- package/my-final-test/core/plugins/__tests__/registry.test.ts +0 -335
- package/my-final-test/core/plugins/built-in/index.ts +0 -142
- package/my-final-test/core/plugins/built-in/logger/index.ts +0 -180
- package/my-final-test/core/plugins/built-in/monitoring/README.md +0 -193
- package/my-final-test/core/plugins/built-in/monitoring/index.ts +0 -912
- package/my-final-test/core/plugins/built-in/static/index.ts +0 -289
- package/my-final-test/core/plugins/built-in/swagger/index.ts +0 -229
- package/my-final-test/core/plugins/built-in/vite/index.ts +0 -316
- package/my-final-test/core/plugins/config.ts +0 -348
- package/my-final-test/core/plugins/discovery.ts +0 -350
- package/my-final-test/core/plugins/executor.ts +0 -351
- package/my-final-test/core/plugins/index.ts +0 -195
- package/my-final-test/core/plugins/manager.ts +0 -583
- package/my-final-test/core/plugins/registry.ts +0 -424
- package/my-final-test/core/plugins/types.ts +0 -254
- package/my-final-test/core/server/framework.ts +0 -123
- package/my-final-test/core/server/index.ts +0 -8
- package/my-final-test/core/server/plugins/database.ts +0 -182
- package/my-final-test/core/server/plugins/logger.ts +0 -47
- package/my-final-test/core/server/plugins/swagger.ts +0 -34
- package/my-final-test/core/server/standalone.ts +0 -91
- package/my-final-test/core/templates/create-project.ts +0 -455
- package/my-final-test/core/types/api.ts +0 -169
- package/my-final-test/core/types/build.ts +0 -174
- package/my-final-test/core/types/config.ts +0 -68
- package/my-final-test/core/types/index.ts +0 -127
- package/my-final-test/core/types/plugin.ts +0 -94
- package/my-final-test/core/utils/__tests__/errors.test.ts +0 -139
- package/my-final-test/core/utils/__tests__/helpers.test.ts +0 -297
- package/my-final-test/core/utils/__tests__/logger.test.ts +0 -141
- package/my-final-test/core/utils/env-runtime-v2.ts +0 -232
- package/my-final-test/core/utils/env-runtime.ts +0 -252
- package/my-final-test/core/utils/errors/codes.ts +0 -115
- package/my-final-test/core/utils/errors/handlers.ts +0 -63
- package/my-final-test/core/utils/errors/index.ts +0 -81
- package/my-final-test/core/utils/helpers.ts +0 -180
- package/my-final-test/core/utils/index.ts +0 -18
- package/my-final-test/core/utils/logger/index.ts +0 -161
- package/my-final-test/core/utils/logger.ts +0 -106
- package/my-final-test/core/utils/monitoring/index.ts +0 -212
- package/my-final-test/package.json +0 -68
- package/my-final-test/tsconfig.json +0 -51
- package/my-final-test/vite.config.ts +0 -42
- package/publish-setup.md +0 -111
- package/teste-corrigido/README.md +0 -44
- package/teste-corrigido/app/client/README.md +0 -69
- package/teste-corrigido/app/client/frontend-only.ts +0 -12
- package/teste-corrigido/app/client/index.html +0 -13
- package/teste-corrigido/app/client/public/vite.svg +0 -1
- package/teste-corrigido/app/client/src/App.css +0 -883
- package/teste-corrigido/app/client/src/App.tsx +0 -669
- package/teste-corrigido/app/client/src/assets/react.svg +0 -1
- package/teste-corrigido/app/client/src/components/TestPage.tsx +0 -453
- package/teste-corrigido/app/client/src/index.css +0 -51
- package/teste-corrigido/app/client/src/lib/eden-api.ts +0 -110
- package/teste-corrigido/app/client/src/main.tsx +0 -10
- package/teste-corrigido/app/client/src/vite-env.d.ts +0 -1
- package/teste-corrigido/app/client/tsconfig.app.json +0 -43
- package/teste-corrigido/app/client/tsconfig.json +0 -7
- package/teste-corrigido/app/client/tsconfig.node.json +0 -25
- package/teste-corrigido/app/server/app.ts +0 -10
- package/teste-corrigido/app/server/backend-only.ts +0 -15
- package/teste-corrigido/app/server/controllers/users.controller.ts +0 -69
- package/teste-corrigido/app/server/index.ts +0 -104
- package/teste-corrigido/app/server/routes/index.ts +0 -25
- package/teste-corrigido/app/server/routes/users.routes.ts +0 -121
- package/teste-corrigido/app/server/types/index.ts +0 -1
- package/teste-corrigido/app/shared/types/index.ts +0 -18
- package/teste-corrigido/bun.lock +0 -1053
- package/teste-corrigido/core/__tests__/integration.test.ts +0 -227
- package/teste-corrigido/core/build/index.ts +0 -186
- package/teste-corrigido/core/cli/command-registry.ts +0 -334
- package/teste-corrigido/core/cli/index.ts +0 -394
- package/teste-corrigido/core/cli/plugin-discovery.ts +0 -200
- package/teste-corrigido/core/client/standalone.ts +0 -57
- package/teste-corrigido/core/config/__tests__/config-loader.test.ts +0 -591
- package/teste-corrigido/core/config/__tests__/config-merger.test.ts +0 -657
- package/teste-corrigido/core/config/__tests__/env-converter.test.ts +0 -372
- package/teste-corrigido/core/config/__tests__/env-processor.test.ts +0 -431
- package/teste-corrigido/core/config/__tests__/env.test.ts +0 -452
- package/teste-corrigido/core/config/__tests__/integration.test.ts +0 -418
- package/teste-corrigido/core/config/__tests__/loader.test.ts +0 -331
- package/teste-corrigido/core/config/__tests__/schema.test.ts +0 -129
- package/teste-corrigido/core/config/__tests__/validator.test.ts +0 -318
- package/teste-corrigido/core/config/env-dynamic.ts +0 -326
- package/teste-corrigido/core/config/env.ts +0 -597
- package/teste-corrigido/core/config/index.ts +0 -317
- package/teste-corrigido/core/config/loader.ts +0 -546
- package/teste-corrigido/core/config/runtime-config.ts +0 -322
- package/teste-corrigido/core/config/schema.ts +0 -694
- package/teste-corrigido/core/config/validator.ts +0 -540
- package/teste-corrigido/core/framework/__tests__/server.test.ts +0 -233
- package/teste-corrigido/core/framework/client.ts +0 -132
- package/teste-corrigido/core/framework/index.ts +0 -8
- package/teste-corrigido/core/framework/server.ts +0 -501
- package/teste-corrigido/core/framework/types.ts +0 -63
- package/teste-corrigido/core/plugins/__tests__/built-in.test.ts.disabled +0 -366
- package/teste-corrigido/core/plugins/__tests__/manager.test.ts +0 -398
- package/teste-corrigido/core/plugins/__tests__/monitoring.test.ts +0 -401
- package/teste-corrigido/core/plugins/__tests__/registry.test.ts +0 -335
- package/teste-corrigido/core/plugins/built-in/index.ts +0 -142
- package/teste-corrigido/core/plugins/built-in/logger/index.ts +0 -180
- package/teste-corrigido/core/plugins/built-in/monitoring/README.md +0 -193
- package/teste-corrigido/core/plugins/built-in/monitoring/index.ts +0 -912
- package/teste-corrigido/core/plugins/built-in/static/index.ts +0 -289
- package/teste-corrigido/core/plugins/built-in/swagger/index.ts +0 -229
- package/teste-corrigido/core/plugins/built-in/vite/index.ts +0 -316
- package/teste-corrigido/core/plugins/config.ts +0 -348
- package/teste-corrigido/core/plugins/discovery.ts +0 -350
- package/teste-corrigido/core/plugins/executor.ts +0 -351
- package/teste-corrigido/core/plugins/index.ts +0 -195
- package/teste-corrigido/core/plugins/manager.ts +0 -583
- package/teste-corrigido/core/plugins/registry.ts +0 -424
- package/teste-corrigido/core/plugins/types.ts +0 -254
- package/teste-corrigido/core/server/framework.ts +0 -123
- package/teste-corrigido/core/server/index.ts +0 -8
- package/teste-corrigido/core/server/plugins/database.ts +0 -182
- package/teste-corrigido/core/server/plugins/logger.ts +0 -47
- package/teste-corrigido/core/server/plugins/swagger.ts +0 -34
- package/teste-corrigido/core/server/standalone.ts +0 -91
- package/teste-corrigido/core/templates/create-project.ts +0 -455
- package/teste-corrigido/core/types/api.ts +0 -169
- package/teste-corrigido/core/types/build.ts +0 -174
- package/teste-corrigido/core/types/config.ts +0 -68
- package/teste-corrigido/core/types/index.ts +0 -127
- package/teste-corrigido/core/types/plugin.ts +0 -94
- package/teste-corrigido/core/utils/__tests__/errors.test.ts +0 -139
- package/teste-corrigido/core/utils/__tests__/helpers.test.ts +0 -297
- package/teste-corrigido/core/utils/__tests__/logger.test.ts +0 -141
- package/teste-corrigido/core/utils/env-runtime-v2.ts +0 -232
- package/teste-corrigido/core/utils/env-runtime.ts +0 -252
- package/teste-corrigido/core/utils/errors/codes.ts +0 -115
- package/teste-corrigido/core/utils/errors/handlers.ts +0 -63
- package/teste-corrigido/core/utils/errors/index.ts +0 -81
- package/teste-corrigido/core/utils/helpers.ts +0 -180
- package/teste-corrigido/core/utils/index.ts +0 -18
- package/teste-corrigido/core/utils/logger/index.ts +0 -161
- package/teste-corrigido/core/utils/logger.ts +0 -106
- package/teste-corrigido/core/utils/monitoring/index.ts +0 -212
- package/teste-corrigido/package-template.json +0 -51
- package/teste-corrigido/package.json +0 -51
- package/teste-corrigido/tsconfig.json +0 -51
- package/teste-corrigido/vite.config.ts +0 -42
- package/teste-final-npm/README.md +0 -44
- package/teste-final-npm/app/client/README.md +0 -69
- package/teste-final-npm/app/client/frontend-only.ts +0 -12
- package/teste-final-npm/app/client/index.html +0 -13
- package/teste-final-npm/app/client/public/vite.svg +0 -1
- package/teste-final-npm/app/client/src/App.css +0 -883
- package/teste-final-npm/app/client/src/App.tsx +0 -669
- package/teste-final-npm/app/client/src/assets/react.svg +0 -1
- package/teste-final-npm/app/client/src/components/TestPage.tsx +0 -453
- package/teste-final-npm/app/client/src/index.css +0 -51
- package/teste-final-npm/app/client/src/lib/eden-api.ts +0 -110
- package/teste-final-npm/app/client/src/main.tsx +0 -10
- package/teste-final-npm/app/client/src/vite-env.d.ts +0 -1
- package/teste-final-npm/app/client/tsconfig.app.json +0 -43
- package/teste-final-npm/app/client/tsconfig.json +0 -7
- package/teste-final-npm/app/client/tsconfig.node.json +0 -25
- package/teste-final-npm/app/server/app.ts +0 -10
- package/teste-final-npm/app/server/backend-only.ts +0 -15
- package/teste-final-npm/app/server/controllers/users.controller.ts +0 -69
- package/teste-final-npm/app/server/index.ts +0 -104
- package/teste-final-npm/app/server/routes/index.ts +0 -25
- package/teste-final-npm/app/server/routes/users.routes.ts +0 -121
- package/teste-final-npm/app/server/types/index.ts +0 -1
- package/teste-final-npm/app/shared/types/index.ts +0 -18
- package/teste-final-npm/bun.lock +0 -1053
- package/teste-final-npm/core/__tests__/integration.test.ts +0 -227
- package/teste-final-npm/core/build/index.ts +0 -186
- package/teste-final-npm/core/cli/command-registry.ts +0 -334
- package/teste-final-npm/core/cli/index.ts +0 -394
- package/teste-final-npm/core/cli/plugin-discovery.ts +0 -200
- package/teste-final-npm/core/client/standalone.ts +0 -57
- package/teste-final-npm/core/config/__tests__/config-loader.test.ts +0 -591
- package/teste-final-npm/core/config/__tests__/config-merger.test.ts +0 -657
- package/teste-final-npm/core/config/__tests__/env-converter.test.ts +0 -372
- package/teste-final-npm/core/config/__tests__/env-processor.test.ts +0 -431
- package/teste-final-npm/core/config/__tests__/env.test.ts +0 -452
- package/teste-final-npm/core/config/__tests__/integration.test.ts +0 -418
- package/teste-final-npm/core/config/__tests__/loader.test.ts +0 -331
- package/teste-final-npm/core/config/__tests__/schema.test.ts +0 -129
- package/teste-final-npm/core/config/__tests__/validator.test.ts +0 -318
- package/teste-final-npm/core/config/env-dynamic.ts +0 -326
- package/teste-final-npm/core/config/env.ts +0 -597
- package/teste-final-npm/core/config/index.ts +0 -317
- package/teste-final-npm/core/config/loader.ts +0 -546
- package/teste-final-npm/core/config/runtime-config.ts +0 -322
- package/teste-final-npm/core/config/schema.ts +0 -694
- package/teste-final-npm/core/config/validator.ts +0 -540
- package/teste-final-npm/core/framework/__tests__/server.test.ts +0 -233
- package/teste-final-npm/core/framework/client.ts +0 -132
- package/teste-final-npm/core/framework/index.ts +0 -8
- package/teste-final-npm/core/framework/server.ts +0 -501
- package/teste-final-npm/core/framework/types.ts +0 -63
- package/teste-final-npm/core/plugins/__tests__/built-in.test.ts.disabled +0 -366
- package/teste-final-npm/core/plugins/__tests__/manager.test.ts +0 -398
- package/teste-final-npm/core/plugins/__tests__/monitoring.test.ts +0 -401
- package/teste-final-npm/core/plugins/__tests__/registry.test.ts +0 -335
- package/teste-final-npm/core/plugins/built-in/index.ts +0 -142
- package/teste-final-npm/core/plugins/built-in/logger/index.ts +0 -180
- package/teste-final-npm/core/plugins/built-in/monitoring/README.md +0 -193
- package/teste-final-npm/core/plugins/built-in/monitoring/index.ts +0 -912
- package/teste-final-npm/core/plugins/built-in/static/index.ts +0 -289
- package/teste-final-npm/core/plugins/built-in/swagger/index.ts +0 -229
- package/teste-final-npm/core/plugins/built-in/vite/index.ts +0 -316
- package/teste-final-npm/core/plugins/config.ts +0 -348
- package/teste-final-npm/core/plugins/discovery.ts +0 -350
- package/teste-final-npm/core/plugins/executor.ts +0 -351
- package/teste-final-npm/core/plugins/index.ts +0 -195
- package/teste-final-npm/core/plugins/manager.ts +0 -583
- package/teste-final-npm/core/plugins/registry.ts +0 -424
- package/teste-final-npm/core/plugins/types.ts +0 -254
- package/teste-final-npm/core/server/framework.ts +0 -123
- package/teste-final-npm/core/server/index.ts +0 -8
- package/teste-final-npm/core/server/plugins/database.ts +0 -182
- package/teste-final-npm/core/server/plugins/logger.ts +0 -47
- package/teste-final-npm/core/server/plugins/swagger.ts +0 -34
- package/teste-final-npm/core/server/standalone.ts +0 -91
- package/teste-final-npm/core/templates/create-project.ts +0 -455
- package/teste-final-npm/core/types/api.ts +0 -169
- package/teste-final-npm/core/types/build.ts +0 -174
- package/teste-final-npm/core/types/config.ts +0 -68
- package/teste-final-npm/core/types/index.ts +0 -127
- package/teste-final-npm/core/types/plugin.ts +0 -94
- package/teste-final-npm/core/utils/__tests__/errors.test.ts +0 -139
- package/teste-final-npm/core/utils/__tests__/helpers.test.ts +0 -297
- package/teste-final-npm/core/utils/__tests__/logger.test.ts +0 -141
- package/teste-final-npm/core/utils/env-runtime-v2.ts +0 -232
- package/teste-final-npm/core/utils/env-runtime.ts +0 -252
- package/teste-final-npm/core/utils/errors/codes.ts +0 -115
- package/teste-final-npm/core/utils/errors/handlers.ts +0 -63
- package/teste-final-npm/core/utils/errors/index.ts +0 -81
- package/teste-final-npm/core/utils/helpers.ts +0 -180
- package/teste-final-npm/core/utils/index.ts +0 -18
- package/teste-final-npm/core/utils/logger/index.ts +0 -161
- package/teste-final-npm/core/utils/logger.ts +0 -106
- package/teste-final-npm/core/utils/monitoring/index.ts +0 -212
- package/teste-final-npm/package-template.json +0 -51
- package/teste-final-npm/package.json +0 -51
- package/teste-final-npm/tsconfig.json +0 -51
- package/teste-final-npm/vite.config.ts +0 -42
|
@@ -1,591 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests for Configuration Loader
|
|
3
|
-
* Tests the main configuration loading system, including file loading, caching, and fallbacks
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { describe, test, expect, beforeEach, afterEach, vi } from 'vitest'
|
|
7
|
-
import {
|
|
8
|
-
getConfig,
|
|
9
|
-
getConfigSync,
|
|
10
|
-
reloadConfig,
|
|
11
|
-
createPluginConfig,
|
|
12
|
-
isFeatureEnabled,
|
|
13
|
-
createLegacyConfig
|
|
14
|
-
} from '../index'
|
|
15
|
-
import type { FluxStackConfig } from '../schema'
|
|
16
|
-
|
|
17
|
-
// Mock file system operations
|
|
18
|
-
vi.mock('fs', () => ({
|
|
19
|
-
existsSync: vi.fn(),
|
|
20
|
-
promises: {
|
|
21
|
-
readFile: vi.fn(),
|
|
22
|
-
access: vi.fn()
|
|
23
|
-
}
|
|
24
|
-
}))
|
|
25
|
-
|
|
26
|
-
vi.mock('fs/promises', () => ({
|
|
27
|
-
readFile: vi.fn(),
|
|
28
|
-
access: vi.fn()
|
|
29
|
-
}))
|
|
30
|
-
|
|
31
|
-
describe('Configuration Loader', () => {
|
|
32
|
-
let originalEnv: NodeJS.ProcessEnv
|
|
33
|
-
|
|
34
|
-
beforeEach(() => {
|
|
35
|
-
originalEnv = { ...process.env }
|
|
36
|
-
// Clear relevant environment variables
|
|
37
|
-
for (const key in process.env) {
|
|
38
|
-
if (key.startsWith('FLUXSTACK_') || key.startsWith('PORT') || key.startsWith('HOST') ||
|
|
39
|
-
key.startsWith('NODE_ENV')) {
|
|
40
|
-
delete process.env[key]
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Clear any cached configurations
|
|
45
|
-
vi.clearAllMocks()
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
afterEach(() => {
|
|
49
|
-
process.env = originalEnv
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
describe('getConfigSync', () => {
|
|
53
|
-
test('loads configuration from environment variables', () => {
|
|
54
|
-
process.env.PORT = '4000'
|
|
55
|
-
process.env.HOST = 'example.com'
|
|
56
|
-
process.env.LOG_LEVEL = 'debug'
|
|
57
|
-
process.env.NODE_ENV = 'production'
|
|
58
|
-
|
|
59
|
-
const config = getConfigSync()
|
|
60
|
-
|
|
61
|
-
expect(config.server?.port).toBe(4000)
|
|
62
|
-
expect(config.server?.host).toBe('example.com')
|
|
63
|
-
expect(config.logging?.level).toBe('debug')
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
test('applies environment defaults based on NODE_ENV', () => {
|
|
67
|
-
process.env.NODE_ENV = 'production'
|
|
68
|
-
|
|
69
|
-
const config = getConfigSync()
|
|
70
|
-
|
|
71
|
-
// Should apply production defaults
|
|
72
|
-
expect(config.build?.optimization?.minify).toBe(true)
|
|
73
|
-
expect(config.monitoring?.enabled).toBe(true)
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
test('uses development defaults when NODE_ENV not set', () => {
|
|
77
|
-
delete process.env.NODE_ENV
|
|
78
|
-
|
|
79
|
-
const config = getConfigSync()
|
|
80
|
-
|
|
81
|
-
// Should apply development defaults
|
|
82
|
-
expect(config.build?.optimization?.minify).toBe(false)
|
|
83
|
-
expect(config.monitoring?.enabled).toBe(false)
|
|
84
|
-
})
|
|
85
|
-
|
|
86
|
-
test('handles custom environment variables with FluxStack prefix', () => {
|
|
87
|
-
process.env.FLUXSTACK_PORT = '5000'
|
|
88
|
-
process.env.FLUXSTACK_API_PREFIX = '/v2'
|
|
89
|
-
process.env.FLUXSTACK_LOG_LEVEL = 'error'
|
|
90
|
-
|
|
91
|
-
// Force reload config to pick up new env vars
|
|
92
|
-
reloadConfig()
|
|
93
|
-
const config = getConfigSync()
|
|
94
|
-
|
|
95
|
-
expect(config.server?.port).toBe(5000)
|
|
96
|
-
expect(config.server?.apiPrefix).toBe('/v2')
|
|
97
|
-
expect(config.logging?.level).toBe('error')
|
|
98
|
-
})
|
|
99
|
-
|
|
100
|
-
test('merges CORS configuration from environment', () => {
|
|
101
|
-
process.env.CORS_ORIGINS = 'http://localhost:3000,https://example.com'
|
|
102
|
-
process.env.CORS_METHODS = 'GET,POST,DELETE'
|
|
103
|
-
process.env.CORS_CREDENTIALS = 'true'
|
|
104
|
-
|
|
105
|
-
const config = getConfigSync()
|
|
106
|
-
|
|
107
|
-
expect(config.server?.cors?.origins).toEqual(['http://localhost:3000', 'https://example.com'])
|
|
108
|
-
expect(config.server?.cors?.methods).toEqual(['GET', 'POST', 'DELETE'])
|
|
109
|
-
expect(config.server?.cors?.credentials).toBe(true)
|
|
110
|
-
})
|
|
111
|
-
|
|
112
|
-
test('handles database configuration from environment', () => {
|
|
113
|
-
process.env.DATABASE_URL = 'postgresql://user:pass@localhost:5432/db'
|
|
114
|
-
process.env.DATABASE_HOST = 'db.example.com'
|
|
115
|
-
process.env.DATABASE_PORT = '5433'
|
|
116
|
-
process.env.DATABASE_SSL = 'true'
|
|
117
|
-
|
|
118
|
-
const config = getConfigSync()
|
|
119
|
-
|
|
120
|
-
expect(config.database?.url).toBe('postgresql://user:pass@localhost:5432/db')
|
|
121
|
-
expect(config.database?.host).toBe('db.example.com')
|
|
122
|
-
expect(config.database?.port).toBe(5433)
|
|
123
|
-
expect(config.database?.ssl).toBe(true)
|
|
124
|
-
})
|
|
125
|
-
|
|
126
|
-
test('handles authentication configuration', () => {
|
|
127
|
-
process.env.JWT_SECRET = 'my-secret-key'
|
|
128
|
-
process.env.JWT_EXPIRES_IN = '7d'
|
|
129
|
-
process.env.JWT_ALGORITHM = 'HS256'
|
|
130
|
-
|
|
131
|
-
const config = getConfigSync()
|
|
132
|
-
|
|
133
|
-
expect(config.auth?.secret).toBe('my-secret-key')
|
|
134
|
-
expect(config.auth?.expiresIn).toBe('7d')
|
|
135
|
-
expect(config.auth?.algorithm).toBe('HS256')
|
|
136
|
-
})
|
|
137
|
-
|
|
138
|
-
test('handles email configuration', () => {
|
|
139
|
-
process.env.SMTP_HOST = 'smtp.gmail.com'
|
|
140
|
-
process.env.SMTP_PORT = '587'
|
|
141
|
-
process.env.SMTP_USER = 'user@example.com'
|
|
142
|
-
process.env.SMTP_SECURE = 'true'
|
|
143
|
-
|
|
144
|
-
const config = getConfigSync()
|
|
145
|
-
|
|
146
|
-
expect(config.email?.host).toBe('smtp.gmail.com')
|
|
147
|
-
expect(config.email?.port).toBe(587)
|
|
148
|
-
expect(config.email?.user).toBe('user@example.com')
|
|
149
|
-
expect(config.email?.secure).toBe(true)
|
|
150
|
-
})
|
|
151
|
-
|
|
152
|
-
test('handles monitoring configuration', () => {
|
|
153
|
-
process.env.MONITORING_ENABLED = 'true'
|
|
154
|
-
process.env.METRICS_ENABLED = 'false'
|
|
155
|
-
process.env.METRICS_INTERVAL = '30000'
|
|
156
|
-
process.env.PROFILING_ENABLED = 'true'
|
|
157
|
-
|
|
158
|
-
const config = getConfigSync()
|
|
159
|
-
|
|
160
|
-
expect(config.monitoring?.enabled).toBe(true)
|
|
161
|
-
expect(config.monitoring?.metrics?.enabled).toBe(false)
|
|
162
|
-
expect(config.monitoring?.metrics?.collectInterval).toBe(30000)
|
|
163
|
-
expect(config.monitoring?.profiling?.enabled).toBe(true)
|
|
164
|
-
})
|
|
165
|
-
|
|
166
|
-
test('handles build configuration', () => {
|
|
167
|
-
process.env.BUILD_TARGET = 'docker'
|
|
168
|
-
process.env.BUILD_OUTDIR = 'build'
|
|
169
|
-
process.env.BUILD_MINIFY = 'true'
|
|
170
|
-
process.env.BUILD_SOURCEMAPS = 'false'
|
|
171
|
-
|
|
172
|
-
reloadConfig()
|
|
173
|
-
const config = getConfigSync()
|
|
174
|
-
|
|
175
|
-
expect(config.build?.target).toBe('docker')
|
|
176
|
-
expect(config.build?.outDir).toBe('build')
|
|
177
|
-
expect(config.build?.optimization?.minify).toBe(true)
|
|
178
|
-
expect(config.build?.sourceMaps).toBe(false)
|
|
179
|
-
})
|
|
180
|
-
|
|
181
|
-
test('handles plugin configuration', () => {
|
|
182
|
-
process.env.FLUXSTACK_PLUGINS_ENABLED = 'plugin1,plugin2,plugin3'
|
|
183
|
-
process.env.FLUXSTACK_PLUGINS_DISABLED = 'plugin4'
|
|
184
|
-
|
|
185
|
-
reloadConfig()
|
|
186
|
-
const config = getConfigSync()
|
|
187
|
-
|
|
188
|
-
expect(config.plugins?.enabled).toEqual(['plugin1', 'plugin2', 'plugin3'])
|
|
189
|
-
expect(config.plugins?.disabled).toEqual(['plugin4'])
|
|
190
|
-
})
|
|
191
|
-
})
|
|
192
|
-
|
|
193
|
-
describe('createPluginConfig', () => {
|
|
194
|
-
test('creates plugin configuration from main config', () => {
|
|
195
|
-
const mainConfig: FluxStackConfig = {
|
|
196
|
-
app: { name: 'TestApp', version: '1.0.0' },
|
|
197
|
-
server: {
|
|
198
|
-
port: 3000,
|
|
199
|
-
host: 'localhost',
|
|
200
|
-
apiPrefix: '/api',
|
|
201
|
-
cors: {
|
|
202
|
-
origins: ['*'],
|
|
203
|
-
methods: ['GET', 'POST'],
|
|
204
|
-
headers: ['Content-Type'],
|
|
205
|
-
credentials: false,
|
|
206
|
-
maxAge: 86400
|
|
207
|
-
},
|
|
208
|
-
middleware: []
|
|
209
|
-
},
|
|
210
|
-
client: {
|
|
211
|
-
port: 5173,
|
|
212
|
-
proxy: { target: 'http://localhost:3000' },
|
|
213
|
-
build: {
|
|
214
|
-
target: 'es2020',
|
|
215
|
-
outDir: 'dist/client',
|
|
216
|
-
sourceMaps: true,
|
|
217
|
-
minify: false
|
|
218
|
-
}
|
|
219
|
-
},
|
|
220
|
-
build: {
|
|
221
|
-
target: 'bun',
|
|
222
|
-
outDir: 'dist',
|
|
223
|
-
clean: true,
|
|
224
|
-
optimization: {
|
|
225
|
-
minify: false,
|
|
226
|
-
compress: false,
|
|
227
|
-
treeshake: false,
|
|
228
|
-
splitChunks: false,
|
|
229
|
-
bundleAnalyzer: false
|
|
230
|
-
},
|
|
231
|
-
sourceMaps: true
|
|
232
|
-
},
|
|
233
|
-
logging: {
|
|
234
|
-
level: 'info',
|
|
235
|
-
format: 'pretty',
|
|
236
|
-
transports: [
|
|
237
|
-
{ type: 'console', level: 'info', format: 'pretty' }
|
|
238
|
-
]
|
|
239
|
-
},
|
|
240
|
-
monitoring: {
|
|
241
|
-
enabled: false,
|
|
242
|
-
metrics: {
|
|
243
|
-
enabled: false,
|
|
244
|
-
collectInterval: 60000,
|
|
245
|
-
httpMetrics: true,
|
|
246
|
-
systemMetrics: true,
|
|
247
|
-
customMetrics: false
|
|
248
|
-
},
|
|
249
|
-
profiling: {
|
|
250
|
-
enabled: false,
|
|
251
|
-
sampleRate: 0.1,
|
|
252
|
-
memoryProfiling: false,
|
|
253
|
-
cpuProfiling: false
|
|
254
|
-
},
|
|
255
|
-
exporters: []
|
|
256
|
-
},
|
|
257
|
-
plugins: {
|
|
258
|
-
enabled: [],
|
|
259
|
-
disabled: [],
|
|
260
|
-
config: {
|
|
261
|
-
vite: {
|
|
262
|
-
port: 5174,
|
|
263
|
-
enabled: true
|
|
264
|
-
},
|
|
265
|
-
logger: {
|
|
266
|
-
logRequests: true,
|
|
267
|
-
logResponses: false
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
},
|
|
271
|
-
custom: {
|
|
272
|
-
myPlugin: {
|
|
273
|
-
customSetting: 'value'
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
} as FluxStackConfig
|
|
277
|
-
|
|
278
|
-
// Test plugin config from plugins.config
|
|
279
|
-
const viteConfig = createPluginConfig(mainConfig, 'vite')
|
|
280
|
-
expect(viteConfig).toEqual({
|
|
281
|
-
port: 5174,
|
|
282
|
-
enabled: true
|
|
283
|
-
})
|
|
284
|
-
|
|
285
|
-
// Test plugin config from custom section
|
|
286
|
-
const myPluginConfig = createPluginConfig(mainConfig, 'myPlugin')
|
|
287
|
-
expect(myPluginConfig).toEqual({
|
|
288
|
-
customSetting: 'value'
|
|
289
|
-
})
|
|
290
|
-
|
|
291
|
-
// Test merging both sections
|
|
292
|
-
const combinedConfig: FluxStackConfig = {
|
|
293
|
-
...mainConfig,
|
|
294
|
-
plugins: {
|
|
295
|
-
...mainConfig.plugins,
|
|
296
|
-
config: {
|
|
297
|
-
...mainConfig.plugins.config,
|
|
298
|
-
myPlugin: {
|
|
299
|
-
baseSetting: 'base'
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
const mergedConfig = createPluginConfig(combinedConfig, 'myPlugin')
|
|
306
|
-
expect(mergedConfig).toEqual({
|
|
307
|
-
baseSetting: 'base',
|
|
308
|
-
customSetting: 'value' // custom should override plugins.config
|
|
309
|
-
})
|
|
310
|
-
})
|
|
311
|
-
|
|
312
|
-
test('returns empty object for non-existent plugin', () => {
|
|
313
|
-
const mainConfig: FluxStackConfig = {
|
|
314
|
-
app: { name: 'TestApp', version: '1.0.0' },
|
|
315
|
-
server: {
|
|
316
|
-
port: 3000,
|
|
317
|
-
host: 'localhost',
|
|
318
|
-
apiPrefix: '/api',
|
|
319
|
-
cors: {
|
|
320
|
-
origins: ['*'],
|
|
321
|
-
methods: ['GET', 'POST'],
|
|
322
|
-
headers: ['Content-Type'],
|
|
323
|
-
credentials: false,
|
|
324
|
-
maxAge: 86400
|
|
325
|
-
},
|
|
326
|
-
middleware: []
|
|
327
|
-
},
|
|
328
|
-
client: {
|
|
329
|
-
port: 5173,
|
|
330
|
-
proxy: { target: 'http://localhost:3000' },
|
|
331
|
-
build: {
|
|
332
|
-
target: 'es2020',
|
|
333
|
-
outDir: 'dist/client',
|
|
334
|
-
sourceMaps: true,
|
|
335
|
-
minify: false
|
|
336
|
-
}
|
|
337
|
-
},
|
|
338
|
-
build: {
|
|
339
|
-
target: 'bun',
|
|
340
|
-
outDir: 'dist',
|
|
341
|
-
clean: true,
|
|
342
|
-
optimization: {
|
|
343
|
-
minify: false,
|
|
344
|
-
compress: false,
|
|
345
|
-
treeshake: false,
|
|
346
|
-
splitChunks: false,
|
|
347
|
-
bundleAnalyzer: false
|
|
348
|
-
},
|
|
349
|
-
sourceMaps: true
|
|
350
|
-
},
|
|
351
|
-
logging: {
|
|
352
|
-
level: 'info',
|
|
353
|
-
format: 'pretty',
|
|
354
|
-
transports: [
|
|
355
|
-
{ type: 'console', level: 'info', format: 'pretty' }
|
|
356
|
-
]
|
|
357
|
-
},
|
|
358
|
-
monitoring: {
|
|
359
|
-
enabled: false,
|
|
360
|
-
metrics: {
|
|
361
|
-
enabled: false,
|
|
362
|
-
collectInterval: 60000,
|
|
363
|
-
httpMetrics: true,
|
|
364
|
-
systemMetrics: true,
|
|
365
|
-
customMetrics: false
|
|
366
|
-
},
|
|
367
|
-
profiling: {
|
|
368
|
-
enabled: false,
|
|
369
|
-
sampleRate: 0.1,
|
|
370
|
-
memoryProfiling: false,
|
|
371
|
-
cpuProfiling: false
|
|
372
|
-
},
|
|
373
|
-
exporters: []
|
|
374
|
-
},
|
|
375
|
-
plugins: {
|
|
376
|
-
enabled: [],
|
|
377
|
-
disabled: [],
|
|
378
|
-
config: {}
|
|
379
|
-
}
|
|
380
|
-
} as FluxStackConfig
|
|
381
|
-
|
|
382
|
-
const config = createPluginConfig(mainConfig, 'nonexistent')
|
|
383
|
-
expect(config).toEqual({})
|
|
384
|
-
})
|
|
385
|
-
})
|
|
386
|
-
|
|
387
|
-
describe('isFeatureEnabled', () => {
|
|
388
|
-
test('checks if feature is enabled in plugins', () => {
|
|
389
|
-
const config: FluxStackConfig = {
|
|
390
|
-
app: { name: 'TestApp', version: '1.0.0' },
|
|
391
|
-
server: {
|
|
392
|
-
port: 3000,
|
|
393
|
-
host: 'localhost',
|
|
394
|
-
apiPrefix: '/api',
|
|
395
|
-
cors: {
|
|
396
|
-
origins: ['*'],
|
|
397
|
-
methods: ['GET', 'POST'],
|
|
398
|
-
headers: ['Content-Type'],
|
|
399
|
-
credentials: false,
|
|
400
|
-
maxAge: 86400
|
|
401
|
-
},
|
|
402
|
-
middleware: []
|
|
403
|
-
},
|
|
404
|
-
client: {
|
|
405
|
-
port: 5173,
|
|
406
|
-
proxy: { target: 'http://localhost:3000' },
|
|
407
|
-
build: {
|
|
408
|
-
target: 'es2020',
|
|
409
|
-
outDir: 'dist/client',
|
|
410
|
-
sourceMaps: true,
|
|
411
|
-
minify: false
|
|
412
|
-
}
|
|
413
|
-
},
|
|
414
|
-
build: {
|
|
415
|
-
target: 'bun',
|
|
416
|
-
outDir: 'dist',
|
|
417
|
-
clean: true,
|
|
418
|
-
optimization: {
|
|
419
|
-
minify: false,
|
|
420
|
-
compress: false,
|
|
421
|
-
treeshake: false,
|
|
422
|
-
splitChunks: false,
|
|
423
|
-
bundleAnalyzer: false
|
|
424
|
-
},
|
|
425
|
-
sourceMaps: true
|
|
426
|
-
},
|
|
427
|
-
logging: {
|
|
428
|
-
level: 'info',
|
|
429
|
-
format: 'pretty',
|
|
430
|
-
transports: [
|
|
431
|
-
{ type: 'console', level: 'info', format: 'pretty' }
|
|
432
|
-
]
|
|
433
|
-
},
|
|
434
|
-
monitoring: {
|
|
435
|
-
enabled: true,
|
|
436
|
-
metrics: {
|
|
437
|
-
enabled: true,
|
|
438
|
-
collectInterval: 60000,
|
|
439
|
-
httpMetrics: true,
|
|
440
|
-
systemMetrics: true,
|
|
441
|
-
customMetrics: false
|
|
442
|
-
},
|
|
443
|
-
profiling: {
|
|
444
|
-
enabled: false,
|
|
445
|
-
sampleRate: 0.1,
|
|
446
|
-
memoryProfiling: false,
|
|
447
|
-
cpuProfiling: false
|
|
448
|
-
},
|
|
449
|
-
exporters: []
|
|
450
|
-
},
|
|
451
|
-
plugins: {
|
|
452
|
-
enabled: ['plugin1', 'plugin2'],
|
|
453
|
-
disabled: ['plugin3'],
|
|
454
|
-
config: {}
|
|
455
|
-
},
|
|
456
|
-
custom: {
|
|
457
|
-
customFeature: true
|
|
458
|
-
}
|
|
459
|
-
} as FluxStackConfig
|
|
460
|
-
|
|
461
|
-
expect(isFeatureEnabled(config, 'plugin1')).toBe(true)
|
|
462
|
-
expect(isFeatureEnabled(config, 'plugin2')).toBe(true)
|
|
463
|
-
expect(isFeatureEnabled(config, 'plugin3')).toBe(false) // disabled
|
|
464
|
-
expect(isFeatureEnabled(config, 'plugin4')).toBe(false) // not in enabled
|
|
465
|
-
expect(isFeatureEnabled(config, 'monitoring')).toBe(true)
|
|
466
|
-
expect(isFeatureEnabled(config, 'metrics')).toBe(true)
|
|
467
|
-
expect(isFeatureEnabled(config, 'profiling')).toBe(false)
|
|
468
|
-
expect(isFeatureEnabled(config, 'customFeature')).toBe(true)
|
|
469
|
-
expect(isFeatureEnabled(config, 'nonexistent')).toBe(false)
|
|
470
|
-
})
|
|
471
|
-
})
|
|
472
|
-
|
|
473
|
-
describe('createLegacyConfig', () => {
|
|
474
|
-
test('creates legacy configuration format', () => {
|
|
475
|
-
const config: FluxStackConfig = {
|
|
476
|
-
app: { name: 'TestApp', version: '1.0.0' },
|
|
477
|
-
server: {
|
|
478
|
-
port: 4000,
|
|
479
|
-
host: 'localhost',
|
|
480
|
-
apiPrefix: '/v2',
|
|
481
|
-
cors: {
|
|
482
|
-
origins: ['http://localhost:3000', 'https://example.com'],
|
|
483
|
-
methods: ['GET', 'POST', 'PUT'],
|
|
484
|
-
headers: ['Content-Type', 'Authorization'],
|
|
485
|
-
credentials: true,
|
|
486
|
-
maxAge: 86400
|
|
487
|
-
},
|
|
488
|
-
middleware: []
|
|
489
|
-
},
|
|
490
|
-
client: {
|
|
491
|
-
port: 5174,
|
|
492
|
-
proxy: { target: 'http://localhost:3000' },
|
|
493
|
-
build: {
|
|
494
|
-
target: 'es2020',
|
|
495
|
-
outDir: 'dist/client',
|
|
496
|
-
sourceMaps: true,
|
|
497
|
-
minify: false
|
|
498
|
-
}
|
|
499
|
-
},
|
|
500
|
-
build: {
|
|
501
|
-
target: 'docker',
|
|
502
|
-
outDir: 'build',
|
|
503
|
-
clean: true,
|
|
504
|
-
optimization: {
|
|
505
|
-
minify: false,
|
|
506
|
-
compress: false,
|
|
507
|
-
treeshake: false,
|
|
508
|
-
splitChunks: false,
|
|
509
|
-
bundleAnalyzer: false
|
|
510
|
-
},
|
|
511
|
-
sourceMaps: true
|
|
512
|
-
},
|
|
513
|
-
logging: {
|
|
514
|
-
level: 'info',
|
|
515
|
-
format: 'pretty',
|
|
516
|
-
transports: [
|
|
517
|
-
{ type: 'console', level: 'info', format: 'pretty' }
|
|
518
|
-
]
|
|
519
|
-
},
|
|
520
|
-
monitoring: {
|
|
521
|
-
enabled: false,
|
|
522
|
-
metrics: {
|
|
523
|
-
enabled: false,
|
|
524
|
-
collectInterval: 60000,
|
|
525
|
-
httpMetrics: true,
|
|
526
|
-
systemMetrics: true,
|
|
527
|
-
customMetrics: false
|
|
528
|
-
},
|
|
529
|
-
profiling: {
|
|
530
|
-
enabled: false,
|
|
531
|
-
sampleRate: 0.1,
|
|
532
|
-
memoryProfiling: false,
|
|
533
|
-
cpuProfiling: false
|
|
534
|
-
},
|
|
535
|
-
exporters: []
|
|
536
|
-
},
|
|
537
|
-
plugins: {
|
|
538
|
-
enabled: [],
|
|
539
|
-
disabled: [],
|
|
540
|
-
config: {}
|
|
541
|
-
}
|
|
542
|
-
} as FluxStackConfig
|
|
543
|
-
|
|
544
|
-
const legacyConfig = createLegacyConfig(config)
|
|
545
|
-
|
|
546
|
-
expect(legacyConfig).toEqual({
|
|
547
|
-
port: 4000,
|
|
548
|
-
vitePort: 5174,
|
|
549
|
-
clientPath: 'app/client',
|
|
550
|
-
apiPrefix: '/v2',
|
|
551
|
-
cors: {
|
|
552
|
-
origins: ['http://localhost:3000', 'https://example.com'],
|
|
553
|
-
methods: ['GET', 'POST', 'PUT'],
|
|
554
|
-
headers: ['Content-Type', 'Authorization']
|
|
555
|
-
},
|
|
556
|
-
build: {
|
|
557
|
-
outDir: 'build',
|
|
558
|
-
target: 'docker'
|
|
559
|
-
}
|
|
560
|
-
})
|
|
561
|
-
})
|
|
562
|
-
})
|
|
563
|
-
|
|
564
|
-
describe('error handling and warnings', () => {
|
|
565
|
-
test('handles configuration with warnings gracefully', () => {
|
|
566
|
-
// Test with invalid environment variables that should generate warnings
|
|
567
|
-
process.env.PORT = 'invalid-port' // Should fall back to default
|
|
568
|
-
process.env.LOG_LEVEL = 'invalid-level' // Should fall back to default
|
|
569
|
-
process.env.BUILD_TARGET = 'invalid-target' // Should fall back to default
|
|
570
|
-
|
|
571
|
-
expect(() => {
|
|
572
|
-
const config = getConfigSync()
|
|
573
|
-
// Should not throw, but use defaults
|
|
574
|
-
expect(typeof config.server?.port).toBe('number')
|
|
575
|
-
expect(['debug', 'info', 'warn', 'error']).toContain(config.logging?.level)
|
|
576
|
-
expect(['bun', 'node', 'docker']).toContain(config.build?.target)
|
|
577
|
-
}).not.toThrow()
|
|
578
|
-
})
|
|
579
|
-
|
|
580
|
-
test('handles missing optional configurations', () => {
|
|
581
|
-
// No environment variables set
|
|
582
|
-
const config = getConfigSync()
|
|
583
|
-
|
|
584
|
-
// Should have default values and structure
|
|
585
|
-
expect(config).toBeDefined()
|
|
586
|
-
expect(config.app).toBeDefined()
|
|
587
|
-
expect(config.server).toBeDefined()
|
|
588
|
-
expect(config.plugins).toBeDefined()
|
|
589
|
-
})
|
|
590
|
-
})
|
|
591
|
-
})
|