├── .commitlintrc.js ├── .devcontainer ├── devcontainer.json └── postCreateCommand.sh ├── .dockerignore ├── .editorconfig ├── .github ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── BUG_REPORT.yml │ └── FEATURE_REQUEST.yml ├── actions │ ├── install-dependencies │ │ └── action.yml │ └── setup │ │ └── action.yml └── workflows │ ├── ci.yml │ ├── commintlint.yml │ ├── release.yml │ └── smoke-tests.yml ├── .gitignore ├── .husky ├── .gitignore ├── commit-msg └── pre-commit ├── .lintstagedrc ├── .nx └── workflows │ ├── agents.yaml │ └── distribution-config.yaml ├── .nxignore ├── .prettierignore ├── .prettierrc ├── .verdaccio └── config.yml ├── .vscode ├── launch.json └── settings.json ├── LICENSE ├── README.md ├── bun.lockb ├── bunfig.toml ├── e2e ├── nx-flutter-e2e │ ├── eslint.config.mjs │ ├── jest.config.ts │ ├── project.json │ ├── tests │ │ ├── create-nx-flutter.spec.ts │ │ └── nx-flutter.spec.ts │ ├── tsconfig.json │ └── tsconfig.spec.json ├── nx-ktor-e2e │ ├── eslint.config.mjs │ ├── jest.config.ts │ ├── project.json │ ├── tests │ │ ├── create-nx-ktor.spec.ts │ │ └── nx-ktor.spec.ts │ ├── tsconfig.json │ └── tsconfig.spec.json ├── nx-melos-e2e │ ├── eslint.config.mjs │ ├── jest.config.ts │ ├── project.json │ ├── tests │ │ └── nx-melos.spec.ts │ ├── tsconfig.json │ └── tsconfig.spec.json ├── nx-micronaut-e2e │ ├── eslint.config.mjs │ ├── jest.config.ts │ ├── project.json │ ├── tests │ │ ├── create-nx-micronaut.spec.ts │ │ └── nx-micronaut.spec.ts │ ├── tsconfig.json │ └── tsconfig.spec.json ├── nx-quarkus-e2e │ ├── eslint.config.mjs │ ├── jest.config.ts │ ├── project.json │ ├── tests │ │ ├── create-nx-quarkus.spec.ts │ │ └── nx-quarkus.spec.ts │ ├── tsconfig.json │ └── tsconfig.spec.json ├── nx-spring-boot-e2e │ ├── eslint.config.mjs │ ├── jest.config.ts │ ├── project.json │ ├── tests │ │ ├── create-nx-spring-boot.spec.ts │ │ └── nx-spring-boot.spec.ts │ ├── tsconfig.json │ └── tsconfig.spec.json └── smoke │ ├── README.md │ ├── eslint.config.mjs │ ├── jest.config.ts │ ├── project.json │ ├── tests │ └── smoke.spec.ts │ ├── tsconfig.json │ └── tsconfig.spec.json ├── eslint.config.mjs ├── images ├── create-nx-flutter.png ├── create-nx-ktor.png ├── create-nx-micronaut.png ├── create-nx-quarkus.png ├── create-nx-spring-boot.png ├── create-pkg-full.txt ├── create-pkg.txt ├── flutter.png ├── ktor.svg ├── melos.png ├── micronaut.jpg ├── nx-flutter-dep-graph.png ├── nx-flutter.png ├── nx-flutter.pxd ├── nx-ktor.png ├── nx-ktor.pxz ├── nx-melos.png ├── nx-melos.pxz ├── nx-micronaut.png ├── nx-micronaut.pxz ├── nx-quarkus-dep-graph.png ├── nx-quarkus.png ├── nx-quarkus.pxz ├── nx-spring-boot-dep-graph.png ├── nx-spring-boot.png ├── nx-spring-boot.pxd ├── nxrocks.png ├── nxrocks.pxd └── spring-boot.png ├── jest.config.ts ├── jest.preset.js ├── nx.json ├── package.json ├── packages ├── common-cli │ ├── CHANGELOG.md │ ├── README.md │ ├── eslint.config.mjs │ ├── jest.config.ts │ ├── package.json │ ├── project.json │ ├── src │ │ ├── index.ts │ │ └── lib │ │ │ ├── main.ts │ │ │ ├── models.ts │ │ │ └── utils.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ └── tsconfig.spec.json ├── common-jvm │ ├── CHANGELOG.md │ ├── README.md │ ├── eslint.config.mjs │ ├── jest.config.ts │ ├── package.json │ ├── project.json │ ├── src │ │ ├── index.ts │ │ └── lib │ │ │ ├── builders │ │ │ ├── builder-core.interface.ts │ │ │ ├── gradle-builder.class.ts │ │ │ ├── index.ts │ │ │ └── maven-builder.class.ts │ │ │ ├── constants.ts │ │ │ ├── models.ts │ │ │ └── utils │ │ │ ├── gradle-utils.spec.ts │ │ │ ├── gradle-utils.ts │ │ │ ├── index.ts │ │ │ ├── maven-utils.spec.ts │ │ │ ├── maven-utils.ts │ │ │ ├── utils.spec.ts │ │ │ ├── utils.ts │ │ │ ├── xml-utils.spec.ts │ │ │ └── xml-utils.ts │ ├── testing │ │ └── index.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ └── tsconfig.spec.json ├── common │ ├── .babelrc │ ├── CHANGELOG.md │ ├── README.md │ ├── eslint.config.mjs │ ├── jest.config.ts │ ├── package.json │ ├── project.json │ ├── src │ │ ├── index.ts │ │ └── lib │ │ │ ├── constants.ts │ │ │ ├── utils │ │ │ ├── index.ts │ │ │ ├── migration-utils.ts │ │ │ ├── strings-utils.ts │ │ │ ├── utils.ts │ │ │ └── zip-utils.ts │ │ │ └── workspace │ │ │ ├── add-plugin-to-nx-json.ts │ │ │ ├── index.ts │ │ │ ├── models.ts │ │ │ ├── project-graph.ts │ │ │ └── utils.ts │ ├── testing │ │ ├── e2e │ │ │ └── index.ts │ │ ├── expects.ts │ │ ├── index.ts │ │ └── utils.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ └── tsconfig.spec.json ├── create-nx-flutter │ ├── CHANGELOG.md │ ├── README.md │ ├── bin │ │ └── index.ts │ ├── eslint.config.mjs │ ├── jest.config.ts │ ├── package.json │ ├── project.json │ ├── tsconfig.json │ ├── tsconfig.lib.json │ └── tsconfig.spec.json ├── create-nx-ktor │ ├── CHANGELOG.md │ ├── README.md │ ├── bin │ │ └── index.ts │ ├── eslint.config.mjs │ ├── jest.config.ts │ ├── package.json │ ├── project.json │ ├── tsconfig.json │ ├── tsconfig.lib.json │ └── tsconfig.spec.json ├── create-nx-micronaut │ ├── CHANGELOG.md │ ├── README.md │ ├── bin │ │ └── index.ts │ ├── eslint.config.mjs │ ├── jest.config.ts │ ├── package.json │ ├── project.json │ ├── tsconfig.json │ ├── tsconfig.lib.json │ └── tsconfig.spec.json ├── create-nx-quarkus │ ├── CHANGELOG.md │ ├── README.md │ ├── bin │ │ └── index.ts │ ├── eslint.config.mjs │ ├── jest.config.ts │ ├── package.json │ ├── project.json │ ├── tsconfig.json │ ├── tsconfig.lib.json │ └── tsconfig.spec.json ├── create-nx-spring-boot │ ├── CHANGELOG.md │ ├── README.md │ ├── bin │ │ └── index.ts │ ├── eslint.config.mjs │ ├── jest.config.ts │ ├── package.json │ ├── project.json │ ├── tsconfig.json │ ├── tsconfig.lib.json │ └── tsconfig.spec.json ├── nx-flutter │ ├── CHANGELOG.md │ ├── README.md │ ├── eslint.config.mjs │ ├── executors.json │ ├── generators.json │ ├── jest.config.ts │ ├── package.json │ ├── project.json │ ├── src │ │ ├── generators │ │ │ ├── preset │ │ │ │ ├── generator.spec.ts │ │ │ │ ├── generator.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ └── project │ │ │ │ ├── generator.spec.ts │ │ │ │ ├── generator.ts │ │ │ │ ├── lib │ │ │ │ ├── generate-project-configuration.ts │ │ │ │ ├── generate-project.ts │ │ │ │ ├── index.ts │ │ │ │ ├── normalize-options.ts │ │ │ │ └── prompt-additional-options.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ ├── graph │ │ │ ├── create-dependencies.ts │ │ │ ├── create-nodes.ts │ │ │ └── plugin.ts │ │ ├── index.ts │ │ └── utils │ │ │ ├── deps-utils.ts │ │ │ ├── flutter-utils.ts │ │ │ └── plugin-utils.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ └── tsconfig.spec.json ├── nx-ktor │ ├── CHANGELOG.md │ ├── README.md │ ├── eslint.config.mjs │ ├── executors.json │ ├── generators.json │ ├── jest.config.ts │ ├── migrations.json │ ├── package.json │ ├── project.json │ ├── recipes │ │ ├── README.md │ │ └── images │ │ │ ├── ktor-features-list.png │ │ │ └── nx-console-add-features.png │ ├── src │ │ ├── core │ │ │ └── constants.ts │ │ ├── executors │ │ │ ├── build-image │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── build │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── check-format │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── clean │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── format │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── install │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── publish-image-locally │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── publish-image │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── run-docker │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── run │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── serve │ │ │ │ └── schema.json │ │ │ └── test │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ ├── generators │ │ │ ├── link │ │ │ │ ├── generator.spec.ts │ │ │ │ ├── generator.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── preset │ │ │ │ ├── generator.spec.ts │ │ │ │ ├── generator.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ └── project │ │ │ │ ├── generator.spec.ts │ │ │ │ ├── generator.ts │ │ │ │ ├── lib │ │ │ │ ├── add-docker-maven-plugin.ts │ │ │ │ ├── add-dockerfile.ts │ │ │ │ ├── add-formatting-with-spotless.ts │ │ │ │ ├── add-gradle-application-plugin.ts │ │ │ │ ├── add-maven-publish-plugin.ts │ │ │ │ ├── generate-ktor-project.ts │ │ │ │ ├── generate-project-configuration.ts │ │ │ │ ├── index.ts │ │ │ │ ├── normalize-options.ts │ │ │ │ ├── prompt-ktor-features.ts │ │ │ │ └── prompt-multi-module-support.ts │ │ │ │ ├── maven-files │ │ │ │ └── Dockerfile__tmpl__ │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ ├── graph │ │ │ ├── create-dependencies.ts │ │ │ ├── create-nodes.ts │ │ │ └── plugin.ts │ │ ├── index.ts │ │ ├── migrations │ │ │ ├── update-3.0.0 │ │ │ │ ├── add-install-to-cacheable-operations.spec.ts │ │ │ │ └── add-install-to-cacheable-operations.ts │ │ │ └── update-3.2.0 │ │ │ │ ├── make-serve-target-depends-on-dependency-install.spec.ts │ │ │ │ └── make-serve-target-depends-on-dependency-install.ts │ │ └── utils │ │ │ ├── ktor-utils.ts │ │ │ └── plugin-utils.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ └── tsconfig.spec.json ├── nx-melos │ ├── CHANGELOG.md │ ├── README.md │ ├── eslint.config.mjs │ ├── executors.json │ ├── generators.json │ ├── jest.config.ts │ ├── package.json │ ├── project.json │ ├── src │ │ ├── generators │ │ │ └── init │ │ │ │ ├── generator.spec.ts │ │ │ │ ├── generator.ts │ │ │ │ ├── lib │ │ │ │ ├── add-melos-scripts.ts │ │ │ │ ├── generate-melos-configuration.ts │ │ │ │ ├── index.ts │ │ │ │ └── install-melos-package.ts │ │ │ │ ├── root-files │ │ │ │ ├── melos.yaml__tmpl__ │ │ │ │ └── nx-melos.mjs │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ ├── index.ts │ │ └── utils │ │ │ └── melos-utils.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ └── tsconfig.spec.json ├── nx-micronaut │ ├── CHANGELOG.md │ ├── README.md │ ├── eslint.config.mjs │ ├── executors.json │ ├── generators.json │ ├── jest.config.ts │ ├── migrations.json │ ├── package.json │ ├── project.json │ ├── recipes │ │ ├── README.md │ │ └── images │ │ │ ├── micronaut-features-list.png │ │ │ └── nx-console-add-features.png │ ├── src │ │ ├── core │ │ │ └── constants.ts │ │ ├── executors │ │ │ ├── aot-sample-config │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── build │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── check-format │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── clean │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── dockerfile │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── format │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── install │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── run │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ └── test │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ ├── generators │ │ │ ├── link │ │ │ │ ├── generator.spec.ts │ │ │ │ ├── generator.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── preset │ │ │ │ ├── generator.spec.ts │ │ │ │ ├── generator.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ └── project │ │ │ │ ├── generator.spec.ts │ │ │ │ ├── generator.ts │ │ │ │ ├── lib │ │ │ │ ├── add-formatting-with-spotless.ts │ │ │ │ ├── add-maven-publish-plugin.ts │ │ │ │ ├── generate-micronaut-project.ts │ │ │ │ ├── generate-project-configuration.ts │ │ │ │ ├── index.ts │ │ │ │ ├── normalize-options.ts │ │ │ │ ├── prompt-micronaut-features.ts │ │ │ │ └── prompt-multi-module-support.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ ├── graph │ │ │ ├── create-dependencies.ts │ │ │ ├── create-nodes.ts │ │ │ └── plugin.ts │ │ ├── index.ts │ │ ├── migrations │ │ │ ├── update-5.0.0 │ │ │ │ ├── add-install-to-cacheable-operations.spec.ts │ │ │ │ └── add-install-to-cacheable-operations.ts │ │ │ └── update-5.2.0 │ │ │ │ ├── make-serve-target-depends-on-dependency-install.spec.ts │ │ │ │ └── make-serve-target-depends-on-dependency-install.ts │ │ └── utils │ │ │ ├── micronaut-utils.ts │ │ │ └── plugin-utils.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ └── tsconfig.spec.json ├── nx-quarkus │ ├── CHANGELOG.md │ ├── README.md │ ├── eslint.config.mjs │ ├── executors.json │ ├── generators.json │ ├── jest.config.ts │ ├── migrations.json │ ├── package.json │ ├── project.json │ ├── recipes │ │ ├── README.md │ │ └── images │ │ │ ├── nx-console-add-extensions.png │ │ │ └── quarkus-extensions-list.png │ ├── src │ │ ├── core │ │ │ └── constants.ts │ │ ├── executors │ │ │ ├── add-extension │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── build │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── check-format │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── clean │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── dev │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── format │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── install │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── list-extensions │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── package │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── remote-dev │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ └── test │ │ │ │ ├── executor.spec.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ ├── generators │ │ │ ├── link │ │ │ │ ├── generator.spec.ts │ │ │ │ ├── generator.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── preset │ │ │ │ ├── generator.spec.ts │ │ │ │ ├── generator.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ └── project │ │ │ │ ├── generator.spec.ts │ │ │ │ ├── generator.ts │ │ │ │ ├── lib │ │ │ │ ├── add-formatting-with-spotless.ts │ │ │ │ ├── add-maven-publish-plugin.ts │ │ │ │ ├── generate-project-configuration.ts │ │ │ │ ├── generate-quarkus-project.ts │ │ │ │ ├── index.ts │ │ │ │ ├── normalize-options.ts │ │ │ │ ├── prompt-multi-module-support.ts │ │ │ │ └── prompt-quarkus-extensions.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ ├── graph │ │ │ ├── create-dependencies.ts │ │ │ ├── create-nodes.ts │ │ │ └── plugin.ts │ │ ├── index.ts │ │ ├── migrations │ │ │ ├── update-7.0.0 │ │ │ │ ├── add-install-to-cacheable-operations.spec.ts │ │ │ │ └── add-install-to-cacheable-operations.ts │ │ │ └── update-7.2.0 │ │ │ │ ├── make-serve-target-depends-on-dependency-install.spec.ts │ │ │ │ └── make-serve-target-depends-on-dependency-install.ts │ │ └── utils │ │ │ ├── plugin-utils.ts │ │ │ └── quarkus-utils.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ └── tsconfig.spec.json └── nx-spring-boot │ ├── CHANGELOG.md │ ├── README.md │ ├── eslint.config.mjs │ ├── executors.json │ ├── generators.json │ ├── jest.config.ts │ ├── migrations.json │ ├── package.json │ ├── project.json │ ├── recipes │ ├── README.md │ └── images │ │ ├── boot-dependencies-list.png │ │ └── nx-console-add-dependencies.png │ ├── src │ ├── core │ │ └── constants.ts │ ├── executors │ │ ├── build-image │ │ │ ├── executor.spec.ts │ │ │ ├── executor.ts │ │ │ ├── schema.d.ts │ │ │ └── schema.json │ │ ├── build-info │ │ │ ├── executor.spec.ts │ │ │ ├── executor.ts │ │ │ ├── schema.d.ts │ │ │ └── schema.json │ │ ├── build │ │ │ ├── executor.spec.ts │ │ │ ├── executor.ts │ │ │ ├── schema.d.ts │ │ │ └── schema.json │ │ ├── check-format │ │ │ ├── executor.spec.ts │ │ │ ├── executor.ts │ │ │ ├── schema.d.ts │ │ │ └── schema.json │ │ ├── clean │ │ │ ├── executor.spec.ts │ │ │ ├── executor.ts │ │ │ ├── schema.d.ts │ │ │ └── schema.json │ │ ├── format │ │ │ ├── executor.spec.ts │ │ │ ├── executor.ts │ │ │ ├── schema.d.ts │ │ │ └── schema.json │ │ ├── install │ │ │ ├── executor.spec.ts │ │ │ ├── executor.ts │ │ │ ├── schema.d.ts │ │ │ └── schema.json │ │ ├── run │ │ │ ├── executor.spec.ts │ │ │ ├── executor.ts │ │ │ ├── schema.d.ts │ │ │ └── schema.json │ │ ├── serve │ │ │ └── schema.json │ │ └── test │ │ │ ├── executor.spec.ts │ │ │ ├── executor.ts │ │ │ ├── schema.d.ts │ │ │ └── schema.json │ ├── generators │ │ ├── link │ │ │ ├── generator.spec.ts │ │ │ ├── generator.ts │ │ │ ├── schema.d.ts │ │ │ └── schema.json │ │ ├── preset │ │ │ ├── generator.spec.ts │ │ │ ├── generator.ts │ │ │ ├── schema.d.ts │ │ │ └── schema.json │ │ └── project │ │ │ ├── files │ │ │ └── library │ │ │ │ ├── main │ │ │ │ └── service │ │ │ │ │ ├── MyService.__ext__ │ │ │ │ │ └── ServiceProperties.__ext__ │ │ │ │ └── test │ │ │ │ └── service │ │ │ │ └── MyServiceTest.__ext__ │ │ │ ├── generator.spec.ts │ │ │ ├── generator.ts │ │ │ ├── lib │ │ │ ├── add-build-info-task.ts │ │ │ ├── add-formatting-with-spotless.ts │ │ │ ├── add-maven-publish-plugin.ts │ │ │ ├── create-library-files.ts │ │ │ ├── disable-boot-gradle-plugin.ts │ │ │ ├── generate-boot-project.ts │ │ │ ├── generate-project-configuration.ts │ │ │ ├── index.ts │ │ │ ├── normalize-options.ts │ │ │ ├── prompt-boot-dependencies.ts │ │ │ ├── prompt-multi-module-support.ts │ │ │ ├── remove-boot-build-image-gradle-task.ts │ │ │ └── remove-spring-boot-plugin.ts │ │ │ ├── schema.d.ts │ │ │ └── schema.json │ ├── graph │ │ ├── create-dependencies.ts │ │ ├── create-nodes.ts │ │ └── plugin.ts │ ├── index.ts │ ├── migrations │ │ ├── update-9.0.0 │ │ │ ├── add-install-to-cacheable-operations.spec.ts │ │ │ └── add-install-to-cacheable-operations.ts │ │ └── update-9.2.0 │ │ │ ├── make-serve-target-depends-on-dependency-install.spec.ts │ │ │ └── make-serve-target-depends-on-dependency-install.ts │ └── utils │ │ ├── boot-utils.ts │ │ └── plugin-utils.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ └── tsconfig.spec.json ├── project.json ├── tcom ├── tools ├── scripts │ ├── populate-local-registry.ts │ ├── run-all-e2e-tests.ts │ ├── start-local-registry.ts │ ├── stop-local-registry.ts │ ├── sync-preset-schemas.ts │ └── utils.ts └── tsconfig.tools.json ├── tsconfig.base.json ├── tsconfig.json └── unpublish /.devcontainer/postCreateCommand.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Installing Bun 4 | echo "⚙️ Installing bun..." 5 | curl -fsSL https://bun.sh/install | bash 6 | source ~/.bashrc 7 | 8 | # Adding Bun to path (for current session) 9 | export BUN_INSTALL="$HOME/.bun" 10 | export PATH="$BUN_INSTALL/bin:$PATH" 11 | 12 | # Install NPM dependencies 13 | echo "⚙️ Installing NPM dependencies..." 14 | bun install --frozen-lockfile -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | tmp/ 3 | dist/ 4 | .git/ 5 | .github/ 6 | .idea/ 7 | .vscode/ 8 | .verdaccio/ -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: tinesoft 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | custom: # Replace with a single custom sponsorship URL 9 | -------------------------------------------------------------------------------- /.github/actions/install-dependencies/action.yml: -------------------------------------------------------------------------------- 1 | name: 'Install dependencies' 2 | description: Install node and bun, then run bun install 3 | 4 | inputs: 5 | node-version: # id of input 6 | description: 'Node version' 7 | required: false 8 | default: 20 9 | 10 | runs: 11 | using: 'composite' 12 | steps: 13 | - name: Setup Bun 14 | uses: oven-sh/setup-bun@v2 15 | 16 | - name: Use Node.js ${{ inputs.node-version }} 17 | uses: actions/setup-node@v4 18 | with: 19 | node-version: ${{ inputs.node-version }} 20 | #cache: 'bun' 21 | registry-url: 'https://registry.npmjs.org' 22 | 23 | - name: Cache node_modules 24 | id: cache-modules 25 | uses: actions/cache@v4 26 | with: 27 | lookup-only: true 28 | path: '**/node_modules' 29 | key: bun-${{ hashFiles('bun.lockb','bun.lock') }} 30 | 31 | - name: Install packages 32 | run: bun install --frozen-lockfile 33 | shell: bash 34 | -------------------------------------------------------------------------------- /.github/workflows/commintlint.yml: -------------------------------------------------------------------------------- 1 | name: Lint Commit Messages 2 | on: [pull_request] 3 | 4 | jobs: 5 | commitlint: 6 | runs-on: ubuntu-latest 7 | steps: 8 | - name: Checkout Repo 9 | uses: actions/checkout@v4 10 | with: 11 | fetch-depth: 0 12 | - name: Lint the commit 13 | uses: wagoid/commitlint-github-action@v5 14 | with: 15 | configFile: '.commitlintrc.js' 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | dist 5 | tmp 6 | /out-tsc 7 | /bin 8 | 9 | # dependencies 10 | /node_modules 11 | .pnpm-store 12 | 13 | # IDEs and editors 14 | /.idea 15 | .project 16 | .classpath 17 | .c9/ 18 | *.launch 19 | .settings/ 20 | *.sublime-workspace 21 | 22 | # IDE - VSCode 23 | .vscode/* 24 | !.vscode/settings.json 25 | !.vscode/tasks.json 26 | !.vscode/launch.json 27 | !.vscode/extensions.json 28 | 29 | # misc 30 | /.sass-cache 31 | /connect.lock 32 | /coverage 33 | /libpeerconnection.log 34 | npm-debug.log 35 | yarn-error.log 36 | testem.log 37 | /typings 38 | v8-compile-cache-0 39 | 40 | # System Files 41 | .DS_Store 42 | Thumbs.db 43 | 44 | # Nx files 45 | /migrations.json 46 | .nx/cache 47 | .nx/workspace-data 48 | .cursor/rules/nx-rules.mdc 49 | .github/instructions/nx.instructions.md 50 | 51 | # Misc files 52 | 53 | .gradle 54 | target 55 | -------------------------------------------------------------------------------- /.husky/.gitignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | commitlint --edit $1 2 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | bun sync-preset-schemas 2 | lint-staged --concurrent false --relative 3 | bun affected:test 4 | -------------------------------------------------------------------------------- /.lintstagedrc: -------------------------------------------------------------------------------- 1 | { 2 | "*.ts": [ 3 | "bunx nx affected:lint --files" 4 | ], 5 | "*": [ 6 | "bunx nx format:write --files" 7 | ] 8 | } -------------------------------------------------------------------------------- /.nx/workflows/distribution-config.yaml: -------------------------------------------------------------------------------- 1 | distribute-on: 2 | small-changeset: 4 linux-medium-js-java-flutter 3 | medium-changeset: 6 linux-medium-js-java-flutter 4 | large-changeset: 8 linux-medium-js-java-flutter 5 | # small-changeset: 2 linux-large-js, 4 linux-medium-js-java-flutter, 2 linux-medium-js 6 | # medium-changeset: 3 linux-large-js, 6 linux-medium-js-java-flutter, 5 linux-medium-js 7 | # large-changeset: 4 linux-large-js, 8 linux-medium-js-java-flutter, 8 linux-medium-js 8 | # assignment-rules: 9 | # - target: build 10 | # runs-on: 11 | # - linux-large-js 12 | 13 | # - target: e2e 14 | # runs-on: 15 | # - linux-medium-js-java-flutter 16 | 17 | # - target: test 18 | # runs-on: 19 | # - linux-medium-js 20 | 21 | # - target: lint 22 | # runs-on: 23 | # - linux-medium-js 24 | -------------------------------------------------------------------------------- /.nxignore: -------------------------------------------------------------------------------- 1 | /tools/ 2 | /.devcontainer/ -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # Add files here to ignore them from prettier formatting 2 | 3 | /dist 4 | /coverage 5 | 6 | node_modules 7 | /package.json 8 | /bun.lock 9 | 10 | packages/**/CHANGELOG.md 11 | 12 | /.nx/cache 13 | /.nx/workspace-data -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true 3 | } 4 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "eslint.validate": ["json"], 3 | "nxConsole.generateAiAgentRules": true 4 | } 5 | -------------------------------------------------------------------------------- /bun.lockb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/bun.lockb -------------------------------------------------------------------------------- /bunfig.toml: -------------------------------------------------------------------------------- 1 | [install] 2 | saveTextLockfile = false -------------------------------------------------------------------------------- /e2e/nx-flutter-e2e/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import baseConfig from '../../eslint.config.mjs'; 2 | 3 | export default [...baseConfig]; 4 | -------------------------------------------------------------------------------- /e2e/nx-flutter-e2e/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'nx-flutter-e2e', 4 | preset: '../../jest.preset.js', 5 | transform: { 6 | '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], 7 | }, 8 | moduleFileExtensions: ['ts', 'js', 'html'], 9 | coverageDirectory: '../../coverage/e2e/nx-flutter-e2e', 10 | globalSetup: '../../tools/scripts/start-local-registry.ts', 11 | globalTeardown: '../../tools/scripts/stop-local-registry.ts', 12 | }; 13 | -------------------------------------------------------------------------------- /e2e/nx-flutter-e2e/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nx-flutter-e2e", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "projectType": "application", 5 | "sourceRoot": "e2e/nx-flutter-e2e/tests", 6 | "tags": ["e2e"], 7 | "implicitDependencies": ["nx-flutter"], 8 | "targets": {} 9 | } 10 | -------------------------------------------------------------------------------- /e2e/nx-flutter-e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "./tsconfig.spec.json" 8 | } 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /e2e/nx-flutter-e2e/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /e2e/nx-ktor-e2e/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import baseConfig from '../../eslint.config.mjs'; 2 | 3 | export default [...baseConfig]; 4 | -------------------------------------------------------------------------------- /e2e/nx-ktor-e2e/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'nx-ktor-e2e', 4 | preset: '../../jest.preset.js', 5 | transform: { 6 | '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], 7 | }, 8 | moduleFileExtensions: ['ts', 'js', 'html'], 9 | coverageDirectory: '../../coverage/e2e/nx-ktor-e2e', 10 | globalSetup: '../../tools/scripts/start-local-registry.ts', 11 | globalTeardown: '../../tools/scripts/stop-local-registry.ts', 12 | }; 13 | -------------------------------------------------------------------------------- /e2e/nx-ktor-e2e/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nx-ktor-e2e", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "projectType": "application", 5 | "sourceRoot": "e2e/nx-ktor-e2e/tests", 6 | "tags": ["e2e"], 7 | "implicitDependencies": ["nx-ktor"], 8 | "targets": {} 9 | } 10 | -------------------------------------------------------------------------------- /e2e/nx-ktor-e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "./tsconfig.spec.json" 8 | } 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /e2e/nx-ktor-e2e/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": [ 9 | "jest.config.ts", 10 | "src/**/*.test.ts", 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /e2e/nx-melos-e2e/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import baseConfig from '../../eslint.config.mjs'; 2 | 3 | export default [...baseConfig]; 4 | -------------------------------------------------------------------------------- /e2e/nx-melos-e2e/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'nx-melos-e2e', 4 | preset: '../../jest.preset.js', 5 | transform: { 6 | '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], 7 | }, 8 | moduleFileExtensions: ['ts', 'js', 'html'], 9 | coverageDirectory: '../../coverage/e2e/nx-melos-e2e', 10 | globalSetup: '../../tools/scripts/start-local-registry.ts', 11 | globalTeardown: '../../tools/scripts/stop-local-registry.ts', 12 | }; 13 | -------------------------------------------------------------------------------- /e2e/nx-melos-e2e/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nx-melos-e2e", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "projectType": "application", 5 | "sourceRoot": "e2e/nx-melos-e2e/tests", 6 | "tags": ["e2e"], 7 | "implicitDependencies": ["nx-melos"], 8 | "targets": {} 9 | } 10 | -------------------------------------------------------------------------------- /e2e/nx-melos-e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "./tsconfig.spec.json" 8 | } 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /e2e/nx-melos-e2e/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /e2e/nx-micronaut-e2e/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import baseConfig from '../../eslint.config.mjs'; 2 | 3 | export default [...baseConfig]; 4 | -------------------------------------------------------------------------------- /e2e/nx-micronaut-e2e/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'nx-micronaut-e2e', 4 | preset: '../../jest.preset.js', 5 | transform: { 6 | '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], 7 | }, 8 | moduleFileExtensions: ['ts', 'js', 'html'], 9 | coverageDirectory: '../../coverage/e2e/nx-micronaut-e2e', 10 | globalSetup: '../../tools/scripts/start-local-registry.ts', 11 | globalTeardown: '../../tools/scripts/stop-local-registry.ts', 12 | }; 13 | -------------------------------------------------------------------------------- /e2e/nx-micronaut-e2e/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nx-micronaut-e2e", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "projectType": "application", 5 | "sourceRoot": "e2e/nx-micronaut-e2e/tests", 6 | "tags": ["e2e"], 7 | "implicitDependencies": ["nx-micronaut"], 8 | "targets": {} 9 | } 10 | -------------------------------------------------------------------------------- /e2e/nx-micronaut-e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "./tsconfig.spec.json" 8 | } 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /e2e/nx-micronaut-e2e/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /e2e/nx-quarkus-e2e/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import baseConfig from '../../eslint.config.mjs'; 2 | 3 | export default [...baseConfig]; 4 | -------------------------------------------------------------------------------- /e2e/nx-quarkus-e2e/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'nx-quarkus-e2e', 4 | preset: '../../jest.preset.js', 5 | transform: { 6 | '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], 7 | }, 8 | moduleFileExtensions: ['ts', 'js', 'html'], 9 | coverageDirectory: '../../coverage/e2e/nx-quarkus-e2e', 10 | globalSetup: '../../tools/scripts/start-local-registry.ts', 11 | globalTeardown: '../../tools/scripts/stop-local-registry.ts', 12 | }; 13 | -------------------------------------------------------------------------------- /e2e/nx-quarkus-e2e/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nx-quarkus-e2e", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "projectType": "application", 5 | "sourceRoot": "e2e/nx-quarkus-e2e/tests", 6 | "tags": ["e2e"], 7 | "implicitDependencies": ["nx-quarkus"], 8 | "targets": {} 9 | } 10 | -------------------------------------------------------------------------------- /e2e/nx-quarkus-e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "./tsconfig.spec.json" 8 | } 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /e2e/nx-quarkus-e2e/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /e2e/nx-spring-boot-e2e/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import baseConfig from '../../eslint.config.mjs'; 2 | 3 | export default [...baseConfig]; 4 | -------------------------------------------------------------------------------- /e2e/nx-spring-boot-e2e/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'nx-spring-boot-e2e', 4 | preset: '../../jest.preset.js', 5 | transform: { 6 | '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], 7 | }, 8 | moduleFileExtensions: ['ts', 'js', 'html'], 9 | coverageDirectory: '../../coverage/e2e/nx-spring-boot-e2e', 10 | globalSetup: '../../tools/scripts/start-local-registry.ts', 11 | globalTeardown: '../../tools/scripts/stop-local-registry.ts', 12 | }; 13 | -------------------------------------------------------------------------------- /e2e/nx-spring-boot-e2e/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nx-spring-boot-e2e", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "projectType": "application", 5 | "sourceRoot": "e2e/nx-spring-boot-e2e/tests", 6 | "tags": ["e2e"], 7 | "implicitDependencies": ["nx-spring-boot"], 8 | "targets": {} 9 | } 10 | -------------------------------------------------------------------------------- /e2e/nx-spring-boot-e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "./tsconfig.spec.json" 8 | } 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /e2e/nx-spring-boot-e2e/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /e2e/smoke/README.md: -------------------------------------------------------------------------------- 1 | # Smoke 2 | 3 | ## What 4 | 5 | The tests in this project should test very similar things to e2e-core, with the main difference being that the nx workspace is created through `npx create-nx-workspace ...` and we do not utilize the e2e utils from nx-plugin. 6 | 7 | ## Why 8 | 9 | Testing this way allows us to detect breakage due to a new version of Nx or of the plugins themselves. -------------------------------------------------------------------------------- /e2e/smoke/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import baseConfig from '../../eslint.config.mjs'; 2 | 3 | export default [...baseConfig]; 4 | -------------------------------------------------------------------------------- /e2e/smoke/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'smoke', 4 | preset: '../../jest.preset.js', 5 | transform: { 6 | '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], 7 | }, 8 | moduleFileExtensions: ['ts', 'js', 'html'], 9 | coverageDirectory: '../../coverage/e2e/smoke', 10 | globalSetup: '../../tools/scripts/start-local-registry.ts', 11 | globalTeardown: '../../tools/scripts/stop-local-registry.ts', 12 | }; 13 | -------------------------------------------------------------------------------- /e2e/smoke/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "smoke", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "sourceRoot": "e2e/smoke/src", 5 | "projectType": "application", 6 | "tags": ["e2e"], 7 | "implicitDependencies": [ 8 | "nx-spring-boot", 9 | "nx-quarkus", 10 | "nx-micronaut", 11 | "nx-flutter", 12 | "nx-ktor" 13 | ], 14 | "targets": {} 15 | } 16 | -------------------------------------------------------------------------------- /e2e/smoke/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "./tsconfig.spec.json" 8 | } 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /e2e/smoke/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /images/create-nx-flutter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/images/create-nx-flutter.png -------------------------------------------------------------------------------- /images/create-nx-ktor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/images/create-nx-ktor.png -------------------------------------------------------------------------------- /images/create-nx-micronaut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/images/create-nx-micronaut.png -------------------------------------------------------------------------------- /images/create-nx-quarkus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/images/create-nx-quarkus.png -------------------------------------------------------------------------------- /images/create-nx-spring-boot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/images/create-nx-spring-boot.png -------------------------------------------------------------------------------- /images/create-pkg.txt: -------------------------------------------------------------------------------- 1 | $ npx create-nx-spring-boot 2 | 3 | ┌ create-nx-spring-boot 4 | │ 5 | ◇ What is the name of your workspace (e.g. org name)? 6 | │ myorg 7 | │ 8 | ◇ Would you like to use Nx Wrapper? [ Nx Wrapper ] 9 | │ Yes 10 | │ 11 | ◇ Would you like to use Nx Cloud? [ Nx Cloud ] 12 | │ Yes 13 | │ 14 | (#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠏ Installing dependencies -------------------------------------------------------------------------------- /images/flutter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/images/flutter.png -------------------------------------------------------------------------------- /images/melos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/images/melos.png -------------------------------------------------------------------------------- /images/micronaut.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/images/micronaut.jpg -------------------------------------------------------------------------------- /images/nx-flutter-dep-graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/images/nx-flutter-dep-graph.png -------------------------------------------------------------------------------- /images/nx-flutter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/images/nx-flutter.png -------------------------------------------------------------------------------- /images/nx-flutter.pxd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/images/nx-flutter.pxd -------------------------------------------------------------------------------- /images/nx-ktor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/images/nx-ktor.png -------------------------------------------------------------------------------- /images/nx-ktor.pxz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/images/nx-ktor.pxz -------------------------------------------------------------------------------- /images/nx-melos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/images/nx-melos.png -------------------------------------------------------------------------------- /images/nx-melos.pxz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/images/nx-melos.pxz -------------------------------------------------------------------------------- /images/nx-micronaut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/images/nx-micronaut.png -------------------------------------------------------------------------------- /images/nx-micronaut.pxz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/images/nx-micronaut.pxz -------------------------------------------------------------------------------- /images/nx-quarkus-dep-graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/images/nx-quarkus-dep-graph.png -------------------------------------------------------------------------------- /images/nx-quarkus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/images/nx-quarkus.png -------------------------------------------------------------------------------- /images/nx-quarkus.pxz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/images/nx-quarkus.pxz -------------------------------------------------------------------------------- /images/nx-spring-boot-dep-graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/images/nx-spring-boot-dep-graph.png -------------------------------------------------------------------------------- /images/nx-spring-boot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/images/nx-spring-boot.png -------------------------------------------------------------------------------- /images/nx-spring-boot.pxd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/images/nx-spring-boot.pxd -------------------------------------------------------------------------------- /images/nxrocks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/images/nxrocks.png -------------------------------------------------------------------------------- /images/nxrocks.pxd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/images/nxrocks.pxd -------------------------------------------------------------------------------- /images/spring-boot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/images/spring-boot.png -------------------------------------------------------------------------------- /jest.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from 'jest'; 2 | import { getJestProjectsAsync } from '@nx/jest'; 3 | 4 | export default async (): Promise => ({ 5 | projects: await getJestProjectsAsync(), 6 | }); 7 | -------------------------------------------------------------------------------- /jest.preset.js: -------------------------------------------------------------------------------- 1 | const nxPreset = require('@nx/jest/preset').default; 2 | 3 | module.exports = { ...nxPreset }; 4 | -------------------------------------------------------------------------------- /packages/common-cli/README.md: -------------------------------------------------------------------------------- 1 | # common-cli 2 | 3 | Common library to share code among the `create-*` packages. 4 | 5 | ## Building 6 | 7 | Run `nx build common-cli` to build the library. 8 | 9 | ## Running unit tests 10 | 11 | Run `nx test common-cli` to execute the unit tests via [Jest](https://jestjs.io). 12 | 13 | ## License 14 | 15 | Copyright (c) 2023-present Tine Kondo. Licensed under the MIT License (MIT) 16 | -------------------------------------------------------------------------------- /packages/common-cli/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import baseConfig from '../../eslint.config.mjs'; 2 | 3 | export default [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.json'], 7 | rules: { 8 | '@nx/dependency-checks': [ 9 | 'error', 10 | { 11 | ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs}'], 12 | }, 13 | ], 14 | }, 15 | languageOptions: { 16 | parser: await import('jsonc-eslint-parser'), 17 | }, 18 | }, 19 | { 20 | files: ['**/package.json'], 21 | rules: { 22 | '@nx/nx-plugin-checks': 'error', 23 | }, 24 | languageOptions: { 25 | parser: await import('jsonc-eslint-parser'), 26 | }, 27 | }, 28 | ]; 29 | -------------------------------------------------------------------------------- /packages/common-cli/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'common-cli', 4 | preset: '../../jest.preset.js', 5 | testEnvironment: 'node', 6 | transform: { 7 | '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], 8 | }, 9 | moduleFileExtensions: ['ts', 'js', 'html'], 10 | coverageDirectory: '../../coverage/packages/common-cli', 11 | }; 12 | -------------------------------------------------------------------------------- /packages/common-cli/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "common-cli", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "sourceRoot": "packages/common-cli/src", 5 | "projectType": "library", 6 | "tags": [], 7 | "targets": { 8 | "build": { 9 | "executor": "@nx/js:tsc", 10 | "outputs": ["{options.outputPath}"], 11 | "options": { 12 | "outputPath": "dist/packages/common-cli", 13 | "main": "packages/common-cli/src/index.ts", 14 | "tsConfig": "packages/common-cli/tsconfig.lib.json", 15 | "assets": ["packages/common-cli/*.md"] 16 | } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/common-cli/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './lib/utils'; 2 | export * from './lib/models'; 3 | export * from './lib/main'; 4 | -------------------------------------------------------------------------------- /packages/common-cli/src/lib/models.ts: -------------------------------------------------------------------------------- 1 | import { CreateWorkspaceOptions } from 'create-nx-workspace'; 2 | 3 | export interface CLIArguments extends CreateWorkspaceOptions { 4 | useNxWrapper?: boolean; 5 | verbose?: boolean; 6 | presetVersion?: string; 7 | } 8 | -------------------------------------------------------------------------------- /packages/common-cli/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | "forceConsistentCasingInFileNames": true, 6 | "strict": true, 7 | "noImplicitOverride": true, 8 | "noPropertyAccessFromIndexSignature": true, 9 | "noImplicitReturns": true, 10 | "noFallthroughCasesInSwitch": true 11 | }, 12 | "files": [], 13 | "include": [], 14 | "references": [ 15 | { 16 | "path": "./tsconfig.lib.json" 17 | }, 18 | { 19 | "path": "./tsconfig.spec.json" 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/common-cli/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "declaration": true, 6 | "types": ["node"] 7 | }, 8 | "include": ["src/**/*.ts"], 9 | "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/common-cli/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": [ 9 | "jest.config.ts", 10 | "src/**/*.test.ts", 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /packages/common-jvm/README.md: -------------------------------------------------------------------------------- 1 | # common-jvm 2 | 3 | Common library to share code among the JVM-related plugins. 4 | 5 | ## Building 6 | 7 | Run `nx build common-jvm` to build the library. 8 | 9 | ## Running unit tests 10 | 11 | Run `nx test common-jvm` to execute the unit tests via [Jest](https://jestjs.io). 12 | 13 | ## License 14 | 15 | Copyright (c) 2023-present Tine Kondo. Licensed under the MIT License (MIT) 16 | -------------------------------------------------------------------------------- /packages/common-jvm/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import baseConfig from '../../eslint.config.mjs'; 2 | 3 | export default [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.json'], 7 | rules: { 8 | '@nx/dependency-checks': [ 9 | 'error', 10 | { 11 | ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs}'], 12 | }, 13 | ], 14 | }, 15 | languageOptions: { 16 | parser: await import('jsonc-eslint-parser'), 17 | }, 18 | }, 19 | { 20 | files: ['**/package.json'], 21 | rules: { 22 | '@nx/nx-plugin-checks': 'error', 23 | }, 24 | languageOptions: { 25 | parser: await import('jsonc-eslint-parser'), 26 | }, 27 | }, 28 | ]; 29 | -------------------------------------------------------------------------------- /packages/common-jvm/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'common-jvm', 4 | preset: '../../jest.preset.js', 5 | testEnvironment: 'node', 6 | transform: { 7 | '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], 8 | }, 9 | moduleFileExtensions: ['ts', 'js', 'html'], 10 | coverageDirectory: '../../coverage/packages/common-jvm', 11 | }; 12 | -------------------------------------------------------------------------------- /packages/common-jvm/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "common-jvm", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "sourceRoot": "packages/common-jvm/src", 5 | "projectType": "library", 6 | "tags": [], 7 | "targets": { 8 | "build": { 9 | "executor": "@nx/js:tsc", 10 | "outputs": ["{options.outputPath}"], 11 | "options": { 12 | "outputPath": "dist/packages/common-jvm", 13 | "main": "packages/common-jvm/src/index.ts", 14 | "tsConfig": "packages/common-jvm/tsconfig.lib.json", 15 | "assets": ["packages/common-jvm/*.md"] 16 | } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/common-jvm/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './lib/utils'; 2 | export * from './lib/builders'; 3 | export * from './lib/constants'; 4 | export * from './lib/models'; 5 | 6 | export * from '@nxrocks/common'; 7 | 8 | -------------------------------------------------------------------------------- /packages/common-jvm/src/lib/builders/builder-core.interface.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Type of JVM Build System. 3 | */ 4 | export enum BuildSystem { 5 | MAVEN, 6 | GRADLE, 7 | } 8 | 9 | /** 10 | * Class defining the mapping between a command alias and the actual command to run. 11 | */ 12 | export interface BuilderCommandAliasMapper { 13 | [key: string]: string; 14 | } 15 | 16 | /** 17 | * Base interface for build systems. 18 | */ 19 | export interface BuilderCore { 20 | getBuildSystemType(): BuildSystem; 21 | 22 | getExecutable(ignoreWrapper: boolean, useLegacyWrapper: boolean): string; 23 | 24 | getCommand(alias: BuilderCommandAliasType, options: { cwd: string, ignoreWrapper?: boolean, runFromParentModule?: boolean}): {cwd: string, command: string}; 25 | } 26 | 27 | export type BuilderCommandAliasType = keyof BuilderCommandAliasMapper & string; // enforce that the key is a string (default result of keyof would be string|number) 28 | -------------------------------------------------------------------------------- /packages/common-jvm/src/lib/builders/index.ts: -------------------------------------------------------------------------------- 1 | export * from './builder-core.interface'; 2 | export * from './maven-builder.class'; 3 | export * from './gradle-builder.class'; 4 | -------------------------------------------------------------------------------- /packages/common-jvm/src/lib/constants.ts: -------------------------------------------------------------------------------- 1 | import { IS_WINDOWS } from "@nxrocks/common"; 2 | 3 | export const MAVEN_EXECUTABLE = 'mvn'; 4 | 5 | export const GRADLE_EXECUTABLE = 'gradle'; 6 | 7 | export const MAVEN_WRAPPER_EXECUTABLE = IS_WINDOWS ? 'mvnw.cmd' : './mvnw'; 8 | 9 | // previous versions of the wrapper were using '.bat' extension for Windows executable 10 | export const MAVEN_WRAPPER_EXECUTABLE_LEGACY = IS_WINDOWS ? 'mvnw.bat' : './mvnw'; 11 | 12 | export const GRADLE_WRAPPER_EXECUTABLE = IS_WINDOWS 13 | ? 'gradlew.bat' 14 | : './gradlew'; 15 | -------------------------------------------------------------------------------- /packages/common-jvm/src/lib/models.ts: -------------------------------------------------------------------------------- 1 | export interface MavenDependency { 2 | groupId: string; 3 | artifactId: string; 4 | scope: string; 5 | } -------------------------------------------------------------------------------- /packages/common-jvm/src/lib/utils/index.ts: -------------------------------------------------------------------------------- 1 | 2 | export * from './gradle-utils'; 3 | export * from './maven-utils'; 4 | export * from './xml-utils'; 5 | export * from './utils'; 6 | -------------------------------------------------------------------------------- /packages/common-jvm/testing/index.ts: -------------------------------------------------------------------------------- 1 | export * from '@nxrocks/common/testing'; 2 | -------------------------------------------------------------------------------- /packages/common-jvm/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | "forceConsistentCasingInFileNames": true, 6 | "strict": true, 7 | "noImplicitOverride": true, 8 | "noPropertyAccessFromIndexSignature": true, 9 | "noImplicitReturns": true, 10 | "noFallthroughCasesInSwitch": true 11 | }, 12 | "files": [], 13 | "include": [], 14 | "references": [ 15 | { 16 | "path": "./tsconfig.lib.json" 17 | }, 18 | { 19 | "path": "./tsconfig.spec.json" 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/common-jvm/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "declaration": true, 6 | "types": ["node"] 7 | }, 8 | "include": ["src/**/*.ts"], 9 | "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/common-jvm/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": [ 9 | "jest.config.ts", 10 | "src/**/*.test.ts", 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /packages/common/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "@nx/js/babel", 5 | { 6 | "useBuiltIns": "usage" 7 | } 8 | ] 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /packages/common/README.md: -------------------------------------------------------------------------------- 1 | # common 2 | 3 | Common library to share code among the `@nxrocks/*` plugins. 4 | 5 | ## Building 6 | 7 | Run `nx build common` to build the library. 8 | 9 | ## Running unit tests 10 | 11 | Run `nx test common` to execute the unit tests via [Jest](https://jestjs.io). 12 | 13 | ## License 14 | 15 | Copyright (c) 2021-present Tine Kondo. Licensed under the MIT License (MIT) 16 | -------------------------------------------------------------------------------- /packages/common/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import baseConfig from '../../eslint.config.mjs'; 2 | 3 | export default [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.json'], 7 | rules: { 8 | '@nx/dependency-checks': [ 9 | 'error', 10 | { 11 | ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs}'], 12 | ignoredDependencies: ['@nx/plugin'], //@nx/plugin/testing is only used in tests 13 | }, 14 | ], 15 | }, 16 | languageOptions: { 17 | parser: await import('jsonc-eslint-parser'), 18 | }, 19 | }, 20 | { 21 | files: ['**/package.json'], 22 | rules: { 23 | '@nx/nx-plugin-checks': 'error', 24 | }, 25 | languageOptions: { 26 | parser: await import('jsonc-eslint-parser'), 27 | }, 28 | }, 29 | ]; 30 | -------------------------------------------------------------------------------- /packages/common/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'common', 4 | preset: '../../jest.preset.js', 5 | transform: { 6 | '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], 7 | }, 8 | moduleFileExtensions: ['ts', 'js', 'html'], 9 | coverageDirectory: '../../coverage/packages/common', 10 | }; 11 | -------------------------------------------------------------------------------- /packages/common/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "common", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "sourceRoot": "packages/common/src", 5 | "projectType": "library", 6 | "tags": [], 7 | "targets": { 8 | "build": { 9 | "executor": "@nx/js:tsc", 10 | "outputs": ["{options.outputPath}"], 11 | "options": { 12 | "outputPath": "dist/packages/common", 13 | "main": "packages/common/src/index.ts", 14 | "tsConfig": "packages/common/tsconfig.lib.json", 15 | "assets": ["packages/common/*.md"] 16 | } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/common/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './lib/workspace'; 2 | export * from './lib/constants'; 3 | export * from './lib/utils'; 4 | 5 | -------------------------------------------------------------------------------- /packages/common/src/lib/constants.ts: -------------------------------------------------------------------------------- 1 | export const IS_WINDOWS = process.platform === 'win32'; 2 | -------------------------------------------------------------------------------- /packages/common/src/lib/utils/index.ts: -------------------------------------------------------------------------------- 1 | export * from './utils'; 2 | export * from './strings-utils'; 3 | export * from './zip-utils'; 4 | export * from './migration-utils'; 5 | -------------------------------------------------------------------------------- /packages/common/src/lib/utils/strings-utils.ts: -------------------------------------------------------------------------------- 1 | // credits: https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/core/src/utils/literals.ts 2 | 3 | 4 | // eslint-disable-next-line @typescript-eslint/no-explicit-any 5 | export function stripIndent(strings: TemplateStringsArray, ...values: any[]) { 6 | const endResult = String.raw(strings, ...values); 7 | 8 | // remove the shortest leading indentation from each line 9 | const match = endResult.match(/^[ \t]*(?=\S)/gm); 10 | 11 | // return early if there's nothing to strip 12 | if (match === null) { 13 | return endResult; 14 | } 15 | 16 | const indent = Math.min(...match.map((el) => el.length)); 17 | const regexp = new RegExp('^[ \\t]{' + indent + '}', 'gm'); 18 | 19 | return (indent > 0 ? endResult.replace(regexp, '') : endResult).trim(); 20 | } -------------------------------------------------------------------------------- /packages/common/src/lib/workspace/index.ts: -------------------------------------------------------------------------------- 1 | export * from './add-plugin-to-nx-json'; 2 | export * from './project-graph'; 3 | export * from './models'; 4 | export * from './utils'; 5 | -------------------------------------------------------------------------------- /packages/common/src/lib/workspace/models.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Interface representing a package dependency 3 | */ 4 | export interface PackageInfo { 5 | packageId: string; 6 | packageFile: string; 7 | dependencies?: PackageInfo[]; 8 | modules?: string[] 9 | } 10 | 11 | /** 12 | * Interface representing a workspace, with each project associated to its packages 13 | */ 14 | export interface WorkspacePackageInfoConfiguration { 15 | projects: { 16 | [projectRoot: string]: PackageInfo; 17 | }; 18 | 19 | packages: { 20 | [packageId: string]: string; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /packages/common/testing/expects.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext, logger } from '@nx/devkit'; 2 | 3 | import { join } from 'path'; 4 | 5 | //first, we mock 6 | //jest.mock('child_process'); 7 | 8 | //then, we import 9 | import * as cp from 'child_process'; 10 | 11 | export function expectExecutorCommandRanWith( 12 | execute: string, 13 | context: ExecutorContext, 14 | options: { root: string } 15 | ) { 16 | expect(logger.info).toHaveBeenLastCalledWith(`Executing command: ${execute}`); 17 | expect(cp.execSync).toHaveBeenCalledWith( 18 | execute, 19 | expect.objectContaining({ 20 | cwd: expect.stringContaining(join(context.root, options.root)), 21 | stdio: [0, 1, 2], 22 | }) 23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /packages/common/testing/index.ts: -------------------------------------------------------------------------------- 1 | export * from './expects'; 2 | export * from './utils'; 3 | export * from './e2e'; 4 | -------------------------------------------------------------------------------- /packages/common/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | "forceConsistentCasingInFileNames": true, 6 | "strict": true, 7 | "noImplicitOverride": true, 8 | "noPropertyAccessFromIndexSignature": true, 9 | "noImplicitReturns": true, 10 | "noFallthroughCasesInSwitch": true 11 | }, 12 | "files": [], 13 | "include": [], 14 | "references": [ 15 | { 16 | "path": "./tsconfig.lib.json" 17 | }, 18 | { 19 | "path": "./tsconfig.spec.json" 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/common/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "declaration": true, 6 | "types": ["jest","node"] 7 | }, 8 | "include": ["src/**/*.ts"], 9 | "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/common/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": [ 9 | "jest.config.ts", 10 | "src/**/*.test.ts", 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /packages/create-nx-flutter/bin/index.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | import { mainCLI } from '@nxrocks/common-cli'; 4 | 5 | async function main() { 6 | 7 | mainCLI('@nxrocks/nx-flutter', 'Flutter'); 8 | 9 | } 10 | 11 | main(); 12 | -------------------------------------------------------------------------------- /packages/create-nx-flutter/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import baseConfig from '../../eslint.config.mjs'; 2 | 3 | export default [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.json'], 7 | rules: { 8 | '@nx/dependency-checks': [ 9 | 'error', 10 | { 11 | ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs}'], 12 | }, 13 | ], 14 | }, 15 | languageOptions: { 16 | parser: await import('jsonc-eslint-parser'), 17 | }, 18 | }, 19 | ]; 20 | -------------------------------------------------------------------------------- /packages/create-nx-flutter/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'create-nx-flutter', 4 | preset: '../../jest.preset.js', 5 | transform: { 6 | '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], 7 | }, 8 | moduleFileExtensions: ['ts', 'js', 'html'], 9 | coverageDirectory: '../../coverage/packages/create-nx-flutter', 10 | }; 11 | -------------------------------------------------------------------------------- /packages/create-nx-flutter/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-nx-flutter", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "sourceRoot": "packages/create-nx-flutter/bin", 5 | "projectType": "library", 6 | "tags": [], 7 | "implicitDependencies": ["nx-flutter"], 8 | "targets": { 9 | "build": { 10 | "executor": "@nx/js:tsc", 11 | "outputs": ["{options.outputPath}"], 12 | "options": { 13 | "outputPath": "dist/packages/create-nx-flutter", 14 | "main": "packages/create-nx-flutter/bin/index.ts", 15 | "tsConfig": "packages/create-nx-flutter/tsconfig.lib.json", 16 | "assets": ["packages/create-nx-flutter/*.md"] 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /packages/create-nx-flutter/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "module": "commonjs" 5 | }, 6 | "files": [], 7 | "include": [], 8 | "references": [ 9 | { 10 | "path": "./tsconfig.lib.json" 11 | }, 12 | { 13 | "path": "./tsconfig.spec.json" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /packages/create-nx-flutter/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "declaration": true, 6 | "types": ["node"] 7 | }, 8 | "include": ["src/**/*.ts", "bin/**/*.ts"], 9 | "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/create-nx-flutter/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": [ 9 | "jest.config.ts", 10 | "src/**/*.test.ts", 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /packages/create-nx-ktor/bin/index.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | import { mainCLI } from '@nxrocks/common-cli'; 4 | 5 | async function main() { 6 | 7 | mainCLI('@nxrocks/nx-ktor', 'Ktor'); 8 | 9 | } 10 | 11 | main(); 12 | -------------------------------------------------------------------------------- /packages/create-nx-ktor/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import baseConfig from '../../eslint.config.mjs'; 2 | 3 | export default [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.json'], 7 | rules: { 8 | '@nx/dependency-checks': [ 9 | 'error', 10 | { 11 | ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs}'], 12 | }, 13 | ], 14 | }, 15 | languageOptions: { 16 | parser: await import('jsonc-eslint-parser'), 17 | }, 18 | }, 19 | ]; 20 | -------------------------------------------------------------------------------- /packages/create-nx-ktor/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'create-nx-ktor', 4 | preset: '../../jest.preset.js', 5 | transform: { 6 | '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], 7 | }, 8 | moduleFileExtensions: ['ts', 'js', 'html'], 9 | coverageDirectory: '../../coverage/packages/create-nx-ktor', 10 | }; 11 | -------------------------------------------------------------------------------- /packages/create-nx-ktor/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-nx-ktor", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "sourceRoot": "packages/create-nx-ktor/bin", 5 | "projectType": "library", 6 | "tags": [], 7 | "implicitDependencies": ["nx-ktor"], 8 | "targets": { 9 | "build": { 10 | "executor": "@nx/js:tsc", 11 | "outputs": ["{options.outputPath}"], 12 | "options": { 13 | "outputPath": "dist/packages/create-nx-ktor", 14 | "main": "packages/create-nx-ktor/bin/index.ts", 15 | "tsConfig": "packages/create-nx-ktor/tsconfig.lib.json", 16 | "assets": ["packages/create-nx-ktor/*.md"] 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /packages/create-nx-ktor/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | "forceConsistentCasingInFileNames": true, 6 | "strict": true, 7 | "noImplicitOverride": true, 8 | "noPropertyAccessFromIndexSignature": true, 9 | "noImplicitReturns": true, 10 | "noFallthroughCasesInSwitch": true 11 | }, 12 | "files": [], 13 | "include": [], 14 | "references": [ 15 | { 16 | "path": "./tsconfig.lib.json" 17 | }, 18 | { 19 | "path": "./tsconfig.spec.json" 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/create-nx-ktor/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "declaration": true, 6 | "types": ["node"] 7 | }, 8 | "include": ["src/**/*.ts", "bin/**/*.ts"], 9 | "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/create-nx-ktor/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": [ 9 | "jest.config.ts", 10 | "src/**/*.test.ts", 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /packages/create-nx-micronaut/bin/index.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | import { mainCLI } from '@nxrocks/common-cli'; 4 | 5 | async function main() { 6 | 7 | mainCLI('@nxrocks/nx-micronaut', 'Micronaut'); 8 | 9 | } 10 | 11 | main(); 12 | -------------------------------------------------------------------------------- /packages/create-nx-micronaut/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import baseConfig from '../../eslint.config.mjs'; 2 | 3 | export default [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.json'], 7 | rules: { 8 | '@nx/dependency-checks': [ 9 | 'error', 10 | { 11 | ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs}'], 12 | }, 13 | ], 14 | }, 15 | languageOptions: { 16 | parser: await import('jsonc-eslint-parser'), 17 | }, 18 | }, 19 | ]; 20 | -------------------------------------------------------------------------------- /packages/create-nx-micronaut/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'create-nx-micronaut', 4 | preset: '../../jest.preset.js', 5 | transform: { 6 | '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], 7 | }, 8 | moduleFileExtensions: ['ts', 'js', 'html'], 9 | coverageDirectory: '../../coverage/packages/create-nx-micronaut', 10 | }; 11 | -------------------------------------------------------------------------------- /packages/create-nx-micronaut/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | "forceConsistentCasingInFileNames": true, 6 | "strict": true, 7 | "noImplicitOverride": true, 8 | "noPropertyAccessFromIndexSignature": true, 9 | "noImplicitReturns": true, 10 | "noFallthroughCasesInSwitch": true 11 | }, 12 | "files": [], 13 | "include": [], 14 | "references": [ 15 | { 16 | "path": "./tsconfig.lib.json" 17 | }, 18 | { 19 | "path": "./tsconfig.spec.json" 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/create-nx-micronaut/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "declaration": true, 6 | "types": ["node"] 7 | }, 8 | "include": ["src/**/*.ts", "bin/**/*.ts"], 9 | "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/create-nx-micronaut/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": [ 9 | "jest.config.ts", 10 | "src/**/*.test.ts", 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /packages/create-nx-quarkus/bin/index.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | import { mainCLI } from '@nxrocks/common-cli'; 4 | 5 | async function main() { 6 | 7 | mainCLI('@nxrocks/nx-quarkus', 'Quarkus'); 8 | 9 | } 10 | 11 | main(); 12 | -------------------------------------------------------------------------------- /packages/create-nx-quarkus/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import baseConfig from '../../eslint.config.mjs'; 2 | 3 | export default [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.json'], 7 | rules: { 8 | '@nx/dependency-checks': [ 9 | 'error', 10 | { 11 | ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs}'], 12 | }, 13 | ], 14 | }, 15 | languageOptions: { 16 | parser: await import('jsonc-eslint-parser'), 17 | }, 18 | }, 19 | ]; 20 | -------------------------------------------------------------------------------- /packages/create-nx-quarkus/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'create-nx-quarkus', 4 | preset: '../../jest.preset.js', 5 | transform: { 6 | '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], 7 | }, 8 | moduleFileExtensions: ['ts', 'js', 'html'], 9 | coverageDirectory: '../../coverage/packages/create-nx-quarkus', 10 | }; 11 | -------------------------------------------------------------------------------- /packages/create-nx-quarkus/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-nx-quarkus", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "sourceRoot": "packages/create-nx-quarkus/bin", 5 | "projectType": "library", 6 | "tags": [], 7 | "implicitDependencies": ["nx-quarkus"], 8 | "targets": { 9 | "build": { 10 | "executor": "@nx/js:tsc", 11 | "outputs": ["{options.outputPath}"], 12 | "options": { 13 | "outputPath": "dist/packages/create-nx-quarkus", 14 | "main": "packages/create-nx-quarkus/bin/index.ts", 15 | "tsConfig": "packages/create-nx-quarkus/tsconfig.lib.json", 16 | "assets": ["packages/create-nx-quarkus/*.md"] 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /packages/create-nx-quarkus/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | "forceConsistentCasingInFileNames": true, 6 | "strict": true, 7 | "noImplicitOverride": true, 8 | "noPropertyAccessFromIndexSignature": true, 9 | "noImplicitReturns": true, 10 | "noFallthroughCasesInSwitch": true 11 | }, 12 | "files": [], 13 | "include": [], 14 | "references": [ 15 | { 16 | "path": "./tsconfig.lib.json" 17 | }, 18 | { 19 | "path": "./tsconfig.spec.json" 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/create-nx-quarkus/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "declaration": true, 6 | "types": ["node"] 7 | }, 8 | "include": ["src/**/*.ts", "bin/**/*.ts"], 9 | "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/create-nx-quarkus/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": [ 9 | "jest.config.ts", 10 | "src/**/*.test.ts", 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /packages/create-nx-spring-boot/bin/index.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | import { mainCLI } from '@nxrocks/common-cli'; 4 | 5 | async function main() { 6 | 7 | mainCLI('@nxrocks/nx-spring-boot', 'Spring Boot'); 8 | 9 | } 10 | 11 | main(); 12 | -------------------------------------------------------------------------------- /packages/create-nx-spring-boot/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import baseConfig from '../../eslint.config.mjs'; 2 | 3 | export default [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.json'], 7 | rules: { 8 | '@nx/dependency-checks': [ 9 | 'error', 10 | { 11 | ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs}'], 12 | }, 13 | ], 14 | }, 15 | languageOptions: { 16 | parser: await import('jsonc-eslint-parser'), 17 | }, 18 | }, 19 | ]; 20 | -------------------------------------------------------------------------------- /packages/create-nx-spring-boot/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'create-nx-spring-boot', 4 | preset: '../../jest.preset.js', 5 | transform: { 6 | '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], 7 | }, 8 | moduleFileExtensions: ['ts', 'js', 'html'], 9 | coverageDirectory: '../../coverage/packages/create-nx-spring-boot', 10 | }; 11 | -------------------------------------------------------------------------------- /packages/create-nx-spring-boot/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-nx-spring-boot", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "sourceRoot": "packages/create-nx-spring-boot/bin", 5 | "projectType": "library", 6 | "tags": [], 7 | "implicitDependencies": ["nx-spring-boot"], 8 | "targets": { 9 | "build": { 10 | "executor": "@nx/js:tsc", 11 | "outputs": ["{options.outputPath}"], 12 | "options": { 13 | "outputPath": "dist/packages/create-nx-spring-boot", 14 | "main": "packages/create-nx-spring-boot/bin/index.ts", 15 | "tsConfig": "packages/create-nx-spring-boot/tsconfig.lib.json", 16 | "assets": ["packages/create-nx-spring-boot/*.md"] 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /packages/create-nx-spring-boot/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | "forceConsistentCasingInFileNames": true, 6 | "strict": true, 7 | "noImplicitOverride": true, 8 | "noPropertyAccessFromIndexSignature": true, 9 | "noImplicitReturns": true, 10 | "noFallthroughCasesInSwitch": true 11 | }, 12 | "files": [], 13 | "include": [], 14 | "references": [ 15 | { 16 | "path": "./tsconfig.lib.json" 17 | }, 18 | { 19 | "path": "./tsconfig.spec.json" 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/create-nx-spring-boot/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "declaration": true, 6 | "types": ["node"] 7 | }, 8 | "include": ["src/**/*.ts", "bin/**/*.ts"], 9 | "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/create-nx-spring-boot/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": [ 9 | "jest.config.ts", 10 | "src/**/*.test.ts", 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /packages/nx-flutter/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import baseConfig from '../../eslint.config.mjs'; 2 | 3 | export default [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.json'], 7 | rules: { 8 | '@nx/dependency-checks': [ 9 | 'error', 10 | { 11 | ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs}'], 12 | }, 13 | ], 14 | }, 15 | languageOptions: { 16 | parser: await import('jsonc-eslint-parser'), 17 | }, 18 | }, 19 | { 20 | files: [ 21 | '**/package.json', 22 | '**/generators.json', 23 | '**/executors.json', 24 | '**/migrations.json', 25 | ], 26 | rules: { 27 | '@nx/nx-plugin-checks': 'error', 28 | }, 29 | languageOptions: { 30 | parser: await import('jsonc-eslint-parser'), 31 | }, 32 | }, 33 | ]; 34 | -------------------------------------------------------------------------------- /packages/nx-flutter/executors.json: -------------------------------------------------------------------------------- 1 | { 2 | "executors": { 3 | } 4 | } 5 | -------------------------------------------------------------------------------- /packages/nx-flutter/generators.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nx-flutter", 3 | "version": "0.0.1", 4 | "generators": { 5 | "project": { 6 | "factory": "./src/generators/project/generator", 7 | "schema": "./src/generators/project/schema.json", 8 | "description": "Creates a `Flutter` project", 9 | "aliases": ["proj", "new", "create"] 10 | }, 11 | "preset": { 12 | "factory": "./src/generators/preset/generator", 13 | "schema": "./src/generators/preset/schema.json", 14 | "description": "Initializes a workspace with an nx-flutter inside of it. Use as: `create-nx-workspace --preset @nxrocks/nx-flutter`.", 15 | "x-use-standalone-layout": true, 16 | "hidden": true 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/nx-flutter/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'nx-flutter', 4 | preset: '../../jest.preset.js', 5 | transform: { 6 | '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], 7 | }, 8 | moduleFileExtensions: ['ts', 'js', 'html'], 9 | coverageDirectory: '../../coverage/packages/nx-flutter', 10 | }; 11 | -------------------------------------------------------------------------------- /packages/nx-flutter/src/generators/preset/generator.ts: -------------------------------------------------------------------------------- 1 | import { Tree } from '@nx/devkit'; 2 | import { PresetGeneratorSchema } from './schema'; 3 | import projectGenerator from '../project/generator'; 4 | 5 | export async function presetGenerator( 6 | tree: Tree, 7 | options: PresetGeneratorSchema 8 | ) { 9 | if (options.prjName) { 10 | options.directory = options.prjName; 11 | delete options['name']; // remove 'name' set from create-nx-workspace, where it refers to the workspace name and not project name 12 | } 13 | 14 | await projectGenerator(tree, options); 15 | } 16 | 17 | export default presetGenerator; 18 | -------------------------------------------------------------------------------- /packages/nx-flutter/src/generators/preset/schema.d.ts: -------------------------------------------------------------------------------- 1 | import { ProjectGeneratorOptions } from '../project/schema'; 2 | 3 | export interface PresetGeneratorSchema extends ProjectGeneratorOptions { 4 | prjName?: string; //replacement for 'name' & 'directory' which can't be used as-is, because they have a special meaning in `create-nx-workspace` 5 | } 6 | -------------------------------------------------------------------------------- /packages/nx-flutter/src/generators/project/generator.ts: -------------------------------------------------------------------------------- 1 | import { Tree } from '@nx/devkit'; 2 | import { addPluginToNxJson } from '@nxrocks/common'; 3 | 4 | import { 5 | normalizeOptions, 6 | promptAdditionalOptions, 7 | generateFlutterProject, 8 | generateProjectConfiguration, 9 | } from './lib'; 10 | import { ProjectGeneratorOptions } from './schema'; 11 | import { NX_FLUTTER_PKG } from '../../index'; 12 | import { normalizePluginOptions } from '../../graph/plugin'; 13 | 14 | export async function projectGenerator( 15 | tree: Tree, 16 | options: ProjectGeneratorOptions 17 | ) { 18 | const normalizedOptions = await normalizeOptions(tree, options); 19 | 20 | await promptAdditionalOptions(tree, normalizedOptions); 21 | 22 | generateProjectConfiguration(tree, normalizedOptions); 23 | 24 | await generateFlutterProject(tree, normalizedOptions); 25 | 26 | addPluginToNxJson(NX_FLUTTER_PKG, tree, normalizePluginOptions()); 27 | } 28 | 29 | export default projectGenerator; 30 | -------------------------------------------------------------------------------- /packages/nx-flutter/src/generators/project/lib/generate-project-configuration.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Tree, 3 | logger, 4 | addProjectConfiguration, 5 | joinPathFragments, 6 | } from '@nx/devkit'; 7 | import { NormalizedSchema } from '../schema'; 8 | import { isNxCrystalEnabled } from '@nxrocks/common'; 9 | import { getProjectTypeAndTargetsFromOptions } from '../../../utils/plugin-utils'; 10 | 11 | export function generateProjectConfiguration( 12 | tree: Tree, 13 | options: NormalizedSchema 14 | ) { 15 | logger.info(`⚙️ Generating project configuration...`); 16 | 17 | addProjectConfiguration(tree, options.projectName, { 18 | root: options.projectRoot, 19 | sourceRoot: joinPathFragments(options.projectRoot, 'src'), 20 | ...(!isNxCrystalEnabled() 21 | ? getProjectTypeAndTargetsFromOptions(options) 22 | : {}), 23 | tags: options.parsedTags, 24 | }); 25 | } 26 | -------------------------------------------------------------------------------- /packages/nx-flutter/src/generators/project/lib/index.ts: -------------------------------------------------------------------------------- 1 | export { generateFlutterProject } from './generate-project'; 2 | export { generateProjectConfiguration } from './generate-project-configuration'; 3 | export { promptAdditionalOptions } from './prompt-additional-options'; 4 | export { normalizeOptions } from './normalize-options'; 5 | -------------------------------------------------------------------------------- /packages/nx-flutter/src/generators/project/schema.d.ts: -------------------------------------------------------------------------------- 1 | export type AndroidLanguageType = 'java' | 'kotlin'; 2 | 3 | export type IosLanguageType = 'objc' | 'swift'; 4 | 5 | export type TemplateType = 'app' | 'module' | 'package' | 'plugin'; 6 | 7 | export type PlatformType = 8 | | 'android' 9 | | 'ios' 10 | | 'linux' 11 | | 'macos' 12 | | 'windows' 13 | | 'web'; 14 | export interface ProjectGeneratorOptions { 15 | directory: string; 16 | name?: string; 17 | org?: string; 18 | description?: string; 19 | androidLanguage?: AndroidLanguageType; 20 | iosLanguage?: IosLanguageType; 21 | template?: TemplateType; 22 | sample?: string; 23 | platforms?: PlatformType[]; 24 | 25 | useFvm?: boolean; 26 | pub?: boolean; 27 | offline?: boolean; 28 | tags?: string; 29 | } 30 | 31 | export interface NormalizedSchema extends ProjectGeneratorOptions { 32 | projectName: string; 33 | projectRoot: string; 34 | parsedTags: string[]; 35 | } 36 | -------------------------------------------------------------------------------- /packages/nx-flutter/src/graph/create-dependencies.ts: -------------------------------------------------------------------------------- 1 | import { CreateDependencies } from '@nx/devkit'; 2 | 3 | import { createDependenciesIf } from '@nxrocks/common'; 4 | import { NX_FLUTTER_PKG } from '../index'; 5 | import { isFlutterProject } from '../utils/flutter-utils'; 6 | import { getPackageInfo } from '../utils/deps-utils'; 7 | 8 | export const createDependencies: CreateDependencies = (_, ctx) => 9 | createDependenciesIf( 10 | NX_FLUTTER_PKG, 11 | ['pubspec.yaml'], 12 | isFlutterProject, 13 | getPackageInfo, 14 | ctx 15 | ); 16 | -------------------------------------------------------------------------------- /packages/nx-flutter/src/graph/create-nodes.ts: -------------------------------------------------------------------------------- 1 | import { createNodesFor, createNodesForV2 } from '@nxrocks/common'; 2 | import { NX_FLUTTER_PKG } from '../index'; 3 | import { isFlutterProject } from '../utils/flutter-utils'; 4 | import { getProjectTypeAndTargetsFromFile } from '../utils/plugin-utils'; 5 | 6 | // wrapped into a () to avoid the 'Cannot access 'NX_FLUTTER_PKG' before initialization' 7 | export const createNodesFn = () => 8 | createNodesFor( 9 | ['pubspec.yaml'], 10 | isFlutterProject, 11 | getProjectTypeAndTargetsFromFile, 12 | NX_FLUTTER_PKG 13 | ); 14 | 15 | export const createNodesFnV2 = () => 16 | createNodesForV2( 17 | ['pubspec.yaml'], 18 | isFlutterProject, 19 | getProjectTypeAndTargetsFromFile, 20 | NX_FLUTTER_PKG 21 | ); 22 | -------------------------------------------------------------------------------- /packages/nx-flutter/src/index.ts: -------------------------------------------------------------------------------- 1 | import { createNodesFn, createNodesFnV2 } from './graph/create-nodes'; 2 | 3 | export { projectGenerator } from './generators/project/generator'; 4 | export { createDependencies } from './graph/create-dependencies'; 5 | 6 | export const NX_FLUTTER_PKG = '@nxrocks/nx-flutter'; 7 | 8 | export const createNodes = createNodesFn(); 9 | export const createNodesV2 = createNodesFnV2(); 10 | -------------------------------------------------------------------------------- /packages/nx-flutter/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "module": "commonjs" 5 | }, 6 | "files": [], 7 | "include": [], 8 | "references": [ 9 | { 10 | "path": "./tsconfig.lib.json" 11 | }, 12 | { 13 | "path": "./tsconfig.spec.json" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /packages/nx-flutter/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "declaration": true, 6 | "types": ["node"] 7 | }, 8 | "include": ["**/*.ts"], 9 | "exclude": ["jest.config.ts", "**/*.spec.ts", "**/*.test.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/nx-flutter/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/nx-ktor/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import baseConfig from '../../eslint.config.mjs'; 2 | 3 | export default [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.json'], 7 | rules: { 8 | '@nx/dependency-checks': [ 9 | 'error', 10 | { 11 | ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs}'], 12 | }, 13 | ], 14 | }, 15 | languageOptions: { 16 | parser: await import('jsonc-eslint-parser'), 17 | }, 18 | }, 19 | { 20 | files: [ 21 | '**/package.json', 22 | '**/generators.json', 23 | '**/executors.json', 24 | '**/migrations.json', 25 | ], 26 | rules: { 27 | '@nx/nx-plugin-checks': 'error', 28 | }, 29 | languageOptions: { 30 | parser: await import('jsonc-eslint-parser'), 31 | }, 32 | }, 33 | ]; 34 | -------------------------------------------------------------------------------- /packages/nx-ktor/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'nx-ktor', 4 | preset: '../../jest.preset.js', 5 | transform: { 6 | '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], 7 | }, 8 | moduleFileExtensions: ['ts', 'js', 'html'], 9 | coverageDirectory: '../../coverage/packages/nx-ktor', 10 | }; 11 | -------------------------------------------------------------------------------- /packages/nx-ktor/migrations.json: -------------------------------------------------------------------------------- 1 | { 2 | "generators": { 3 | "add-install-to-cacheable-operations": { 4 | "version": "3.0.0", 5 | "description": "Add target to Nx cacheable operations", 6 | "implementation": "./src/migrations/update-3.0.0/add-install-to-cacheable-operations" 7 | }, 8 | "make-serve-target-depends-on-dependency-install": { 9 | "version": "9.2.0", 10 | "description": "Migration for v9.2.0", 11 | "implementation": "./src/migrations/update-3.2.0/make-serve-target-depends-on-dependency-install" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/nx-ktor/recipes/images/ktor-features-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/packages/nx-ktor/recipes/images/ktor-features-list.png -------------------------------------------------------------------------------- /packages/nx-ktor/recipes/images/nx-console-add-features.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/packages/nx-ktor/recipes/images/nx-console-add-features.png -------------------------------------------------------------------------------- /packages/nx-ktor/src/executors/build-image/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { BuildImageExecutorOptions } from './schema'; 4 | import { runKtorPluginCommand } from '../../utils/ktor-utils'; 5 | 6 | export async function buildImageExecutor( 7 | options: BuildImageExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runKtorPluginCommand('build-image', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default buildImageExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-ktor/src/executors/build-image/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface BuildImageExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-ktor/src/executors/build/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { BuildExecutorOptions } from './schema'; 4 | import { runKtorPluginCommand } from '../../utils/ktor-utils'; 5 | 6 | export async function buildExecutor( 7 | options: BuildExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runKtorPluginCommand('build', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default buildExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-ktor/src/executors/build/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface BuildExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-ktor/src/executors/build/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "$schema": "http://json-schema.org/schema", 4 | "title": "Build executor", 5 | "description": "", 6 | "outputCapture": "pipe", 7 | "type": "object", 8 | "properties": { 9 | "root": { 10 | "description": "The project root", 11 | "type": "string" 12 | }, 13 | "ignoreWrapper": { 14 | "description": "Whether or not to use the embedded wrapper (`mvnw`or `gradlew`) to perfom build operations", 15 | "type": "boolean", 16 | "default": false 17 | }, 18 | "runFromParentModule": { 19 | "description": "Whether or not to run the (child) module from the context of its parent", 20 | "type": "boolean", 21 | "default": false 22 | }, 23 | "args": { 24 | "description": "The argument to be passed to the underlying Ktor command", 25 | "type": "array", 26 | "default": [] 27 | } 28 | }, 29 | "required": [] 30 | } 31 | -------------------------------------------------------------------------------- /packages/nx-ktor/src/executors/check-format/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { FormatCheckExecutorOptions } from './schema'; 4 | import { runKtorPluginCommand } from '../../utils/ktor-utils'; 5 | 6 | export async function formatCheckExecutor( 7 | options: FormatCheckExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runKtorPluginCommand('check-format', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default formatCheckExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-ktor/src/executors/check-format/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface FormatCheckExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-ktor/src/executors/clean/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { CleanExecutorOptions } from './schema'; 4 | import { runKtorPluginCommand } from '../../utils/ktor-utils'; 5 | 6 | export async function cleanExecutor( 7 | options: CleanExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runKtorPluginCommand('clean', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default cleanExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-ktor/src/executors/clean/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface CleanExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-ktor/src/executors/format/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { FormatExecutorOptions } from './schema'; 4 | import { runKtorPluginCommand } from '../../utils/ktor-utils'; 5 | 6 | export async function formatExecutor( 7 | options: FormatExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runKtorPluginCommand('format', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default formatExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-ktor/src/executors/format/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface FormatExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-ktor/src/executors/format/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "$schema": "http://json-schema.org/schema", 4 | "title": "Format executor", 5 | "description": "", 6 | "cli": "nx", 7 | "outputCapture": "pipe", 8 | "type": "object", 9 | "properties": { 10 | "root": { 11 | "description": "The project root", 12 | "type": "string" 13 | }, 14 | "ignoreWrapper": { 15 | "description": "Whether or not to use the embedded wrapper (`mvnw`or `gradlew`) to perfom build operations", 16 | "type": "boolean", 17 | "default": false 18 | }, 19 | "runFromParentModule": { 20 | "description": "Whether or not to run the (child) module from the context of its parent", 21 | "type": "boolean", 22 | "default": false 23 | }, 24 | "args": { 25 | "description": "The argument to be passed to the underlying Ktor command", 26 | "type": "array", 27 | "default": [] 28 | } 29 | }, 30 | "required": [] 31 | } 32 | -------------------------------------------------------------------------------- /packages/nx-ktor/src/executors/install/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { InstallExecutorOptions } from './schema'; 4 | import { runKtorPluginCommand } from '../../utils/ktor-utils'; 5 | 6 | export async function installExecutor( 7 | options: InstallExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runKtorPluginCommand('install', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default installExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-ktor/src/executors/install/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface InstallExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-ktor/src/executors/publish-image-locally/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { PublishImageLocallyExecutorOptions } from './schema'; 4 | import { runKtorPluginCommand } from '../../utils/ktor-utils'; 5 | 6 | export async function publishImageLocallyExecutor( 7 | options: PublishImageLocallyExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runKtorPluginCommand('publish-image-locally', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default publishImageLocallyExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-ktor/src/executors/publish-image-locally/schema.d.ts: -------------------------------------------------------------------------------- 1 | export interface PublishImageLocallyExecutorOptions { 2 | root: string; 3 | ignoreWrapper?: boolean; 4 | runFromParentModule?: boolean; 5 | args?: string[]; 6 | } 7 | -------------------------------------------------------------------------------- /packages/nx-ktor/src/executors/publish-image/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { PublishImageExecutorOptions } from './schema'; 4 | import { runKtorPluginCommand } from '../../utils/ktor-utils'; 5 | 6 | export async function publishImageExecutor( 7 | options: PublishImageExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runKtorPluginCommand('publish-image', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default publishImageExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-ktor/src/executors/publish-image/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface PublishImageExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-ktor/src/executors/run-docker/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { RunDockerExecutorOptions } from './schema'; 4 | import { runKtorPluginCommand } from '../../utils/ktor-utils'; 5 | 6 | export async function runDockerExecutor( 7 | options: RunDockerExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runKtorPluginCommand('run-docker', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default runDockerExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-ktor/src/executors/run-docker/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface RunDockerExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-ktor/src/executors/run/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { RunExecutorOptions } from './schema'; 4 | import { runKtorPluginCommand } from '../../utils/ktor-utils'; 5 | 6 | export async function runExecutor( 7 | options: RunExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runKtorPluginCommand('run', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default runExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-ktor/src/executors/run/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface RunExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-ktor/src/executors/run/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "$schema": "http://json-schema.org/schema", 4 | "title": "Run executor", 5 | "description": "", 6 | "cli": "nx", 7 | "outputCapture": "pipe", 8 | "type": "object", 9 | "properties": { 10 | "root": { 11 | "description": "The project root", 12 | "type": "string" 13 | }, 14 | "ignoreWrapper": { 15 | "description": "Whether or not to use the embedded wrapper (`mvnw`or `gradlew`) to perfom build operations", 16 | "type": "boolean", 17 | "default": false 18 | }, 19 | "runFromParentModule": { 20 | "description": "Whether or not to run the (child) module from the context of its parent", 21 | "type": "boolean", 22 | "default": false 23 | }, 24 | "args": { 25 | "description": "The argument to be passed to the underlying Ktor command", 26 | "type": "array", 27 | "default": [] 28 | } 29 | }, 30 | "required": [] 31 | } 32 | -------------------------------------------------------------------------------- /packages/nx-ktor/src/executors/test/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { TestExecutorOptions } from './schema'; 4 | import { runKtorPluginCommand } from '../../utils/ktor-utils'; 5 | 6 | export async function testExecutor( 7 | options: TestExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runKtorPluginCommand('test', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default testExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-ktor/src/executors/test/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface TestExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-ktor/src/executors/test/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "$schema": "http://json-schema.org/schema", 4 | "title": "Test executor", 5 | "description": "", 6 | "cli": "nx", 7 | "outputCapture": "pipe", 8 | "type": "object", 9 | "properties": { 10 | "root": { 11 | "description": "The project root", 12 | "type": "string" 13 | }, 14 | "ignoreWrapper": { 15 | "description": "Whether or not to use the embedded wrapper (`mvnw`or `gradlew`) to perform build operations", 16 | "type": "boolean", 17 | "default": false 18 | }, 19 | "runFromParentModule": { 20 | "description": "Whether or not to run the (child) module from the context of its parent", 21 | "type": "boolean", 22 | "default": false 23 | }, 24 | "args": { 25 | "description": "The argument to be passed to the underlying Ktor command", 26 | "type": "array", 27 | "default": [] 28 | } 29 | }, 30 | "required": [] 31 | } 32 | -------------------------------------------------------------------------------- /packages/nx-ktor/src/generators/link/schema.d.ts: -------------------------------------------------------------------------------- 1 | export interface LinkGeneratorSchema { 2 | sourceProjectName: string; 3 | targetProjectName: string; 4 | } -------------------------------------------------------------------------------- /packages/nx-ktor/src/generators/preset/generator.ts: -------------------------------------------------------------------------------- 1 | import { Tree } from '@nx/devkit'; 2 | import { PresetGeneratorSchema } from './schema'; 3 | import projectGenerator from '../project/generator'; 4 | 5 | export async function presetGenerator( 6 | tree: Tree, 7 | options: PresetGeneratorSchema 8 | ) { 9 | if (options.prjName) { 10 | options.directory = options.prjName; 11 | delete options['name']; // remove 'name' set from create-nx-workspace, where it refers to the workspace name and not project name 12 | } 13 | 14 | await projectGenerator(tree, options); 15 | } 16 | 17 | export default presetGenerator; 18 | -------------------------------------------------------------------------------- /packages/nx-ktor/src/generators/preset/schema.d.ts: -------------------------------------------------------------------------------- 1 | import { ProjectGeneratorOptions } from '../project/schema'; 2 | 3 | export interface PresetGeneratorSchema extends ProjectGeneratorOptions { 4 | prjName?: string; //replacement for 'name' & 'directory' which can't be used as-is, because they have a special meaning in `create-nx-workspace` 5 | } 6 | -------------------------------------------------------------------------------- /packages/nx-ktor/src/generators/project/lib/add-docker-maven-plugin.ts: -------------------------------------------------------------------------------- 1 | import { logger, Tree } from '@nx/devkit'; 2 | import { addMavenPlugin } from '@nxrocks/common-jvm'; 3 | import { NormalizedSchema } from '../schema'; 4 | 5 | export function addDockerMavenPlugin(tree: Tree, options: NormalizedSchema) { 6 | if (options.buildSystem === 'MAVEN') { 7 | logger.debug(`Adding 'docker-maven' plugin...`); 8 | 9 | addMavenPlugin( 10 | tree, 11 | options.projectRoot, 12 | 'io.fabric8', 13 | 'docker-maven-plugin', 14 | '0.42.0', 15 | '' 16 | ); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/nx-ktor/src/generators/project/lib/add-dockerfile.ts: -------------------------------------------------------------------------------- 1 | import { generateFiles, logger, Tree } from '@nx/devkit'; 2 | import { join } from 'path'; 3 | import { NormalizedSchema } from '../schema'; 4 | 5 | export function addDockerfile(tree: Tree, options: NormalizedSchema) { 6 | if (options.buildSystem === 'MAVEN') { 7 | //not necessary for gradle buils thanks to the ktor-gradle-plugin 8 | logger.debug(`Adding 'Dockerfile'...`); 9 | 10 | const templateOptions = { 11 | tmpl: '', 12 | }; 13 | generateFiles( 14 | tree, 15 | join(__dirname, '..', 'maven-files'), 16 | options.projectRoot, 17 | templateOptions 18 | ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /packages/nx-ktor/src/generators/project/lib/add-formatting-with-spotless.ts: -------------------------------------------------------------------------------- 1 | import { Tree } from '@nx/devkit'; 2 | import { 3 | addSpotlessGradlePlugin, 4 | addSpotlessMavenPlugin, 5 | } from '@nxrocks/common-jvm'; 6 | import { NormalizedSchema } from '../schema'; 7 | 8 | export function addFormattingWithSpotless( 9 | tree: Tree, 10 | options: NormalizedSchema 11 | ) { 12 | if (options.buildSystem === 'MAVEN') { 13 | addSpotlessMavenPlugin(tree, options.projectRoot, 'kotlin', 11); 14 | } else { 15 | addSpotlessGradlePlugin( 16 | tree, 17 | options.projectRoot, 18 | 'kotlin', 19 | 11, 20 | null, 21 | options.buildSystem === 'GRADLE_KTS' 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/nx-ktor/src/generators/project/lib/index.ts: -------------------------------------------------------------------------------- 1 | export { generateKtorProject } from './generate-ktor-project'; 2 | export { generateProjectConfiguration } from './generate-project-configuration'; 3 | export { addFormattingWithSpotless } from './add-formatting-with-spotless'; 4 | export { addMavenPublishPlugin } from './add-maven-publish-plugin'; 5 | export { normalizeOptions } from './normalize-options'; 6 | export { promptKtorFeatures } from './prompt-ktor-features'; 7 | export { addDockerfile } from './add-dockerfile'; 8 | export { promptForMultiModuleSupport } from './prompt-multi-module-support'; 9 | -------------------------------------------------------------------------------- /packages/nx-ktor/src/generators/project/lib/prompt-ktor-features.ts: -------------------------------------------------------------------------------- 1 | import { NormalizedSchema } from '../schema'; 2 | import { prompt } from 'enquirer'; 3 | import { fetchKtorFeatures } from '../../../utils/ktor-utils'; 4 | import { logger } from '@nx/devkit'; 5 | 6 | export async function promptKtorFeatures(options: NormalizedSchema) { 7 | if (options.features === undefined && process.env.NX_INTERACTIVE === 'true') { 8 | logger.info(`⏳ Fetching Ktor features list. Please wait...`); 9 | 10 | const features = (await fetchKtorFeatures(options)).map((f) => f.name); 11 | 12 | options.projectFeatures = await prompt({ 13 | name: 'features', 14 | message: 15 | 'What features would you like to use? (type something to filter, press [space] to multi-select)', 16 | type: 'autocomplete', 17 | choices: features, 18 | multiple: true, 19 | }).then((a) => a['features']); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/nx-ktor/src/generators/project/maven-files/Dockerfile__tmpl__: -------------------------------------------------------------------------------- 1 | FROM maven:3-openjdk-11 AS build 2 | COPY src /home/maven/src 3 | COPY pom.xml /home/maven/pom.xml 4 | WORKDIR /home/maven 5 | RUN mvn package 6 | 7 | FROM openjdk:11 8 | EXPOSE 8080:8080 9 | RUN mkdir /app 10 | COPY --from=build /home/maven/target/*-with-dependencies.jar /app/app.jar 11 | ENTRYPOINT ["java","-jar","/app/app.jar"] -------------------------------------------------------------------------------- /packages/nx-ktor/src/generators/project/schema.d.ts: -------------------------------------------------------------------------------- 1 | export interface ProjectGeneratorOptions { 2 | directory: string; 3 | name?: string; 4 | tags?: string; 5 | 6 | ktorInitializrUrl?: string; 7 | proxyUrl?: string; 8 | 9 | buildSystem?: 'MAVEN' | 'GRADLE' | 'GRADLE_KTS'; 10 | groupId?: string; 11 | artifactId?: string; 12 | ktorVersion?: string; 13 | kotlinVersion?: 'string'; 14 | engine?: 'NETTY' | 'JETTY' | 'CIO' | 'TOMCAT'; 15 | configurationLocation?: 'YAML' | 'HOCON' | 'CODE'; 16 | features?: string; 17 | skipFormat?: boolean; 18 | skipCodeSamples?: boolean; 19 | 20 | transformIntoMultiModule?: boolean; 21 | addToExistingParentModule?: boolean; 22 | parentModuleName?: string; 23 | keepProjectLevelWrapper?: boolean; 24 | } 25 | 26 | export interface NormalizedSchema extends ProjectGeneratorOptions { 27 | projectName: string; 28 | projectRoot: string; 29 | projectFeatures: string[]; 30 | parsedTags: string[]; 31 | moduleRoot?: string; 32 | } 33 | -------------------------------------------------------------------------------- /packages/nx-ktor/src/graph/create-dependencies.ts: -------------------------------------------------------------------------------- 1 | import { CreateDependencies } from "@nx/devkit"; 2 | 3 | import { JVM_PROJECT_FILES, createDependenciesIf, getJvmPackageInfo } from "@nxrocks/common-jvm"; 4 | import { NX_KTOR_PKG } from "../index"; 5 | import { isKtorProject } from "../utils/ktor-utils"; 6 | 7 | export const createDependencies: CreateDependencies = (_, ctx) => createDependenciesIf(NX_KTOR_PKG, JVM_PROJECT_FILES, isKtorProject, getJvmPackageInfo, ctx); 8 | -------------------------------------------------------------------------------- /packages/nx-ktor/src/graph/create-nodes.ts: -------------------------------------------------------------------------------- 1 | import { 2 | JVM_PROJECT_FILES, 3 | createNodesFor, 4 | createNodesForV2, 5 | } from '@nxrocks/common-jvm'; 6 | import { NX_KTOR_PKG } from '../index'; 7 | import { isKtorProject } from '../utils/ktor-utils'; 8 | import { getProjectTypeAndTargetsFromFile } from '../utils/plugin-utils'; 9 | 10 | // wrapped into a () to avoid the 'Cannot access 'NX_KTOR_PKG' before initialization' 11 | export const createNodesFn = () => 12 | createNodesFor( 13 | JVM_PROJECT_FILES, 14 | isKtorProject, 15 | getProjectTypeAndTargetsFromFile, 16 | NX_KTOR_PKG 17 | ); 18 | 19 | export const createNodesFnV2 = () => 20 | createNodesForV2( 21 | JVM_PROJECT_FILES, 22 | isKtorProject, 23 | getProjectTypeAndTargetsFromFile, 24 | NX_KTOR_PKG 25 | ); 26 | -------------------------------------------------------------------------------- /packages/nx-ktor/src/index.ts: -------------------------------------------------------------------------------- 1 | import { createNodesFn, createNodesFnV2 } from './graph/create-nodes'; 2 | 3 | export { projectGenerator } from './generators/project/generator'; 4 | export { createDependencies } from './graph/create-dependencies'; 5 | 6 | export const NX_KTOR_PKG = '@nxrocks/nx-ktor'; 7 | 8 | export const createNodes = createNodesFn(); 9 | export const createNodesV2 = createNodesFnV2(); 10 | -------------------------------------------------------------------------------- /packages/nx-ktor/src/migrations/update-3.0.0/add-install-to-cacheable-operations.spec.ts: -------------------------------------------------------------------------------- 1 | import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; 2 | import { NxJsonConfiguration, Tree, readJson } from '@nx/devkit'; 3 | 4 | import update from './add-install-to-cacheable-operations'; 5 | 6 | describe('add-install-to-cacheable-operations migration', () => { 7 | let tree: Tree; 8 | 9 | beforeEach(() => { 10 | tree = createTreeWithEmptyWorkspace(); 11 | }); 12 | 13 | it('should run successfully', async () => { 14 | await update(tree); 15 | const nxJson = readJson(tree, 'nx.json'); 16 | expect(nxJson.targetDefaults?.['install'].cache).toBe(true) 17 | 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /packages/nx-ktor/src/migrations/update-3.0.0/add-install-to-cacheable-operations.ts: -------------------------------------------------------------------------------- 1 | import { NxJsonConfiguration, Tree, formatFiles, readJson, writeJson } from '@nx/devkit'; 2 | 3 | export default async function update(host: Tree) { 4 | const nxJson = readJson(host, 'nx.json'); 5 | 6 | let cacheableOperationsPreNx17 = nxJson.tasksRunnerOptions?.['default']?.options?.cacheableOperations; 7 | 8 | if (cacheableOperationsPreNx17?.includes['install'] === false) { 9 | cacheableOperationsPreNx17 = [...cacheableOperationsPreNx17, 'install']; 10 | 11 | writeJson(host, 'nx.json', nxJson); 12 | } 13 | else { 14 | nxJson.targetDefaults ??= {}; 15 | nxJson.targetDefaults['install'] ??= {}; 16 | nxJson.targetDefaults['install'].cache ??= true; 17 | 18 | writeJson(host, 'nx.json', nxJson); 19 | } 20 | 21 | await formatFiles(host); 22 | } 23 | -------------------------------------------------------------------------------- /packages/nx-ktor/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "module": "commonjs" 5 | }, 6 | "files": [], 7 | "include": [], 8 | "references": [ 9 | { 10 | "path": "./tsconfig.lib.json" 11 | }, 12 | { 13 | "path": "./tsconfig.spec.json" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /packages/nx-ktor/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "declaration": true, 6 | "types": ["node"] 7 | }, 8 | "include": ["src/**/*.ts"], 9 | "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/nx-ktor/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": [ 9 | "jest.config.ts", 10 | "src/**/*.test.ts", 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /packages/nx-melos/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import baseConfig from '../../eslint.config.mjs'; 2 | 3 | export default [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.json'], 7 | rules: { 8 | '@nx/dependency-checks': [ 9 | 'error', 10 | { 11 | ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs}'], 12 | }, 13 | ], 14 | }, 15 | languageOptions: { 16 | parser: await import('jsonc-eslint-parser'), 17 | }, 18 | }, 19 | { 20 | files: [ 21 | '**/package.json', 22 | '**/generators.json', 23 | '**/executors.json', 24 | '**/migrations.json', 25 | ], 26 | rules: { 27 | '@nx/nx-plugin-checks': 'error', 28 | }, 29 | languageOptions: { 30 | parser: await import('jsonc-eslint-parser'), 31 | }, 32 | }, 33 | ]; 34 | -------------------------------------------------------------------------------- /packages/nx-melos/executors.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "executors": { 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /packages/nx-melos/generators.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "name": "nx-melos", 4 | "version": "0.0.1", 5 | "generators": { 6 | "init": { 7 | "factory": "./src/generators/init/generator", 8 | "schema": "./src/generators/init/schema.json", 9 | "description": "Generator that initializes Melos for Flutter/Dart projects in the workspace", 10 | "aliases": ["configure", "config", "new"] 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/nx-melos/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'nx-melos', 4 | preset: '../../jest.preset.js', 5 | transform: { 6 | '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], 7 | }, 8 | moduleFileExtensions: ['ts', 'js', 'html'], 9 | coverageDirectory: '../../coverage/packages/nx-melos', 10 | }; 11 | -------------------------------------------------------------------------------- /packages/nx-melos/src/generators/init/generator.ts: -------------------------------------------------------------------------------- 1 | import { Tree, formatFiles } from '@nx/devkit'; 2 | import { addPluginToNxJson } from '@nxrocks/common'; 3 | import { NX_MELOS_PKG } from '../../index'; 4 | import { 5 | installMelosPackageGlobally, 6 | generateMelosConfigurationFile, 7 | addMelosScriptsToPackageJson, 8 | } from './lib'; 9 | import { InitGeneratorOptions } from './schema'; 10 | 11 | export async function initGenerator(tree: Tree, options: InitGeneratorOptions) { 12 | await installMelosPackageGlobally(); 13 | await generateMelosConfigurationFile(tree); 14 | addMelosScriptsToPackageJson(tree, options); 15 | addPluginToNxJson(NX_MELOS_PKG, tree, null); 16 | await formatFiles(tree); 17 | } 18 | 19 | export default initGenerator; 20 | -------------------------------------------------------------------------------- /packages/nx-melos/src/generators/init/lib/index.ts: -------------------------------------------------------------------------------- 1 | export { installMelosPackageGlobally } from './install-melos-package'; 2 | export { generateMelosConfigurationFile } from './generate-melos-configuration'; 3 | export { addMelosScriptsToPackageJson } from './add-melos-scripts'; 4 | -------------------------------------------------------------------------------- /packages/nx-melos/src/generators/init/root-files/nx-melos.mjs: -------------------------------------------------------------------------------- 1 | import { homedir} from 'os'; 2 | import { spawnSync} from 'child_process'; 3 | 4 | // This plugin (nx-melos) installs 'melos' (upon initialization) as a Dart global package (inside user's home folder at `~/.pub-cache/bin`). 5 | // But that folder might not be on your PATH environment variable, so we cannot rely on the 'melos' executable to be globally available. 6 | // Thus this wrapper, that uses the full path (OS independent) to the 'melos' executable. 7 | 8 | const melosExec = `${homedir()}/.pub-cache/bin/melos`; 9 | 10 | const args = process.argv.slice(2); 11 | const execute = `${melosExec} ${args}`; 12 | const silent = false; 13 | try { 14 | spawnSync(execute, { shell: false, ...(silent ? { stdio: ['ignore', 'ignore', 'ignore'] } : {}), }); 15 | } catch (e) { 16 | console.error(`Failed to execute command: ${execute}`); 17 | console.error(e); 18 | } -------------------------------------------------------------------------------- /packages/nx-melos/src/generators/init/schema.d.ts: -------------------------------------------------------------------------------- 1 | export interface InitGeneratorOptions { 2 | scriptNameSeparator?: '-' | ':'; 3 | } 4 | -------------------------------------------------------------------------------- /packages/nx-melos/src/generators/init/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "$id": "@nxrocks/nx-melos:init", 4 | "description": "Init Generator.", 5 | "title": "Generates the configuration to use Melos to manage Flutter/Dart projects in the workspace", 6 | "type": "object", 7 | "properties": { 8 | "scriptNameSeparator": { 9 | "description": "Separator to use to name melos scripts added in the root package.json file (for e.g 'melos-bootstrap' or 'melos:bootstrap').", 10 | "default": "-", 11 | "type": "string", 12 | "enum": [ 13 | ":", 14 | "-" 15 | ], 16 | "x-prompt": { 17 | "message": "What separator would you like to use to generate the name of melos scripts added in the root package.json file? (for e.g 'melos-bootstrap' or 'melos:bootstrap')" 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/nx-melos/src/index.ts: -------------------------------------------------------------------------------- 1 | export const NX_MELOS_PKG = '@nxrocks/nx-melos'; 2 | -------------------------------------------------------------------------------- /packages/nx-melos/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | "forceConsistentCasingInFileNames": true, 6 | "strict": true, 7 | "noImplicitOverride": true, 8 | "noPropertyAccessFromIndexSignature": true, 9 | "noImplicitReturns": true, 10 | "noFallthroughCasesInSwitch": true 11 | }, 12 | "files": [], 13 | "include": [], 14 | "references": [ 15 | { 16 | "path": "./tsconfig.lib.json" 17 | }, 18 | { 19 | "path": "./tsconfig.spec.json" 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /packages/nx-melos/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "declaration": true, 6 | "types": ["node"] 7 | }, 8 | "include": ["**/*.ts"], 9 | "exclude": ["jest.config.ts", "**/*.spec.ts", "**/*.test.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/nx-melos/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/nx-micronaut/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import baseConfig from '../../eslint.config.mjs'; 2 | 3 | export default [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.json'], 7 | rules: { 8 | '@nx/dependency-checks': [ 9 | 'error', 10 | { 11 | ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs}'], 12 | }, 13 | ], 14 | }, 15 | languageOptions: { 16 | parser: await import('jsonc-eslint-parser'), 17 | }, 18 | }, 19 | { 20 | files: [ 21 | '**/package.json', 22 | '**/generators.json', 23 | '**/executors.json', 24 | '**/migrations.json', 25 | ], 26 | rules: { 27 | '@nx/nx-plugin-checks': 'error', 28 | }, 29 | languageOptions: { 30 | parser: await import('jsonc-eslint-parser'), 31 | }, 32 | }, 33 | ]; 34 | -------------------------------------------------------------------------------- /packages/nx-micronaut/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'nx-micronaut', 4 | preset: '../../jest.preset.js', 5 | transform: { 6 | '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], 7 | }, 8 | moduleFileExtensions: ['ts', 'js', 'html'], 9 | coverageDirectory: '../../coverage/packages/nx-micronaut', 10 | }; 11 | -------------------------------------------------------------------------------- /packages/nx-micronaut/migrations.json: -------------------------------------------------------------------------------- 1 | { 2 | "generators": { 3 | "add-install-to-cacheable-operations": { 4 | "version": "5.0.0", 5 | "description": "Add target to Nx cacheable operations", 6 | "implementation": "./src/migrations/update-5.0.0/add-install-to-cacheable-operations" 7 | }, 8 | "make-serve-target-depends-on-dependency-install": { 9 | "version": "9.2.0", 10 | "description": "Migration for v9.2.0", 11 | "implementation": "./src/migrations/update-5.2.0/make-serve-target-depends-on-dependency-install" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/nx-micronaut/recipes/images/micronaut-features-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/packages/nx-micronaut/recipes/images/micronaut-features-list.png -------------------------------------------------------------------------------- /packages/nx-micronaut/recipes/images/nx-console-add-features.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/packages/nx-micronaut/recipes/images/nx-console-add-features.png -------------------------------------------------------------------------------- /packages/nx-micronaut/src/executors/aot-sample-config/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { AotSampleConfigExecutorOptions } from './schema'; 4 | import { runMicronautPluginCommand } from '../../utils/micronaut-utils'; 5 | 6 | export async function aotSampleConfigExecutor( 7 | options: AotSampleConfigExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runMicronautPluginCommand('aot-sample-config', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default aotSampleConfigExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-micronaut/src/executors/aot-sample-config/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface AotSampleConfigExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-micronaut/src/executors/build/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { BuildExecutorOptions } from './schema'; 4 | import { runMicronautPluginCommand } from '../../utils/micronaut-utils'; 5 | 6 | export async function buildExecutor( 7 | options: BuildExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runMicronautPluginCommand('build', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default buildExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-micronaut/src/executors/build/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface BuildExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-micronaut/src/executors/build/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "$schema": "http://json-schema.org/schema", 4 | "title": "Build executor", 5 | "description": "", 6 | "outputCapture": "pipe", 7 | "type": "object", 8 | "properties": { 9 | "root": { 10 | "description": "The project root", 11 | "type": "string" 12 | }, 13 | "ignoreWrapper": { 14 | "description": "Whether or not to use the embedded wrapper (`mvnw`or `gradlew`) to perfom build operations", 15 | "type": "boolean", 16 | "default": false 17 | }, 18 | "runFromParentModule": { 19 | "description": "Whether or not to run the (child) module from the context of its parent", 20 | "type": "boolean", 21 | "default": false 22 | }, 23 | "args": { 24 | "description": "The argument to be passed to the underlying Micronaut command", 25 | "type": "array", 26 | "default": [] 27 | } 28 | }, 29 | "required": [] 30 | } 31 | -------------------------------------------------------------------------------- /packages/nx-micronaut/src/executors/check-format/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { FormatCheckExecutorOptions } from './schema'; 4 | import { runMicronautPluginCommand } from '../../utils/micronaut-utils'; 5 | 6 | export async function formatCheckExecutor( 7 | options: FormatCheckExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runMicronautPluginCommand('check-format', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default formatCheckExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-micronaut/src/executors/check-format/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface FormatCheckExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-micronaut/src/executors/check-format/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "$schema": "http://json-schema.org/schema", 4 | "title": "Format Check executor", 5 | "description": "", 6 | "outputCapture": "pipe", 7 | "type": "object", 8 | "properties": { 9 | "root": { 10 | "description": "The project root", 11 | "type": "string" 12 | }, 13 | "ignoreWrapper": { 14 | "description": "Whether or not to use the embedded wrapper (`mvnw`or `gradlew`) to perfom build operations", 15 | "type": "boolean", 16 | "default": false 17 | }, 18 | "runFromParentModule": { 19 | "description": "Whether or not to run the (child) module from the context of its parent", 20 | "type": "boolean", 21 | "default": false 22 | }, 23 | "args": { 24 | "description": "The argument to be passed to the underlying Micronaut command", 25 | "type": "array", 26 | "default": [] 27 | } 28 | }, 29 | "required": [] 30 | } 31 | -------------------------------------------------------------------------------- /packages/nx-micronaut/src/executors/clean/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { CleanExecutorOptions } from './schema'; 4 | import { runMicronautPluginCommand } from '../../utils/micronaut-utils'; 5 | 6 | export async function cleanExecutor( 7 | options: CleanExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runMicronautPluginCommand('clean', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default cleanExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-micronaut/src/executors/clean/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface CleanExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-micronaut/src/executors/clean/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "$schema": "http://json-schema.org/schema", 4 | "title": "Clean executor", 5 | "description": "", 6 | "outputCapture": "pipe", 7 | "type": "object", 8 | "properties": { 9 | "root": { 10 | "description": "The project root", 11 | "type": "string" 12 | }, 13 | "ignoreWrapper": { 14 | "description": "Whether or not to use the embedded wrapper (`mvnw`or `gradlew`) to perfom build operations", 15 | "type": "boolean", 16 | "default": false 17 | }, 18 | "runFromParentModule": { 19 | "description": "Whether or not to run the (child) module from the context of its parent", 20 | "type": "boolean", 21 | "default": false 22 | }, 23 | "args": { 24 | "description": "The argument to be passed to the underlying Maven or Gradle command", 25 | "type": "array", 26 | "default": [] 27 | } 28 | }, 29 | "required": [] 30 | } 31 | -------------------------------------------------------------------------------- /packages/nx-micronaut/src/executors/dockerfile/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { DockerfileExecutorOptions } from './schema'; 4 | import { runMicronautPluginCommand } from '../../utils/micronaut-utils'; 5 | 6 | export async function buildExecutor( 7 | options: DockerfileExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runMicronautPluginCommand('dockerfile', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default buildExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-micronaut/src/executors/dockerfile/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface DockerfileExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-micronaut/src/executors/dockerfile/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "$schema": "http://json-schema.org/schema", 4 | "title": "Dockerfile executor", 5 | "description": "", 6 | "outputCapture": "pipe", 7 | "type": "object", 8 | "properties": { 9 | "root": { 10 | "description": "The project root", 11 | "type": "string" 12 | }, 13 | "ignoreWrapper": { 14 | "description": "Whether or not to use the embedded wrapper (`mvnw`or `gradlew`) to perfom build operations", 15 | "type": "boolean", 16 | "default": false 17 | }, 18 | "runFromParentModule": { 19 | "description": "Whether or not to run the (child) module from the context of its parent", 20 | "type": "boolean", 21 | "default": false 22 | }, 23 | "args": { 24 | "description": "The argument to be passed to the underlying Micronaut command", 25 | "type": "array", 26 | "default": [] 27 | } 28 | }, 29 | "required": [] 30 | } 31 | -------------------------------------------------------------------------------- /packages/nx-micronaut/src/executors/format/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { FormatExecutorOptions } from './schema'; 4 | import { runMicronautPluginCommand } from '../../utils/micronaut-utils'; 5 | 6 | export async function formatExecutor( 7 | options: FormatExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runMicronautPluginCommand('format', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default formatExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-micronaut/src/executors/format/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface FormatExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-micronaut/src/executors/format/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "$schema": "http://json-schema.org/schema", 4 | "title": "Format executor", 5 | "description": "", 6 | "outputCapture": "pipe", 7 | "type": "object", 8 | "properties": { 9 | "root": { 10 | "description": "The project root", 11 | "type": "string" 12 | }, 13 | "ignoreWrapper": { 14 | "description": "Whether or not to use the embedded wrapper (`mvnw`or `gradlew`) to perfom build operations", 15 | "type": "boolean", 16 | "default": false 17 | }, 18 | "runFromParentModule": { 19 | "description": "Whether or not to run the (child) module from the context of its parent", 20 | "type": "boolean", 21 | "default": false 22 | }, 23 | "args": { 24 | "description": "The argument to be passed to the underlying Micronaut command", 25 | "type": "array", 26 | "default": [] 27 | } 28 | }, 29 | "required": [] 30 | } 31 | -------------------------------------------------------------------------------- /packages/nx-micronaut/src/executors/install/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { InstallExecutorOptions } from './schema'; 4 | import { runMicronautPluginCommand } from '../../utils/micronaut-utils'; 5 | 6 | export async function installExecutor( 7 | options: InstallExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runMicronautPluginCommand('install', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default installExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-micronaut/src/executors/install/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface InstallExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-micronaut/src/executors/install/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "$schema": "http://json-schema.org/schema", 4 | "title": "Install executor", 5 | "description": "", 6 | "outputCapture": "pipe", 7 | "type": "object", 8 | "properties": { 9 | "root": { 10 | "description": "The project root", 11 | "type": "string" 12 | }, 13 | "ignoreWrapper": { 14 | "description": "Whether or not to use the embedded wrapper (`mvnw`or `gradlew`) to perfom build operations", 15 | "type": "boolean", 16 | "default": false 17 | }, 18 | "runFromParentModule": { 19 | "description": "Whether or not to run the (child) module from the context of its parent", 20 | "type": "boolean", 21 | "default": false 22 | }, 23 | "args": { 24 | "description": "The argument to be passed to the underlying Quarkus command", 25 | "type": "array", 26 | "default": [] 27 | } 28 | }, 29 | "required": [] 30 | } 31 | -------------------------------------------------------------------------------- /packages/nx-micronaut/src/executors/run/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { RunExecutorOptions } from './schema'; 4 | import { runMicronautPluginCommand } from '../../utils/micronaut-utils'; 5 | 6 | export async function runExecutor( 7 | options: RunExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runMicronautPluginCommand('run', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default runExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-micronaut/src/executors/run/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface RunExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-micronaut/src/executors/run/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "$schema": "http://json-schema.org/schema", 4 | "title": "Run executor", 5 | "description": "", 6 | "outputCapture": "pipe", 7 | "type": "object", 8 | "properties": { 9 | "root": { 10 | "description": "The project root", 11 | "type": "string" 12 | }, 13 | "ignoreWrapper": { 14 | "description": "Whether or not to use the embedded wrapper (`mvnw`or `gradlew`) to perfom build operations", 15 | "type": "boolean", 16 | "default": false 17 | }, 18 | "runFromParentModule": { 19 | "description": "Whether or not to run the (child) module from the context of its parent", 20 | "type": "boolean", 21 | "default": false 22 | }, 23 | "args": { 24 | "description": "The argument to be passed to the underlying Micronaut command", 25 | "type": "array", 26 | "default": [] 27 | } 28 | }, 29 | "required": [] 30 | } 31 | -------------------------------------------------------------------------------- /packages/nx-micronaut/src/executors/test/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { TestExecutorOptions } from './schema'; 4 | import { runMicronautPluginCommand } from '../../utils/micronaut-utils'; 5 | 6 | export async function testExecutor( 7 | options: TestExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runMicronautPluginCommand('test', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default testExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-micronaut/src/executors/test/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface TestExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-micronaut/src/executors/test/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "$schema": "http://json-schema.org/schema", 4 | "title": "Test executor", 5 | "description": "", 6 | "outputCapture": "pipe", 7 | "type": "object", 8 | "properties": { 9 | "root": { 10 | "description": "The project root", 11 | "type": "string" 12 | }, 13 | "ignoreWrapper": { 14 | "description": "Whether or not to use the embedded wrapper (`mvnw`or `gradlew`) to perform build operations", 15 | "type": "boolean", 16 | "default": false 17 | }, 18 | "runFromParentModule": { 19 | "description": "Whether or not to run the (child) module from the context of its parent", 20 | "type": "boolean", 21 | "default": false 22 | }, 23 | "args": { 24 | "description": "The argument to be passed to the underlying Micronaut command", 25 | "type": "array", 26 | "default": [] 27 | } 28 | }, 29 | "required": [] 30 | } 31 | -------------------------------------------------------------------------------- /packages/nx-micronaut/src/generators/link/schema.d.ts: -------------------------------------------------------------------------------- 1 | export interface LinkGeneratorSchema { 2 | sourceProjectName: string; 3 | targetProjectName: string; 4 | } -------------------------------------------------------------------------------- /packages/nx-micronaut/src/generators/preset/generator.ts: -------------------------------------------------------------------------------- 1 | import { Tree } from '@nx/devkit'; 2 | import { PresetGeneratorSchema } from './schema'; 3 | import projectGenerator from '../project/generator'; 4 | 5 | export async function presetGenerator( 6 | tree: Tree, 7 | options: PresetGeneratorSchema 8 | ) { 9 | if (options.prjName) { 10 | options.directory = options.prjName; 11 | delete options['name']; // remove 'name' set from create-nx-workspace, where it refers to the workspace name and not project name 12 | } 13 | 14 | await projectGenerator(tree, options); 15 | } 16 | 17 | export default presetGenerator; 18 | -------------------------------------------------------------------------------- /packages/nx-micronaut/src/generators/preset/schema.d.ts: -------------------------------------------------------------------------------- 1 | import { ProjectGeneratorOptions } from '../project/schema'; 2 | 3 | export interface PresetGeneratorSchema extends ProjectGeneratorOptions { 4 | prjName?: string; //replacement for 'name' & 'directory' which can't be used as-is, because they have a special meaning in `create-nx-workspace` 5 | } 6 | -------------------------------------------------------------------------------- /packages/nx-micronaut/src/generators/project/lib/add-formatting-with-spotless.ts: -------------------------------------------------------------------------------- 1 | import { Tree } from '@nx/devkit'; 2 | import { 3 | addSpotlessGradlePlugin, 4 | addSpotlessMavenPlugin, 5 | } from '@nxrocks/common-jvm'; 6 | import { NormalizedSchema } from '../schema'; 7 | 8 | export function addFormattingWithSpotless( 9 | tree: Tree, 10 | options: NormalizedSchema 11 | ) { 12 | if (options.buildSystem === 'MAVEN') { 13 | addSpotlessMavenPlugin(tree, options.projectRoot, 'java', 11); 14 | } else { 15 | addSpotlessGradlePlugin( 16 | tree, 17 | options.projectRoot, 18 | 'java', 19 | 11, 20 | null, 21 | options.buildSystem === 'GRADLE_KOTLIN' 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/nx-micronaut/src/generators/project/lib/index.ts: -------------------------------------------------------------------------------- 1 | export { generateMicronautProject } from './generate-micronaut-project'; 2 | export { generateProjectConfiguration } from './generate-project-configuration'; 3 | export { addFormattingWithSpotless } from './add-formatting-with-spotless'; 4 | export { addMavenPublishPlugin } from './add-maven-publish-plugin'; 5 | export { normalizeOptions } from './normalize-options'; 6 | export { promptMicronautFeatures } from './prompt-micronaut-features'; 7 | export { promptForMultiModuleSupport } from './prompt-multi-module-support'; 8 | -------------------------------------------------------------------------------- /packages/nx-micronaut/src/generators/project/lib/prompt-micronaut-features.ts: -------------------------------------------------------------------------------- 1 | import { NormalizedSchema } from '../schema'; 2 | import { prompt } from 'enquirer'; 3 | import { fetchMicronautFeatures } from '../../../utils/micronaut-utils'; 4 | import { logger } from '@nx/devkit'; 5 | 6 | export async function promptMicronautFeatures(options: NormalizedSchema) { 7 | if (options.features === undefined && process.env.NX_INTERACTIVE === 'true') { 8 | logger.info(`⏳ Fetching Micronaut features list. Please wait...`); 9 | 10 | const features = (await fetchMicronautFeatures(options)).map((f) => f.name); 11 | 12 | options.projectFeatures = await prompt({ 13 | name: 'features', 14 | message: 15 | 'What features would you like to use? (type something to filter, press [space] to multi-select)', 16 | type: 'autocomplete', 17 | choices: features, 18 | multiple: true, 19 | }).then((a) => a['features']); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/nx-micronaut/src/graph/create-dependencies.ts: -------------------------------------------------------------------------------- 1 | import { CreateDependencies } from "@nx/devkit"; 2 | 3 | import { JVM_PROJECT_FILES, createDependenciesIf, getJvmPackageInfo } from "@nxrocks/common-jvm"; 4 | import { NX_MICRONAUT_PKG } from "../index"; 5 | import { isMicronautProject } from "../utils/micronaut-utils"; 6 | 7 | export const createDependencies: CreateDependencies = (_, ctx) => createDependenciesIf(NX_MICRONAUT_PKG, JVM_PROJECT_FILES, isMicronautProject, getJvmPackageInfo, ctx); 8 | -------------------------------------------------------------------------------- /packages/nx-micronaut/src/graph/create-nodes.ts: -------------------------------------------------------------------------------- 1 | import { 2 | JVM_PROJECT_FILES, 3 | createNodesFor, 4 | createNodesForV2, 5 | } from '@nxrocks/common-jvm'; 6 | import { NX_MICRONAUT_PKG } from '../index'; 7 | import { isMicronautProject } from '../utils/micronaut-utils'; 8 | import { getProjectTypeAndTargetsFromFile } from '../utils/plugin-utils'; 9 | 10 | // wrapped into a () to avoid the 'Cannot access 'NX_MICRONAUT_PKG' before initialization' 11 | export const createNodesFn = () => 12 | createNodesFor( 13 | JVM_PROJECT_FILES, 14 | isMicronautProject, 15 | getProjectTypeAndTargetsFromFile, 16 | NX_MICRONAUT_PKG 17 | ); 18 | 19 | export const createNodesFnV2 = () => 20 | createNodesForV2( 21 | JVM_PROJECT_FILES, 22 | isMicronautProject, 23 | getProjectTypeAndTargetsFromFile, 24 | NX_MICRONAUT_PKG 25 | ); 26 | -------------------------------------------------------------------------------- /packages/nx-micronaut/src/index.ts: -------------------------------------------------------------------------------- 1 | import { createNodesFn, createNodesFnV2 } from './graph/create-nodes'; 2 | 3 | export { projectGenerator } from './generators/project/generator'; 4 | export { createDependencies } from './graph/create-dependencies'; 5 | 6 | export const NX_MICRONAUT_PKG = '@nxrocks/nx-micronaut'; 7 | 8 | export const createNodes = createNodesFn(); 9 | export const createNodesV2 = createNodesFnV2(); 10 | -------------------------------------------------------------------------------- /packages/nx-micronaut/src/migrations/update-5.0.0/add-install-to-cacheable-operations.spec.ts: -------------------------------------------------------------------------------- 1 | import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; 2 | import { NxJsonConfiguration, Tree, readJson } from '@nx/devkit'; 3 | 4 | import update from './add-install-to-cacheable-operations'; 5 | 6 | describe('add-install-to-cacheable-operations migration', () => { 7 | let tree: Tree; 8 | 9 | beforeEach(() => { 10 | tree = createTreeWithEmptyWorkspace(); 11 | }); 12 | 13 | it('should run successfully', async () => { 14 | await update(tree); 15 | const nxJson = readJson(tree, 'nx.json'); 16 | expect(nxJson.targetDefaults?.['install'].cache).toBe(true) 17 | 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /packages/nx-micronaut/src/migrations/update-5.0.0/add-install-to-cacheable-operations.ts: -------------------------------------------------------------------------------- 1 | import { NxJsonConfiguration, Tree, formatFiles, readJson, writeJson } from '@nx/devkit'; 2 | 3 | export default async function update(host: Tree) { 4 | const nxJson = readJson(host, 'nx.json'); 5 | 6 | let cacheableOperationsPreNx17 = nxJson.tasksRunnerOptions?.['default']?.options?.cacheableOperations; 7 | 8 | if (cacheableOperationsPreNx17?.includes['install'] === false) { 9 | cacheableOperationsPreNx17 = [...cacheableOperationsPreNx17, 'install']; 10 | 11 | writeJson(host, 'nx.json', nxJson); 12 | } 13 | else { 14 | nxJson.targetDefaults ??= {}; 15 | nxJson.targetDefaults['install'] ??= {}; 16 | nxJson.targetDefaults['install'].cache ??= true; 17 | 18 | writeJson(host, 'nx.json', nxJson); 19 | } 20 | 21 | await formatFiles(host); 22 | } 23 | -------------------------------------------------------------------------------- /packages/nx-micronaut/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "module": "commonjs" 5 | }, 6 | "files": [], 7 | "include": [], 8 | "references": [ 9 | { 10 | "path": "./tsconfig.lib.json" 11 | }, 12 | { 13 | "path": "./tsconfig.spec.json" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /packages/nx-micronaut/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "declaration": true, 6 | "types": [] 7 | }, 8 | "include": ["**/*.ts"], 9 | "exclude": ["jest.config.ts", "**/*.spec.ts", "**/*.test.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/nx-micronaut/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/nx-quarkus/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import baseConfig from '../../eslint.config.mjs'; 2 | 3 | export default [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.json'], 7 | rules: { 8 | '@nx/dependency-checks': [ 9 | 'error', 10 | { 11 | ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs}'], 12 | }, 13 | ], 14 | }, 15 | languageOptions: { 16 | parser: await import('jsonc-eslint-parser'), 17 | }, 18 | }, 19 | { 20 | files: [ 21 | '**/package.json', 22 | '**/generators.json', 23 | '**/executors.json', 24 | '**/migrations.json', 25 | ], 26 | rules: { 27 | '@nx/nx-plugin-checks': 'error', 28 | }, 29 | languageOptions: { 30 | parser: await import('jsonc-eslint-parser'), 31 | }, 32 | }, 33 | ]; 34 | -------------------------------------------------------------------------------- /packages/nx-quarkus/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'nx-quarkus', 4 | preset: '../../jest.preset.js', 5 | transform: { 6 | '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], 7 | }, 8 | moduleFileExtensions: ['ts', 'js', 'html'], 9 | coverageDirectory: '../../coverage/packages/nx-quarkus', 10 | }; 11 | -------------------------------------------------------------------------------- /packages/nx-quarkus/migrations.json: -------------------------------------------------------------------------------- 1 | { 2 | "generators": { 3 | "add-install-to-cacheable-operations": { 4 | "version": "7.0.0", 5 | "description": "Add target to Nx cacheable operations", 6 | "implementation": "./src/migrations/update-7.0.0/add-install-to-cacheable-operations" 7 | }, 8 | "make-serve-target-depends-on-dependency-install": { 9 | "version": "9.2.0", 10 | "description": "Migration for v9.2.0", 11 | "implementation": "./src/migrations/update-7.2.0/make-serve-target-depends-on-dependency-install" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/nx-quarkus/recipes/images/nx-console-add-extensions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/packages/nx-quarkus/recipes/images/nx-console-add-extensions.png -------------------------------------------------------------------------------- /packages/nx-quarkus/recipes/images/quarkus-extensions-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/packages/nx-quarkus/recipes/images/quarkus-extensions-list.png -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/add-extension/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { AddExtensionExecutorOptions } from './schema'; 4 | import { runQuarkusPluginCommand } from '../../utils/quarkus-utils'; 5 | 6 | export async function addExtensionExecutor( 7 | options: AddExtensionExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runQuarkusPluginCommand('add-extension', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default addExtensionExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/add-extension/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface AddExtensionExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | extensions?: string; 7 | args?: string[]; 8 | } -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/build/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { BuildExecutorOptions } from './schema'; 4 | import { runQuarkusPluginCommand } from '../../utils/quarkus-utils'; 5 | 6 | export async function buildExecutor( 7 | options: BuildExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runQuarkusPluginCommand('build', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default buildExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/build/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface BuildExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/build/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "$schema": "http://json-schema.org/schema", 4 | "title": "Build executor", 5 | "description": "", 6 | "outputCapture": "pipe", 7 | "type": "object", 8 | "properties": { 9 | "root": { 10 | "description": "The project root", 11 | "type": "string" 12 | }, 13 | "ignoreWrapper": { 14 | "description": "Whether or not to use the embedded wrapper (`mvnw`or `gradlew`) to perfom build operations", 15 | "type": "boolean", 16 | "default": false 17 | }, 18 | "runFromParentModule": { 19 | "description": "Whether or not to run the (child) module from the context of its parent", 20 | "type": "boolean", 21 | "default": false 22 | }, 23 | "args": { 24 | "description": "The argument to be passed to the underlying Quarkus command", 25 | "type": "array", 26 | "default": [] 27 | } 28 | }, 29 | "required": [] 30 | } 31 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/check-format/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { FormatCheckExecutorOptions } from './schema'; 4 | import { runQuarkusPluginCommand } from '../../utils/quarkus-utils'; 5 | 6 | export async function formatCheckExecutor( 7 | options: FormatCheckExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runQuarkusPluginCommand('check-format', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default formatCheckExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/check-format/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface FormatCheckExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/check-format/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "$schema": "http://json-schema.org/schema", 4 | "title": "Format Check executor", 5 | "description": "", 6 | "outputCapture": "pipe", 7 | "type": "object", 8 | "properties": { 9 | "root": { 10 | "description": "The project root", 11 | "type": "string" 12 | }, 13 | "ignoreWrapper": { 14 | "description": "Whether or not to use the embedded wrapper (`mvnw`or `gradlew`) to perfom build operations", 15 | "type": "boolean", 16 | "default": false 17 | }, 18 | "runFromParentModule": { 19 | "description": "Whether or not to run the (child) module from the context of its parent", 20 | "type": "boolean", 21 | "default": false 22 | }, 23 | "args": { 24 | "description": "The argument to be passed to the underlying Quarkus command", 25 | "type": "array", 26 | "default": [] 27 | } 28 | }, 29 | "required": [] 30 | } 31 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/clean/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { CleanExecutorOptions } from './schema'; 4 | import { runQuarkusPluginCommand } from '../../utils/quarkus-utils'; 5 | 6 | export async function cleanExecutor( 7 | options: CleanExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runQuarkusPluginCommand('clean', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default cleanExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/clean/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface CleanExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/clean/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "$schema": "http://json-schema.org/schema", 4 | "title": "Clean executor", 5 | "description": "", 6 | "outputCapture": "pipe", 7 | "type": "object", 8 | "properties": { 9 | "root": { 10 | "description": "The project root", 11 | "type": "string" 12 | }, 13 | "ignoreWrapper": { 14 | "description": "Whether or not to use the embedded wrapper (`mvnw`or `gradlew`) to perfom build operations", 15 | "type": "boolean", 16 | "default": false 17 | }, 18 | "runFromParentModule": { 19 | "description": "Whether or not to run the (child) module from the context of its parent", 20 | "type": "boolean", 21 | "default": false 22 | }, 23 | "args": { 24 | "description": "The argument to be passed to the underlying Maven or Gradle command", 25 | "type": "array", 26 | "default": [] 27 | } 28 | }, 29 | "required": [] 30 | } 31 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/dev/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { DevExecutorOptions } from './schema'; 4 | import { runQuarkusPluginCommand } from '../../utils/quarkus-utils'; 5 | 6 | export async function devExecutor( 7 | options: DevExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runQuarkusPluginCommand('dev', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default devExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/dev/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface DevExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/dev/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "$schema": "http://json-schema.org/schema", 4 | "title": "Dev executor", 5 | "description": "", 6 | "outputCapture": "pipe", 7 | "type": "object", 8 | "properties": { 9 | "root": { 10 | "description": "The project root", 11 | "type": "string" 12 | }, 13 | "ignoreWrapper": { 14 | "description": "Whether or not to use the embedded wrapper (`mvnw`or `gradlew`) to perfom build operations", 15 | "type": "boolean", 16 | "default": false 17 | }, 18 | "runFromParentModule": { 19 | "description": "Whether or not to run the (child) module from the context of its parent", 20 | "type": "boolean", 21 | "default": false 22 | }, 23 | "args": { 24 | "description": "The argument to be passed to the underlying Quarkus command", 25 | "type": "array", 26 | "default": [] 27 | } 28 | }, 29 | "required": [] 30 | } 31 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/format/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { FormatExecutorOptions } from './schema'; 4 | import { runQuarkusPluginCommand } from '../../utils/quarkus-utils'; 5 | 6 | export async function formatExecutor( 7 | options: FormatExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runQuarkusPluginCommand('format', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default formatExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/format/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface FormatExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/format/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "$schema": "http://json-schema.org/schema", 4 | "title": "Format executor", 5 | "description": "", 6 | "outputCapture": "pipe", 7 | "type": "object", 8 | "properties": { 9 | "root": { 10 | "description": "The project root", 11 | "type": "string" 12 | }, 13 | "ignoreWrapper": { 14 | "description": "Whether or not to use the embedded wrapper (`mvnw`or `gradlew`) to perfom build operations", 15 | "type": "boolean", 16 | "default": false 17 | }, 18 | "runFromParentModule": { 19 | "description": "Whether or not to run the (child) module from the context of its parent", 20 | "type": "boolean", 21 | "default": false 22 | }, 23 | "args": { 24 | "description": "The argument to be passed to the underlying Quarkus command", 25 | "type": "array", 26 | "default": [] 27 | } 28 | }, 29 | "required": [] 30 | } 31 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/install/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { InstallExecutorOptions } from './schema'; 4 | import { runQuarkusPluginCommand } from '../../utils/quarkus-utils'; 5 | 6 | export async function installExecutor( 7 | options: InstallExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runQuarkusPluginCommand('install', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default installExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/install/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface InstallExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/install/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "$schema": "http://json-schema.org/schema", 4 | "title": "Install executor", 5 | "description": "", 6 | "outputCapture": "pipe", 7 | "type": "object", 8 | "properties": { 9 | "root": { 10 | "description": "The project root", 11 | "type": "string" 12 | }, 13 | "ignoreWrapper": { 14 | "description": "Whether or not to use the embedded wrapper (`mvnw`or `gradlew`) to perfom build operations", 15 | "type": "boolean", 16 | "default": false 17 | }, 18 | "runFromParentModule": { 19 | "description": "Whether or not to run the (child) module from the context of its parent", 20 | "type": "boolean", 21 | "default": false 22 | }, 23 | "args": { 24 | "description": "The argument to be passed to the underlying Quarkus command", 25 | "type": "array", 26 | "default": [] 27 | } 28 | }, 29 | "required": [] 30 | } 31 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/list-extensions/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { ListExtensionsExecutorOptions } from './schema'; 4 | import { runQuarkusPluginCommand } from '../../utils/quarkus-utils'; 5 | 6 | export async function listExtensionsExecutor( 7 | options: ListExtensionsExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runQuarkusPluginCommand('list-extensions', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default listExtensionsExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/list-extensions/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface ListExtensionsExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/package/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { PackageExecutorOptions } from './schema'; 4 | import { runQuarkusPluginCommand } from '../../utils/quarkus-utils'; 5 | 6 | export async function packageExecutor( 7 | options: PackageExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runQuarkusPluginCommand('package', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default packageExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/package/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface PackageExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/package/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "$schema": "http://json-schema.org/schema", 4 | "title": "Package executor", 5 | "description": "", 6 | "outputCapture": "pipe", 7 | "type": "object", 8 | "properties": { 9 | "root": { 10 | "description": "The project root", 11 | "type": "string" 12 | }, 13 | "ignoreWrapper": { 14 | "description": "Whether or not to use the embedded wrapper (`mvnw`or `gradlew`) to perfom build operations", 15 | "type": "boolean", 16 | "default": false 17 | }, 18 | "runFromParentModule": { 19 | "description": "Whether or not to run the (child) module from the context of its parent", 20 | "type": "boolean", 21 | "default": false 22 | }, 23 | "args": { 24 | "description": "The argument to be passed to the underlying Maven or Gradle command", 25 | "type": "array", 26 | "default": [] 27 | } 28 | }, 29 | "required": [] 30 | } 31 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/remote-dev/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { RemoteDevExecutorOptions } from './schema'; 4 | import { runQuarkusPluginCommand } from '../../utils/quarkus-utils'; 5 | 6 | export async function remoteDevExecutor( 7 | options: RemoteDevExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runQuarkusPluginCommand('remote-dev', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default remoteDevExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/remote-dev/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface RemoteDevExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/remote-dev/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "$schema": "http://json-schema.org/schema", 4 | "title": "Run Remote Dev executor", 5 | "description": "", 6 | "outputCapture": "pipe", 7 | "type": "object", 8 | "properties": { 9 | "root": { 10 | "description": "The project root", 11 | "type": "string" 12 | }, 13 | "ignoreWrapper": { 14 | "description": "Whether or not to use the embedded wrapper (`mvnw`or `gradlew`) to perfom build operations", 15 | "type": "boolean", 16 | "default": false 17 | }, 18 | "runFromParentModule": { 19 | "description": "Whether or not to run the (child) module from the context of its parent", 20 | "type": "boolean", 21 | "default": false 22 | }, 23 | "args": { 24 | "description": "The argument to be passed to the underlying Quarkus command", 25 | "type": "array", 26 | "default": [] 27 | } 28 | }, 29 | "required": [] 30 | } 31 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/test/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { TestExecutorOptions } from './schema'; 4 | import { runQuarkusPluginCommand } from '../../utils/quarkus-utils'; 5 | 6 | export async function testExecutor( 7 | options: TestExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runQuarkusPluginCommand('test', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default testExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/test/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface TestExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-quarkus/src/executors/test/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "$schema": "http://json-schema.org/schema", 4 | "title": "Test executor", 5 | "description": "", 6 | "outputCapture": "pipe", 7 | "type": "object", 8 | "properties": { 9 | "root": { 10 | "description": "The project root", 11 | "type": "string" 12 | }, 13 | "ignoreWrapper": { 14 | "description": "Whether or not to use the embedded wrapper (`mvnw`or `gradlew`) to perform build operations", 15 | "type": "boolean", 16 | "default": false 17 | }, 18 | "runFromParentModule": { 19 | "description": "Whether or not to run the (child) module from the context of its parent", 20 | "type": "boolean", 21 | "default": false 22 | }, 23 | "args": { 24 | "description": "The argument to be passed to the underlying Quarkus command", 25 | "type": "array", 26 | "default": [] 27 | } 28 | }, 29 | "required": [] 30 | } 31 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/generators/link/schema.d.ts: -------------------------------------------------------------------------------- 1 | export interface LinkGeneratorSchema { 2 | sourceProjectName: string; 3 | targetProjectName: string; 4 | } -------------------------------------------------------------------------------- /packages/nx-quarkus/src/generators/preset/generator.ts: -------------------------------------------------------------------------------- 1 | import { Tree } from '@nx/devkit'; 2 | import { PresetGeneratorSchema } from './schema'; 3 | import projectGenerator from '../project/generator'; 4 | 5 | export async function presetGenerator( 6 | tree: Tree, 7 | options: PresetGeneratorSchema 8 | ) { 9 | if (options.prjName) { 10 | options.directory = options.prjName; 11 | delete options['name']; // remove 'name' set from create-nx-workspace, where it refers to the workspace name and not project name 12 | } 13 | 14 | await projectGenerator(tree, options); 15 | } 16 | 17 | export default presetGenerator; 18 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/generators/preset/schema.d.ts: -------------------------------------------------------------------------------- 1 | import { ProjectGeneratorOptions } from '../project/schema'; 2 | 3 | export interface PresetGeneratorSchema extends ProjectGeneratorOptions { 4 | prjName?: string; //replacement for 'name' & 'directory' which can't be used as-is, because they have a special meaning in `create-nx-workspace` 5 | } 6 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/generators/project/lib/add-formatting-with-spotless.ts: -------------------------------------------------------------------------------- 1 | import { Tree } from '@nx/devkit'; 2 | import { 3 | addSpotlessGradlePlugin, 4 | addSpotlessMavenPlugin, 5 | } from '@nxrocks/common-jvm'; 6 | import { NormalizedSchema } from '../schema'; 7 | 8 | export function addFormattingWithSpotless( 9 | tree: Tree, 10 | options: NormalizedSchema 11 | ) { 12 | if (options.buildSystem === 'MAVEN') { 13 | addSpotlessMavenPlugin(tree, options.projectRoot, 'java', 11); 14 | } else { 15 | addSpotlessGradlePlugin( 16 | tree, 17 | options.projectRoot, 18 | 'java', 19 | 11, 20 | null, 21 | options.buildSystem === 'GRADLE_KOTLIN_DSL' 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/generators/project/lib/index.ts: -------------------------------------------------------------------------------- 1 | export { generateQuarkusProject } from './generate-quarkus-project'; 2 | export { generateProjectConfiguration } from './generate-project-configuration'; 3 | export { addFormattingWithSpotless } from './add-formatting-with-spotless'; 4 | export { addMavenPublishPlugin } from './add-maven-publish-plugin'; 5 | export { normalizeOptions } from './normalize-options'; 6 | export { promptQuarkusExtensions } from './prompt-quarkus-extensions'; 7 | export { promptForMultiModuleSupport } from './prompt-multi-module-support'; 8 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/generators/project/lib/prompt-quarkus-extensions.ts: -------------------------------------------------------------------------------- 1 | import { NormalizedSchema } from '../schema'; 2 | import { prompt } from 'enquirer'; 3 | import { fetchQuarkusExtensions } from '../../../utils/quarkus-utils'; 4 | import { logger } from '@nx/devkit'; 5 | 6 | export async function promptQuarkusExtensions(options: NormalizedSchema) { 7 | if ( 8 | options.extensions === undefined && 9 | process.env.NX_INTERACTIVE === 'true' 10 | ) { 11 | logger.info(`⏳ Fetching Quarkus extensions list. Please wait...`); 12 | 13 | const extensions = (await fetchQuarkusExtensions(options)).map((e) => e.id); 14 | 15 | options.projectExtensions = await prompt({ 16 | name: 'extensions', 17 | message: 18 | 'What extensions would you like to use? (type something to filter, press [space] to multi-select)', 19 | type: 'autocomplete', 20 | choices: extensions, 21 | multiple: true, 22 | }).then((a) => a['extensions']); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/generators/project/schema.d.ts: -------------------------------------------------------------------------------- 1 | export interface ProjectGeneratorOptions { 2 | directory: string; 3 | projectType: ProjectType; 4 | name?: string; 5 | tags?: string; 6 | 7 | quarkusInitializerUrl: string; 8 | proxyUrl?: string; 9 | 10 | buildSystem: 'MAVEN' | 'GRADLE' | 'GRADLE_KOTLIN_DSL'; 11 | javaVersion?: string; 12 | groupId?: string; 13 | artifactId?: string; 14 | skipCodeSamples?: boolean; 15 | extensions?: string; 16 | version?: string; 17 | skipFormat?: boolean; 18 | 19 | transformIntoMultiModule?: boolean; 20 | addToExistingParentModule?: boolean; 21 | parentModuleName?: string; 22 | keepProjectLevelWrapper?: boolean; 23 | } 24 | 25 | export interface NormalizedSchema extends ProjectGeneratorOptions { 26 | projectName: string; 27 | projectRoot: string; 28 | projectExtensions: string[]; 29 | parsedTags: string[]; 30 | moduleRoot?: string; 31 | } 32 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/graph/create-dependencies.ts: -------------------------------------------------------------------------------- 1 | import { CreateDependencies } from "@nx/devkit"; 2 | 3 | import { JVM_PROJECT_FILES, createDependenciesIf, getJvmPackageInfo } from "@nxrocks/common-jvm"; 4 | import { NX_QUARKUS_PKG } from "../index"; 5 | import { isQuarkusProject } from "../utils/quarkus-utils"; 6 | 7 | export const createDependencies: CreateDependencies = (_, ctx) => createDependenciesIf(NX_QUARKUS_PKG, JVM_PROJECT_FILES, isQuarkusProject, getJvmPackageInfo, ctx); 8 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/graph/create-nodes.ts: -------------------------------------------------------------------------------- 1 | import { 2 | JVM_PROJECT_FILES, 3 | createNodesFor, 4 | createNodesForV2, 5 | } from '@nxrocks/common-jvm'; 6 | import { NX_QUARKUS_PKG } from '../index'; 7 | import { isQuarkusProject } from '../utils/quarkus-utils'; 8 | import { getProjectTypeAndTargetsFromFile } from '../utils/plugin-utils'; 9 | 10 | // wrapped into a () to avoid the 'Cannot access 'NX_QUARKUS_PKG' before initialization' 11 | export const createNodesFn = () => 12 | createNodesFor( 13 | JVM_PROJECT_FILES, 14 | isQuarkusProject, 15 | getProjectTypeAndTargetsFromFile, 16 | NX_QUARKUS_PKG 17 | ); 18 | 19 | export const createNodesFnV2 = () => 20 | createNodesForV2( 21 | JVM_PROJECT_FILES, 22 | isQuarkusProject, 23 | getProjectTypeAndTargetsFromFile, 24 | NX_QUARKUS_PKG 25 | ); 26 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/index.ts: -------------------------------------------------------------------------------- 1 | import { createNodesFn, createNodesFnV2 } from './graph/create-nodes'; 2 | 3 | export { projectGenerator } from './generators/project/generator'; 4 | export { createDependencies } from './graph/create-dependencies'; 5 | 6 | export const NX_QUARKUS_PKG = '@nxrocks/nx-quarkus'; 7 | 8 | export const createNodes = createNodesFn(); 9 | export const createNodesV2 = createNodesFnV2(); 10 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/migrations/update-7.0.0/add-install-to-cacheable-operations.spec.ts: -------------------------------------------------------------------------------- 1 | import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; 2 | import { NxJsonConfiguration, Tree, readJson } from '@nx/devkit'; 3 | 4 | import update from './add-install-to-cacheable-operations'; 5 | 6 | describe('add-install-to-cacheable-operations migration', () => { 7 | let tree: Tree; 8 | 9 | beforeEach(() => { 10 | tree = createTreeWithEmptyWorkspace(); 11 | }); 12 | 13 | it('should run successfully', async () => { 14 | await update(tree); 15 | const nxJson = readJson(tree, 'nx.json'); 16 | expect(nxJson.targetDefaults?.['install'].cache).toBe(true) 17 | 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /packages/nx-quarkus/src/migrations/update-7.0.0/add-install-to-cacheable-operations.ts: -------------------------------------------------------------------------------- 1 | import { NxJsonConfiguration, Tree, formatFiles, readJson, writeJson } from '@nx/devkit'; 2 | 3 | export default async function update(host: Tree) { 4 | const nxJson = readJson(host, 'nx.json'); 5 | 6 | let cacheableOperationsPreNx17 = nxJson.tasksRunnerOptions?.['default']?.options?.cacheableOperations; 7 | 8 | if (cacheableOperationsPreNx17?.includes['install'] === false) { 9 | cacheableOperationsPreNx17 = [...cacheableOperationsPreNx17, 'install']; 10 | 11 | writeJson(host, 'nx.json', nxJson); 12 | } 13 | else { 14 | nxJson.targetDefaults ??= {}; 15 | nxJson.targetDefaults['install'] ??= {}; 16 | nxJson.targetDefaults['install'].cache ??= true; 17 | 18 | writeJson(host, 'nx.json', nxJson); 19 | } 20 | 21 | await formatFiles(host); 22 | } 23 | -------------------------------------------------------------------------------- /packages/nx-quarkus/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "module": "commonjs" 5 | }, 6 | "files": [], 7 | "include": [], 8 | "references": [ 9 | { 10 | "path": "./tsconfig.lib.json" 11 | }, 12 | { 13 | "path": "./tsconfig.spec.json" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /packages/nx-quarkus/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "declaration": true, 6 | "types": [] 7 | }, 8 | "include": ["**/*.ts"], 9 | "exclude": ["jest.config.ts", "**/*.spec.ts", "**/*.test.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/nx-quarkus/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import baseConfig from '../../eslint.config.mjs'; 2 | 3 | export default [ 4 | ...baseConfig, 5 | { 6 | files: ['**/*.json'], 7 | rules: { 8 | '@nx/dependency-checks': [ 9 | 'error', 10 | { 11 | ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs}'], 12 | }, 13 | ], 14 | }, 15 | languageOptions: { 16 | parser: await import('jsonc-eslint-parser'), 17 | }, 18 | }, 19 | { 20 | files: [ 21 | '**/package.json', 22 | '**/generators.json', 23 | '**/executors.json', 24 | '**/migrations.json', 25 | ], 26 | rules: { 27 | '@nx/nx-plugin-checks': 'error', 28 | }, 29 | languageOptions: { 30 | parser: await import('jsonc-eslint-parser'), 31 | }, 32 | }, 33 | ]; 34 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'nx-spring-boot', 4 | preset: '../../jest.preset.js', 5 | transform: { 6 | '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], 7 | }, 8 | moduleFileExtensions: ['ts', 'js', 'html'], 9 | coverageDirectory: '../../coverage/packages/nx-spring-boot', 10 | }; 11 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/migrations.json: -------------------------------------------------------------------------------- 1 | { 2 | "generators": { 3 | "add-install-to-cacheable-operations": { 4 | "version": "9.0.0", 5 | "description": "Add target to Nx cacheable operations", 6 | "implementation": "./src/migrations/update-9.0.0/add-install-to-cacheable-operations" 7 | }, 8 | "make-serve-target-depends-on-dependency-install": { 9 | "version": "9.2.0", 10 | "description": "Migration for v9.2.0", 11 | "implementation": "./src/migrations/update-9.2.0/make-serve-target-depends-on-dependency-install" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/recipes/images/boot-dependencies-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/packages/nx-spring-boot/recipes/images/boot-dependencies-list.png -------------------------------------------------------------------------------- /packages/nx-spring-boot/recipes/images/nx-console-add-dependencies.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tinesoft/nxrocks/8fa46d968baa0c5b25984eca236c980f01e79f2c/packages/nx-spring-boot/recipes/images/nx-console-add-dependencies.png -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/executors/build-image/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { BuildImageExecutorOptions } from './schema'; 4 | import { runBootPluginCommand } from '../../utils/boot-utils'; 5 | 6 | export async function buildImageExecutor( 7 | options: BuildImageExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runBootPluginCommand('build-image', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default buildImageExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/executors/build-image/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface BuildImageExecutorOptions{ 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/executors/build-info/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { BuildInfoExecutorOptions } from './schema'; 4 | import { runBootPluginCommand } from '../../utils/boot-utils'; 5 | 6 | export async function buildInfoExecutor( 7 | options: BuildInfoExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runBootPluginCommand('build-info', [], { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default buildInfoExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/executors/build-info/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface BuildInfoExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | } -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/executors/build/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { BuildExecutorOptions } from './schema'; 4 | import { runBootPluginCommand } from '../../utils/boot-utils'; 5 | 6 | export async function buildExecutor( 7 | options: BuildExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runBootPluginCommand('build', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default buildExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/executors/build/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface BuildExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/executors/build/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "$schema": "http://json-schema.org/schema", 4 | "title": "Build executor", 5 | "description": "", 6 | "outputCapture": "pipe", 7 | "type": "object", 8 | "properties": { 9 | "root": { 10 | "description": "The project root", 11 | "type": "string" 12 | }, 13 | "ignoreWrapper": { 14 | "description": "Whether or not to use the embedded wrapper (`mvnw`or `gradlew`) to perfom build operations", 15 | "type": "boolean", 16 | "default": false 17 | }, 18 | "runFromParentModule": { 19 | "description": "Whether or not to run the (child) module from the context of its parent", 20 | "type": "boolean", 21 | "default": false 22 | }, 23 | "args": { 24 | "description": "The argument to be passed to the underlying Spring Boot command", 25 | "type": "array", 26 | "default": [] 27 | } 28 | }, 29 | "required": [] 30 | } 31 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/executors/check-format/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { runBootPluginCommand } from '../../utils/boot-utils'; 4 | import { FormatCheckExecutorOptions } from './schema'; 5 | 6 | export async function formatCheckExecutor( 7 | options: FormatCheckExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runBootPluginCommand('check-format', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default formatCheckExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/executors/check-format/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface FormatCheckExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/executors/clean/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { CleanExecutorOptions } from './schema'; 4 | import { runBootPluginCommand } from '../../utils/boot-utils'; 5 | 6 | export async function cleanExecutor( 7 | options: CleanExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runBootPluginCommand('clean', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default cleanExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/executors/clean/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface CleanExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/executors/clean/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "$schema": "http://json-schema.org/schema", 4 | "title": "Clean executor", 5 | "description": "", 6 | "outputCapture": "pipe", 7 | "type": "object", 8 | "properties": { 9 | "root": { 10 | "description": "The project root", 11 | "type": "string" 12 | }, 13 | "ignoreWrapper": { 14 | "description": "Whether or not to use the embedded wrapper (`mvnw`or `gradlew`) to perfom build operations", 15 | "type": "boolean", 16 | "default": false 17 | }, 18 | "runFromParentModule": { 19 | "description": "Whether or not to run the (child) module from the context of its parent", 20 | "type": "boolean", 21 | "default": false 22 | }, 23 | "args": { 24 | "description": "The argument to be passed to the underlying Maven or Gradle command", 25 | "type": "array", 26 | "default": [] 27 | } 28 | }, 29 | "required": [] 30 | } 31 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/executors/format/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { FormatExecutorOptions } from './schema'; 4 | import { runBootPluginCommand } from '../../utils/boot-utils'; 5 | 6 | export async function formatExecutor( 7 | options: FormatExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runBootPluginCommand('format', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default formatExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/executors/format/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface FormatExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/executors/format/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "$schema": "http://json-schema.org/schema", 4 | "title": "Format executor", 5 | "description": "", 6 | "outputCapture": "pipe", 7 | "type": "object", 8 | "properties": { 9 | "root": { 10 | "description": "The project root", 11 | "type": "string" 12 | }, 13 | "ignoreWrapper": { 14 | "description": "Whether or not to use the embedded wrapper (`mvnw`or `gradlew`) to perfom build operations", 15 | "type": "boolean", 16 | "default": false 17 | }, 18 | "runFromParentModule": { 19 | "description": "Whether or not to run the (child) module from the context of its parent", 20 | "type": "boolean", 21 | "default": false 22 | }, 23 | "args": { 24 | "description": "The argument to be passed to the underlying Spring Boot command", 25 | "type": "array", 26 | "default": [] 27 | } 28 | }, 29 | "required": [] 30 | } 31 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/executors/install/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { InstallExecutorOptions } from './schema'; 4 | import { runBootPluginCommand } from '../../utils/boot-utils'; 5 | 6 | export async function installExecutor( 7 | options: InstallExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runBootPluginCommand('install', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default installExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/executors/install/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface InstallExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/executors/install/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "$schema": "http://json-schema.org/schema", 4 | "title": "Install executor", 5 | "description": "", 6 | "outputCapture": "pipe", 7 | "type": "object", 8 | "properties": { 9 | "root": { 10 | "description": "The project root", 11 | "type": "string" 12 | }, 13 | "ignoreWrapper": { 14 | "description": "Whether or not to use the embedded wrapper (`mvnw`or `gradlew`) to perfom build operations", 15 | "type": "boolean", 16 | "default": false 17 | }, 18 | "runFromParentModule": { 19 | "description": "Whether or not to run the (child) module from the context of its parent", 20 | "type": "boolean", 21 | "default": false 22 | }, 23 | "args": { 24 | "description": "The argument to be passed to the underlying Spring Boot command", 25 | "type": "array", 26 | "default": [] 27 | } 28 | }, 29 | "required": [] 30 | } 31 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/executors/run/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { RunExecutorOptions } from './schema'; 4 | import { runBootPluginCommand } from '../../utils/boot-utils'; 5 | 6 | export async function runExecutor( 7 | options: RunExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runBootPluginCommand('run', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default runExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/executors/run/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface RunExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/executors/run/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "$schema": "http://json-schema.org/schema", 4 | "title": "Run executor", 5 | "description": "", 6 | "outputCapture": "pipe", 7 | "type": "object", 8 | "properties": { 9 | "root": { 10 | "description": "The project root", 11 | "type": "string" 12 | }, 13 | "ignoreWrapper": { 14 | "description": "Whether or not to use the embedded wrapper (`mvnw`or `gradlew`) to perfom build operations", 15 | "type": "boolean", 16 | "default": false 17 | }, 18 | "runFromParentModule": { 19 | "description": "Whether or not to run the (child) module from the context of its parent", 20 | "type": "boolean", 21 | "default": false 22 | }, 23 | "args": { 24 | "description": "The argument to be passed to the underlying Spring Boot command", 25 | "type": "array", 26 | "default": [] 27 | } 28 | }, 29 | "required": [] 30 | } 31 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/executors/test/executor.ts: -------------------------------------------------------------------------------- 1 | import { ExecutorContext } from '@nx/devkit'; 2 | import * as path from 'path'; 3 | import { TestExecutorOptions } from './schema'; 4 | import { runBootPluginCommand } from '../../utils/boot-utils'; 5 | 6 | export async function testExecutor( 7 | options: TestExecutorOptions, 8 | context: ExecutorContext 9 | ) { 10 | const root = path.resolve(context.root, options.root); 11 | return runBootPluginCommand('test', options.args, { 12 | cwd: root, 13 | ignoreWrapper: options.ignoreWrapper, 14 | runFromParentModule: options.runFromParentModule, 15 | }); 16 | } 17 | 18 | export default testExecutor; 19 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/executors/test/schema.d.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface TestExecutorOptions { 3 | root: string; 4 | ignoreWrapper?: boolean; 5 | runFromParentModule?: boolean; 6 | args?: string[]; 7 | } -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/executors/test/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "$schema": "http://json-schema.org/schema", 4 | "title": "Test executor", 5 | "description": "", 6 | "outputCapture": "pipe", 7 | "type": "object", 8 | "properties": { 9 | "root": { 10 | "description": "The project root", 11 | "type": "string" 12 | }, 13 | "ignoreWrapper": { 14 | "description": "Whether or not to use the embedded wrapper (`mvnw`or `gradlew`) to perform build operations", 15 | "type": "boolean", 16 | "default": false 17 | }, 18 | "runFromParentModule": { 19 | "description": "Whether or not to run the (child) module from the context of its parent", 20 | "type": "boolean", 21 | "default": false 22 | }, 23 | "args": { 24 | "description": "The argument to be passed to the underlying Spring Boot command", 25 | "type": "array", 26 | "default": [] 27 | } 28 | }, 29 | "required": [] 30 | } 31 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/generators/link/schema.d.ts: -------------------------------------------------------------------------------- 1 | export interface LinkGeneratorSchema { 2 | sourceProjectName: string; 3 | targetProjectName: string; 4 | } -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/generators/preset/generator.ts: -------------------------------------------------------------------------------- 1 | import { Tree } from '@nx/devkit'; 2 | import { PresetGeneratorSchema } from './schema'; 3 | import projectGenerator from '../project/generator'; 4 | 5 | export async function presetGenerator( 6 | tree: Tree, 7 | options: PresetGeneratorSchema 8 | ) { 9 | if (options.prjName) { 10 | options.directory = options.prjName; 11 | delete options['name']; // remove 'name' set from create-nx-workspace, where it refers to the workspace name and not project name 12 | } 13 | 14 | await projectGenerator(tree, options); 15 | } 16 | 17 | export default presetGenerator; 18 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/generators/preset/schema.d.ts: -------------------------------------------------------------------------------- 1 | import { ProjectGeneratorOptions } from '../project/schema'; 2 | 3 | export interface PresetGeneratorSchema extends ProjectGeneratorOptions { 4 | prjName?: string; //replacement for 'name' & 'directory' which can't be used as-is, because they have a special meaning in `create-nx-workspace` 5 | } 6 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/generators/project/lib/add-build-info-task.ts: -------------------------------------------------------------------------------- 1 | import { logger, Tree } from '@nx/devkit'; 2 | import { stripIndent } from '@nxrocks/common-jvm'; 3 | import { NormalizedSchema } from '../schema'; 4 | 5 | export function addBuilInfoTask(tree: Tree, options: NormalizedSchema) { 6 | if ( 7 | options.projectType === 'application' && 8 | (options.buildSystem === 'gradle-project' || 9 | options.buildSystem === 'gradle-project-kotlin') 10 | ) { 11 | const ext = options.buildSystem === 'gradle-project-kotlin' ? '.kts' : ''; 12 | logger.debug(`Adding 'buildInfo' task to the build.gradle${ext} file...`); 13 | 14 | const buildInfoTask = stripIndent` 15 | springBoot { 16 | buildInfo() 17 | } 18 | `; 19 | const buildGradlePath = `${options.projectRoot}/build.gradle${ext}`; 20 | const content = tree.read(buildGradlePath, 'utf-8') + buildInfoTask; 21 | tree.write(buildGradlePath, content); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/generators/project/lib/add-formatting-with-spotless.ts: -------------------------------------------------------------------------------- 1 | import { Tree } from '@nx/devkit'; 2 | import { 3 | addSpotlessGradlePlugin, 4 | addSpotlessMavenPlugin, 5 | } from '@nxrocks/common-jvm'; 6 | import { NormalizedSchema } from '../schema'; 7 | 8 | export function addFormattingWithSpotless( 9 | tree: Tree, 10 | options: NormalizedSchema 11 | ) { 12 | if (options.buildSystem === 'maven-project') { 13 | addSpotlessMavenPlugin( 14 | tree, 15 | options.projectRoot, 16 | options.language, 17 | +options.javaVersion 18 | ); 19 | } else { 20 | addSpotlessGradlePlugin( 21 | tree, 22 | options.projectRoot, 23 | options.language, 24 | +options.javaVersion, 25 | null, 26 | options.buildSystem === 'gradle-project-kotlin' 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/generators/project/lib/index.ts: -------------------------------------------------------------------------------- 1 | export { generateBootProject } from './generate-boot-project'; 2 | export { addBuilInfoTask } from './add-build-info-task'; 3 | export { disableBootGradlePlugin } from './disable-boot-gradle-plugin'; 4 | export { removeBootMavenPlugin } from './remove-spring-boot-plugin'; 5 | export { addFormattingWithSpotless } from './add-formatting-with-spotless'; 6 | export { addMavenPublishPlugin } from './add-maven-publish-plugin'; 7 | export { promptBootDependencies } from './prompt-boot-dependencies'; 8 | export { normalizeOptions } from './normalize-options'; 9 | export { promptForMultiModuleSupport } from './prompt-multi-module-support'; 10 | export { generateProjectConfiguration } from './generate-project-configuration'; 11 | export { createLibraryFiles } from './create-library-files'; 12 | export { removeBootBuildImageGradleTask } from './remove-boot-build-image-gradle-task'; 13 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/generators/project/lib/remove-spring-boot-plugin.ts: -------------------------------------------------------------------------------- 1 | import { logger, Tree } from '@nx/devkit'; 2 | import { removeMavenPlugin } from '@nxrocks/common-jvm'; 3 | import { NormalizedSchema } from '../schema'; 4 | 5 | export function removeBootMavenPlugin(tree: Tree, options: NormalizedSchema) { 6 | if ( 7 | options.projectType === 'library' && 8 | options.buildSystem === 'maven-project' 9 | ) { 10 | logger.debug(`Removing 'spring-boot' maven plugin on a library project...`); 11 | 12 | return removeMavenPlugin( 13 | tree, 14 | options.projectRoot, 15 | 'org.springframework.boot', 16 | 'spring-boot-maven-plugin' 17 | ); 18 | } 19 | return false; 20 | } 21 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/graph/create-dependencies.ts: -------------------------------------------------------------------------------- 1 | import { CreateDependencies } from "@nx/devkit"; 2 | 3 | import { JVM_PROJECT_FILES, createDependenciesIf, getJvmPackageInfo } from "@nxrocks/common-jvm"; 4 | import { NX_SPRING_BOOT_PKG } from "../index"; 5 | import { isBootProject } from "../utils/boot-utils"; 6 | 7 | export const createDependencies: CreateDependencies = (_, ctx) => createDependenciesIf(NX_SPRING_BOOT_PKG, JVM_PROJECT_FILES, isBootProject, getJvmPackageInfo, ctx); 8 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/graph/create-nodes.ts: -------------------------------------------------------------------------------- 1 | import { 2 | JVM_PROJECT_FILES, 3 | createNodesFor, 4 | createNodesForV2, 5 | } from '@nxrocks/common-jvm'; 6 | import { NX_SPRING_BOOT_PKG } from '../index'; 7 | import { isBootProject } from '../utils/boot-utils'; 8 | import { getProjectTypeAndTargetsFromFile } from '../utils/plugin-utils'; 9 | 10 | // wrapped into a () to avoid the 'Cannot access 'NX_SPRING_BOOT_PKG' before initialization' 11 | export const createNodesFn = () => 12 | createNodesFor( 13 | JVM_PROJECT_FILES, 14 | isBootProject, 15 | getProjectTypeAndTargetsFromFile, 16 | NX_SPRING_BOOT_PKG 17 | ); 18 | 19 | export const createNodesFnV2 = () => 20 | createNodesForV2( 21 | JVM_PROJECT_FILES, 22 | isBootProject, 23 | getProjectTypeAndTargetsFromFile, 24 | NX_SPRING_BOOT_PKG 25 | ); 26 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/index.ts: -------------------------------------------------------------------------------- 1 | import { createNodesFn, createNodesFnV2 } from './graph/create-nodes'; 2 | 3 | export { projectGenerator } from './generators/project/generator'; 4 | export { createDependencies } from './graph/create-dependencies'; 5 | 6 | export const NX_SPRING_BOOT_PKG = '@nxrocks/nx-spring-boot'; 7 | 8 | export const createNodes = createNodesFn(); 9 | export const createNodesV2 = createNodesFnV2(); 10 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/migrations/update-9.0.0/add-install-to-cacheable-operations.spec.ts: -------------------------------------------------------------------------------- 1 | import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; 2 | import { NxJsonConfiguration, Tree, readJson } from '@nx/devkit'; 3 | 4 | import update from './add-install-to-cacheable-operations'; 5 | 6 | describe('add-install-to-cacheable-operations migration', () => { 7 | let tree: Tree; 8 | 9 | beforeEach(() => { 10 | tree = createTreeWithEmptyWorkspace(); 11 | }); 12 | 13 | it('should run successfully', async () => { 14 | await update(tree); 15 | const nxJson = readJson(tree, 'nx.json'); 16 | expect(nxJson.targetDefaults?.['install'].cache).toBe(true) 17 | 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/src/migrations/update-9.0.0/add-install-to-cacheable-operations.ts: -------------------------------------------------------------------------------- 1 | import { NxJsonConfiguration, Tree, formatFiles, readJson, writeJson } from '@nx/devkit'; 2 | 3 | export default async function update(host: Tree) { 4 | const nxJson = readJson(host, 'nx.json'); 5 | 6 | let cacheableOperationsPreNx17 = nxJson.tasksRunnerOptions?.['default']?.options?.cacheableOperations; 7 | 8 | if (cacheableOperationsPreNx17?.includes['install'] === false) { 9 | cacheableOperationsPreNx17 = [...cacheableOperationsPreNx17, 'install']; 10 | 11 | writeJson(host, 'nx.json', nxJson); 12 | } 13 | else { 14 | nxJson.targetDefaults ??= {}; 15 | nxJson.targetDefaults['install'] ??= {}; 16 | nxJson.targetDefaults['install'].cache ??= true; 17 | 18 | writeJson(host, 'nx.json', nxJson); 19 | } 20 | 21 | await formatFiles(host); 22 | } 23 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "module": "commonjs" 5 | }, 6 | "files": [], 7 | "include": [], 8 | "references": [ 9 | { 10 | "path": "./tsconfig.lib.json" 11 | }, 12 | { 13 | "path": "./tsconfig.spec.json" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "declaration": true, 6 | "types": [] 7 | }, 8 | "include": ["**/*.ts"], 9 | "exclude": ["jest.config.ts", "**/*.spec.ts", "**/*.test.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /packages/nx-spring-boot/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nxrocks", 3 | "$schema": "node_modules/nx/schemas/project-schema.json", 4 | "targets": { 5 | "local-registry": { 6 | "executor": "@nx/js:verdaccio", 7 | "options": { 8 | "port": 4873, 9 | "listenAddress": "0.0.0.0", 10 | "config": ".verdaccio/config.yml", 11 | "storage": "tmp/local-registry/storage" 12 | } 13 | }, 14 | "populate-local-registry": { 15 | "cache": true, 16 | "parallelism": false, 17 | "inputs": ["production"], 18 | "dependsOn": ["build"], 19 | "command": "ts-node -P ./tools/tsconfig.tools.json ./tools/scripts/populate-local-registry.ts", 20 | "outputs": ["{workspaceRoot}/tmp/local-registry/storage"] 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /tcom: -------------------------------------------------------------------------------- 1 | bun affected:test && git com "$1" -------------------------------------------------------------------------------- /tools/scripts/run-all-e2e-tests.ts: -------------------------------------------------------------------------------- 1 | import { execFileSync } from "child_process"; 2 | import startLocalRegistry from "./start-local-registry"; 3 | import stopRegistry from './stop-local-registry'; 4 | 5 | 6 | (async () => { 7 | 8 | await startLocalRegistry(); 9 | const nx = require.resolve('nx'); 10 | execFileSync( 11 | nx, 12 | ['affected', '-t', 'e2e', '--runInBand', '--exclude', 'smoke'], 13 | { 14 | stdio: 'inherit' 15 | } 16 | ); 17 | 18 | await stopRegistry(); 19 | 20 | })(); 21 | 22 | -------------------------------------------------------------------------------- /tools/scripts/stop-local-registry.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This script stops the local registry for e2e testing purposes. 3 | * It is meant to be called in jest's globalTeardown. 4 | */ 5 | 6 | export default () => { 7 | 8 | if (global.stopLocalRegistry) { 9 | global.stopLocalRegistry(); 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /tools/scripts/utils.ts: -------------------------------------------------------------------------------- 1 | import { workspaceRoot } from "@nx/devkit"; 2 | import { execFileSync } from "child_process"; 3 | 4 | 5 | const nx = require.resolve('nx'); 6 | 7 | export const execNx = (args: string[]) => 8 | execFileSync(nx, args, { 9 | env: process.env, 10 | stdio: 'inherit', 11 | maxBuffer: 1024 * 1024 * 10, 12 | cwd: workspaceRoot, 13 | }); 14 | -------------------------------------------------------------------------------- /tools/tsconfig.tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../dist/out-tsc/tools", 5 | "rootDir": ".", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": ["node"] 9 | }, 10 | "include": ["**/*.ts"] 11 | } 12 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "resolveJsonModule": true 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /unpublish: -------------------------------------------------------------------------------- 1 | npm login 2 | 3 | npm unpublish create-nx-spring-boot@"$1" --force --verbose 4 | npm unpublish create-nx-micronaut@"$1" --force --verbose 5 | npm unpublish create-nx-quarkus@"$1" --force --verbose 6 | npm unpublish create-nx-flutter@"$1" --force --verbose 7 | npm unpublish create-nx-ktor@"$1" --force --verbose 8 | 9 | npm unpublish @nxrocks/nx-spring-boot@"$1" --force --verbose 10 | npm unpublish @nxrocks/nx-micronaut@"$1" --force --verbose 11 | npm unpublish @nxrocks/nx-quarkus@"$1" --force --verbose 12 | npm unpublish @nxrocks/nx-ktor@"$1" --force --verbose 13 | npm unpublish @nxrocks/nx-flutter@"$1" --force --verbose 14 | npm unpublish @nxrocks/nx-melos@"$1" --force --verbose 15 | 16 | npm unpublish @nxrocks/common-jvm@"$1" --force --verbose 17 | npm unpublish @nxrocks/common-cli@"$1" --force --verbose 18 | 19 | npm unpublish @nxrocks/common@"$1" --force --verbose 20 | --------------------------------------------------------------------------------