├── .all-contributorsrc ├── .commitlintrc.json ├── .cz-config.js ├── .devcontainer └── devcontainer.json ├── .editorconfig ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── config.yml │ ├── documentation.md │ ├── feature_request.md │ └── guides.md ├── actions │ ├── release │ │ └── action.yml │ └── setup │ │ └── action.yml ├── disabled_workflows │ ├── ci-checks-windows.yml │ └── nxext-ci.yml └── workflows │ └── ci.yml ├── .gitignore ├── .husky ├── .gitignore ├── commit-msg ├── post-checkout ├── post-merge └── pre-push ├── .node-version ├── .nxignore ├── .prettierignore ├── .prettierrc ├── .verdaccio └── config.yml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── docs ├── .vitepress │ ├── config.mts │ └── theme │ │ ├── index.js │ │ └── vars.css ├── docs │ ├── capacitor │ │ ├── executors.md │ │ ├── generators.md │ │ └── overview.md │ ├── ionic-angular │ │ ├── executors.md │ │ ├── generators.md │ │ └── overview.md │ ├── ionic-react │ │ ├── executors.md │ │ └── generators.md │ ├── nxext │ │ ├── community.md │ │ ├── contributing.md │ │ └── overview.md │ ├── preact │ │ ├── generators.md │ │ ├── installation.md │ │ └── overview.md │ ├── solid │ │ ├── generators.md │ │ ├── installation.md │ │ └── overview.md │ ├── stencil │ │ ├── executors.md │ │ ├── generators.md │ │ ├── installation.md │ │ └── overview.md │ ├── svelte │ │ ├── generators.md │ │ ├── installation.md │ │ └── overview.md │ └── sveltekit │ │ ├── executors.md │ │ ├── generators.md │ │ ├── installation.md │ │ └── overview.md ├── guide │ ├── articles.md │ └── index.md ├── index.md ├── project.json └── public │ ├── _headers │ ├── logo.svg │ └── logo_light.svg ├── e2e ├── .gitkeep ├── capacitor-e2e │ ├── eslint.config.js │ ├── jest.config.ts │ ├── project.json │ ├── tests │ │ └── capacitor.spec.ts │ ├── tsconfig.json │ └── tsconfig.spec.json ├── ionic-angular-e2e │ ├── eslint.config.js │ ├── jest.config.ts │ ├── project.json │ ├── tests │ │ └── ionic-angular.spec.ts │ ├── tsconfig.json │ └── tsconfig.spec.json ├── ionic-react-e2e │ ├── eslint.config.js │ ├── jest.config.ts │ ├── project.json │ ├── tests │ │ └── ionic-react.spec.ts │ ├── tsconfig.json │ └── tsconfig.spec.json ├── preact-e2e │ ├── eslint.config.js │ ├── jest.config.ts │ ├── project.json │ ├── tests │ │ └── preact.test.ts │ ├── tsconfig.json │ └── tsconfig.spec.json ├── solid-e2e │ ├── eslint.config.js │ ├── jest.config.ts │ ├── project.json │ ├── tests │ │ └── solid.test.ts │ ├── tsconfig.json │ └── tsconfig.spec.json ├── stencil-e2e │ ├── eslint.config.js │ ├── jest.config.ts │ ├── project.json │ ├── tests │ │ ├── application.test.ts │ │ └── library.test.ts │ ├── tsconfig.json │ └── tsconfig.spec.json ├── svelte-e2e │ ├── eslint.config.js │ ├── jest.config.ts │ ├── project.json │ ├── tests │ │ ├── application.test.ts │ │ └── library.test.ts │ ├── tsconfig.json │ └── tsconfig.spec.json ├── sveltekit-e2e │ ├── eslint.config.js │ ├── jest.config.ts │ ├── project.json │ ├── tests │ │ └── sveltekit.spec.ts │ ├── tsconfig.json │ └── tsconfig.spec.json └── utils │ ├── index.ts │ └── run-commands-until.ts ├── eslint.config.js ├── images ├── logo-dark.png ├── logo-dark.svg ├── logo-light.png └── logo-light.svg ├── jest.config.ts ├── jest.preset.js ├── nx.json ├── package.json ├── packages ├── capacitor │ ├── CHANGELOG.md │ ├── MIGRATION.md │ ├── README.md │ ├── eslint.config.js │ ├── executors.json │ ├── generators.json │ ├── jest.config.ts │ ├── migrations.json │ ├── package.json │ ├── project.json │ ├── src │ │ ├── executors │ │ │ └── cap │ │ │ │ ├── compat.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ ├── generators │ │ │ └── configuration │ │ │ │ ├── files │ │ │ │ ├── capacitor-config │ │ │ │ │ └── capacitor.config.ts__template__ │ │ │ │ └── package-json │ │ │ │ │ └── package.json__template__ │ │ │ │ ├── generator.spec.ts │ │ │ │ ├── generator.ts │ │ │ │ ├── lib │ │ │ │ ├── add-capacitor-config.ts │ │ │ │ ├── add-dependencies.ts │ │ │ │ ├── normalize-options.ts │ │ │ │ ├── update-project-gitignore.ts │ │ │ │ └── update-project-package-json.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ ├── index.ts │ │ ├── plugins │ │ │ └── plugin.ts │ │ └── utils │ │ │ └── versions.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ └── tsconfig.spec.json ├── common │ ├── CHANGELOG.md │ ├── README.md │ ├── eslint.config.js │ ├── jest.config.ts │ ├── package.json │ ├── project.json │ ├── src │ │ ├── index.ts │ │ └── lib │ │ │ ├── is-verbose.ts │ │ │ └── utils │ │ │ ├── add-plugin-to-nx-json.ts │ │ │ ├── ast-utils.ts │ │ │ ├── map-lint-pattern.ts │ │ │ └── path.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ └── tsconfig.spec.json ├── ionic-angular │ ├── CHANGELOG.md │ ├── README.md │ ├── eslint.config.js │ ├── executors.json │ ├── generators.json │ ├── jest.config.ts │ ├── package.json │ ├── project.json │ ├── src │ │ ├── generators │ │ │ └── configuration │ │ │ │ ├── files │ │ │ │ ├── ionic.config.json.template │ │ │ │ └── src │ │ │ │ │ ├── app │ │ │ │ │ ├── app.component.html.template │ │ │ │ │ ├── app.component.spec.ts.template │ │ │ │ │ ├── app.component.ts.template │ │ │ │ │ ├── app.routes.ts.template │ │ │ │ │ ├── explore-container │ │ │ │ │ │ ├── explore-container.component.html.template │ │ │ │ │ │ ├── explore-container.component.scss.template │ │ │ │ │ │ ├── explore-container.component.spec.ts.template │ │ │ │ │ │ └── explore-container.component.ts.template │ │ │ │ │ ├── tab1 │ │ │ │ │ │ ├── tab1.page.html.template │ │ │ │ │ │ ├── tab1.page.scss.template │ │ │ │ │ │ ├── tab1.page.spec.ts.template │ │ │ │ │ │ └── tab1.page.ts.template │ │ │ │ │ ├── tab2 │ │ │ │ │ │ ├── tab2.page.html.template │ │ │ │ │ │ ├── tab2.page.scss.template │ │ │ │ │ │ ├── tab2.page.spec.ts.template │ │ │ │ │ │ └── tab2.page.ts.template │ │ │ │ │ ├── tab3 │ │ │ │ │ │ ├── tab3.page.html.template │ │ │ │ │ │ ├── tab3.page.scss.template │ │ │ │ │ │ ├── tab3.page.spec.ts.template │ │ │ │ │ │ └── tab3.page.ts.template │ │ │ │ │ └── tabs │ │ │ │ │ │ ├── tabs.page.html.template │ │ │ │ │ │ ├── tabs.page.scss.template │ │ │ │ │ │ ├── tabs.page.spec.ts.template │ │ │ │ │ │ ├── tabs.page.ts.template │ │ │ │ │ │ └── tabs.routes.ts.template │ │ │ │ │ ├── index.html.template │ │ │ │ │ ├── main.ts.template │ │ │ │ │ ├── public │ │ │ │ │ ├── favicon.png │ │ │ │ │ └── shapes.svg │ │ │ │ │ ├── styles.scss.template │ │ │ │ │ └── theme │ │ │ │ │ └── variables.scss.template │ │ │ │ ├── generator.spec.ts │ │ │ │ ├── generator.ts │ │ │ │ ├── lib │ │ │ │ ├── add-capacitor.ts │ │ │ │ ├── add-dependencies.ts │ │ │ │ ├── files.ts │ │ │ │ ├── normalize-options.ts │ │ │ │ ├── update-jest-config.ts │ │ │ │ └── update-workspace.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ ├── index.ts │ │ └── utils │ │ │ └── versions.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ └── tsconfig.spec.json ├── ionic-react │ ├── CHANGELOG.md │ ├── MIGRATION.md │ ├── README.md │ ├── eslint.config.js │ ├── executors.json │ ├── generators.json │ ├── jest.config.ts │ ├── package.json │ ├── project.json │ ├── src │ │ ├── generators │ │ │ └── configuration │ │ │ │ ├── files │ │ │ │ ├── index.html.template │ │ │ │ ├── ionic.config.json.template │ │ │ │ ├── public │ │ │ │ │ └── favicon.png │ │ │ │ └── src │ │ │ │ │ ├── App.spec.tsx.template │ │ │ │ │ ├── App.tsx.template │ │ │ │ │ ├── components │ │ │ │ │ ├── ExploreContainer.css.template │ │ │ │ │ └── ExploreContainer.tsx.template │ │ │ │ │ ├── main.tsx.template │ │ │ │ │ ├── manifest.json.template │ │ │ │ │ ├── pages │ │ │ │ │ ├── Tab1.css.template │ │ │ │ │ ├── Tab1.tsx.template │ │ │ │ │ ├── Tab2.css.template │ │ │ │ │ ├── Tab2.tsx.template │ │ │ │ │ ├── Tab3.css.template │ │ │ │ │ └── Tab3.tsx.template │ │ │ │ │ └── theme │ │ │ │ │ └── variables.css.template │ │ │ │ ├── generator.spec.ts │ │ │ │ ├── generator.ts │ │ │ │ ├── lib │ │ │ │ ├── add-capacitor.ts │ │ │ │ ├── add-dependencies.ts │ │ │ │ ├── files.ts │ │ │ │ ├── normalize-options.ts │ │ │ │ └── update-workspace.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ ├── index.ts │ │ └── utils │ │ │ └── versions.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ └── tsconfig.spec.json ├── preact │ ├── CHANGELOG.md │ ├── README.md │ ├── eslint.config.js │ ├── generators.json │ ├── jest.config.ts │ ├── package.json │ ├── project.json │ ├── src │ │ ├── generators │ │ │ ├── application │ │ │ │ ├── application.spec.ts │ │ │ │ ├── application.ts │ │ │ │ ├── files │ │ │ │ │ ├── eslintrc.js.template │ │ │ │ │ ├── index.html.template │ │ │ │ │ ├── package.json.template │ │ │ │ │ ├── public │ │ │ │ │ │ └── favicon.svg │ │ │ │ │ ├── src │ │ │ │ │ │ ├── App.module.css │ │ │ │ │ │ ├── App.tsx.template │ │ │ │ │ │ ├── index.css │ │ │ │ │ │ ├── index.tsx.template │ │ │ │ │ │ └── logo.tsx │ │ │ │ │ ├── tsconfig.app.json.template │ │ │ │ │ ├── tsconfig.json.template │ │ │ │ │ └── tsconfig.spec.json.template │ │ │ │ ├── lib │ │ │ │ │ ├── add-cypress.ts │ │ │ │ │ ├── add-jest.ts │ │ │ │ │ ├── add-linting.ts │ │ │ │ │ ├── add-project.ts │ │ │ │ │ ├── add-vite.ts │ │ │ │ │ ├── create-lint-target.ts │ │ │ │ │ └── update-jest-config.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── component │ │ │ │ ├── component.spec.ts │ │ │ │ ├── component.ts │ │ │ │ ├── files │ │ │ │ │ └── src │ │ │ │ │ │ └── components │ │ │ │ │ │ └── __fileName__ │ │ │ │ │ │ ├── __className__.tsx.template │ │ │ │ │ │ └── __fileName__.spec.tsx.template │ │ │ │ ├── lib │ │ │ │ │ ├── add-exports-to-barrel.ts │ │ │ │ │ └── create-component-in-project.ts │ │ │ │ └── schema.json │ │ │ ├── init │ │ │ │ ├── init.spec.ts │ │ │ │ ├── init.ts │ │ │ │ ├── lib │ │ │ │ │ ├── add-cypress-plugin.ts │ │ │ │ │ ├── add-dependencies.ts │ │ │ │ │ └── add-jest-plugin.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── library │ │ │ │ ├── files │ │ │ │ │ ├── package.json.template │ │ │ │ │ ├── src │ │ │ │ │ │ └── index.ts.template │ │ │ │ │ ├── tsconfig.json.template │ │ │ │ │ ├── tsconfig.lib.json.template │ │ │ │ │ └── tsconfig.spec.json.template │ │ │ │ ├── lib │ │ │ │ │ ├── add-jest.ts │ │ │ │ │ ├── add-linting.ts │ │ │ │ │ ├── add-project.ts │ │ │ │ │ ├── add-vite.ts │ │ │ │ │ ├── add-vitest.ts │ │ │ │ │ ├── create-files.ts │ │ │ │ │ ├── normalize-options.ts │ │ │ │ │ └── update-npm-scope.ts │ │ │ │ ├── library.spec.ts │ │ │ │ ├── library.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ └── utils │ │ │ │ ├── lint.ts │ │ │ │ ├── testing.ts │ │ │ │ └── versions.ts │ │ └── index.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ └── tsconfig.spec.json ├── solid │ ├── CHANGELOG.md │ ├── README.md │ ├── eslint.config.js │ ├── generators.json │ ├── jest.config.ts │ ├── migrations.json │ ├── package.json │ ├── project.json │ ├── src │ │ ├── generators │ │ │ ├── application │ │ │ │ ├── application.spec.ts │ │ │ │ ├── application.ts │ │ │ │ ├── files │ │ │ │ │ ├── eslintrc.js.template │ │ │ │ │ ├── index.html.template │ │ │ │ │ ├── package.json.template │ │ │ │ │ ├── public │ │ │ │ │ │ └── favicon.ico │ │ │ │ │ ├── src │ │ │ │ │ │ ├── App.module.css.template │ │ │ │ │ │ ├── App.tsx.template │ │ │ │ │ │ ├── index.css.template │ │ │ │ │ │ ├── index.tsx.template │ │ │ │ │ │ └── logo.svg │ │ │ │ │ ├── tsconfig.app.json.template │ │ │ │ │ ├── tsconfig.json.template │ │ │ │ │ └── tsconfig.spec.json.template │ │ │ │ ├── lib │ │ │ │ │ ├── add-cypress.ts │ │ │ │ │ ├── add-jest.ts │ │ │ │ │ ├── add-linting.ts │ │ │ │ │ ├── add-project.ts │ │ │ │ │ ├── add-vite.ts │ │ │ │ │ ├── create-project-files.ts │ │ │ │ │ └── update-jest-config.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── component │ │ │ │ ├── component.spec.ts │ │ │ │ ├── component.ts │ │ │ │ ├── files │ │ │ │ │ └── src │ │ │ │ │ │ └── components │ │ │ │ │ │ └── __fileName__ │ │ │ │ │ │ ├── __className__.tsx.template │ │ │ │ │ │ └── __fileName__.spec.tsx.template │ │ │ │ ├── lib │ │ │ │ │ ├── add-exports-to-barrel.ts │ │ │ │ │ └── create-component-in-project.ts │ │ │ │ └── schema.json │ │ │ ├── init │ │ │ │ ├── init.spec.ts │ │ │ │ ├── init.ts │ │ │ │ ├── lib │ │ │ │ │ ├── add-cypress-plugin.ts │ │ │ │ │ ├── add-dependencies.ts │ │ │ │ │ └── add-jest-plugin.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── library │ │ │ │ ├── files │ │ │ │ │ ├── eslintrc.js.template │ │ │ │ │ ├── package.json.template │ │ │ │ │ ├── src │ │ │ │ │ │ └── index.ts.template │ │ │ │ │ ├── tsconfig.json.template │ │ │ │ │ ├── tsconfig.lib.json.template │ │ │ │ │ └── tsconfig.spec.json.template │ │ │ │ ├── lib │ │ │ │ │ ├── add-jest.ts │ │ │ │ │ ├── add-linting.ts │ │ │ │ │ ├── add-project.ts │ │ │ │ │ ├── add-vite.ts │ │ │ │ │ ├── add-vitest.ts │ │ │ │ │ ├── create-project-files.ts │ │ │ │ │ ├── update-jest-config.ts │ │ │ │ │ └── update-tsconfig.ts │ │ │ │ ├── library.spec.ts │ │ │ │ ├── library.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ └── utils │ │ │ │ ├── lint.ts │ │ │ │ ├── testing.ts │ │ │ │ └── versions.ts │ │ └── index.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ └── tsconfig.spec.json ├── stencil │ ├── CHANGELOG.md │ ├── README.md │ ├── eslint.config.js │ ├── executors.json │ ├── generators.json │ ├── jest.config.ts │ ├── migrations.json │ ├── package.json │ ├── project.json │ ├── src │ │ ├── executors │ │ │ ├── build │ │ │ │ ├── compat.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── e2e │ │ │ │ ├── compat.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── serve │ │ │ │ ├── compat.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── stencil-runtime │ │ │ │ ├── e2e-testing.ts │ │ │ │ ├── index.ts │ │ │ │ ├── prepare-config-and-outputarget-paths.ts │ │ │ │ ├── stencil-config.ts │ │ │ │ ├── stencil-parameters.ts │ │ │ │ ├── stencil-process.spec.ts │ │ │ │ ├── stencil-process.ts │ │ │ │ └── types.ts │ │ │ └── test │ │ │ │ ├── compat.ts │ │ │ │ ├── executor.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ ├── generators │ │ │ ├── add-outputtarget │ │ │ │ ├── add-angular │ │ │ │ │ └── generator.ts │ │ │ │ ├── add-outputtarget-angular.spec.ts │ │ │ │ ├── add-outputtarget-react.spec.ts │ │ │ │ ├── add-outputtarget-vue.spec.ts │ │ │ │ ├── add-outputtarget.ts │ │ │ │ ├── add-react │ │ │ │ │ └── generator.ts │ │ │ │ ├── add-vue │ │ │ │ │ └── generator.ts │ │ │ │ ├── lib │ │ │ │ │ └── calculate-stencil-source-options.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── application │ │ │ │ ├── files │ │ │ │ │ └── app │ │ │ │ │ │ ├── LICENSE.template │ │ │ │ │ │ ├── src │ │ │ │ │ │ ├── assets │ │ │ │ │ │ │ └── icon │ │ │ │ │ │ │ │ ├── favicon.ico │ │ │ │ │ │ │ │ └── icon.png │ │ │ │ │ │ ├── components.d.ts.template │ │ │ │ │ │ ├── components │ │ │ │ │ │ │ ├── app-home │ │ │ │ │ │ │ │ ├── app-home.__style__.template │ │ │ │ │ │ │ │ ├── app-home.e2e.ts.template │ │ │ │ │ │ │ │ └── app-home.tsx.template │ │ │ │ │ │ │ ├── app-profile │ │ │ │ │ │ │ │ ├── app-profile.__style__.template │ │ │ │ │ │ │ │ ├── app-profile.e2e.ts.template │ │ │ │ │ │ │ │ ├── app-profile.spec.ts.template │ │ │ │ │ │ │ │ └── app-profile.tsx.template │ │ │ │ │ │ │ └── app-root │ │ │ │ │ │ │ │ ├── app-root.__style__.template │ │ │ │ │ │ │ │ ├── app-root.e2e.ts.template │ │ │ │ │ │ │ │ └── app-root.tsx.template │ │ │ │ │ │ ├── global │ │ │ │ │ │ │ ├── app.__style__.template │ │ │ │ │ │ │ └── app.ts.template │ │ │ │ │ │ ├── index.html.template │ │ │ │ │ │ ├── index.ts.template │ │ │ │ │ │ └── manifest.json.template │ │ │ │ │ │ ├── stencil.config.ts.template │ │ │ │ │ │ ├── tsconfig.app.json.template │ │ │ │ │ │ └── tsconfig.json.template │ │ │ │ ├── generator.spec.ts │ │ │ │ ├── generator.ts │ │ │ │ ├── lib │ │ │ │ │ ├── add-cypress.ts │ │ │ │ │ ├── add-linting.ts │ │ │ │ │ └── add-project.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── component │ │ │ │ ├── component.spec.ts │ │ │ │ ├── component.ts │ │ │ │ ├── files │ │ │ │ │ └── component │ │ │ │ │ │ ├── __componentFileName__.__style__.template │ │ │ │ │ │ ├── __componentFileName__.e2e.ts.template │ │ │ │ │ │ ├── __componentFileName__.spec.tsx.template │ │ │ │ │ │ ├── __componentFileName__.stories.tsx.template │ │ │ │ │ │ └── __componentFileName__.tsx.template │ │ │ │ └── schema.json │ │ │ ├── init │ │ │ │ ├── init.spec.ts │ │ │ │ ├── init.ts │ │ │ │ ├── lib │ │ │ │ │ ├── add-cypress.ts │ │ │ │ │ ├── add-dependencies-for-apptype.ts │ │ │ │ │ ├── add-e2e-dependencies.ts │ │ │ │ │ ├── add-jest.ts │ │ │ │ │ └── add-style-module-dependencies.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── library │ │ │ │ ├── files │ │ │ │ │ └── lib │ │ │ │ │ │ ├── LICENSE.template │ │ │ │ │ │ ├── src │ │ │ │ │ │ ├── components.d.ts.template │ │ │ │ │ │ ├── components │ │ │ │ │ │ │ └── my-component │ │ │ │ │ │ │ │ ├── my-component.__style__.template │ │ │ │ │ │ │ │ ├── my-component.e2e.ts.template │ │ │ │ │ │ │ │ ├── my-component.spec.ts.template │ │ │ │ │ │ │ │ ├── my-component.tsx.template │ │ │ │ │ │ │ │ └── readme.md.template │ │ │ │ │ │ ├── index.ts.template │ │ │ │ │ │ └── utils │ │ │ │ │ │ │ ├── utils.spec.ts.template │ │ │ │ │ │ │ └── utils.ts.template │ │ │ │ │ │ ├── stencil.config.ts.template │ │ │ │ │ │ ├── tsconfig.json.template │ │ │ │ │ │ └── tsconfig.lib.json.template │ │ │ │ ├── generator.spec.ts │ │ │ │ ├── generator.ts │ │ │ │ ├── lib │ │ │ │ │ ├── add-linting.ts │ │ │ │ │ ├── add-project.ts │ │ │ │ │ └── update-tsconfig.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── make-lib-buildable │ │ │ │ ├── files │ │ │ │ │ └── lib │ │ │ │ │ │ ├── package.json.template │ │ │ │ │ │ └── src │ │ │ │ │ │ └── index.html.template │ │ │ │ ├── lib │ │ │ │ │ └── update-tsconfig.ts │ │ │ │ ├── make-lib-buildable.spec.ts │ │ │ │ ├── make-lib-buildable.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ └── storybook-configuration │ │ │ │ ├── generator.spec.ts │ │ │ │ ├── generator.ts │ │ │ │ ├── lib │ │ │ │ ├── add-dependencies.ts │ │ │ │ └── update-lint-config.ts │ │ │ │ ├── project-files │ │ │ │ ├── .babelrc.json │ │ │ │ └── __dot__storybook │ │ │ │ │ ├── main.ts__tmpl__ │ │ │ │ │ ├── preview-body.html │ │ │ │ │ ├── preview-head.html │ │ │ │ │ ├── preview.ts__tmpl__ │ │ │ │ │ └── tsconfig.json__tmpl__ │ │ │ │ ├── root-files │ │ │ │ ├── __dot__storybook │ │ │ │ │ ├── main.ts__tmpl__ │ │ │ │ │ └── utils │ │ │ │ │ │ └── webpack-module-rules.ts__tmpl__ │ │ │ │ └── babel.config.json │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ ├── index.ts │ │ ├── migrations │ │ │ ├── change-stencil-eslint-plugin │ │ │ │ └── change-stencil-eslint-plugin.ts │ │ │ └── utils │ │ │ │ └── migration-utils.ts │ │ ├── stencil-core-utils │ │ │ ├── index.ts │ │ │ └── lib │ │ │ │ ├── plugins.ts │ │ │ │ └── style-plugins.ts │ │ └── utils │ │ │ ├── angular-ast-utils.ts │ │ │ ├── ast-utils.ts │ │ │ ├── fileutils.ts │ │ │ ├── insert-statement.ts │ │ │ ├── lint.spec.ts │ │ │ ├── lint.ts │ │ │ ├── normalize-path.ts │ │ │ ├── targets.ts │ │ │ ├── testing.ts │ │ │ ├── typings.ts │ │ │ ├── utillities.ts │ │ │ └── versions.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ └── tsconfig.spec.json ├── svelte │ ├── CHANGELOG.md │ ├── README.md │ ├── eslint.config.js │ ├── generators.json │ ├── jest.config.ts │ ├── package-lock.json │ ├── package.json │ ├── project.json │ ├── src │ │ ├── generators │ │ │ ├── application │ │ │ │ ├── application.spec.ts │ │ │ │ ├── application.ts │ │ │ │ ├── files │ │ │ │ │ ├── eslintrc.js.template │ │ │ │ │ ├── index.html.template │ │ │ │ │ ├── package.json.template │ │ │ │ │ ├── public │ │ │ │ │ │ ├── favicon.png │ │ │ │ │ │ └── global.css.template │ │ │ │ │ ├── src │ │ │ │ │ │ ├── App.svelte.template │ │ │ │ │ │ └── main.ts.template │ │ │ │ │ ├── svelte.config.cjs.template │ │ │ │ │ ├── tsconfig.app.json.template │ │ │ │ │ └── tsconfig.spec.json.template │ │ │ │ ├── lib │ │ │ │ │ ├── add-cypress.ts │ │ │ │ │ ├── add-jest.ts │ │ │ │ │ ├── add-linting.ts │ │ │ │ │ ├── add-project.ts │ │ │ │ │ ├── add-vite.ts │ │ │ │ │ ├── create-project-files.ts │ │ │ │ │ ├── normalize-options.ts │ │ │ │ │ └── update-jest-config.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── component │ │ │ │ ├── component.spec.ts │ │ │ │ ├── component.ts │ │ │ │ ├── files │ │ │ │ │ └── src │ │ │ │ │ │ └── components │ │ │ │ │ │ └── __fileName__ │ │ │ │ │ │ ├── __className__.svelte.template │ │ │ │ │ │ ├── __fileName__.spec.ts.template │ │ │ │ │ │ └── __fileName__.stories.ts.template │ │ │ │ ├── lib │ │ │ │ │ ├── add-exports-to-barrel.ts │ │ │ │ │ └── create-component-in-project.ts │ │ │ │ └── schema.json │ │ │ ├── init │ │ │ │ ├── init.spec.ts │ │ │ │ ├── init.ts │ │ │ │ ├── lib │ │ │ │ │ ├── add-cypress-plugin.ts │ │ │ │ │ ├── add-dependencies.ts │ │ │ │ │ ├── add-jest-plugin.ts │ │ │ │ │ └── add-linter-plugin.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── library │ │ │ │ ├── files │ │ │ │ │ ├── eslintrc.js.template │ │ │ │ │ ├── package.json.template │ │ │ │ │ ├── src │ │ │ │ │ │ └── index.ts.template │ │ │ │ │ ├── svelte.config.cjs.template │ │ │ │ │ ├── tsconfig.lib.json.template │ │ │ │ │ └── tsconfig.spec.json.template │ │ │ │ ├── lib │ │ │ │ │ ├── add-jest.ts │ │ │ │ │ ├── add-linting.ts │ │ │ │ │ ├── add-project.ts │ │ │ │ │ ├── add-vite.ts │ │ │ │ │ ├── add-vitest.ts │ │ │ │ │ ├── create-project-files.ts │ │ │ │ │ ├── normalize-options.ts │ │ │ │ │ ├── update-jest-config.ts │ │ │ │ │ └── update-tsconfig.ts │ │ │ │ ├── library.spec.ts │ │ │ │ ├── library.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ ├── storybook-configuration │ │ │ │ ├── configuration.spec.ts │ │ │ │ ├── configuration.ts │ │ │ │ ├── lib │ │ │ │ │ └── update-main-js.ts │ │ │ │ ├── schema.d.ts │ │ │ │ └── schema.json │ │ │ └── utils │ │ │ │ ├── add-plugin-to-nx-json.ts │ │ │ │ ├── create-ts-config.ts │ │ │ │ ├── lint.ts │ │ │ │ ├── targets.ts │ │ │ │ ├── testing.ts │ │ │ │ └── versions.ts │ │ ├── graph │ │ │ ├── TypeScriptSvelteImportLocator.ts │ │ │ └── processProjectGraph.ts │ │ ├── index.ts │ │ └── migrations │ │ │ └── utils │ │ │ └── migration-utils.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ └── tsconfig.spec.json └── sveltekit │ ├── CHANGELOG.md │ ├── README.md │ ├── builders.json │ ├── eslint.config.js │ ├── executors.json │ ├── generators.json │ ├── jest.config.ts │ ├── package.json │ ├── project.json │ ├── src │ ├── executors │ │ ├── add │ │ │ ├── executor.spec.ts │ │ │ ├── executor.ts │ │ │ ├── schema.d.ts │ │ │ └── schema.json │ │ └── sveltekit │ │ │ ├── executor.spec.ts │ │ │ ├── executor.ts │ │ │ ├── schema.d.ts │ │ │ └── schema.json │ ├── generators │ │ ├── application │ │ │ ├── files │ │ │ │ ├── app.css │ │ │ │ ├── eslintrc.cjs__template__ │ │ │ │ ├── package.json__template__ │ │ │ │ ├── project.json__template │ │ │ │ ├── src │ │ │ │ │ ├── app.d.ts__template__ │ │ │ │ │ ├── app.html__template__ │ │ │ │ │ ├── index.test.ts__template__ │ │ │ │ │ └── routes │ │ │ │ │ │ ├── +layout.svelte.__template │ │ │ │ │ │ └── +page.svelte__template__ │ │ │ │ ├── static │ │ │ │ │ ├── favicon.ico │ │ │ │ │ ├── favicon.png │ │ │ │ │ └── robots.txt │ │ │ │ ├── svelte.config.js__template__ │ │ │ │ ├── tsconfig.app.json.template │ │ │ │ ├── tsconfig.json.template │ │ │ │ └── tsconfig.spec.json.template │ │ │ ├── generator.spec.ts │ │ │ ├── generator.ts │ │ │ ├── lib │ │ │ │ ├── add-linting.ts │ │ │ │ ├── add-project-files.ts │ │ │ │ ├── add-vite.ts │ │ │ │ ├── install-dependencies.ts │ │ │ │ └── targets.ts │ │ │ ├── schema.d.ts │ │ │ └── schema.json │ │ ├── component │ │ │ ├── component.spec.ts │ │ │ ├── component.ts │ │ │ ├── files │ │ │ │ └── src │ │ │ │ │ └── lib │ │ │ │ │ └── __fileName__ │ │ │ │ │ ├── __className__.svelte.template │ │ │ │ │ └── __fileName__.spec.ts.template │ │ │ ├── lib │ │ │ │ ├── add-exports-to-barrel.ts │ │ │ │ └── create-component-in-project.ts │ │ │ └── schema.json │ │ ├── library │ │ │ ├── files │ │ │ │ └── src │ │ │ │ │ ├── __fileName__.spec.ts.template │ │ │ │ │ └── __fileName__.ts.template │ │ │ ├── lib │ │ │ │ ├── add-exports-to-barrel.ts │ │ │ │ └── create-library-in-project.ts │ │ │ ├── library.spec.ts │ │ │ ├── library.ts │ │ │ ├── schema.d.ts │ │ │ └── schema.json │ │ ├── route │ │ │ ├── files │ │ │ │ └── src │ │ │ │ │ ├── api │ │ │ │ │ └── __fileName__ │ │ │ │ │ │ ├── +server.ts.template │ │ │ │ │ │ └── __fileName__-server.spec.ts.template │ │ │ │ │ ├── error │ │ │ │ │ └── __fileName__ │ │ │ │ │ │ └── +error.svelte │ │ │ │ │ ├── layout │ │ │ │ │ ├── client │ │ │ │ │ │ └── __fileName__ │ │ │ │ │ │ │ ├── +layout.ts.template │ │ │ │ │ │ │ └── __fileName__-loader.spec.ts.template │ │ │ │ │ ├── page │ │ │ │ │ │ └── __fileName__ │ │ │ │ │ │ │ ├── +layout.svelte.__template │ │ │ │ │ │ │ └── __fileName__.spec.ts.template │ │ │ │ │ └── server │ │ │ │ │ │ └── __fileName__ │ │ │ │ │ │ ├── +layout.server.ts.template │ │ │ │ │ │ └── __fileName__-loader.spec.ts.template │ │ │ │ │ └── page │ │ │ │ │ ├── client │ │ │ │ │ └── __fileName__ │ │ │ │ │ │ ├── +page.ts.template │ │ │ │ │ │ └── __fileName__-loader.spec.ts.template │ │ │ │ │ ├── page │ │ │ │ │ └── __fileName__ │ │ │ │ │ │ ├── +page.svelte.template │ │ │ │ │ │ └── __fileName__.spec.ts.template │ │ │ │ │ └── server │ │ │ │ │ └── __fileName__ │ │ │ │ │ ├── +page.server.ts.template │ │ │ │ │ └── __fileName__-loader.spec.ts.template │ │ │ ├── lib │ │ │ │ └── create-route-in-project.ts │ │ │ ├── route.spec.ts │ │ │ ├── route.ts │ │ │ └── schema.json │ │ └── utils │ │ │ ├── lint.ts │ │ │ ├── testing.ts │ │ │ └── versions.ts │ └── index.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ └── tsconfig.spec.json ├── pnpm-lock.yaml ├── project.json ├── tools ├── scripts │ ├── check-lock-files.js │ ├── check-versions.ts │ ├── create-playground.ts │ ├── documentation │ │ ├── documentation.ts │ │ ├── generate-executors-data.ts │ │ ├── generate-generators-data.ts │ │ ├── get-package-configurations.ts │ │ ├── json-parser.ts │ │ ├── schema-flattener.ts │ │ └── utils.ts │ ├── fetch-latest-versions.ts │ ├── mock-project-graph.ts │ ├── notify-lockfile-changes.js │ ├── start-local-registry.ts │ ├── stop-local-registry.ts │ ├── tsconfig.scripts.json │ ├── update-package-json-nx-versions.ts │ ├── update-playground.ts │ └── utils.ts └── tsconfig.tools.json └── tsconfig.base.json /.commitlintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["@commitlint/config-conventional"], 3 | "rules": {} 4 | } 5 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nxext", 3 | "image": "mcr.microsoft.com/devcontainers/javascript-node:1-22-bookworm", 4 | "postCreateCommand": "pnpm config set store-dir /home/node && pnpm install", 5 | "customizations": { 6 | "vscode": { 7 | "extensions": [ 8 | "orta.vscode-jest", 9 | "esbenp.prettier-vscode", 10 | "dbaeumer.vscode-eslint" 11 | ] 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.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: [DominikPieper] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 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 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: '🐞 Bug Report' 3 | about: Create a report to help us improve 4 | title: 'Stencil | Svelte | Sveltekit | Solid | Vite | Vitest | Vue | React | Angular: ' 5 | labels: bug 6 | assignees: '' 7 | --- 8 | 9 | **Describe the bug** 10 | A clear and concise description of what the bug is. 11 | 12 | **To Reproduce** 13 | Steps to reproduce the behavior: 14 | 15 | **Expected behavior** 16 | A clear and concise description of what you expected to happen. 17 | 18 | **Additional context** 19 | Add any other context about the problem here. 20 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Want to start a discussion? 4 | about: Want to start a thread to discuss an idea? Use the discussions feature provided by GitHub. 5 | url: https://github.com/nxext/nx-extensions/discussions 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/documentation.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: '📄 Documentation' 3 | about: Suggest an idea for the docs 4 | title: 'Stencil | Svelte | Sveltekit | Solid | Vite | Vitest | Vue | React | Angular: ' 5 | labels: documentation 6 | assignees: '' 7 | --- 8 | 9 | ** describe what you'd like to see in the docs ** 10 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/guides.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: '⚙️ Guides' 3 | about: Suggest an idea for the guides 4 | title: 'Stencil | Svelte | Sveltekit | Solid | Vite | Vitest | Vue | React | Angular: ' 5 | labels: guides 6 | assignees: '' 7 | --- 8 | 9 | ** describe what you'd like to see in the guides ** 10 | 11 | Use the guides for more complex examples that are not covered or too long for the docs. 12 | -------------------------------------------------------------------------------- /.husky/.gitignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx --no-install commitlint --edit $1 5 | -------------------------------------------------------------------------------- /.husky/post-checkout: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | changedFiles="$(git diff-tree -r --name-only --no-commit-id $1 $2)" 3 | node ./tools/scripts/notify-lockfile-changes.js $changedFiles 4 | -------------------------------------------------------------------------------- /.husky/post-merge: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | changedFiles="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" 3 | node ./tools/scripts/notify-lockfile-changes.js $changedFiles 4 | -------------------------------------------------------------------------------- /.husky/pre-push: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | pnpm format:check || { 5 | echo "Make sure to run \`pnpm format\` before pushing." >&2; 6 | exit 1; 7 | } 8 | pnpm documentation 9 | pnpm check-lock-files 10 | -------------------------------------------------------------------------------- /.node-version: -------------------------------------------------------------------------------- 1 | 18.14.2 2 | -------------------------------------------------------------------------------- /.nxignore: -------------------------------------------------------------------------------- 1 | packages/vue 2 | e2e/vue-e2e 3 | packages/nuxt 4 | e2e/nuxt-e2e 5 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # Add files here to ignore them from prettier formatting 2 | 3 | /dist 4 | /coverage 5 | /tmp 6 | .docusaurus/ 7 | /build 8 | 9 | /.nx/cache 10 | /.nx/workspace-data 11 | 12 | pnpm-lock.yaml 13 | 14 | **/CHANGELOG.md 15 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true 3 | } 4 | -------------------------------------------------------------------------------- /docs/.vitepress/theme/index.js: -------------------------------------------------------------------------------- 1 | import DefaultTheme from 'vitepress/theme'; 2 | import './vars.css'; 3 | 4 | export default { 5 | ...DefaultTheme, 6 | }; 7 | -------------------------------------------------------------------------------- /docs/.vitepress/theme/vars.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --vp-c-brand: rgb(215, 110, 5); 3 | --vp-c-brand-light: rgb(205, 136, 86); 4 | --vp-button-brand-bg: rgb(205, 110, 5); 5 | --vp-button-brand-active-bg: rgb(205, 110, 5); 6 | --vp-button-brand-hover-bg: rgb(205, 110, 5); 7 | --vp-button-brand-hover-border: rgb(205, 110, 5); 8 | --vp-button-brand-active-border: rgb(205, 110, 5); 9 | } 10 | -------------------------------------------------------------------------------- /docs/docs/capacitor/executors.md: -------------------------------------------------------------------------------- 1 | ## @nxext/capacitor:cap 2 | 3 | Run a Capacitor command 4 | 5 | Options can be configured in the 'project.json' when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. 6 | 7 | ### Options 8 | 9 | #### cmd 10 | 11 | Type: `string` 12 | 13 | The Capacitor command. 14 | 15 | #### preserveProjectNodeModules 16 | 17 | Type: `boolean` 18 | 19 | Preserve the node_modules folder inside the project dir. 20 | -------------------------------------------------------------------------------- /docs/docs/ionic-angular/executors.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxext/nx-extensions/b394bd93c2a76d561fef468c4d9aaf3c7f85e0f8/docs/docs/ionic-angular/executors.md -------------------------------------------------------------------------------- /docs/docs/ionic-react/executors.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxext/nx-extensions/b394bd93c2a76d561fef468c4d9aaf3c7f85e0f8/docs/docs/ionic-react/executors.md -------------------------------------------------------------------------------- /docs/docs/nxext/community.md: -------------------------------------------------------------------------------- 1 | # Community 2 | 3 | You can find us on [Discord](https://discord.gg/SWyp4xfGjn) or [Github discussions](https://github.com/nxext/nx-extensions/discussions). 4 | -------------------------------------------------------------------------------- /docs/docs/preact/installation.md: -------------------------------------------------------------------------------- 1 | # Getting Started 2 | 3 | At this current moment we don't have an out of the back workspace setup. In order to use nxext/preact you need to create a new NX workspace. 4 | 5 | ```bash 6 | npx create-nx-workspace --preset=empty 7 | ``` 8 | 9 | After creating the blank workspace. Run the following commands 10 | 11 | ```bash npm2yarn 12 | npm install @nxext/preact --save 13 | ``` 14 | 15 | ## Generating scaffolding 16 | 17 | ### Application 18 | 19 | ```bash 20 | npx nx g @nxext/preact:app [name] 21 | ``` 22 | 23 | ### Library 24 | 25 | ```bash 26 | npx nx g @nxext/preact:lib [name] 27 | ``` 28 | -------------------------------------------------------------------------------- /docs/docs/preact/overview.md: -------------------------------------------------------------------------------- 1 | # Overview of Nxext Preact 2 | 3 | The Nxext Plugin for preact contains generators for managing Preact applications and libraries within an Nx workspace . It provides: 4 | 5 | - Vite alterntive to webpack (@nx/web) 6 | - Quicker and smaller builds 7 | 8 | ## Adding the Preact plugin 9 | 10 | Adding the preact plugin to a workspace can be done with the following: 11 | 12 | ```bash 13 | #yarn 14 | yarn add -D @nxext/preact 15 | ``` 16 | 17 | ```bash 18 | #npm 19 | npm install -D @nxext/preact 20 | ``` 21 | -------------------------------------------------------------------------------- /docs/docs/solid/installation.md: -------------------------------------------------------------------------------- 1 | # Installation 2 | 3 | Add this plugin to an Nx workspace: 4 | 5 | ```bash 6 | npm install @nxext/solid --save 7 | ``` 8 | -------------------------------------------------------------------------------- /docs/docs/solid/overview.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | 3 | [@nxext/solid](https://github.com/nxext/nx-extensions/tree/main/packages/solid) is a nx plugin to bring [Solid](https://www.solidjs.com/) to [Nx](https://nx.dev/). 4 | -------------------------------------------------------------------------------- /docs/docs/stencil/installation.md: -------------------------------------------------------------------------------- 1 | # Installation 2 | 3 | Add this plugin to an Nx workspace: 4 | 5 | ```bash 6 | npm add @nxext/stencil --save 7 | ``` 8 | -------------------------------------------------------------------------------- /docs/docs/stencil/overview.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | 3 | [@nxext/stencil](https://github.com/nxext/nx-extensions/tree/main/packages/stencil) is a nx plugin to bring [StencilJs](https://stenciljs.com/) to [Nx](https://nx.dev/). 4 | -------------------------------------------------------------------------------- /docs/docs/svelte/installation.md: -------------------------------------------------------------------------------- 1 | Add this plugin to an Nx workspace: 2 | 3 | ```bash 4 | npm install @nxext/svelte --save 5 | ``` 6 | -------------------------------------------------------------------------------- /docs/docs/svelte/overview.md: -------------------------------------------------------------------------------- 1 | # Overview of the Svelte plugin 2 | 3 | [@nxext/svelte](https://github.com/nxext/nx-extensions/tree/main/packages/svelte) is a nx plugin to bring [Svelte](https://svelte.dev/) to [Nx](https://nx.dev/). 4 | -------------------------------------------------------------------------------- /docs/docs/sveltekit/executors.md: -------------------------------------------------------------------------------- 1 | ## @nxext/sveltekit:add 2 | 3 | add executor 4 | 5 | Options can be configured in the 'project.json' when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/configuration/projectjson#targets. 6 | 7 | ### Options 8 | 9 | #### package (_**required**_) 10 | 11 | Type: `string` 12 | 13 | Possible values: `tailwindcss`, `mdsvex`, `graphql`, `postcss`, `picocss`, `bulma`, `windicss`, `firebase-hosting` 14 | 15 | Package you want to install 16 | -------------------------------------------------------------------------------- /docs/docs/sveltekit/installation.md: -------------------------------------------------------------------------------- 1 | # Getting Started 2 | 3 | At this current moment we don't have an out of the back workspace setup. In order to use nxext/sveltekit you need to create a new NX workspace. 4 | 5 | ```bash 6 | npx create-nx-workspace --preset=empty 7 | ``` 8 | 9 | After creating the blank workspace. Run the following commands 10 | 11 | ```bash 12 | npm install @nxext/sveltekit --save 13 | ``` 14 | -------------------------------------------------------------------------------- /docs/docs/sveltekit/overview.md: -------------------------------------------------------------------------------- 1 | # Introduction to Nxext Sveltekit 2 | 3 | ::: warning 4 | This plugin is in alpha state. It is not feature complete yet and not ready for production. 5 | ::: 6 | 7 | [@nxext/sveltekit](https://github.com/nxext/nx-extensions/tree/main/packages/sveltekit) is a nx plugin to bring [Sveltekit](https://kit.svelte.dev) to [Nx](https://nx.dev/). 8 | -------------------------------------------------------------------------------- /docs/guide/articles.md: -------------------------------------------------------------------------------- 1 | # Stencil 2 | 3 | | Article | 4 | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | 5 | | [Building React and Angular Component Libraries with Stencil and Nx](https://ionicframework.com/blog/building-react-and-angular-component-libraries-with-stencil-and-nx/) | 6 | | [Framework agnostic component libraries with StencilJs and Nx](https://dev.to/dominikpieper/framework-agnostic-component-libraries-with-stenciljs-and-nx-8mb) | 7 | -------------------------------------------------------------------------------- /docs/guide/index.md: -------------------------------------------------------------------------------- 1 | # Getting started 2 | 3 | This is the place to collect specialized guides for specific topics. 4 | -------------------------------------------------------------------------------- /docs/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "docs", 3 | "$schema": "../node_modules/nx/schemas/project-schema.json", 4 | "sourceRoot": "packages/docs", 5 | "projectType": "library", 6 | "targets": { 7 | "build": { 8 | "executor": "nx:run-commands", 9 | "options": { 10 | "command": "npx vitepress build", 11 | "cwd": "docs" 12 | } 13 | }, 14 | "serve": { 15 | "executor": "nx:run-commands", 16 | "options": { 17 | "command": "npx vitepress dev", 18 | "cwd": "docs" 19 | } 20 | } 21 | }, 22 | "tags": [] 23 | } 24 | -------------------------------------------------------------------------------- /docs/public/_headers: -------------------------------------------------------------------------------- 1 | /assets/* 2 | cache-control: max-age=31536000 3 | cache-control: immutable 4 | 5 | /*.svg 6 | cache-control: max-age=604800 7 | cache-control: immutable 8 | 9 | /*.png 10 | cache-control: max-age=604800 11 | cache-control: immutable 12 | -------------------------------------------------------------------------------- /e2e/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /e2e/capacitor-e2e/eslint.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../eslint.config.js'); 2 | module.exports = [ 3 | ...baseConfig, 4 | { 5 | files: [ 6 | 'e2e/capacitor-e2e/**/*.ts', 7 | 'e2e/capacitor-e2e/**/*.tsx', 8 | 'e2e/capacitor-e2e/**/*.js', 9 | 'e2e/capacitor-e2e/**/*.jsx', 10 | ], 11 | rules: {}, 12 | }, 13 | { 14 | files: ['e2e/capacitor-e2e/**/*.ts', 'e2e/capacitor-e2e/**/*.tsx'], 15 | rules: {}, 16 | }, 17 | { 18 | files: ['e2e/capacitor-e2e/**/*.js', 'e2e/capacitor-e2e/**/*.jsx'], 19 | rules: {}, 20 | }, 21 | ]; 22 | -------------------------------------------------------------------------------- /e2e/capacitor-e2e/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'capacitor-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/capacitor-e2e', 10 | globalSetup: '../../tools/scripts/start-local-registry.ts', 11 | globalTeardown: '../../tools/scripts/stop-local-registry.ts', 12 | }; 13 | -------------------------------------------------------------------------------- /e2e/capacitor-e2e/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "capacitor-e2e", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "projectType": "application", 5 | "sourceRoot": "e2e/capacitor-e2e/tests", 6 | "targets": { 7 | "e2e": {}, 8 | "lint": { 9 | "executor": "@nx/eslint:lint", 10 | "outputs": ["{options.outputFile}"] 11 | } 12 | }, 13 | "tags": [], 14 | "implicitDependencies": ["capacitor"] 15 | } 16 | -------------------------------------------------------------------------------- /e2e/capacitor-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/capacitor-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/ionic-angular-e2e/eslint.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../eslint.config.js'); 2 | module.exports = [ 3 | ...baseConfig, 4 | { 5 | files: [ 6 | 'e2e/ionic-angular-e2e/**/*.ts', 7 | 'e2e/ionic-angular-e2e/**/*.tsx', 8 | 'e2e/ionic-angular-e2e/**/*.js', 9 | 'e2e/ionic-angular-e2e/**/*.jsx', 10 | ], 11 | rules: {}, 12 | }, 13 | { 14 | files: ['e2e/ionic-angular-e2e/**/*.ts', 'e2e/ionic-angular-e2e/**/*.tsx'], 15 | rules: {}, 16 | }, 17 | { 18 | files: ['e2e/ionic-angular-e2e/**/*.js', 'e2e/ionic-angular-e2e/**/*.jsx'], 19 | rules: {}, 20 | }, 21 | ]; 22 | -------------------------------------------------------------------------------- /e2e/ionic-angular-e2e/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'ionic-angular-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/ionic-angular-e2e', 10 | globalSetup: '../../tools/scripts/start-local-registry.ts', 11 | globalTeardown: '../../tools/scripts/stop-local-registry.ts', 12 | }; 13 | -------------------------------------------------------------------------------- /e2e/ionic-angular-e2e/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ionic-angular-e2e", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "projectType": "application", 5 | "sourceRoot": "e2e/ionic-angular-e2e/tests", 6 | "targets": { 7 | "e2e": {}, 8 | "lint": { 9 | "executor": "@nx/eslint:lint", 10 | "outputs": ["{options.outputFile}"] 11 | } 12 | }, 13 | "tags": [], 14 | "implicitDependencies": ["ionic-angular"] 15 | } 16 | -------------------------------------------------------------------------------- /e2e/ionic-angular-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/ionic-angular-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/ionic-react-e2e/eslint.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../eslint.config.js'); 2 | module.exports = [ 3 | ...baseConfig, 4 | { 5 | files: [ 6 | 'e2e/ionic-react-e2e/**/*.ts', 7 | 'e2e/ionic-react-e2e/**/*.tsx', 8 | 'e2e/ionic-react-e2e/**/*.js', 9 | 'e2e/ionic-react-e2e/**/*.jsx', 10 | ], 11 | rules: {}, 12 | }, 13 | { 14 | files: ['e2e/ionic-react-e2e/**/*.ts', 'e2e/ionic-react-e2e/**/*.tsx'], 15 | rules: {}, 16 | }, 17 | { 18 | files: ['e2e/ionic-react-e2e/**/*.js', 'e2e/ionic-react-e2e/**/*.jsx'], 19 | rules: {}, 20 | }, 21 | ]; 22 | -------------------------------------------------------------------------------- /e2e/ionic-react-e2e/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'ionic-react-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/ionic-react-e2e', 10 | globalSetup: '../../tools/scripts/start-local-registry.ts', 11 | globalTeardown: '../../tools/scripts/stop-local-registry.ts', 12 | }; 13 | -------------------------------------------------------------------------------- /e2e/ionic-react-e2e/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ionic-react-e2e", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "projectType": "application", 5 | "sourceRoot": "e2e/ionic-react-e2e/tests", 6 | "targets": { 7 | "e2e": {}, 8 | "lint": { 9 | "executor": "@nx/eslint:lint", 10 | "outputs": ["{options.outputFile}"] 11 | } 12 | }, 13 | "tags": [], 14 | "implicitDependencies": ["ionic-react"] 15 | } 16 | -------------------------------------------------------------------------------- /e2e/ionic-react-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/ionic-react-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/preact-e2e/eslint.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../eslint.config.js'); 2 | module.exports = [ 3 | ...baseConfig, 4 | { 5 | files: [ 6 | 'e2e/preact-e2e/**/*.ts', 7 | 'e2e/preact-e2e/**/*.tsx', 8 | 'e2e/preact-e2e/**/*.js', 9 | 'e2e/preact-e2e/**/*.jsx', 10 | ], 11 | rules: {}, 12 | }, 13 | { 14 | files: ['e2e/preact-e2e/**/*.ts', 'e2e/preact-e2e/**/*.tsx'], 15 | rules: {}, 16 | }, 17 | { 18 | files: ['e2e/preact-e2e/**/*.js', 'e2e/preact-e2e/**/*.jsx'], 19 | rules: {}, 20 | }, 21 | ]; 22 | -------------------------------------------------------------------------------- /e2e/preact-e2e/jest.config.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | displayName: 'preact-e2e', 3 | preset: '../../jest.preset.js', 4 | transform: { 5 | '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], 6 | }, 7 | moduleFileExtensions: ['ts', 'js', 'html'], 8 | coverageDirectory: '../../coverage/e2e/preact-e2e', 9 | globalSetup: '../../tools/scripts/start-local-registry.ts', 10 | globalTeardown: '../../tools/scripts/stop-local-registry.ts', 11 | }; 12 | -------------------------------------------------------------------------------- /e2e/preact-e2e/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "preact-e2e", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "projectType": "application", 5 | "sourceRoot": "e2e/preact-e2e/tests", 6 | "targets": { 7 | "lint": { 8 | "executor": "@nx/eslint:lint", 9 | "outputs": ["{options.outputFile}"] 10 | } 11 | }, 12 | "tags": [], 13 | "implicitDependencies": ["preact"] 14 | } 15 | -------------------------------------------------------------------------------- /e2e/preact-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/preact-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": ["**/*.spec.ts", "**/*.d.ts", "jest.config.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /e2e/solid-e2e/eslint.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../eslint.config.js'); 2 | module.exports = [ 3 | ...baseConfig, 4 | { 5 | files: [ 6 | 'e2e/solid-e2e/**/*.ts', 7 | 'e2e/solid-e2e/**/*.tsx', 8 | 'e2e/solid-e2e/**/*.js', 9 | 'e2e/solid-e2e/**/*.jsx', 10 | ], 11 | rules: {}, 12 | }, 13 | { 14 | files: ['e2e/solid-e2e/**/*.ts', 'e2e/solid-e2e/**/*.tsx'], 15 | rules: {}, 16 | }, 17 | { 18 | files: ['e2e/solid-e2e/**/*.js', 'e2e/solid-e2e/**/*.jsx'], 19 | rules: {}, 20 | }, 21 | ]; 22 | -------------------------------------------------------------------------------- /e2e/solid-e2e/jest.config.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | displayName: 'solid-e2e', 3 | preset: '../../jest.preset.js', 4 | transform: { 5 | '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], 6 | }, 7 | moduleFileExtensions: ['ts', 'js', 'html'], 8 | coverageDirectory: '../../coverage/e2e/solid-e2e', 9 | globalSetup: '../../tools/scripts/start-local-registry.ts', 10 | globalTeardown: '../../tools/scripts/stop-local-registry.ts', 11 | }; 12 | -------------------------------------------------------------------------------- /e2e/solid-e2e/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "solid-e2e", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "projectType": "application", 5 | "sourceRoot": "e2e/solid-e2e/tests", 6 | "targets": { 7 | "lint": { 8 | "executor": "@nx/eslint:lint", 9 | "outputs": ["{options.outputFile}"] 10 | } 11 | }, 12 | "tags": [], 13 | "implicitDependencies": ["solid"] 14 | } 15 | -------------------------------------------------------------------------------- /e2e/solid-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/solid-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": ["**/*.spec.ts", "**/*.d.ts", "jest.config.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /e2e/stencil-e2e/eslint.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../eslint.config.js'); 2 | module.exports = [ 3 | ...baseConfig, 4 | { 5 | files: [ 6 | 'e2e/stencil-e2e/**/*.ts', 7 | 'e2e/stencil-e2e/**/*.tsx', 8 | 'e2e/stencil-e2e/**/*.js', 9 | 'e2e/stencil-e2e/**/*.jsx', 10 | ], 11 | rules: {}, 12 | }, 13 | { 14 | files: ['e2e/stencil-e2e/**/*.ts', 'e2e/stencil-e2e/**/*.tsx'], 15 | rules: {}, 16 | }, 17 | { 18 | files: ['e2e/stencil-e2e/**/*.js', 'e2e/stencil-e2e/**/*.jsx'], 19 | rules: {}, 20 | }, 21 | ]; 22 | -------------------------------------------------------------------------------- /e2e/stencil-e2e/jest.config.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | displayName: 'stencil-e2e', 3 | preset: '../../jest.preset.js', 4 | transform: { 5 | '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], 6 | }, 7 | moduleFileExtensions: ['ts', 'js', 'html'], 8 | coverageDirectory: '../../coverage/e2e/stencil-e2e', 9 | globalSetup: '../../tools/scripts/start-local-registry.ts', 10 | globalTeardown: '../../tools/scripts/stop-local-registry.ts', 11 | }; 12 | -------------------------------------------------------------------------------- /e2e/stencil-e2e/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "stencil-e2e", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "projectType": "application", 5 | "sourceRoot": "e2e/stencil-e2e/tests", 6 | "targets": { 7 | "lint": { 8 | "executor": "@nx/eslint:lint", 9 | "outputs": ["{options.outputFile}"] 10 | } 11 | }, 12 | "tags": [], 13 | "implicitDependencies": ["stencil"] 14 | } 15 | -------------------------------------------------------------------------------- /e2e/stencil-e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "types": ["node", "jest"] 5 | }, 6 | "include": [], 7 | "files": [], 8 | "references": [ 9 | { 10 | "path": "./tsconfig.spec.json" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /e2e/stencil-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": ["**/*.spec.ts", "**/*.d.ts", "jest.config.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /e2e/svelte-e2e/eslint.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../eslint.config.js'); 2 | module.exports = [ 3 | ...baseConfig, 4 | { 5 | files: [ 6 | 'e2e/svelte-e2e/**/*.ts', 7 | 'e2e/svelte-e2e/**/*.tsx', 8 | 'e2e/svelte-e2e/**/*.js', 9 | 'e2e/svelte-e2e/**/*.jsx', 10 | ], 11 | rules: {}, 12 | }, 13 | { 14 | files: ['e2e/svelte-e2e/**/*.ts', 'e2e/svelte-e2e/**/*.tsx'], 15 | rules: {}, 16 | }, 17 | { 18 | files: ['e2e/svelte-e2e/**/*.js', 'e2e/svelte-e2e/**/*.jsx'], 19 | rules: {}, 20 | }, 21 | ]; 22 | -------------------------------------------------------------------------------- /e2e/svelte-e2e/jest.config.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | displayName: 'svelte-e2e', 3 | preset: '../../jest.preset.js', 4 | transform: { 5 | '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], 6 | }, 7 | moduleFileExtensions: ['ts', 'js', 'html'], 8 | coverageDirectory: '../../coverage/e2e/svelte-e2e', 9 | globalSetup: '../../tools/scripts/start-local-registry.ts', 10 | globalTeardown: '../../tools/scripts/stop-local-registry.ts', 11 | }; 12 | -------------------------------------------------------------------------------- /e2e/svelte-e2e/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "svelte-e2e", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "projectType": "application", 5 | "sourceRoot": "e2e/svelte-e2e/tests", 6 | "targets": { 7 | "lint": { 8 | "executor": "@nx/eslint:lint", 9 | "outputs": ["{options.outputFile}"] 10 | } 11 | }, 12 | "tags": [], 13 | "implicitDependencies": ["svelte"] 14 | } 15 | -------------------------------------------------------------------------------- /e2e/svelte-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/svelte-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": ["**/*.spec.ts", "**/*.d.ts", "jest.config.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /e2e/sveltekit-e2e/eslint.config.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('../../eslint.config.js'); 2 | module.exports = [ 3 | ...baseConfig, 4 | { 5 | files: [ 6 | 'e2e/sveltekit-e2e/**/*.ts', 7 | 'e2e/sveltekit-e2e/**/*.tsx', 8 | 'e2e/sveltekit-e2e/**/*.js', 9 | 'e2e/sveltekit-e2e/**/*.jsx', 10 | ], 11 | rules: {}, 12 | }, 13 | { 14 | files: ['e2e/sveltekit-e2e/**/*.ts', 'e2e/sveltekit-e2e/**/*.tsx'], 15 | rules: {}, 16 | }, 17 | { 18 | files: ['e2e/sveltekit-e2e/**/*.js', 'e2e/sveltekit-e2e/**/*.jsx'], 19 | rules: {}, 20 | }, 21 | ]; 22 | -------------------------------------------------------------------------------- /e2e/sveltekit-e2e/jest.config.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | displayName: 'sveltekit-e2e', 3 | preset: '../../jest.preset.js', 4 | transform: { 5 | '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], 6 | }, 7 | moduleFileExtensions: ['ts', 'js', 'html'], 8 | coverageDirectory: '../../coverage/e2e/sveltekit-e2e', 9 | globalSetup: '../../tools/scripts/start-local-registry.ts', 10 | globalTeardown: '../../tools/scripts/stop-local-registry.ts', 11 | }; 12 | -------------------------------------------------------------------------------- /e2e/sveltekit-e2e/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sveltekit-e2e", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "projectType": "application", 5 | "sourceRoot": "e2e/sveltekit-e2e/tests", 6 | "targets": { 7 | "lint": { 8 | "executor": "@nx/eslint:lint", 9 | "outputs": ["{options.outputFile}"] 10 | } 11 | }, 12 | "tags": [], 13 | "implicitDependencies": ["sveltekit"] 14 | } 15 | -------------------------------------------------------------------------------- /e2e/sveltekit-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/sveltekit-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": ["**/*.spec.ts", "**/*.d.ts", "jest.config.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /jest.config.ts: -------------------------------------------------------------------------------- 1 | import { getJestProjectsAsync } from '@nx/jest'; 2 | 3 | export default async () => ({ 4 | projects: await getJestProjectsAsync(), 5 | }); 6 | -------------------------------------------------------------------------------- /jest.preset.js: -------------------------------------------------------------------------------- 1 | const nxPreset = require('@nx/jest/preset').default; 2 | module.exports = { 3 | ...nxPreset, 4 | testTimeout: 500000, 5 | /* TODO: Update to latest Jest snapshotFormat 6 | * By default Nx has kept the older style of Jest Snapshot formats 7 | * to prevent breaking of any existing tests with snapshots. 8 | * It's recommend you update to the latest format. 9 | * You can do this by removing snapshotFormat property 10 | * and running tests with --update-snapshot flag. 11 | * Example: "nx affected --targets= --update-snapshot" 12 | * More info: https://jestjs.io/docs/upgrading-to-jest29#snapshot-format 13 | */ 14 | snapshotFormat: { escapeString: true, printBasicPrototype: true }, 15 | setupFiles: ['/../../tools/scripts/mock-project-graph.ts'], 16 | }; 17 | -------------------------------------------------------------------------------- /packages/capacitor/README.md: -------------------------------------------------------------------------------- 1 | # capacitor 2 | 3 | This library was generated with [Nx](https://nx.dev). 4 | 5 | ## Building 6 | 7 | Run `nx build capacitor` to build the library. 8 | 9 | ## Running unit tests 10 | 11 | Run `nx test capacitor` to execute the unit tests via [Jest](https://jestjs.io). 12 | -------------------------------------------------------------------------------- /packages/capacitor/executors.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "executors": { 4 | "cap": { 5 | "implementation": "./src/executors/cap/executor", 6 | "schema": "./src/executors/cap/schema.json", 7 | "description": "Run a Capacitor command" 8 | } 9 | }, 10 | "builders": { 11 | "cap": { 12 | "implementation": "./src/executors/cap/compat", 13 | "schema": "./src/executors/cap/schema.json", 14 | "description": "Run a Capacitor command" 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/capacitor/generators.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "name": "nxextCapacitor", 4 | "version": "0.0.1", 5 | "generators": { 6 | "configuration": { 7 | "factory": "./src/generators/configuration/generator", 8 | "schema": "./src/generators/configuration/schema.json", 9 | "description": "Configure Capacitor for an Nx project" 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/capacitor/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | module.exports = { 3 | displayName: 'capacitor', 4 | preset: '../../jest.preset.js', 5 | globals: {}, 6 | transform: { 7 | '^.+\\.[tj]s$': [ 8 | 'ts-jest', 9 | { 10 | tsconfig: '/tsconfig.spec.json', 11 | }, 12 | ], 13 | }, 14 | moduleFileExtensions: ['ts', 'js', 'html'], 15 | coverageDirectory: '../../coverage/packages/capacitor', 16 | }; 17 | -------------------------------------------------------------------------------- /packages/capacitor/migrations.json: -------------------------------------------------------------------------------- 1 | { 2 | "generators": {}, 3 | "packageJsonUpdates": { 4 | "18.0.4": { 5 | "version": "18.0.4", 6 | "packages": { 7 | "@capacitor/core": { 8 | "version": "^5.7.0", 9 | "alwaysAddToPackageJson": true 10 | }, 11 | "@capacitor/cli": { 12 | "version": "^5.7.0", 13 | "alwaysAddToPackageJson": true 14 | }, 15 | "@capacitor/ios": { 16 | "version": "^5.7.0", 17 | "alwaysAddToPackageJson": false 18 | }, 19 | "@capacitor/android": { 20 | "version": "^5.7.0", 21 | "alwaysAddToPackageJson": false 22 | } 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /packages/capacitor/src/executors/cap/compat.ts: -------------------------------------------------------------------------------- 1 | import { convertNxExecutor } from '@nx/devkit'; 2 | import runExecutor from './executor'; 3 | 4 | export default convertNxExecutor(runExecutor); 5 | -------------------------------------------------------------------------------- /packages/capacitor/src/executors/cap/schema.d.ts: -------------------------------------------------------------------------------- 1 | export interface CommandExecutorSchema { 2 | cmd: string; 3 | preserveProjectNodeModules?: boolean; 4 | } 5 | -------------------------------------------------------------------------------- /packages/capacitor/src/executors/cap/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "outputCapture": "direct-nodejs", 4 | "$schema": "http://json-schema.org/schema", 5 | "title": "Command executor", 6 | "description": "Run a Capacitor command.", 7 | "type": "object", 8 | "properties": { 9 | "cmd": { 10 | "description": "The Capacitor command.", 11 | "type": "string" 12 | }, 13 | "preserveProjectNodeModules": { 14 | "description": "Preserve the node_modules folder inside the project dir.", 15 | "type": "boolean" 16 | } 17 | }, 18 | "required": [] 19 | } 20 | -------------------------------------------------------------------------------- /packages/capacitor/src/generators/configuration/files/capacitor-config/capacitor.config.ts__template__: -------------------------------------------------------------------------------- 1 | import { CapacitorConfig } from '@capacitor/cli'; 2 | 3 | const config: CapacitorConfig = { 4 | appId: '<%= appId %>', 5 | appName: '<%= appName %>', 6 | webDir: '<%= webDir %>', 7 | bundledWebRuntime: false, 8 | server: { 9 | androidScheme: 'https' 10 | } 11 | } 12 | 13 | export default config; 14 | -------------------------------------------------------------------------------- /packages/capacitor/src/generators/configuration/files/package-json/package.json__template__: -------------------------------------------------------------------------------- 1 | { 2 | "name": "<%= project %>", 3 | "dependencies": {} 4 | } 5 | -------------------------------------------------------------------------------- /packages/capacitor/src/generators/configuration/lib/add-dependencies.ts: -------------------------------------------------------------------------------- 1 | import { addDependenciesToPackageJson, Tree } from '@nx/devkit'; 2 | import { capacitorVersion } from '../../../utils/versions'; 3 | 4 | export function addDependencies(host: Tree) { 5 | return addDependenciesToPackageJson( 6 | host, 7 | { 8 | '@capacitor/core': capacitorVersion, 9 | '@capacitor/app': capacitorVersion, 10 | '@capacitor/android': capacitorVersion, 11 | '@capacitor/ios': capacitorVersion, 12 | }, 13 | { 14 | '@capacitor/cli': capacitorVersion, 15 | } 16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /packages/capacitor/src/generators/configuration/schema.d.ts: -------------------------------------------------------------------------------- 1 | export interface CapacitorConfigurationSchema { 2 | project: string; 3 | appId: string; 4 | appName?: string; 5 | webDir?: string; 6 | skipFormat: boolean; 7 | } 8 | 9 | export interface NormalizedSchema extends CapacitorConfigurationSchema { 10 | projectRoot: string; 11 | pathToRoot: string; 12 | } 13 | -------------------------------------------------------------------------------- /packages/capacitor/src/index.ts: -------------------------------------------------------------------------------- 1 | export { capacitorConfigurationGenerator } from './generators/configuration/generator'; 2 | export { CapacitorConfigurationSchema } from './generators/configuration/schema'; 3 | -------------------------------------------------------------------------------- /packages/capacitor/src/utils/versions.ts: -------------------------------------------------------------------------------- 1 | export const capacitorVersion = '^6.0.0'; 2 | -------------------------------------------------------------------------------- /packages/capacitor/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/capacitor/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/capacitor/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/common/README.md: -------------------------------------------------------------------------------- 1 | # common 2 | 3 | This library was generated with [Nx](https://nx.dev). 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 | -------------------------------------------------------------------------------- /packages/common/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: '@nxext/common', 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', 11 | }; 12 | -------------------------------------------------------------------------------- /packages/common/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@nxext/common", 3 | "version": "20.0.1", 4 | "description": "Common utilities for Nxext Nx plugins", 5 | "author": { 6 | "name": "Gion Kunz", 7 | "email": "gion@syncrea.ch" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/nxext/nx-extensions", 12 | "directory": "packages/Common" 13 | }, 14 | "bugs": { 15 | "url": "https://github.com/nxext/nx-extensions/issues" 16 | }, 17 | "dependencies": { 18 | "@nx/devkit": "^20.0.0", 19 | "typescript": "^5.4.2", 20 | "@nx/js": "^20.0.0", 21 | "tslib": "^2.3.0" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/common/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './lib/utils/add-plugin-to-nx-json'; 2 | export * from './lib/utils/ast-utils'; 3 | export * from './lib/utils/map-lint-pattern'; 4 | export * from './lib/utils/path'; 5 | 6 | export * from './lib/is-verbose'; 7 | -------------------------------------------------------------------------------- /packages/common/src/lib/is-verbose.ts: -------------------------------------------------------------------------------- 1 | export const isVerbose = process.env.NX_VERBOSE_LOGGING === 'true'; 2 | -------------------------------------------------------------------------------- /packages/common/src/lib/utils/add-plugin-to-nx-json.ts: -------------------------------------------------------------------------------- 1 | import { Tree, writeJson, readNxJson } from '@nx/devkit'; 2 | 3 | export function addPluginToNxJson(pluginName: string, tree: Tree) { 4 | const nxJson = readNxJson(tree); 5 | nxJson.plugins = nxJson.plugins || []; 6 | if (!nxJson.plugins.includes(pluginName)) { 7 | nxJson.plugins.push(pluginName); 8 | } 9 | 10 | writeJson(tree, 'nx.json', nxJson); 11 | } 12 | -------------------------------------------------------------------------------- /packages/common/src/lib/utils/map-lint-pattern.ts: -------------------------------------------------------------------------------- 1 | export function mapLintPattern( 2 | projectRoot: string, 3 | extension: string, 4 | rootProject?: boolean 5 | ) { 6 | const infix = rootProject ? 'src/' : ''; 7 | return `${projectRoot}/${infix}**/*.${extension}`; 8 | } 9 | -------------------------------------------------------------------------------- /packages/common/src/lib/utils/path.ts: -------------------------------------------------------------------------------- 1 | import { isAbsolute } from 'node:path'; 2 | 3 | export function getTerminalLinkForAbsolutePath(absolutePath: string) { 4 | if (!isAbsolute(absolutePath)) { 5 | return absolutePath; 6 | } 7 | return `file:///${absolutePath.replace(/^\//, '').replace(/\\/g, '/')}`; 8 | } 9 | -------------------------------------------------------------------------------- /packages/common/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/common/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | "outDir": "../../dist/out-tsc", 6 | "declaration": true, 7 | "types": ["node"] 8 | }, 9 | "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"], 10 | "include": ["src/**/*.ts"] 11 | } 12 | -------------------------------------------------------------------------------- /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/ionic-angular/README.md: -------------------------------------------------------------------------------- 1 | # @nxext/ionic-angular 2 | 3 | [![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme) 4 | 5 | An Nx plugin for developing [Ionic](https://ionicframework.com/docs) Angular applications and libraries. 6 | 7 | For more complete documentation, visit [nxext.github.io](https://nxext.github.io/nx-extensions-ionic/docs/ionic-angular/overview.html). 8 | 9 | ## Usage 10 | 11 | Visit the official [Getting Started](https://nxext.github.io/nx-extensions-ionic/docs/ionic-angular/getting-started.html) documentation. 12 | -------------------------------------------------------------------------------- /packages/ionic-angular/executors.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "executors": {}, 4 | "builders": {} 5 | } 6 | -------------------------------------------------------------------------------- /packages/ionic-angular/generators.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "name": "Nxext Ionic Angular", 4 | "version": "0.0.1", 5 | "generators": { 6 | "configuration": { 7 | "factory": "./src/generators/configuration/generator", 8 | "schema": "./src/generators/configuration/schema.json", 9 | "description": "Configure Ionic for an Angular application." 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/ionic-angular/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | module.exports = { 3 | displayName: 'ionic-angular', 4 | preset: '../../jest.preset.js', 5 | globals: {}, 6 | transform: { 7 | '^.+\\.[tj]s$': [ 8 | 'ts-jest', 9 | { 10 | tsconfig: '/tsconfig.spec.json', 11 | }, 12 | ], 13 | }, 14 | moduleFileExtensions: ['ts', 'js', 'html'], 15 | coverageDirectory: '../../coverage/packages/ionic-angular', 16 | }; 17 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/files/ionic.config.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "name": "<%= name %>", 3 | "integrations": { 4 | "capacitor": {} 5 | }, 6 | "type": "angular-standalone" 7 | } 8 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/files/src/app/app.component.html.template: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/files/src/app/app.component.spec.ts.template: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | import { provideRouter } from '@angular/router'; 3 | import { AppComponent } from './app.component'; 4 | 5 | describe('AppComponent', () => { 6 | it('should create the app', async () => { 7 | await TestBed.configureTestingModule({ 8 | imports: [AppComponent], 9 | providers: [provideRouter([])] 10 | }).compileComponents(); 11 | 12 | const fixture = TestBed.createComponent(AppComponent); 13 | const app = fixture.componentInstance; 14 | expect(app).toBeTruthy(); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/files/src/app/app.component.ts.template: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonApp, IonRouterOutlet } from '@ionic/angular/standalone'; 3 | 4 | @Component({ 5 | selector: 'app-root', 6 | templateUrl: 'app.component.html', 7 | standalone: true, 8 | imports: [IonApp, IonRouterOutlet], 9 | }) 10 | export class AppComponent {} 11 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/files/src/app/app.routes.ts.template: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | 3 | export const routes: Routes = [ 4 | { 5 | path: '', 6 | loadChildren: () => import('./tabs/tabs.routes').then((m) => m.routes), 7 | }, 8 | ]; 9 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/files/src/app/explore-container/explore-container.component.html.template: -------------------------------------------------------------------------------- 1 |
2 | {{ name }} 3 |

4 | Explore 5 | UI Components 11 |

12 |
13 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/files/src/app/explore-container/explore-container.component.scss.template: -------------------------------------------------------------------------------- 1 | #container { 2 | text-align: center; 3 | 4 | position: absolute; 5 | left: 0; 6 | right: 0; 7 | top: 50%; 8 | transform: translateY(-50%); 9 | } 10 | 11 | #container strong { 12 | font-size: 20px; 13 | line-height: 26px; 14 | } 15 | 16 | #container p { 17 | font-size: 16px; 18 | line-height: 22px; 19 | 20 | color: #8c8c8c; 21 | 22 | margin: 0; 23 | } 24 | 25 | #container a { 26 | text-decoration: none; 27 | } 28 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/files/src/app/explore-container/explore-container.component.spec.ts.template: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { ExploreContainerComponent } from './explore-container.component'; 4 | 5 | describe('ExploreContainerComponent', () => { 6 | let component: ExploreContainerComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | fixture = TestBed.createComponent(ExploreContainerComponent); 11 | component = fixture.componentInstance; 12 | fixture.detectChanges(); 13 | }); 14 | 15 | it('should create', () => { 16 | expect(component).toBeTruthy(); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/files/src/app/explore-container/explore-container.component.ts.template: -------------------------------------------------------------------------------- 1 | import { Component, Input } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-explore-container', 5 | templateUrl: './explore-container.component.html', 6 | styleUrls: ['./explore-container.component.scss'], 7 | standalone: true, 8 | }) 9 | export class ExploreContainerComponent { 10 | @Input() name?: string; 11 | } 12 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/files/src/app/tab1/tab1.page.html.template: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Tab 1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Tab 1 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/files/src/app/tab1/tab1.page.scss.template: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxext/nx-extensions/b394bd93c2a76d561fef468c4d9aaf3c7f85e0f8/packages/ionic-angular/src/generators/configuration/files/src/app/tab1/tab1.page.scss.template -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/files/src/app/tab1/tab1.page.spec.ts.template: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Tab1Page } from './tab1.page'; 4 | 5 | describe('Tab1Page', () => { 6 | let component: Tab1Page; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | fixture = TestBed.createComponent(Tab1Page); 11 | component = fixture.componentInstance; 12 | fixture.detectChanges(); 13 | }); 14 | 15 | it('should create', () => { 16 | expect(component).toBeTruthy(); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/files/src/app/tab1/tab1.page.ts.template: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonHeader, IonToolbar, IonTitle, IonContent } from '@ionic/angular/standalone'; 3 | import { ExploreContainerComponent } from '../explore-container/explore-container.component'; 4 | 5 | @Component({ 6 | selector: 'app-tab1', 7 | templateUrl: 'tab1.page.html', 8 | styleUrls: ['tab1.page.scss'], 9 | standalone: true, 10 | imports: [IonHeader, IonToolbar, IonTitle, IonContent, ExploreContainerComponent], 11 | }) 12 | export class Tab1Page { 13 | constructor() {} 14 | } 15 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/files/src/app/tab2/tab2.page.html.template: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Tab 2 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Tab 2 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/files/src/app/tab2/tab2.page.scss.template: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxext/nx-extensions/b394bd93c2a76d561fef468c4d9aaf3c7f85e0f8/packages/ionic-angular/src/generators/configuration/files/src/app/tab2/tab2.page.scss.template -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/files/src/app/tab2/tab2.page.spec.ts.template: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Tab2Page } from './tab2.page'; 4 | 5 | describe('Tab2Page', () => { 6 | let component: Tab2Page; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | fixture = TestBed.createComponent(Tab2Page); 11 | component = fixture.componentInstance; 12 | fixture.detectChanges(); 13 | }); 14 | 15 | it('should create', () => { 16 | expect(component).toBeTruthy(); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/files/src/app/tab2/tab2.page.ts.template: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonHeader, IonToolbar, IonTitle, IonContent } from '@ionic/angular/standalone'; 3 | import { ExploreContainerComponent } from '../explore-container/explore-container.component'; 4 | 5 | @Component({ 6 | selector: 'app-tab2', 7 | templateUrl: 'tab2.page.html', 8 | styleUrls: ['tab2.page.scss'], 9 | standalone: true, 10 | imports: [IonHeader, IonToolbar, IonTitle, IonContent, ExploreContainerComponent] 11 | }) 12 | export class Tab2Page { 13 | 14 | constructor() {} 15 | 16 | } 17 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/files/src/app/tab3/tab3.page.html.template: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Tab 3 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Tab 3 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/files/src/app/tab3/tab3.page.scss.template: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxext/nx-extensions/b394bd93c2a76d561fef468c4d9aaf3c7f85e0f8/packages/ionic-angular/src/generators/configuration/files/src/app/tab3/tab3.page.scss.template -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/files/src/app/tab3/tab3.page.spec.ts.template: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { Tab3Page } from './tab3.page'; 4 | 5 | describe('Tab3Page', () => { 6 | let component: Tab3Page; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | fixture = TestBed.createComponent(Tab3Page); 11 | component = fixture.componentInstance; 12 | fixture.detectChanges(); 13 | }); 14 | 15 | it('should create', () => { 16 | expect(component).toBeTruthy(); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/files/src/app/tab3/tab3.page.ts.template: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { IonHeader, IonToolbar, IonTitle, IonContent } from '@ionic/angular/standalone'; 3 | import { ExploreContainerComponent } from '../explore-container/explore-container.component'; 4 | 5 | @Component({ 6 | selector: 'app-tab3', 7 | templateUrl: 'tab3.page.html', 8 | styleUrls: ['tab3.page.scss'], 9 | standalone: true, 10 | imports: [IonHeader, IonToolbar, IonTitle, IonContent, ExploreContainerComponent], 11 | }) 12 | export class Tab3Page { 13 | constructor() {} 14 | } 15 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/files/src/app/tabs/tabs.page.html.template: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Tab 1 6 | 7 | 8 | 9 | 10 | Tab 2 11 | 12 | 13 | 14 | 15 | Tab 3 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/files/src/app/tabs/tabs.page.scss.template: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/files/src/app/tabs/tabs.page.ts.template: -------------------------------------------------------------------------------- 1 | import { Component, EnvironmentInjector, inject } from '@angular/core'; 2 | import { IonTabs, IonTabBar, IonTabButton, IonIcon, IonLabel } from '@ionic/angular/standalone'; 3 | import { addIcons } from 'ionicons'; 4 | import { triangle, ellipse, square } from 'ionicons/icons'; 5 | 6 | @Component({ 7 | selector: 'app-tabs', 8 | templateUrl: 'tabs.page.html', 9 | styleUrls: ['tabs.page.scss'], 10 | standalone: true, 11 | imports: [IonTabs, IonTabBar, IonTabButton, IonIcon, IonLabel], 12 | }) 13 | export class TabsPage { 14 | public environmentInjector = inject(EnvironmentInjector); 15 | 16 | constructor() { 17 | addIcons({ triangle, ellipse, square }); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/files/src/main.ts.template: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from '@angular/platform-browser'; 2 | import { RouteReuseStrategy, provideRouter, withPreloading, PreloadAllModules } from '@angular/router'; 3 | import { IonicRouteStrategy, provideIonicAngular } from '@ionic/angular/standalone'; 4 | 5 | import { routes } from './app/app.routes'; 6 | import { AppComponent } from './app/app.component'; 7 | 8 | bootstrapApplication(AppComponent, { 9 | providers: [ 10 | { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }, 11 | provideIonicAngular(), 12 | provideRouter(routes, withPreloading(PreloadAllModules)), 13 | ], 14 | }); 15 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/files/src/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxext/nx-extensions/b394bd93c2a76d561fef468c4d9aaf3c7f85e0f8/packages/ionic-angular/src/generators/configuration/files/src/public/favicon.png -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/files/src/styles.scss.template: -------------------------------------------------------------------------------- 1 | /* 2 | * App Global CSS 3 | * ---------------------------------------------------------------------------- 4 | * Put style rules here that you want to apply globally. These styles are for 5 | * the entire app and not just one component. Additionally, this file can be 6 | * used as an entry point to import other CSS/Sass files to be included in the 7 | * output CSS. 8 | * For more information on global stylesheets, visit the documentation: 9 | * https://ionicframework.com/docs/layout/global-stylesheets 10 | */ 11 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/files/src/theme/variables.scss.template: -------------------------------------------------------------------------------- 1 | // For information on how to create your own theme, please see: 2 | // http://ionicframework.com/docs/theming/ 3 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/lib/add-capacitor.ts: -------------------------------------------------------------------------------- 1 | import { Tree } from '@nx/devkit'; 2 | import { capacitorConfigurationGenerator } from '@nxext/capacitor'; 3 | import { ConfigurationGeneratorSchema } from '../schema'; 4 | 5 | export async function addCapacitor( 6 | host: Tree, 7 | options: ConfigurationGeneratorSchema 8 | ) { 9 | if (options.capacitor) { 10 | return await capacitorConfigurationGenerator(host, { 11 | project: options.project, 12 | appName: options.project, 13 | appId: 'io.ionic.starter', 14 | skipFormat: options.skipFormat, 15 | }); 16 | } else { 17 | // eslint-disable-next-line @typescript-eslint/no-empty-function 18 | return () => {}; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/lib/add-dependencies.ts: -------------------------------------------------------------------------------- 1 | import { addDependenciesToPackageJson, Tree } from '@nx/devkit'; 2 | import { 3 | capacitorPluginsVersion, 4 | ionicAngularVersion, 5 | ioniconsVersion, 6 | } from '../../../utils/versions'; 7 | 8 | export function addDependencies(host: Tree) { 9 | return addDependenciesToPackageJson( 10 | host, 11 | { 12 | '@ionic/angular': ionicAngularVersion, 13 | ionicons: ioniconsVersion, 14 | '@capacitor/haptics': capacitorPluginsVersion, 15 | '@capacitor/keyboard': capacitorPluginsVersion, 16 | '@capacitor/status-bar': capacitorPluginsVersion, 17 | }, 18 | {} 19 | ); 20 | } 21 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/generators/configuration/schema.d.ts: -------------------------------------------------------------------------------- 1 | import { E2eTestRunner, UnitTestRunner } from '@nx/angular'; 2 | 3 | export interface ConfigurationGeneratorSchema { 4 | project: string; 5 | capacitor: boolean; 6 | skipFormat: boolean; 7 | } 8 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/index.ts: -------------------------------------------------------------------------------- 1 | export { configurationGenerator } from './generators/configuration/generator'; 2 | export { ConfigurationGeneratorSchema } from './generators/configuration/schema'; 3 | -------------------------------------------------------------------------------- /packages/ionic-angular/src/utils/versions.ts: -------------------------------------------------------------------------------- 1 | export const ionicAngularVersion = '^8.0.0'; 2 | export const ioniconsVersion = '^7.0.0'; 3 | export const capacitorPluginsVersion = '^6.0.0'; 4 | -------------------------------------------------------------------------------- /packages/ionic-angular/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/ionic-angular/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/ionic-angular/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/ionic-react/executors.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "executors": {}, 4 | "builders": {} 5 | } 6 | -------------------------------------------------------------------------------- /packages/ionic-react/generators.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "name": "IonicReact", 4 | "version": "0.0.1", 5 | "generators": { 6 | "configuration": { 7 | "factory": "./src/generators/configuration/generator", 8 | "schema": "./src/generators/configuration/schema.json", 9 | "description": "Configure Ionic for a React application." 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/ionic-react/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | module.exports = { 3 | displayName: 'ionic-react', 4 | preset: '../../jest.preset.js', 5 | globals: {}, 6 | transform: { 7 | '^.+\\.[tj]s$': [ 8 | 'ts-jest', 9 | { 10 | tsconfig: '/tsconfig.spec.json', 11 | }, 12 | ], 13 | }, 14 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html', 'json'], 15 | coverageDirectory: '../../coverage/packages/ionic-react', 16 | }; 17 | -------------------------------------------------------------------------------- /packages/ionic-react/src/generators/configuration/files/ionic.config.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "name": "<%= name %>", 3 | "integrations": { 4 | "capacitor": {} 5 | }, 6 | "type": "react" 7 | } 8 | -------------------------------------------------------------------------------- /packages/ionic-react/src/generators/configuration/files/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxext/nx-extensions/b394bd93c2a76d561fef468c4d9aaf3c7f85e0f8/packages/ionic-react/src/generators/configuration/files/public/favicon.png -------------------------------------------------------------------------------- /packages/ionic-react/src/generators/configuration/files/src/App.spec.tsx.template: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { render } from '@testing-library/react'; 3 | import App from './App'; 4 | 5 | test('renders without crashing', () => { 6 | const { baseElement } = render(); 7 | expect(baseElement).toBeDefined(); 8 | }); 9 | -------------------------------------------------------------------------------- /packages/ionic-react/src/generators/configuration/files/src/components/ExploreContainer.css.template: -------------------------------------------------------------------------------- 1 | .container { 2 | text-align: center; 3 | position: absolute; 4 | left: 0; 5 | right: 0; 6 | top: 50%; 7 | transform: translateY(-50%); 8 | } 9 | 10 | .container strong { 11 | font-size: 20px; 12 | line-height: 26px; 13 | } 14 | 15 | .container p { 16 | font-size: 16px; 17 | line-height: 22px; 18 | color: #8c8c8c; 19 | margin: 0; 20 | } 21 | 22 | .container a { 23 | text-decoration: none; 24 | } -------------------------------------------------------------------------------- /packages/ionic-react/src/generators/configuration/files/src/components/ExploreContainer.tsx.template: -------------------------------------------------------------------------------- 1 | import './ExploreContainer.css'; 2 | 3 | interface ContainerProps { 4 | name: string; 5 | } 6 | 7 | const ExploreContainer: React.FC = ({ name }) => { 8 | return ( 9 |
10 | {name} 11 |

Explore UI Components

12 |
13 | ); 14 | }; 15 | 16 | export default ExploreContainer; 17 | -------------------------------------------------------------------------------- /packages/ionic-react/src/generators/configuration/files/src/main.tsx.template: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { createRoot } from 'react-dom/client'; 3 | import App from './App'; 4 | 5 | const container = document.getElementById('root'); 6 | // eslint-disable-next-line @typescript-eslint/no-non-null-assertion 7 | const root = createRoot(container!); 8 | root.render( 9 | 10 | 11 | 12 | ); 13 | -------------------------------------------------------------------------------- /packages/ionic-react/src/generators/configuration/files/src/manifest.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "<%= className %>", 3 | "name": "<%= className %>", 4 | "icons": [ 5 | { 6 | "src": "assets/icon/favicon.png", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "assets/icon/icon.png", 12 | "type": "image/png", 13 | "sizes": "512x512", 14 | "purpose": "maskable" 15 | } 16 | ], 17 | "start_url": ".", 18 | "display": "standalone", 19 | "theme_color": "#ffffff", 20 | "background_color": "#ffffff" 21 | } 22 | -------------------------------------------------------------------------------- /packages/ionic-react/src/generators/configuration/files/src/pages/Tab1.css.template: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxext/nx-extensions/b394bd93c2a76d561fef468c4d9aaf3c7f85e0f8/packages/ionic-react/src/generators/configuration/files/src/pages/Tab1.css.template -------------------------------------------------------------------------------- /packages/ionic-react/src/generators/configuration/files/src/pages/Tab2.css.template: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxext/nx-extensions/b394bd93c2a76d561fef468c4d9aaf3c7f85e0f8/packages/ionic-react/src/generators/configuration/files/src/pages/Tab2.css.template -------------------------------------------------------------------------------- /packages/ionic-react/src/generators/configuration/files/src/pages/Tab3.css.template: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxext/nx-extensions/b394bd93c2a76d561fef468c4d9aaf3c7f85e0f8/packages/ionic-react/src/generators/configuration/files/src/pages/Tab3.css.template -------------------------------------------------------------------------------- /packages/ionic-react/src/generators/configuration/files/src/theme/variables.css.template: -------------------------------------------------------------------------------- 1 | /* For information on how to create your own theme, please see: 2 | http://ionicframework.com/docs/theming/ */ 3 | -------------------------------------------------------------------------------- /packages/ionic-react/src/generators/configuration/lib/add-capacitor.ts: -------------------------------------------------------------------------------- 1 | import { Tree } from '@nx/devkit'; 2 | import { capacitorConfigurationGenerator } from '@nxext/capacitor'; 3 | import { NormalizedSchema } from '../schema'; 4 | 5 | export async function addCapacitor(host: Tree, options: NormalizedSchema) { 6 | return await capacitorConfigurationGenerator(host, { 7 | project: options.project, 8 | appName: options.project, 9 | appId: 'io.ionic.starter', 10 | skipFormat: options.skipFormat, 11 | }); 12 | } 13 | -------------------------------------------------------------------------------- /packages/ionic-react/src/generators/configuration/lib/normalize-options.ts: -------------------------------------------------------------------------------- 1 | import { readProjectConfiguration, Tree } from '@nx/devkit'; 2 | import { ConfigurationGeneratorSchema, NormalizedSchema } from '../schema'; 3 | 4 | export function normalizeOptions( 5 | host: Tree, 6 | options: ConfigurationGeneratorSchema 7 | ): NormalizedSchema { 8 | const projectConfig = readProjectConfiguration(host, options.project); 9 | 10 | return { 11 | ...options, 12 | project: options.project, 13 | projectRoot: projectConfig.root, 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /packages/ionic-react/src/generators/configuration/schema.d.ts: -------------------------------------------------------------------------------- 1 | export interface ConfigurationGeneratorSchema { 2 | project: string; 3 | capacitor: boolean; 4 | skipFormat: boolean; 5 | } 6 | 7 | export interface NormalizedSchema extends ConfigurationGeneratorSchema { 8 | projectRoot: string; 9 | } 10 | -------------------------------------------------------------------------------- /packages/ionic-react/src/index.ts: -------------------------------------------------------------------------------- 1 | export { configurationGenerator } from './generators/configuration/generator'; 2 | export { ConfigurationGeneratorSchema } from './generators/configuration/schema'; 3 | -------------------------------------------------------------------------------- /packages/ionic-react/src/utils/versions.ts: -------------------------------------------------------------------------------- 1 | export const ionicReactVersion = '^8.0.0'; 2 | export const ionicReactRouterVersion = '^8.0.0'; 3 | export const ionIconsVersion = '^7.0.0'; 4 | export const capacitorPluginsVersion = '^6.0.0'; 5 | /** 6 | * React Router v6 is not compatible with Ionic React Router, so we force using the v5 7 | * See: https://github.com/ionic-team/ionic-framework/issues/24177, https://github.com/ionic-team/ionic-framework/blob/main/packages/react-router/package.json#L46 8 | */ 9 | export const reactRouterVersion = '^5.3.4'; 10 | export const reactRouterTypesVersion = '^5.1.20'; 11 | export const reactRouterDomTypesVersion = '^5.3.3'; 12 | -------------------------------------------------------------------------------- /packages/ionic-react/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/ionic-react/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/ionic-react/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/preact/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | globals: {}, 4 | transform: { 5 | '^.+\\.[tj]sx?$': [ 6 | 'ts-jest', 7 | { 8 | tsconfig: '/tsconfig.spec.json', 9 | }, 10 | ], 11 | }, 12 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], 13 | coverageDirectory: '../../coverage/packages/preact', 14 | displayName: 'preact', 15 | testEnvironment: 'node', 16 | preset: '../../jest.preset.js', 17 | }; 18 | -------------------------------------------------------------------------------- /packages/preact/src/generators/application/files/eslintrc.js.template: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "parser": "@typescript-eslint/parser", 3 | "plugins": ["preact", "@typescript-eslint"], 4 | "extends": ["<%= offsetFromRoot %>.eslintrc.json"], 5 | "ignorePatterns": ["!**/*", "vite.config.ts"], 6 | "overrides": [ 7 | { 8 | "files": ["*.ts", "*.js", "*.tsx"], 9 | "parserOptions": { 10 | "project": ["<%= projectRoot %>/tsconfig.*?.json"] 11 | }, 12 | "rules": {} 13 | }, 14 | { 15 | "files": ["*.ts", "*.tsx"], 16 | "rules": {} 17 | }, 18 | { 19 | "files": ["*.js", "*.jsx"], 20 | "rules": {} 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /packages/preact/src/generators/application/files/index.html.template: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Preact App 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /packages/preact/src/generators/application/files/package.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "name": "<%= name %>", 3 | "version": "0.0.1", 4 | "description": "Nx Preact <%= name %> app" 5 | } 6 | -------------------------------------------------------------------------------- /packages/preact/src/generators/application/files/src/App.module.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .logo { 6 | animation: logo-spin infinite 20s linear; 7 | height: 40vmin; 8 | pointer-events: none; 9 | } 10 | 11 | .header { 12 | background-color: #282c34; 13 | min-height: 100vh; 14 | display: flex; 15 | flex-direction: column; 16 | align-items: center; 17 | justify-content: center; 18 | font-size: calc(10px + 2vmin); 19 | color: white; 20 | } 21 | 22 | .link { 23 | color: #b318f0; 24 | } 25 | 26 | @keyframes logo-spin { 27 | from { 28 | transform: rotate(0deg); 29 | } 30 | to { 31 | transform: rotate(360deg); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /packages/preact/src/generators/application/files/src/App.tsx.template: -------------------------------------------------------------------------------- 1 | import { Logo } from './logo'; 2 | import styles from "./App.module.css"; 3 | 4 | function App() { 5 | return ( 6 |
7 |
8 | 9 |

10 | Edit src/App.tsx and save to reload. 11 |

12 | 18 | Learn Preact 19 | 20 |
21 |
22 | ); 23 | } 24 | 25 | export default App; 26 | -------------------------------------------------------------------------------- /packages/preact/src/generators/application/files/src/index.css: -------------------------------------------------------------------------------- 1 | html, 2 | body { 3 | height: 100%; 4 | width: 100%; 5 | padding: 0; 6 | margin: 0; 7 | background: #fafafa; 8 | font-family: 'Helvetica Neue', arial, sans-serif; 9 | font-weight: 400; 10 | color: #444; 11 | -webkit-font-smoothing: antialiased; 12 | -moz-osx-font-smoothing: grayscale; 13 | } 14 | 15 | * { 16 | box-sizing: border-box; 17 | } 18 | 19 | #app { 20 | height: 100%; 21 | text-align: center; 22 | background-color: #673ab8; 23 | color: #fff; 24 | font-size: 1.5em; 25 | padding-top: 100px; 26 | } 27 | 28 | .link { 29 | color: #fff; 30 | } 31 | -------------------------------------------------------------------------------- /packages/preact/src/generators/application/files/src/index.tsx.template: -------------------------------------------------------------------------------- 1 | import { render } from 'preact' 2 | 3 | import "./index.css"; 4 | import App from "./App"; 5 | 6 | // eslint-disable-next-line @typescript-eslint/no-non-null-assertion 7 | render(, document.getElementById('root')!); 8 | -------------------------------------------------------------------------------- /packages/preact/src/generators/application/files/tsconfig.app.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | 4 | "compilerOptions": { 5 | "outDir": "<%= offsetFromRoot %>dist/out-tsc", 6 | }, 7 | 8 | "include": ["src/**/*"], 9 | "exclude": ["**/*.spec.ts", "**/*_spec.ts", "**/*.spec.tsx", "**/*_spec.tsx", "public/*"], 10 | } 11 | -------------------------------------------------------------------------------- /packages/preact/src/generators/application/files/tsconfig.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "<%= offsetFromRoot %>tsconfig.base.json", 3 | "compilerOptions": { 4 | "strict": true, 5 | "target": "ESNext", 6 | "module": "ESNext", 7 | "moduleResolution": "node", 8 | "allowSyntheticDefaultImports": true, 9 | "esModuleInterop": true, 10 | "jsx": "preserve", 11 | "jsxFactory": "h", 12 | "jsxFragmentFactory": "Fragment", 13 | "jsxImportSource": "preact", 14 | "types": ["vite/client"] 15 | }, 16 | "files": [], 17 | "include": [], 18 | "references": [ 19 | { 20 | "path": "./tsconfig.app.json" 21 | }, 22 | { 23 | "path": "./tsconfig.spec.json" 24 | } 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /packages/preact/src/generators/application/files/tsconfig.spec.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "<%= offsetFromRoot %>dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": [ 9 | "**/*.spec.ts", 10 | "**/*.spec.js", 11 | "**/*.spec.tsx", 12 | "**/*.spec.jsx", 13 | "**/*.d.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /packages/preact/src/generators/application/lib/add-jest.ts: -------------------------------------------------------------------------------- 1 | import { Tree, ensurePackage, NX_VERSION } from '@nx/devkit'; 2 | import { NormalizedSchema } from '../schema'; 3 | 4 | export async function addJest(host: Tree, options: NormalizedSchema) { 5 | if (options.unitTestRunner !== 'jest') { 6 | return () => {}; // eslint-disable-line @typescript-eslint/no-empty-function 7 | } 8 | const { jestProjectGenerator } = ensurePackage( 9 | '@nx/jest', 10 | NX_VERSION 11 | ); 12 | 13 | return await jestProjectGenerator(host, { 14 | project: options.name, 15 | supportTsx: false, 16 | skipSerializers: true, 17 | setupFile: 'none', 18 | babelJest: false, 19 | }); 20 | } 21 | -------------------------------------------------------------------------------- /packages/preact/src/generators/application/lib/add-project.ts: -------------------------------------------------------------------------------- 1 | import { NormalizedSchema } from '../schema'; 2 | import { addProjectConfiguration, Tree } from '@nx/devkit'; 3 | import { createLintTarget } from './create-lint-target'; 4 | 5 | export function addProject(tree: Tree, options: NormalizedSchema) { 6 | addProjectConfiguration(tree, options.name, { 7 | root: options.projectRoot, 8 | sourceRoot: `${options.projectRoot}/src`, 9 | projectType: 'application', 10 | tags: options.parsedTags, 11 | targets: { lint: createLintTarget(options) }, 12 | }); 13 | } 14 | -------------------------------------------------------------------------------- /packages/preact/src/generators/application/lib/add-vite.ts: -------------------------------------------------------------------------------- 1 | import { ensurePackage, NX_VERSION, Tree } from '@nx/devkit'; 2 | import { NormalizedSchema } from '../schema'; 3 | 4 | export async function addVite(host: Tree, options: NormalizedSchema) { 5 | const { viteConfigurationGenerator } = ensurePackage< 6 | typeof import('@nx/vite') 7 | >('@nx/vite', NX_VERSION); 8 | 9 | return await viteConfigurationGenerator(host, { 10 | uiFramework: 'none', 11 | project: options.name, 12 | newProject: true, 13 | includeVitest: options.unitTestRunner === 'vitest', 14 | inSourceTests: false, 15 | }); 16 | } 17 | -------------------------------------------------------------------------------- /packages/preact/src/generators/application/lib/create-lint-target.ts: -------------------------------------------------------------------------------- 1 | import { NormalizedSchema } from '../schema'; 2 | import { joinPathFragments, TargetConfiguration } from '@nx/devkit'; 3 | 4 | export function createLintTarget( 5 | options: NormalizedSchema 6 | ): TargetConfiguration { 7 | return { 8 | executor: '@nx/eslint:lint', 9 | options: { 10 | linter: 'eslint', 11 | tsConfig: joinPathFragments(options.projectRoot, 'tsconfig.app.json'), 12 | exclude: [ 13 | '**/node_modules/**', 14 | `!${joinPathFragments(options.projectRoot, '**/*')}`, 15 | ], 16 | }, 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /packages/preact/src/generators/application/lib/update-jest-config.ts: -------------------------------------------------------------------------------- 1 | import { NormalizedSchema } from '../schema'; 2 | import { Tree } from '@nx/devkit'; 3 | 4 | export function updateJestConfig(host: Tree, options: NormalizedSchema) { 5 | if (options.unitTestRunner !== 'jest') { 6 | return; 7 | } 8 | 9 | const jestConfigPath = `${options.projectRoot}/jest.config.ts`; 10 | // const svelteConfigPath = `${options.projectRoot}/jest.config.ts`; 11 | const originalContent = host.read(jestConfigPath)?.toString(); 12 | const content = updateJestConfigContent(originalContent); 13 | host.write(jestConfigPath, content); 14 | } 15 | 16 | function updateJestConfigContent(content: string) { 17 | return content; 18 | } 19 | -------------------------------------------------------------------------------- /packages/preact/src/generators/application/schema.d.ts: -------------------------------------------------------------------------------- 1 | import { Linter } from '@nx/eslint'; 2 | 3 | export interface PreactApplicationSchema { 4 | directory: string; 5 | name?: string; 6 | tags?: string; 7 | linter: Linter; 8 | unitTestRunner: 'vitest' | 'jest' | 'none'; 9 | e2eTestRunner: 'cypress' | 'none'; 10 | host?: string; 11 | port?: number; 12 | } 13 | 14 | export interface NormalizedSchema extends PreactApplicationSchema { 15 | projectRoot: string; 16 | projectDirectory: string; 17 | fileName: string; 18 | e2eProjectName: string; 19 | e2eProjectRoot: string; 20 | e2eWebServerAddress: string; 21 | e2eWebServerTarget: string; 22 | parsedTags: string[]; 23 | skipFormat: boolean; 24 | } 25 | -------------------------------------------------------------------------------- /packages/preact/src/generators/component/files/src/components/__fileName__/__className__.tsx.template: -------------------------------------------------------------------------------- 1 | function <%= className %>() { 2 | return

Hello component!

3 | } 4 | 5 | export default <%= className %>; 6 | -------------------------------------------------------------------------------- /packages/preact/src/generators/component/files/src/components/__fileName__/__fileName__.spec.tsx.template: -------------------------------------------------------------------------------- 1 | import '@testing-library/jest-dom' 2 | import {h} from 'preact' 3 | import {render, fireEvent} from '@testing-library/preact' 4 | 5 | import <%= className %> from './<%= className %>' 6 | 7 | 8 | it('it works', async () => { 9 | const { getByText } = render(<%= className %>) 10 | 11 | expect(getByText('Hello component!')); 12 | }) 13 | -------------------------------------------------------------------------------- /packages/preact/src/generators/component/lib/create-component-in-project.ts: -------------------------------------------------------------------------------- 1 | import { 2 | generateFiles, 3 | joinPathFragments, 4 | names, 5 | readProjectConfiguration, 6 | Tree, 7 | } from '@nx/devkit'; 8 | import { PreactComponentSchema } from '../component'; 9 | 10 | export function createComponentInProject( 11 | tree: Tree, 12 | options: PreactComponentSchema 13 | ) { 14 | const projectConfig = readProjectConfiguration(tree, options.project); 15 | const projectDirectory = options.directory 16 | ? joinPathFragments(options.directory) 17 | : ''; 18 | 19 | generateFiles( 20 | tree, 21 | joinPathFragments(__dirname, '../files/src'), 22 | joinPathFragments(`${projectConfig.sourceRoot}/${projectDirectory}`), 23 | names(options.name) 24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /packages/preact/src/generators/init/lib/add-cypress-plugin.ts: -------------------------------------------------------------------------------- 1 | import { Tree, ensurePackage, NX_VERSION } from '@nx/devkit'; 2 | import { Schema } from '../schema'; 3 | 4 | export async function addCypressPlugin(host: Tree, options: Schema) { 5 | if (options.e2eTestRunner !== 'cypress') { 6 | return () => {}; // eslint-disable-line @typescript-eslint/no-empty-function 7 | } 8 | const { cypressInitGenerator } = ensurePackage( 9 | '@nx/cypress', 10 | NX_VERSION 11 | ); 12 | 13 | return cypressInitGenerator(host, {}); 14 | } 15 | -------------------------------------------------------------------------------- /packages/preact/src/generators/init/lib/add-dependencies.ts: -------------------------------------------------------------------------------- 1 | import { addDependenciesToPackageJson, Tree } from '@nx/devkit'; 2 | import { 3 | eslintPluginPreactVersion, 4 | preactVersion, 5 | testingLibraryPreactVersion, 6 | vitePluginPreactVersion, 7 | } from '../../utils/versions'; 8 | 9 | export function updateDependencies(tree: Tree) { 10 | return addDependenciesToPackageJson( 11 | tree, 12 | {}, 13 | { 14 | preact: preactVersion, 15 | '@testing-library/preact': testingLibraryPreactVersion, 16 | '@preact/preset-vite': vitePluginPreactVersion, 17 | 'eslint-plugin-preact': eslintPluginPreactVersion, 18 | } 19 | ); 20 | } 21 | -------------------------------------------------------------------------------- /packages/preact/src/generators/init/lib/add-jest-plugin.ts: -------------------------------------------------------------------------------- 1 | import { Tree, ensurePackage, NX_VERSION } from '@nx/devkit'; 2 | import { Schema } from '../schema'; 3 | 4 | export async function addJestPlugin(host: Tree, options: Schema) { 5 | if (options.unitTestRunner !== 'jest') { 6 | return () => {}; // eslint-disable-line @typescript-eslint/no-empty-function 7 | } 8 | 9 | const { jestInitGenerator } = ensurePackage( 10 | '@nx/jest', 11 | NX_VERSION 12 | ); 13 | 14 | return await jestInitGenerator(host, {}); 15 | } 16 | -------------------------------------------------------------------------------- /packages/preact/src/generators/init/schema.d.ts: -------------------------------------------------------------------------------- 1 | export interface Schema { 2 | unitTestRunner: 'vitest' | 'jest' | 'none'; 3 | e2eTestRunner: 'cypress' | 'none'; 4 | bundler?: 'vite'; 5 | skipFormat: boolean; 6 | } 7 | -------------------------------------------------------------------------------- /packages/preact/src/generators/init/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "$id": "Init", 4 | "title": "", 5 | "type": "object", 6 | "properties": { 7 | "unitTestRunner": { 8 | "description": "Adds the specified unit test runner.", 9 | "type": "string", 10 | "enum": ["vitest", "jest", "none"], 11 | "default": "vitest" 12 | }, 13 | "e2eTestRunner": { 14 | "description": "Adds the specified e2e test runner.", 15 | "type": "string", 16 | "enum": ["cypress", "none"], 17 | "default": "cypress" 18 | }, 19 | "skipFormat": { 20 | "description": "Skip formatting files.", 21 | "type": "boolean", 22 | "default": false 23 | } 24 | }, 25 | "required": [] 26 | } 27 | -------------------------------------------------------------------------------- /packages/preact/src/generators/library/files/package.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "name": "<%= name %>", 3 | "version": "0.0.1", 4 | "description": "Nx Preact <%= name %> lib" 5 | } 6 | -------------------------------------------------------------------------------- /packages/preact/src/generators/library/files/src/index.ts.template: -------------------------------------------------------------------------------- 1 | export {}; -------------------------------------------------------------------------------- /packages/preact/src/generators/library/files/tsconfig.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "<%= offsetFromRoot %>tsconfig.base.json", 3 | "compilerOptions": { 4 | "strict": true, 5 | "target": "ESNext", 6 | "module": "ESNext", 7 | "moduleResolution": "node", 8 | "allowSyntheticDefaultImports": true, 9 | "esModuleInterop": true, 10 | "jsx": "preserve", 11 | "jsxFactory": "h", 12 | "jsxFragmentFactory": "Fragment", 13 | "jsxImportSource": "preact", 14 | "types": ["vite/client"] 15 | }, 16 | "files": [], 17 | "include": [], 18 | "references": [ 19 | { 20 | "path": "./tsconfig.lib.json" 21 | }, 22 | { 23 | "path": "./tsconfig.spec.json" 24 | } 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /packages/preact/src/generators/library/files/tsconfig.lib.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | 4 | "compilerOptions": { 5 | "outDir": "<%= offsetFromRoot %>dist/out-tsc", 6 | }, 7 | 8 | "include": ["src/**/*"], 9 | "exclude": ["**/*.spec.ts", "**/*_spec.ts", "**/*.spec.tsx", "**/*_spec.tsx", "public/*"], 10 | } 11 | -------------------------------------------------------------------------------- /packages/preact/src/generators/library/files/tsconfig.spec.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "<%= offsetFromRoot %>dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": [ 9 | "**/*.spec.ts", 10 | "**/*.spec.tsx", 11 | "**/*.spec.js", 12 | "**/*.spec.jsx", 13 | "**/*.d.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /packages/preact/src/generators/library/lib/add-jest.ts: -------------------------------------------------------------------------------- 1 | import { Tree, ensurePackage, NX_VERSION } from '@nx/devkit'; 2 | import { NormalizedSchema } from '../schema'; 3 | 4 | export async function addJest(host: Tree, options: NormalizedSchema) { 5 | if (options.unitTestRunner !== 'jest') { 6 | return () => {}; // eslint-disable-line @typescript-eslint/no-empty-function 7 | } 8 | const { jestProjectGenerator } = ensurePackage( 9 | '@nx/jest', 10 | NX_VERSION 11 | ); 12 | 13 | return await jestProjectGenerator(host, { 14 | project: options.name, 15 | supportTsx: false, 16 | skipSerializers: true, 17 | setupFile: 'none', 18 | babelJest: false, 19 | }); 20 | } 21 | -------------------------------------------------------------------------------- /packages/preact/src/generators/library/lib/add-project.ts: -------------------------------------------------------------------------------- 1 | import { NormalizedSchema } from '../schema'; 2 | import { addProjectConfiguration, TargetConfiguration, Tree } from '@nx/devkit'; 3 | 4 | export function addProject(tree: Tree, options: NormalizedSchema) { 5 | addProjectConfiguration(tree, options.name, { 6 | root: options.projectRoot, 7 | sourceRoot: `${options.projectRoot}/src`, 8 | projectType: 'library', 9 | tags: options.parsedTags, 10 | }); 11 | } 12 | -------------------------------------------------------------------------------- /packages/preact/src/generators/library/lib/create-files.ts: -------------------------------------------------------------------------------- 1 | import { 2 | generateFiles, 3 | joinPathFragments, 4 | names, 5 | offsetFromRoot, 6 | Tree, 7 | } from '@nx/devkit'; 8 | import { NormalizedSchema } from '../schema'; 9 | import { useFlatConfig } from '@nx/eslint/src/utils/flat-config'; 10 | 11 | export function createFiles(host: Tree, options: NormalizedSchema) { 12 | generateFiles( 13 | host, 14 | joinPathFragments(__dirname, '..', './files'), 15 | options.projectRoot, 16 | { 17 | ...options, 18 | ...names(options.name), 19 | offsetFromRoot: offsetFromRoot(options.projectRoot), 20 | } 21 | ); 22 | 23 | if (!options.publishable && !options.buildable) { 24 | host.delete(`${options.projectRoot}/package.json`); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /packages/preact/src/generators/library/lib/update-npm-scope.ts: -------------------------------------------------------------------------------- 1 | import { Tree, updateJson } from '@nx/devkit'; 2 | import { NormalizedSchema } from '../schema'; 3 | 4 | export function updateNpmScopeIfBuildableOrPublishable( 5 | host: Tree, 6 | options: NormalizedSchema 7 | ) { 8 | if (options.buildable || options.publishable) { 9 | updateLibPackageNpmScope(host, options); 10 | } 11 | } 12 | 13 | function updateLibPackageNpmScope(host: Tree, options: NormalizedSchema) { 14 | return updateJson(host, `${options.projectRoot}/package.json`, (json) => { 15 | json.name = options.importPath; 16 | return json; 17 | }); 18 | } 19 | -------------------------------------------------------------------------------- /packages/preact/src/generators/library/schema.d.ts: -------------------------------------------------------------------------------- 1 | import { Linter } from '@nx/eslint'; 2 | 3 | export interface PreactLibrarySchema { 4 | directory: string; 5 | name?: string; 6 | tags?: string; 7 | linter: Linter; 8 | unitTestRunner: 'vitest' | 'jest' | 'none'; 9 | e2eTestRunner: 'cypress' | 'none'; 10 | buildable?: boolean; 11 | publishable?: boolean; 12 | importPath?: string; 13 | skipFormat: boolean; 14 | } 15 | 16 | export interface NormalizedSchema extends PreactLibrarySchema { 17 | projectName: string; 18 | projectRoot: string; 19 | projectDirectory: string; 20 | fileName: string; 21 | parsedTags: string[]; 22 | importPath: string; 23 | } 24 | -------------------------------------------------------------------------------- /packages/preact/src/generators/utils/versions.ts: -------------------------------------------------------------------------------- 1 | export const preactVersion = '^10.20.0'; 2 | export const testingLibraryPreactVersion = '^3.2.4'; 3 | export const vitePluginPreactVersion = '^2.8.1'; 4 | export const eslintPluginPreactVersion = '^0.1.0'; 5 | -------------------------------------------------------------------------------- /packages/preact/src/index.ts: -------------------------------------------------------------------------------- 1 | export { libraryGenerator } from './generators/library/library'; 2 | export { applicationGenerator } from './generators/application/application'; 3 | export { componentGenerator } from './generators/component/component'; 4 | -------------------------------------------------------------------------------- /packages/preact/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "./tsconfig.lib.json" 8 | }, 9 | { 10 | "path": "./tsconfig.spec.json" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /packages/preact/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | "outDir": "../../dist/out-tsc", 6 | "declaration": true, 7 | "types": ["node"] 8 | }, 9 | "exclude": ["**/*.spec.ts", "jest.config.ts"], 10 | "include": ["**/*.ts"] 11 | } 12 | -------------------------------------------------------------------------------- /packages/preact/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 | "**/*.spec.ts", 10 | "**/*.spec.tsx", 11 | "**/*.spec.js", 12 | "**/*.spec.jsx", 13 | "**/*.d.ts", 14 | "jest.config.ts" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /packages/solid/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | globals: {}, 4 | transform: { 5 | '^.+\\.[tj]sx?$': [ 6 | 'ts-jest', 7 | { 8 | tsconfig: '/tsconfig.spec.json', 9 | }, 10 | ], 11 | }, 12 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], 13 | coverageDirectory: '../../coverage/packages/solid', 14 | displayName: 'solid', 15 | testEnvironment: 'node', 16 | preset: '../../jest.preset.js', 17 | }; 18 | -------------------------------------------------------------------------------- /packages/solid/migrations.json: -------------------------------------------------------------------------------- 1 | { 2 | "generators": {} 3 | } 4 | -------------------------------------------------------------------------------- /packages/solid/src/generators/application/files/eslintrc.js.template: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "parser": "@typescript-eslint/parser", 3 | "plugins": ["solid", "@typescript-eslint"], 4 | "extends": ["<%= offsetFromRoot %>.eslintrc.json"], 5 | "ignorePatterns": ["!**/*", "vite.config.ts"], 6 | "overrides": [ 7 | { 8 | "files": ["*.ts", "*.js", "*.tsx"], 9 | "parserOptions": { 10 | "project": ["<%= appProjectRoot %>/tsconfig.*?.json"] 11 | }, 12 | "rules": {} 13 | }, 14 | { 15 | "files": ["*.ts", "*.tsx"], 16 | "rules": {} 17 | }, 18 | { 19 | "files": ["*.js", "*.jsx"], 20 | "rules": {} 21 | } 22 | ], 23 | "settings": { 24 | 'solid/typescript': require('typescript') 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /packages/solid/src/generators/application/files/index.html.template: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Solid App 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /packages/solid/src/generators/application/files/package.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "name": "<%= name %>", 3 | "version": "0.0.1", 4 | "description": "Nx Solid <%= name %> app" 5 | } 6 | -------------------------------------------------------------------------------- /packages/solid/src/generators/application/files/src/App.module.css.template: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .logo { 6 | animation: logo-spin infinite 20s linear; 7 | height: 40vmin; 8 | pointer-events: none; 9 | } 10 | 11 | .header { 12 | background-color: #282c34; 13 | min-height: 100vh; 14 | display: flex; 15 | flex-direction: column; 16 | align-items: center; 17 | justify-content: center; 18 | font-size: calc(10px + 2vmin); 19 | color: white; 20 | } 21 | 22 | .link { 23 | color: #b318f0; 24 | } 25 | 26 | @keyframes logo-spin { 27 | from { 28 | transform: rotate(0deg); 29 | } 30 | to { 31 | transform: rotate(360deg); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /packages/solid/src/generators/application/files/src/App.tsx.template: -------------------------------------------------------------------------------- 1 | import logo from "./logo.svg"; 2 | import styles from "./App.module.css"; 3 | 4 | function App() { 5 | return ( 6 |
7 |
8 | logo 9 |

10 | Edit src/App.tsx and save to reload. 11 |

12 | 18 | Learn Solid 19 | 20 |
21 |
22 | ); 23 | } 24 | 25 | export default App; 26 | -------------------------------------------------------------------------------- /packages/solid/src/generators/application/files/src/index.css.template: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /packages/solid/src/generators/application/files/src/index.tsx.template: -------------------------------------------------------------------------------- 1 | /* @refresh reload */ 2 | import { render } from 'solid-js/web'; 3 | 4 | import './index.css'; 5 | import App from './App'; 6 | 7 | const root = document.getElementById('root'); 8 | 9 | if (import.meta.env.DEV && !(root instanceof HTMLElement)) { 10 | throw new Error( 11 | 'Root element not found. Did you forget to add it to your index.html? Or maybe the id attribute got misspelled?', 12 | ); 13 | } 14 | 15 | // eslint-disable-next-line @typescript-eslint/no-non-null-assertion 16 | render(() => , root!); 17 | -------------------------------------------------------------------------------- /packages/solid/src/generators/application/files/tsconfig.app.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | 4 | "compilerOptions": { 5 | "outDir": "<%= offsetFromRoot %>dist/out-tsc", 6 | }, 7 | 8 | "include": ["src/**/*"], 9 | "exclude": ["**/*.spec.ts", "**/*_spec.ts", "**/*.spec.tsx", "**/*_spec.tsx", "public/*"], 10 | } 11 | -------------------------------------------------------------------------------- /packages/solid/src/generators/application/files/tsconfig.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "<%= offsetFromRoot %>tsconfig.base.json", 3 | "compilerOptions": { 4 | "strict": true, 5 | "target": "ESNext", 6 | "module": "ESNext", 7 | "moduleResolution": "node", 8 | "allowSyntheticDefaultImports": true, 9 | "esModuleInterop": true, 10 | "jsx": "preserve", 11 | "jsxImportSource": "solid-js", 12 | "types": ["vite/client"] 13 | }, 14 | "files": [], 15 | "include": [], 16 | "references": [ 17 | { 18 | "path": "./tsconfig.app.json" 19 | }, 20 | { 21 | "path": "./tsconfig.spec.json" 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /packages/solid/src/generators/application/files/tsconfig.spec.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "<%= offsetFromRoot %>dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": [ 9 | "**/*.spec.ts", 10 | "**/*.spec.js", 11 | "**/*.spec.tsx", 12 | "**/*.spec.jsx", 13 | "**/*.d.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /packages/solid/src/generators/application/lib/add-jest.ts: -------------------------------------------------------------------------------- 1 | import { ensurePackage, NX_VERSION, Tree } from '@nx/devkit'; 2 | import { NormalizedSchema } from '../schema'; 3 | 4 | export async function addJest(host: Tree, options: NormalizedSchema) { 5 | if (options.unitTestRunner !== 'jest') { 6 | return () => {}; // eslint-disable-line @typescript-eslint/no-empty-function 7 | } 8 | 9 | const { jestProjectGenerator } = ensurePackage( 10 | '@nx/jest', 11 | NX_VERSION 12 | ); 13 | 14 | return await jestProjectGenerator(host, { 15 | project: options.name, 16 | supportTsx: false, 17 | skipSerializers: true, 18 | setupFile: 'none', 19 | babelJest: false, 20 | }); 21 | } 22 | -------------------------------------------------------------------------------- /packages/solid/src/generators/application/lib/add-vite.ts: -------------------------------------------------------------------------------- 1 | import { ensurePackage, NX_VERSION, Tree } from '@nx/devkit'; 2 | import { NormalizedSchema } from '../schema'; 3 | 4 | export async function addVite(host: Tree, options: NormalizedSchema) { 5 | const { viteConfigurationGenerator } = ensurePackage< 6 | typeof import('@nx/vite') 7 | >('@nx/vite', NX_VERSION); 8 | 9 | return await viteConfigurationGenerator(host, { 10 | uiFramework: 'none', 11 | project: options.name, 12 | newProject: true, 13 | includeVitest: options.unitTestRunner === 'vitest', 14 | inSourceTests: false, 15 | }); 16 | } 17 | -------------------------------------------------------------------------------- /packages/solid/src/generators/application/lib/create-project-files.ts: -------------------------------------------------------------------------------- 1 | import { 2 | generateFiles, 3 | joinPathFragments, 4 | names, 5 | offsetFromRoot, 6 | Tree, 7 | } from '@nx/devkit'; 8 | import { NormalizedSchema } from '../schema'; 9 | 10 | export function createFiles(host: Tree, options: NormalizedSchema) { 11 | generateFiles( 12 | host, 13 | joinPathFragments(__dirname, '../files'), 14 | options.appProjectRoot, 15 | { 16 | ...options, 17 | ...names(options.name), 18 | offsetFromRoot: offsetFromRoot(options.appProjectRoot), 19 | } 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /packages/solid/src/generators/application/lib/update-jest-config.ts: -------------------------------------------------------------------------------- 1 | import { NormalizedSchema } from '../schema'; 2 | import { Tree } from '@nx/devkit'; 3 | 4 | export function updateJestConfig(host: Tree, options: NormalizedSchema) { 5 | if (options.unitTestRunner !== 'jest') { 6 | return; 7 | } 8 | 9 | const jestConfigPath = `${options.appProjectRoot}/jest.config.ts`; 10 | // const svelteConfigPath = `${options.projectRoot}/jest.config.ts`; 11 | const originalContent = host.read(jestConfigPath)?.toString(); 12 | const content = updateJestConfigContent(originalContent); 13 | host.write(jestConfigPath, content); 14 | } 15 | 16 | function updateJestConfigContent(content: string) { 17 | return content; 18 | } 19 | -------------------------------------------------------------------------------- /packages/solid/src/generators/application/schema.d.ts: -------------------------------------------------------------------------------- 1 | import { Linter } from '@nx/eslint'; 2 | 3 | export interface Schema { 4 | directory: string; 5 | name?: string; 6 | tags?: string; 7 | linter: Linter; 8 | unitTestRunner: 'jest' | 'vitest' | 'none'; 9 | e2eTestRunner: 'cypress' | 'none'; 10 | rootProject?: boolean; 11 | host?: string; 12 | port?: number; 13 | } 14 | 15 | export interface NormalizedSchema extends T { 16 | projectName: string; 17 | appProjectRoot: string; 18 | e2eProjectName: string; 19 | e2eProjectRoot: string; 20 | e2eWebServerAddress: string; 21 | e2eWebServerTarget: string; 22 | fileName: string; 23 | parsedTags: string[]; 24 | skipFormat: boolean; 25 | } 26 | -------------------------------------------------------------------------------- /packages/solid/src/generators/component/files/src/components/__fileName__/__className__.tsx.template: -------------------------------------------------------------------------------- 1 | function <%= className %>() { 2 | return

Hello component!

3 | } 4 | 5 | export default <%= className %>; 6 | -------------------------------------------------------------------------------- /packages/solid/src/generators/component/files/src/components/__fileName__/__fileName__.spec.tsx.template: -------------------------------------------------------------------------------- 1 | import <%= className %> from './<%= className %>' 2 | import { render } from 'solid-testing-library' 3 | 4 | it('it works', async () => { 5 | const { getByText } = render(<%= className %>) 6 | 7 | expect(getByText('Hello component!')); 8 | }) 9 | -------------------------------------------------------------------------------- /packages/solid/src/generators/component/lib/create-component-in-project.ts: -------------------------------------------------------------------------------- 1 | import { 2 | generateFiles, 3 | joinPathFragments, 4 | names, 5 | readProjectConfiguration, 6 | Tree, 7 | } from '@nx/devkit'; 8 | import { SolidComponentSchema } from '../component'; 9 | 10 | export function createComponentInProject( 11 | tree: Tree, 12 | options: SolidComponentSchema 13 | ) { 14 | const projectConfig = readProjectConfiguration(tree, options.project); 15 | const projectDirectory = options.directory 16 | ? joinPathFragments(options.directory) 17 | : ''; 18 | 19 | generateFiles( 20 | tree, 21 | joinPathFragments(__dirname, '../files/src'), 22 | joinPathFragments(`${projectConfig.sourceRoot}/${projectDirectory}`), 23 | names(options.name) 24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /packages/solid/src/generators/init/lib/add-cypress-plugin.ts: -------------------------------------------------------------------------------- 1 | import { GeneratorCallback, Tree, ensurePackage, NX_VERSION } from '@nx/devkit'; 2 | 3 | export async function addCypressPlugin(tree: Tree): Promise { 4 | const { cypressInitGenerator } = ensurePackage( 5 | '@nx/cypress', 6 | NX_VERSION 7 | ); 8 | return await cypressInitGenerator(tree, {}); 9 | } 10 | -------------------------------------------------------------------------------- /packages/solid/src/generators/init/lib/add-dependencies.ts: -------------------------------------------------------------------------------- 1 | import { addDependenciesToPackageJson, Tree } from '@nx/devkit'; 2 | import { 3 | eslintPluginSolidVersion, 4 | solidJestVersion, 5 | solidTestingLibraryVersion, 6 | solidVersion, 7 | vitePluginSolidVersion, 8 | } from '../../utils/versions'; 9 | 10 | export function updateDependencies(tree: Tree) { 11 | return addDependenciesToPackageJson( 12 | tree, 13 | {}, 14 | { 15 | 'solid-jest': solidJestVersion, 16 | 'solid-js': solidVersion, 17 | 'solid-testing-library': solidTestingLibraryVersion, 18 | 'eslint-plugin-solid': eslintPluginSolidVersion, 19 | 'vite-plugin-solid': vitePluginSolidVersion, 20 | } 21 | ); 22 | } 23 | -------------------------------------------------------------------------------- /packages/solid/src/generators/init/lib/add-jest-plugin.ts: -------------------------------------------------------------------------------- 1 | import { GeneratorCallback, Tree, ensurePackage, NX_VERSION } from '@nx/devkit'; 2 | 3 | export async function addJestPlugin(tree: Tree): Promise { 4 | const { jestInitGenerator } = ensurePackage( 5 | '@nx/jest', 6 | NX_VERSION 7 | ); 8 | return await jestInitGenerator(tree, {}); 9 | } 10 | -------------------------------------------------------------------------------- /packages/solid/src/generators/init/schema.d.ts: -------------------------------------------------------------------------------- 1 | export interface Schema { 2 | unitTestRunner: 'jest' | 'vitest' | 'none'; 3 | e2eTestRunner: 'cypress' | 'none'; 4 | bundler?: 'vite'; 5 | skipFormat: boolean; 6 | } 7 | -------------------------------------------------------------------------------- /packages/solid/src/generators/init/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "$id": "Init", 4 | "title": "", 5 | "type": "object", 6 | "properties": { 7 | "unitTestRunner": { 8 | "description": "Adds the specified unit test runner.", 9 | "type": "string", 10 | "enum": ["vitest", "jest", "none"], 11 | "default": "vitest" 12 | }, 13 | "e2eTestRunner": { 14 | "description": "Adds the specified e2e test runner.", 15 | "type": "string", 16 | "enum": ["cypress", "none"], 17 | "default": "cypress" 18 | }, 19 | "skipFormat": { 20 | "description": "Skip formatting files.", 21 | "type": "boolean", 22 | "default": false 23 | } 24 | }, 25 | "required": [] 26 | } 27 | -------------------------------------------------------------------------------- /packages/solid/src/generators/library/files/eslintrc.js.template: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "parser": "@typescript-eslint/parser", 3 | "plugins": ["solid", "@typescript-eslint"], 4 | "extends": ["<%= offsetFromRoot %>.eslintrc.json"], 5 | "ignorePatterns": ["!**/*", "vite.config.ts"], 6 | "overrides": [ 7 | { 8 | "files": ["*.ts", "*.js", "*.tsx"], 9 | "parserOptions": { 10 | "project": ["<%= projectRoot %>/tsconfig.*?.json"] 11 | }, 12 | "rules": {} 13 | }, 14 | { 15 | "files": ["*.ts", "*.tsx"], 16 | "rules": {} 17 | }, 18 | { 19 | "files": ["*.js", "*.jsx"], 20 | "rules": {} 21 | } 22 | ], 23 | "settings": { 24 | 'solid/typescript': require('typescript') 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /packages/solid/src/generators/library/files/package.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "name": "<%= name %>", 3 | "version": "0.0.1", 4 | "description": "Nx Solid <%= name %> lib" 5 | } 6 | -------------------------------------------------------------------------------- /packages/solid/src/generators/library/files/src/index.ts.template: -------------------------------------------------------------------------------- 1 | export {}; -------------------------------------------------------------------------------- /packages/solid/src/generators/library/files/tsconfig.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "<%= offsetFromRoot %>tsconfig.base.json", 3 | "compilerOptions": { 4 | "strict": true, 5 | "target": "ESNext", 6 | "module": "ESNext", 7 | "moduleResolution": "node", 8 | "allowSyntheticDefaultImports": true, 9 | "esModuleInterop": true, 10 | "jsx": "preserve", 11 | "jsxImportSource": "solid-js", 12 | "types": ["vite/client"] 13 | }, 14 | "files": [], 15 | "include": [], 16 | "references": [ 17 | { 18 | "path": "./tsconfig.lib.json" 19 | }, 20 | { 21 | "path": "./tsconfig.spec.json" 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /packages/solid/src/generators/library/files/tsconfig.lib.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | 4 | "compilerOptions": { 5 | "outDir": "<%= offsetFromRoot %>dist/out-tsc", 6 | }, 7 | 8 | "include": ["src/**/*"], 9 | "exclude": ["**/*.spec.ts", "**/*_spec.ts", "**/*.spec.tsx", "**/*_spec.tsx", "public/*"], 10 | } 11 | -------------------------------------------------------------------------------- /packages/solid/src/generators/library/files/tsconfig.spec.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "<%= offsetFromRoot %>dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": [ 9 | "**/*.spec.ts", 10 | "**/*.spec.tsx", 11 | "**/*.spec.js", 12 | "**/*.spec.jsx", 13 | "**/*.d.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /packages/solid/src/generators/library/lib/add-jest.ts: -------------------------------------------------------------------------------- 1 | import { ensurePackage, NX_VERSION, Tree } from '@nx/devkit'; 2 | import { NormalizedSchema } from '../schema'; 3 | 4 | export async function addJest(host: Tree, options: NormalizedSchema) { 5 | if (options.unitTestRunner !== 'jest') { 6 | return () => {}; // eslint-disable-line @typescript-eslint/no-empty-function 7 | } 8 | const { jestProjectGenerator } = ensurePackage( 9 | '@nx/jest', 10 | NX_VERSION 11 | ); 12 | 13 | return await jestProjectGenerator(host, { 14 | project: options.name, 15 | supportTsx: false, 16 | skipSerializers: true, 17 | setupFile: 'none', 18 | babelJest: false, 19 | }); 20 | } 21 | -------------------------------------------------------------------------------- /packages/solid/src/generators/library/lib/add-vite.ts: -------------------------------------------------------------------------------- 1 | import { ensurePackage, NX_VERSION, Tree } from '@nx/devkit'; 2 | import { NormalizedSchema } from '../schema'; 3 | 4 | export async function addVite(host: Tree, options: NormalizedSchema) { 5 | const { viteConfigurationGenerator } = ensurePackage< 6 | typeof import('@nx/vite') 7 | >('@nx/vite', NX_VERSION); 8 | 9 | return await viteConfigurationGenerator(host, { 10 | uiFramework: 'none', 11 | project: options.name, 12 | newProject: true, 13 | includeVitest: options.unitTestRunner === 'vitest', 14 | inSourceTests: false, 15 | }); 16 | } 17 | -------------------------------------------------------------------------------- /packages/solid/src/generators/library/lib/create-project-files.ts: -------------------------------------------------------------------------------- 1 | import { 2 | generateFiles, 3 | joinPathFragments, 4 | names, 5 | offsetFromRoot, 6 | Tree, 7 | } from '@nx/devkit'; 8 | import { NormalizedSchema } from '../schema'; 9 | 10 | export function createFiles(host: Tree, options: NormalizedSchema) { 11 | generateFiles( 12 | host, 13 | joinPathFragments(__dirname, '../files'), 14 | options.projectRoot, 15 | { 16 | ...options, 17 | ...names(options.name), 18 | offsetFromRoot: offsetFromRoot(options.projectRoot), 19 | } 20 | ); 21 | 22 | if (!options.publishable && !options.buildable) { 23 | host.delete(`${options.projectRoot}/package.json`); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /packages/solid/src/generators/library/lib/update-jest-config.ts: -------------------------------------------------------------------------------- 1 | import { NormalizedSchema } from '../schema'; 2 | import { Tree } from '@nx/devkit'; 3 | 4 | export function updateJestConfig(host: Tree, options: NormalizedSchema) { 5 | if (options.unitTestRunner !== 'jest') { 6 | return; 7 | } 8 | 9 | const configPath = `${options.projectRoot}/jest.config.ts`; 10 | const originalContent = host.read(configPath)?.toString(); 11 | const content = updateJestConfigContent(originalContent); 12 | host.write(configPath, content); 13 | } 14 | 15 | function updateJestConfigContent(content: string) { 16 | return content; 17 | } 18 | -------------------------------------------------------------------------------- /packages/solid/src/generators/library/schema.d.ts: -------------------------------------------------------------------------------- 1 | import { Linter } from '@nx/eslint'; 2 | 3 | export interface SolidLibrarySchema { 4 | directory: string; 5 | name?: string; 6 | tags?: string; 7 | linter: Linter; 8 | unitTestRunner: 'vitest' | 'jest' | 'none'; 9 | e2eTestRunner: 'cypress' | 'none'; 10 | buildable?: boolean; 11 | publishable?: boolean; 12 | importPath?: string; 13 | skipFormat: boolean; 14 | simpleName?: boolean; 15 | } 16 | 17 | export interface NormalizedSchema extends SolidLibrarySchema { 18 | projectRoot: string; 19 | projectDirectory: string; 20 | fileName: string; 21 | parsedTags: string[]; 22 | importPath: string; 23 | inSourceTests: boolean; 24 | } 25 | -------------------------------------------------------------------------------- /packages/solid/src/generators/utils/versions.ts: -------------------------------------------------------------------------------- 1 | export const solidJestVersion = '^0.2.0'; 2 | export const solidVersion = '^1.7.12'; 3 | export const solidTestingLibraryVersion = '^0.5.1'; 4 | export const eslintPluginSolidVersion = '0.13.0'; 5 | export const vitePluginSolidVersion = '2.10.1'; 6 | -------------------------------------------------------------------------------- /packages/solid/src/index.ts: -------------------------------------------------------------------------------- 1 | export { libraryGenerator } from './generators/library/library'; 2 | export { applicationGenerator } from './generators/application/application'; 3 | export { componentGenerator } from './generators/component/component'; 4 | -------------------------------------------------------------------------------- /packages/solid/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "./tsconfig.lib.json" 8 | }, 9 | { 10 | "path": "./tsconfig.spec.json" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /packages/solid/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | "outDir": "../../dist/out-tsc", 6 | "declaration": true, 7 | "types": ["node"] 8 | }, 9 | "exclude": ["**/*.spec.ts", "jest.config.ts"], 10 | "include": ["**/*.ts"] 11 | } 12 | -------------------------------------------------------------------------------- /packages/solid/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 | "**/*.spec.ts", 10 | "**/*.spec.tsx", 11 | "**/*.spec.js", 12 | "**/*.spec.jsx", 13 | "**/*.d.ts", 14 | "jest.config.ts" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /packages/stencil/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | transform: { 4 | '^.+\\.[tj]sx?$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }], 5 | }, 6 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html', 'json'], 7 | coverageDirectory: '../../coverage/packages/stencil', 8 | globals: {}, 9 | displayName: 'stencil', 10 | testEnvironment: 'node', 11 | preset: '../../jest.preset.js', 12 | }; 13 | -------------------------------------------------------------------------------- /packages/stencil/src/executors/build/compat.ts: -------------------------------------------------------------------------------- 1 | import { convertNxExecutor } from '@nx/devkit'; 2 | 3 | import buildExecutor from './executor'; 4 | 5 | export default convertNxExecutor(buildExecutor); 6 | -------------------------------------------------------------------------------- /packages/stencil/src/executors/build/schema.d.ts: -------------------------------------------------------------------------------- 1 | import { StencilBaseConfigOptions } from '../stencil-runtime/stencil-config'; 2 | import { ProjectType } from '../../utils/typings'; 3 | 4 | export interface StencilBuildOptions extends StencilBaseConfigOptions { 5 | projectType?: ProjectType; 6 | 7 | // Stencil compiler Options 8 | ci?: boolean; 9 | debug?: boolean; 10 | dev?: boolean; 11 | docsReadme?: boolean; 12 | es5?: boolean; 13 | log?: boolean; 14 | prerender?: boolean; 15 | ssr?: boolean; 16 | prod?: boolean; 17 | maxWorkers?: number; 18 | port?: number; 19 | serve?: boolean; 20 | verbose?: boolean; 21 | watch?: boolean; 22 | noOpen?: boolean; 23 | } 24 | -------------------------------------------------------------------------------- /packages/stencil/src/executors/e2e/compat.ts: -------------------------------------------------------------------------------- 1 | import { convertNxExecutor } from '@nx/devkit'; 2 | 3 | import e2eExecutor from './executor'; 4 | 5 | export default convertNxExecutor(e2eExecutor); 6 | -------------------------------------------------------------------------------- /packages/stencil/src/executors/e2e/schema.d.ts: -------------------------------------------------------------------------------- 1 | import { StencilBaseConfigOptions } from '../stencil-runtime/stencil-config'; 2 | import { ProjectType } from '../../utils/typings'; 3 | 4 | export interface StencilE2EOptions extends StencilBaseConfigOptions { 5 | projectType?: ProjectType; 6 | } 7 | -------------------------------------------------------------------------------- /packages/stencil/src/executors/e2e/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "outputCapture": "direct-nodejs", 4 | "$schema": "http://json-schema.org/schema", 5 | "title": "Stencil build", 6 | "description": "", 7 | "type": "object", 8 | "properties": { 9 | "projectType": { 10 | "type": "string" 11 | } 12 | }, 13 | "required": [] 14 | } 15 | -------------------------------------------------------------------------------- /packages/stencil/src/executors/serve/compat.ts: -------------------------------------------------------------------------------- 1 | import { convertNxExecutor } from '@nx/devkit'; 2 | 3 | import serveExecutor from './executor'; 4 | 5 | export default convertNxExecutor(serveExecutor); 6 | -------------------------------------------------------------------------------- /packages/stencil/src/executors/serve/schema.d.ts: -------------------------------------------------------------------------------- 1 | import { StencilBaseConfigOptions } from '../stencil-runtime/stencil-config'; 2 | import { ProjectType } from '../../utils/typings'; 3 | 4 | export interface StencilServeOptions extends StencilBaseConfigOptions { 5 | projectType?: ProjectType; 6 | 7 | // Stencil compiler Options 8 | ci?: boolean; 9 | debug?: boolean; 10 | dev?: boolean; 11 | docsReadme?: boolean; 12 | es5?: boolean; 13 | log?: boolean; 14 | prerender?: boolean; 15 | ssr?: boolean; 16 | prod?: boolean; 17 | maxWorkers?: number; 18 | port?: number; 19 | serve?: boolean; 20 | verbose?: boolean; 21 | watch?: boolean; 22 | noOpen?: boolean; 23 | } 24 | -------------------------------------------------------------------------------- /packages/stencil/src/executors/stencil-runtime/index.ts: -------------------------------------------------------------------------------- 1 | export { prepareConfigAndOutputargetPaths } from './prepare-config-and-outputarget-paths'; 2 | export { createStencilProcess } from './stencil-process'; 3 | export { initializeStencilConfig } from './stencil-config'; 4 | -------------------------------------------------------------------------------- /packages/stencil/src/executors/stencil-runtime/stencil-parameters.ts: -------------------------------------------------------------------------------- 1 | import { StencilBaseConfigOptions } from './stencil-config'; 2 | 3 | export function parseRunParameters( 4 | runOptions: string[], 5 | options: T 6 | ) { 7 | Object.keys(options).forEach((optionKey: string) => { 8 | if (typeof options[optionKey] === 'boolean' && options[optionKey]) { 9 | runOptions.push(`--${optionKey}`); 10 | } else if (options[optionKey]) { 11 | runOptions.push(`--${optionKey}=${options[optionKey]}`); 12 | } 13 | }); 14 | 15 | return runOptions; 16 | } 17 | -------------------------------------------------------------------------------- /packages/stencil/src/executors/stencil-runtime/types.ts: -------------------------------------------------------------------------------- 1 | export type PathCollection = { 2 | distDir: string; 3 | projectRoot: string; 4 | projectName: string; 5 | pkgJson: string; 6 | }; 7 | -------------------------------------------------------------------------------- /packages/stencil/src/executors/test/compat.ts: -------------------------------------------------------------------------------- 1 | import { convertNxExecutor } from '@nx/devkit'; 2 | 3 | import testExecutor from './executor'; 4 | 5 | export default convertNxExecutor(testExecutor); 6 | -------------------------------------------------------------------------------- /packages/stencil/src/executors/test/schema.d.ts: -------------------------------------------------------------------------------- 1 | import { StencilBaseConfigOptions } from '../stencil-runtime/stencil-config'; 2 | import { ProjectType } from '../../utils/typings'; 3 | 4 | export interface StencilTestOptions extends StencilBaseConfigOptions { 5 | projectType?: ProjectType; 6 | watch?: boolean; 7 | } 8 | -------------------------------------------------------------------------------- /packages/stencil/src/executors/test/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "outputCapture": "direct-nodejs", 4 | "$schema": "http://json-schema.org/schema", 5 | "title": "Stencil build", 6 | "description": "", 7 | "type": "object", 8 | "properties": { 9 | "projectType": { 10 | "type": "string" 11 | }, 12 | "configPath": { 13 | "type": "string", 14 | "description": "Path to the stencil.config.ts file." 15 | }, 16 | "watch": { 17 | "type": "boolean" 18 | } 19 | }, 20 | "required": [] 21 | } 22 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/add-outputtarget/schema.d.ts: -------------------------------------------------------------------------------- 1 | import { OutputTargetType } from './lib/add-outputtarget-to-config'; 2 | 3 | export type OutputTargetType = 'angular' | 'react' | 'svelte' | 'vue'; 4 | 5 | export interface AddOutputtargetSchematicSchema { 6 | projectName: string; 7 | outputType: OutputTargetType; 8 | publishable: boolean; 9 | importPath?: string; 10 | unitTestRunner: 'jest' | 'none'; 11 | skipFormat: boolean; 12 | } 13 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/application/files/app/src/assets/icon/favicon.ico: -------------------------------------------------------------------------------- 1 | �PNG 2 |  3 | IHDR����q4'PLTEGpL�������������������������������n)e" tRNS|�Y0� ��� �_�J��IDATx�۱N�`��kJD � �B��� ��/��Й�8;V7�N]�Kw��Cg����Nk�����/�-B�#""��L�-R���=�AOܮ�Zl,~+5؀�g�vP�D�>��(��e�Lܮ��0���������X�o���#+� V��`%X V���^ ������_�F[%�z��\0�pN�Sk�~��J�I\�b�Q^���N� { 4 | it('renders', async () => { 5 | const page = await newE2EPage(); 6 | await page.setContent(''); 7 | 8 | const element = await page.find('app-home'); 9 | expect(element).toHaveClass('hydrated'); 10 | }); 11 | 12 | it('contains a "Profile Page" button', async () => { 13 | const page = await newE2EPage(); 14 | await page.setContent(''); 15 | 16 | const element = await page.find('app-home >>> button'); 17 | expect(element.textContent).toEqual('Profile page'); 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/application/files/app/src/components/app-profile/app-profile.__style__.template: -------------------------------------------------------------------------------- 1 | .app-profile { 2 | padding: 10px; 3 | } 4 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/application/files/app/src/components/app-root/app-root.__style__.template: -------------------------------------------------------------------------------- 1 | header { 2 | background: #5851ff; 3 | color: white; 4 | height: 56px; 5 | display: flex; 6 | align-items: center; 7 | box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26); 8 | } 9 | 10 | h1 { 11 | font-size: 1.4rem; 12 | font-weight: 500; 13 | color: #fff; 14 | padding: 0 12px; 15 | } 16 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/application/files/app/src/components/app-root/app-root.e2e.ts.template: -------------------------------------------------------------------------------- 1 | import { newE2EPage } from '@stencil/core/testing'; 2 | 3 | describe('app-root', () => { 4 | it('renders', async () => { 5 | const page = await newE2EPage({ url: '/'}); 6 | 7 | const element = await page.find('app-root'); 8 | expect(element).toHaveClass('hydrated'); 9 | }); 10 | 11 | it('renders the title', async () => { 12 | const page = await newE2EPage({ url: '/'}); 13 | 14 | const element = await page.find('app-root >>> h1'); 15 | expect(element.textContent).toEqual('Stencil App Starter'); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/application/files/app/src/global/app.__style__.template: -------------------------------------------------------------------------------- 1 | /* 2 | Global App CSS 3 | ---------------------- 4 | Use this file for styles that should be applied to all components. 5 | For example, "font-family" within the "body" selector is a CSS property 6 | most apps will want applied to all components. 7 | 8 | Any global CSS variables should also be applied here. 9 | */ 10 | 11 | 12 | body { 13 | margin: 0px; 14 | padding: 0px; 15 | font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"; 16 | } 17 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/application/files/app/src/global/app.ts.template: -------------------------------------------------------------------------------- 1 | export default async () => { 2 | /** 3 | * The code to be executed should be placed within a default function that is 4 | * exported by the global script. Ensure all of the code in the global script 5 | * is wrapped in the function() that is exported. 6 | */ 7 | }; 8 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/application/files/app/src/index.ts.template: -------------------------------------------------------------------------------- 1 | export * from './components'; 2 | import '@stencil/router'; 3 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/application/files/app/src/manifest.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Stencil Starter", 3 | "short_name": "Stencil", 4 | "start_url": "/", 5 | "display": "standalone", 6 | "icons": [{ 7 | "src": "assets/icon/icon.png", 8 | "sizes": "512x512", 9 | "type": "image/png" 10 | }], 11 | "background_color": "#16161d", 12 | "theme_color": "#16161d" 13 | } -------------------------------------------------------------------------------- /packages/stencil/src/generators/application/files/app/stencil.config.ts.template: -------------------------------------------------------------------------------- 1 | import { Config } from '@stencil/core'; 2 | // https://stenciljs.com/docs/config 3 | 4 | export const config: Config = { 5 | globalStyle: 'src/global/app.<%= style %>', 6 | globalScript: 'src/global/app.ts', 7 | taskQueue: 'async', 8 | sourceMap: true, 9 | 10 | outputTargets: [ 11 | { 12 | type: 'www', 13 | // comment the following line to disable service workers in production 14 | serviceWorker: null, 15 | baseUrl: 'https://<% projectName %>.local/', 16 | }, 17 | ], 18 | extras: { 19 | experimentalImportInjection: true, 20 | } 21 | }; 22 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/application/files/app/tsconfig.app.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "<%= offsetFromRoot %>dist/out-tsc", 5 | "types": ["node"] 6 | }, 7 | "exclude": ["**/*.spec.ts", "**/*.spec.tsx"], 8 | "include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"], 9 | } 10 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/application/files/app/tsconfig.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "<%= offsetFromRoot %>tsconfig.base.json", 3 | "compilerOptions": { 4 | "allowSyntheticDefaultImports": true, 5 | "allowUnreachableCode": false, 6 | "declaration": false, 7 | "experimentalDecorators": true, 8 | "lib": [ 9 | "dom", 10 | "es2015" 11 | ], 12 | "moduleResolution": "node", 13 | "module": "esnext", 14 | "target": "es2017", 15 | "noUnusedLocals": true, 16 | "noUnusedParameters": true, 17 | "jsx": "react", 18 | "jsxFactory": "h" 19 | }, 20 | "include": [], 21 | "references": [ 22 | { 23 | "path": "./tsconfig.app.json" 24 | } 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/component/files/component/__componentFileName__.__style__.template: -------------------------------------------------------------------------------- 1 | :host { 2 | display: block; 3 | } 4 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/component/files/component/__componentFileName__.stories.tsx.template: -------------------------------------------------------------------------------- 1 | import { html } from 'lit-html'; 2 | 3 | export default { 4 | title: '<%= className %>', 5 | component: '<%= className %>', 6 | args: { 7 | first: 'first', 8 | middle: 'first', 9 | last: 'first', 10 | }, 11 | }; 12 | 13 | const Template = (args) => { 14 | return html` 15 | <<%= componentFileName %> first=${args.first} middle=${args.middle} last=${args.last}>> 16 | `; 17 | }; 18 | 19 | export const Default = (args) => Template(args); 20 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/init/lib/add-cypress.ts: -------------------------------------------------------------------------------- 1 | import { ensurePackage, NX_VERSION, Tree } from '@nx/devkit'; 2 | import { InitSchema } from '../schema'; 3 | 4 | export async function addCypress(host: Tree, options: InitSchema) { 5 | if (options.e2eTestRunner !== 'cypress') { 6 | // eslint-disable-next-line @typescript-eslint/no-empty-function 7 | return () => {}; 8 | } 9 | 10 | await ensurePackage('@nx/cypress', NX_VERSION); 11 | const generators = await import('@nx/cypress'); 12 | return generators.cypressInitGenerator(host, {}); 13 | } 14 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/init/lib/add-dependencies-for-apptype.ts: -------------------------------------------------------------------------------- 1 | import { AppType, PROJECT_TYPE_DEPENDENCIES } from '../../../utils/typings'; 2 | import { addDependenciesToPackageJson, Tree } from '@nx/devkit'; 3 | 4 | export function addDependenciesByApptype(tree: Tree, appType: AppType) { 5 | const projectDependency = PROJECT_TYPE_DEPENDENCIES[appType]; 6 | 7 | if (!projectDependency) { 8 | // eslint-disable-next-line @typescript-eslint/no-empty-function 9 | return () => {}; 10 | } 11 | 12 | return addDependenciesToPackageJson( 13 | tree, 14 | projectDependency.dependencies, 15 | projectDependency.devDependencies 16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/init/lib/add-e2e-dependencies.ts: -------------------------------------------------------------------------------- 1 | import { PROJECT_TYPE_DEPENDENCIES } from '../../../utils/typings'; 2 | import { addDependenciesToPackageJson, Tree } from '@nx/devkit'; 3 | import { InitSchema } from '../schema'; 4 | 5 | export async function addPuppeteer(tree: Tree, options: InitSchema) { 6 | if (options.e2eTestRunner !== 'puppeteer') { 7 | // eslint-disable-next-line @typescript-eslint/no-empty-function 8 | return () => {}; 9 | } 10 | 11 | const testDependencies = PROJECT_TYPE_DEPENDENCIES['puppeteer']; 12 | 13 | return addDependenciesToPackageJson( 14 | tree, 15 | testDependencies.dependencies, 16 | testDependencies.devDependencies 17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/init/lib/add-jest.ts: -------------------------------------------------------------------------------- 1 | import { ensurePackage, NX_VERSION, Tree } from '@nx/devkit'; 2 | import { InitSchema } from '../schema'; 3 | 4 | export async function addJest(host: Tree, options: InitSchema) { 5 | if (options.unitTestRunner !== 'jest') { 6 | // eslint-disable-next-line @typescript-eslint/no-empty-function 7 | return () => {}; 8 | } 9 | 10 | await ensurePackage('@nx/jest', NX_VERSION); 11 | const { jestInitGenerator } = await import('@nx/jest'); 12 | 13 | return jestInitGenerator(host, {}); 14 | } 15 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/init/lib/add-style-module-dependencies.ts: -------------------------------------------------------------------------------- 1 | import { InitSchema } from '../schema'; 2 | import { STYLE_PLUGIN_DEPENDENCIES } from '../../../utils/typings'; 3 | import { addDependenciesToPackageJson, Tree } from '@nx/devkit'; 4 | 5 | export function addStyledDependencies( 6 | tree: Tree, 7 | options: T 8 | ) { 9 | const styleDependencies = STYLE_PLUGIN_DEPENDENCIES[options.style]; 10 | 11 | if (!styleDependencies) { 12 | // eslint-disable-next-line @typescript-eslint/no-empty-function 13 | return () => {}; 14 | } 15 | 16 | return addDependenciesToPackageJson( 17 | tree, 18 | styleDependencies.dependencies, 19 | styleDependencies.devDependencies 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/init/schema.d.ts: -------------------------------------------------------------------------------- 1 | import { AppType } from '../../utils/typings'; 2 | import { SupportedStyles } from '../../stencil-core-utils'; 3 | 4 | export interface InitSchema { 5 | name: string; 6 | tags?: string; 7 | directory?: string; 8 | style?: SupportedStyles; 9 | skipFormat?: boolean; 10 | appType?: AppType; 11 | e2eTestRunner?: string; 12 | unitTestRunner?: string; 13 | projectRoot?: string; 14 | } 15 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/init/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "$id": "Nxext-Init", 4 | "title": "Add Nxext Stencil Schematics", 5 | "type": "object", 6 | "properties": { 7 | "skipFormat": { 8 | "description": "Skip formatting files", 9 | "type": "boolean", 10 | "default": false 11 | } 12 | }, 13 | "required": [] 14 | } 15 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/library/files/lib/src/components.d.ts.template: -------------------------------------------------------------------------------- 1 | export * from './components/my-component/my-component'; 2 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/library/files/lib/src/components/my-component/my-component.__style__.template: -------------------------------------------------------------------------------- 1 | :host { 2 | display: block; 3 | } 4 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/library/files/lib/src/components/my-component/readme.md.template: -------------------------------------------------------------------------------- 1 | # my-component 2 | 3 | 4 | 5 | 6 | 7 | 8 | ## Properties 9 | 10 | | Property | Attribute | Description | Type | Default | 11 | | -------- | --------- | --------------- | -------- | ----------- | 12 | | `first` | `first` | The first name | `string` | `undefined` | 13 | | `last` | `last` | The last name | `string` | `undefined` | 14 | | `middle` | `middle` | The middle name | `string` | `undefined` | 15 | 16 | 17 | ---------------------------------------------- 18 | 19 | *Built with [StencilJS](https://stenciljs.com/)* 20 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/library/files/lib/src/index.ts.template: -------------------------------------------------------------------------------- 1 | export * from './components'; 2 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/library/files/lib/src/utils/utils.spec.ts.template: -------------------------------------------------------------------------------- 1 | import { format } from './utils'; 2 | 3 | describe('format', () => { 4 | it('returns empty string for no names defined', () => { 5 | expect(format(undefined, undefined, undefined)).toEqual(''); 6 | }); 7 | 8 | it('formats just first names', () => { 9 | expect(format('Joseph', undefined, undefined)).toEqual('Joseph'); 10 | }); 11 | 12 | it('formats first and last names', () => { 13 | expect(format('Joseph', undefined, 'Publique')).toEqual('Joseph Publique'); 14 | }); 15 | 16 | it('formats first, middle and last names', () => { 17 | expect(format('Joseph', 'Quincy', 'Publique')).toEqual( 18 | 'Joseph Quincy Publique' 19 | ); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/library/files/lib/src/utils/utils.ts.template: -------------------------------------------------------------------------------- 1 | 2 | export function format(first: string, middle: string, last: string): string { 3 | return ( 4 | (first || '') + 5 | (middle ? ` ${middle}` : '') + 6 | (last ? ` ${last}` : '') 7 | ); 8 | } 9 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/library/files/lib/stencil.config.ts.template: -------------------------------------------------------------------------------- 1 | import { Config } from '@stencil/core'; 2 | 3 | export const config: Config = { 4 | namespace: '<%= name %>', 5 | taskQueue: 'async', 6 | sourceMap: true, 7 | 8 | extras: { 9 | experimentalImportInjection: true, 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/library/files/lib/tsconfig.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "<%= offsetFromRoot %>tsconfig.base.json", 3 | "compilerOptions": { 4 | "allowSyntheticDefaultImports": true, 5 | "allowUnreachableCode": false, 6 | "declaration": false, 7 | "experimentalDecorators": true, 8 | "lib": [ 9 | "dom", 10 | "es2015" 11 | ], 12 | "moduleResolution": "node", 13 | "module": "esnext", 14 | "target": "es2017", 15 | "noUnusedLocals": true, 16 | "noUnusedParameters": true, 17 | "jsx": "react", 18 | "jsxFactory": "h" 19 | }, 20 | "references": [ 21 | { 22 | "path": "./tsconfig.lib.json" 23 | } 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/library/files/lib/tsconfig.lib.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "<%= offsetFromRoot %>dist/out-tsc", 5 | "declaration": true, 6 | "composite": true, 7 | "types": ["node"] 8 | }, 9 | "exclude": ["**/*.spec.ts", "**/*.spec.tsx"], 10 | "include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"], 11 | } 12 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/library/lib/add-project.ts: -------------------------------------------------------------------------------- 1 | import { addProjectConfiguration, Tree } from '@nx/devkit'; 2 | import { getTestTarget } from '../../../utils/targets'; 3 | import { LibrarySchema } from '../schema'; 4 | 5 | export function addProject(tree: Tree, options: LibrarySchema) { 6 | const targets = { 7 | test: getTestTarget('library', options), 8 | }; 9 | 10 | addProjectConfiguration(tree, options.name, { 11 | root: options.projectRoot, 12 | sourceRoot: `${options.projectRoot}/src`, 13 | projectType: 'library', 14 | generators: { 15 | '@nxext/stencil:component': { 16 | style: options.style, 17 | }, 18 | }, 19 | tags: options.parsedTags, 20 | targets, 21 | }); 22 | } 23 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/library/lib/update-tsconfig.ts: -------------------------------------------------------------------------------- 1 | import { LibrarySchema } from '../schema'; 2 | import { Tree, updateJson } from '@nx/devkit'; 3 | 4 | export function updateTsConfig(host: Tree, options: LibrarySchema) { 5 | updateJson(host, 'tsconfig.base.json', (json) => { 6 | const c = json.compilerOptions; 7 | delete c.paths[`${options.importPath}`]; 8 | c.paths[`${options.importPath}`] = [`${options.projectRoot}/src/index.ts`]; 9 | return json; 10 | }); 11 | } 12 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/make-lib-buildable/files/lib/package.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "name": "<%= importPath %>", 3 | "version": "0.0.1", 4 | "main": "./dist/index.cjs.js", 5 | "module": "./dist/index.js", 6 | "es2015": "./dist/esm/index.mjs", 7 | "es2017": "./dist/esm/index.mjs", 8 | "types": "./dist/types/index.d.ts", 9 | "collection": "./dist/collection/collection-manifest.json", 10 | "collection:main": "./dist/collection/index.js", 11 | "unpkg": "./dist/<%= name %>/<%= name %>.js", 12 | "files": [ 13 | "dist/", 14 | "loader/" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/make-lib-buildable/files/lib/src/index.html.template: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stencil Component Starter 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/make-lib-buildable/schema.d.ts: -------------------------------------------------------------------------------- 1 | import { InitSchema } from '../../generators/init/schema'; 2 | 3 | export interface MakeLibBuildableSchema 4 | extends Pick { 5 | /** 6 | * The TS `paths` entry to be used across Nx projects. 7 | * 8 | * Defaults to: ampersand, Nx workspace name, forward-slash and finally Nx library name. Such as: 9 | * `@nx-workspace/nx-library` 10 | */ 11 | importPath?: string; 12 | } 13 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/storybook-configuration/lib/add-dependencies.ts: -------------------------------------------------------------------------------- 1 | import { addDependenciesToPackageJson, Tree } from '@nx/devkit'; 2 | import { storybookVersion } from '@nx/storybook'; 3 | 4 | export function updateDependencies(tree: Tree) { 5 | return addDependenciesToPackageJson( 6 | tree, 7 | {}, 8 | { 9 | '@storybook/manager-webpack5': storybookVersion, 10 | '@storybook/builder-webpack5': storybookVersion, 11 | '@storybook/web-components': storybookVersion, 12 | 'lit-html': '^2.4.0', 13 | } 14 | ); 15 | } 16 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/storybook-configuration/project-files/.babelrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | // @see https://babeljs.io/docs/en/babel-preset-typescript 5 | "@babel/preset-typescript", 6 | { 7 | "onlyRemoveTypeImports": true 8 | } 9 | ] 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/storybook-configuration/project-files/__dot__storybook/preview-body.html: -------------------------------------------------------------------------------- 1 | 2 | 10 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/storybook-configuration/project-files/__dot__storybook/preview-head.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/storybook-configuration/project-files/__dot__storybook/preview.ts__tmpl__: -------------------------------------------------------------------------------- 1 | import { html } from 'lit-html'; 2 | import { classMap } from 'lit-html/directives/class-map.js'; 3 | import { defineCustomElements } from '<%= loaderDir %>/loader'; 4 | 5 | defineCustomElements(); 6 | 7 | const withThemeProvider = (storyFn, context) => { 8 | const cssClasses = { centered: context.parameters.layout === 'centered' }; 9 | 10 | return html`
${storyFn()}
`; 11 | }; 12 | export const decorators = [withThemeProvider]; 13 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/storybook-configuration/project-files/__dot__storybook/tsconfig.json__tmpl__: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "include": [ 4 | "preview.ts", 5 | "**/*.stories.js", 6 | "**/*.stories.ts", 7 | "**/*.stories.jsx", 8 | "**/*.stories.tsx" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /packages/stencil/src/generators/storybook-configuration/schema.d.ts: -------------------------------------------------------------------------------- 1 | import { Linter } from '@nx/eslint'; 2 | 3 | export interface StorybookConfigureSchema { 4 | name: string; 5 | configureCypress?: boolean; 6 | linter?: Linter; 7 | cypressDirectory?: string; 8 | standaloneConfig?: boolean; 9 | } 10 | -------------------------------------------------------------------------------- /packages/stencil/src/index.ts: -------------------------------------------------------------------------------- 1 | export { initGenerator } from './generators/init/init'; 2 | export { applicationGenerator } from './generators/application/generator'; 3 | export { componentGenerator } from './generators/component/component'; 4 | export { outputtargetGenerator } from './generators/add-outputtarget/add-outputtarget'; 5 | export { libraryGenerator } from './generators/library/generator'; 6 | export { makeLibBuildableGenerator } from './generators/make-lib-buildable/make-lib-buildable'; 7 | -------------------------------------------------------------------------------- /packages/stencil/src/stencil-core-utils/index.ts: -------------------------------------------------------------------------------- 1 | export * from './lib/plugins'; 2 | export * from './lib/style-plugins'; 3 | -------------------------------------------------------------------------------- /packages/stencil/src/utils/fileutils.ts: -------------------------------------------------------------------------------- 1 | import * as path from 'path'; 2 | import * as fs from 'fs'; 3 | 4 | export function getRelativePath(from: string, to: string) { 5 | return path.relative(from, to); 6 | } 7 | 8 | export function getDistDir(rootDir: string): string { 9 | return `dist/${rootDir}`; 10 | } 11 | 12 | export function deleteFile(path: string) { 13 | try { 14 | fs.unlinkSync(path); 15 | } catch (err) { 16 | // empty 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/stencil/src/utils/lint.spec.ts: -------------------------------------------------------------------------------- 1 | import { getEsLintPluginBaseName } from './lint'; 2 | import { 3 | deprecatedStencilEslintPlugin, 4 | eslintImportPlugin, 5 | stencilEslintPlugin, 6 | } from './versions'; 7 | 8 | describe('stencil:utils:lint', () => { 9 | it('getEsLintPluginBaseName should return correct value', () => { 10 | const name1 = getEsLintPluginBaseName(stencilEslintPlugin); 11 | const name2 = getEsLintPluginBaseName(deprecatedStencilEslintPlugin); 12 | const name3 = getEsLintPluginBaseName(eslintImportPlugin); 13 | expect(name1).toEqual('@stencil-community'); 14 | expect(name2).toEqual('@stencil'); 15 | expect(name3).toEqual('import'); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /packages/stencil/src/utils/versions.ts: -------------------------------------------------------------------------------- 1 | export const stencilVersion = '^4.12.6'; 2 | export const stencilRouterVersion = '^1.0.1'; 3 | 4 | export const puppeteer = '^21.4.1'; 5 | 6 | export const deprecatedStencilEslintPlugin = '@stencil/eslint-plugin'; 7 | export const stencilEslintPlugin = '@stencil-community/eslint-plugin'; 8 | export const eslintImportPlugin = 'eslint-plugin-import'; 9 | export const ESLINT_PLUGIN_VERSIONS = { 10 | [deprecatedStencilEslintPlugin]: '0.3.1', 11 | [stencilEslintPlugin]: '^0.8.0', 12 | [eslintImportPlugin]: '^2.28.0', 13 | }; 14 | 15 | export const STENCIL_OUTPUTTARGET_VERSION = { 16 | react: '^0.5.3', 17 | angular: '^0.8.3', 18 | vue: '^0.9.0', 19 | }; 20 | 21 | export const STENCIL_STYLE_PLUGIN_VERSION = { 22 | scss: '3.0.7', 23 | }; 24 | -------------------------------------------------------------------------------- /packages/stencil/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "types": ["node", "jest"] 5 | }, 6 | "include": [], 7 | "files": [], 8 | "references": [ 9 | { 10 | "path": "./tsconfig.lib.json" 11 | }, 12 | { 13 | "path": "./tsconfig.spec.json" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /packages/stencil/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | "outDir": "../../dist/out-tsc", 6 | "declaration": true, 7 | "types": ["node"] 8 | }, 9 | "exclude": ["**/*.spec.ts", "jest.config.ts"], 10 | "include": ["**/*.ts"] 11 | } 12 | -------------------------------------------------------------------------------- /packages/stencil/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 | "**/*.spec.ts", 10 | "**/*.spec.tsx", 11 | "**/*.spec.js", 12 | "**/*.spec.jsx", 13 | "**/*.d.ts", 14 | "jest.config.ts" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /packages/svelte/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | globals: {}, 4 | transform: { 5 | '^.+\\.[tj]sx?$': [ 6 | 'ts-jest', 7 | { 8 | tsconfig: '/tsconfig.spec.json', 9 | }, 10 | ], 11 | }, 12 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], 13 | coverageDirectory: '../../coverage/packages/svelte', 14 | displayName: 'svelte', 15 | testEnvironment: 'node', 16 | preset: '../../jest.preset.js', 17 | }; 18 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/application/files/eslintrc.js.template: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "parser": "@typescript-eslint/parser", 3 | "plugins": ["svelte3", "@typescript-eslint"], 4 | "extends": ["<%= offsetFromRoot %>.eslintrc.json"], 5 | "ignorePatterns": ["!**/*", "vite.config.ts"], 6 | "overrides": [ 7 | { 8 | "files": ["*.ts", "*.js", "*.svelte"], 9 | "rules": {} 10 | }, 11 | { 12 | "files": ["*.ts", "*.tsx"], 13 | "rules": {} 14 | }, 15 | { 16 | "files": ["*.js", "*.jsx"], 17 | "rules": {} 18 | }, 19 | { 20 | "files": ["*.svelte"], 21 | "processor": "svelte3/svelte3" 22 | } 23 | ], 24 | "settings": { 25 | 'svelte3/typescript': require('typescript') 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/application/files/index.html.template: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Svelte + TS + Vite App 9 | 10 | 11 |
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/application/files/package.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "name": "<%= name %>", 3 | "version": "0.0.1" 4 | } 5 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/application/files/src/App.svelte.template: -------------------------------------------------------------------------------- 1 | 4 | 5 |
6 |

Welcome {name}!

7 |

Visit the Svelte tutorial to learn how to build Svelte apps.

8 |
9 | 10 | 31 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/application/files/src/main.ts.template: -------------------------------------------------------------------------------- 1 | import App from './App.svelte'; 2 | 3 | const app = new App({ 4 | target: document.body, 5 | props: { 6 | name: '<%= name %>' 7 | } 8 | }); 9 | 10 | export default app; 11 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/application/files/svelte.config.cjs.template: -------------------------------------------------------------------------------- 1 | const sveltePreprocess = require('svelte-preprocess'); 2 | 3 | module.exports = { 4 | // Consult https://github.com/sveltejs/svelte-preprocess 5 | // for more information about preprocessors 6 | preprocess: sveltePreprocess() 7 | }; 8 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/application/files/tsconfig.spec.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "<%= offsetFromRoot %>dist/out-tsc", 5 | "module": "commonjs", 6 | "types": [<% if(unitTestRunner === 'jest') { %>"jest",<% } %><% if(unitTestRunner === 'vitest') { %>'vitest/globals', 'vitest/importMeta', 'vite/client',<% } %> "node"] 7 | }, 8 | "include": [ 9 | "src/**/*.test.ts", 10 | "src/**/*.spec.ts", 11 | "src/**/*.test.tsx", 12 | "src/**/*.spec.tsx", 13 | "src/**/*.test.js", 14 | "src/**/*.spec.js", 15 | "src/**/*.test.jsx", 16 | "src/**/*.spec.jsx", 17 | "src/**/*.d.ts" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/application/lib/add-jest.ts: -------------------------------------------------------------------------------- 1 | import { Tree } from '@nx/devkit'; 2 | import { jestProjectGenerator } from '@nx/jest'; 3 | import { NormalizedSchema } from '../schema'; 4 | 5 | export async function addJest(host: Tree, options: NormalizedSchema) { 6 | if (options.unitTestRunner !== 'jest') { 7 | return () => {}; // eslint-disable-line @typescript-eslint/no-empty-function 8 | } 9 | 10 | return await jestProjectGenerator(host, { 11 | project: options.name, 12 | supportTsx: false, 13 | skipSerializers: true, 14 | setupFile: 'none', 15 | babelJest: false, 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/application/lib/add-project.ts: -------------------------------------------------------------------------------- 1 | import { NormalizedSchema } from '../schema'; 2 | import { addProjectConfiguration, Tree } from '@nx/devkit'; 3 | import { createLintAndCheckTargets } from '../../utils/targets'; 4 | 5 | export function addProject(tree: Tree, options: NormalizedSchema) { 6 | const targets = createLintAndCheckTargets(options); 7 | 8 | addProjectConfiguration(tree, options.name, { 9 | root: options.projectRoot, 10 | sourceRoot: `${options.projectRoot}/src`, 11 | projectType: 'application', 12 | tags: options.parsedTags, 13 | targets, 14 | }); 15 | } 16 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/application/lib/add-vite.ts: -------------------------------------------------------------------------------- 1 | import { ensurePackage, NX_VERSION, Tree } from '@nx/devkit'; 2 | import { NormalizedSchema } from '../schema'; 3 | 4 | export async function addVite(host: Tree, options: NormalizedSchema) { 5 | await ensurePackage('@nx/vite', NX_VERSION); 6 | const { viteConfigurationGenerator } = await import('@nx/vite'); 7 | 8 | return await viteConfigurationGenerator(host, { 9 | uiFramework: 'none', 10 | project: options.name, 11 | newProject: true, 12 | includeVitest: options.unitTestRunner === 'vitest', 13 | inSourceTests: false, 14 | }); 15 | } 16 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/application/schema.d.ts: -------------------------------------------------------------------------------- 1 | import { Linter } from '@nx/eslint'; 2 | 3 | export interface Schema { 4 | directory: string; 5 | name?: string; 6 | tags?: string; 7 | linter: Linter; 8 | unitTestRunner: 'jest' | 'vitest' | 'none'; 9 | e2eTestRunner: 'cypress' | 'none'; 10 | host?: string; 11 | port?: number; 12 | rootProject?: boolean; 13 | } 14 | 15 | export interface NormalizedSchema extends Schema { 16 | projectName: string; 17 | projectRoot: string; 18 | e2eProjectName: string; 19 | e2eProjectRoot: string; 20 | e2eWebServerAddress: string; 21 | e2eWebServerTarget: string; 22 | fileName: string; 23 | parsedTags: string[]; 24 | skipFormat: boolean; 25 | } 26 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/component/files/src/components/__fileName__/__className__.svelte.template: -------------------------------------------------------------------------------- 1 | 3 | 4 | 6 | 7 |

Hello component!

8 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/component/files/src/components/__fileName__/__fileName__.spec.ts.template: -------------------------------------------------------------------------------- 1 | import <%= className %> from './<%= className %>.svelte' 2 | import { render } from '@testing-library/svelte' 3 | 4 | it('it works', async () => { 5 | const { getByText } = render(<%= className %>) 6 | 7 | expect(getByText('Hello component!')); 8 | }) 9 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/component/files/src/components/__fileName__/__fileName__.stories.ts.template: -------------------------------------------------------------------------------- 1 | import { action } from '@storybook/addon-actions'; 2 | import <%= className %> from './<%= className %>.svelte'; 3 | 4 | export default { 5 | title: '<%= className %>', 6 | component: <%= className %>, 7 | }; 8 | 9 | export const Text = () => ({ 10 | Component: <%= className %>, 11 | props: { } 12 | }); 13 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/init/lib/add-cypress-plugin.ts: -------------------------------------------------------------------------------- 1 | import { GeneratorCallback, Tree, ensurePackage, NX_VERSION } from '@nx/devkit'; 2 | import { cypressInitGenerator } from '@nx/cypress'; 3 | import { Schema } from '../schema'; 4 | 5 | export async function addCypressPlugin( 6 | tree: Tree, 7 | schema: Schema 8 | ): Promise { 9 | if (!schema.unitTestRunner || schema.unitTestRunner === 'jest') { 10 | // eslint-disable-next-line @typescript-eslint/no-empty-function 11 | return () => {}; 12 | } 13 | 14 | await ensurePackage('@nx/cypress', NX_VERSION); 15 | return cypressInitGenerator(tree, {}); 16 | } 17 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/init/lib/add-jest-plugin.ts: -------------------------------------------------------------------------------- 1 | import { jestInitGenerator } from '@nx/jest'; 2 | import { GeneratorCallback, Tree, ensurePackage, NX_VERSION } from '@nx/devkit'; 3 | import { Schema } from '../schema'; 4 | 5 | export async function addJestPlugin( 6 | tree: Tree, 7 | schema: Schema 8 | ): Promise { 9 | if (!schema.unitTestRunner || schema.unitTestRunner === 'jest') { 10 | // eslint-disable-next-line @typescript-eslint/no-empty-function 11 | return () => {}; 12 | } 13 | 14 | await ensurePackage('@nx/jest', NX_VERSION); 15 | 16 | return await jestInitGenerator(tree, {}); 17 | } 18 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/init/lib/add-linter-plugin.ts: -------------------------------------------------------------------------------- 1 | import { ensurePackage, GeneratorCallback, NX_VERSION, Tree } from '@nx/devkit'; 2 | 3 | export async function addLinterPlugin(tree: Tree): Promise { 4 | ensurePackage('@nx/eslint', NX_VERSION); 5 | const { lintInitGenerator } = await import('@nx/eslint'); 6 | 7 | return lintInitGenerator(tree, {}); 8 | } 9 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/init/schema.d.ts: -------------------------------------------------------------------------------- 1 | export interface Schema { 2 | unitTestRunner: 'jest' | 'vitest' | 'none'; 3 | e2eTestRunner: 'cypress' | 'none'; 4 | skipFormat: boolean; 5 | } 6 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/init/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "$id": "Init", 4 | "title": "", 5 | "type": "object", 6 | "properties": { 7 | "unitTestRunner": { 8 | "description": "Adds the specified unit test runner.", 9 | "type": "string", 10 | "enum": ["jest", "vitest", "none"], 11 | "default": "vitest" 12 | }, 13 | "e2eTestRunner": { 14 | "description": "Adds the specified e2e test runner.", 15 | "type": "string", 16 | "enum": ["cypress", "none"], 17 | "default": "cypress" 18 | }, 19 | "skipFormat": { 20 | "description": "Skip formatting files.", 21 | "type": "boolean", 22 | "default": false 23 | } 24 | }, 25 | "required": [] 26 | } 27 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/library/files/eslintrc.js.template: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "parser": "@typescript-eslint/parser", 3 | "plugins": ["svelte3", "@typescript-eslint"], 4 | "extends": ["<%= offsetFromRoot %>.eslintrc.json"], 5 | "ignorePatterns": ["!**/*", "vite.config.ts"], 6 | "overrides": [ 7 | { 8 | "files": ["*.ts", "*.js", "*.svelte"], 9 | "rules": {} 10 | }, 11 | { 12 | "files": ["*.ts", "*.tsx"], 13 | "rules": {} 14 | }, 15 | { 16 | "files": ["*.js", "*.jsx"], 17 | "rules": {} 18 | }, 19 | { 20 | "files": ["*.svelte"], 21 | "processor": "svelte3/svelte3" 22 | } 23 | ], 24 | "settings": { 25 | 'svelte3/typescript': require('typescript') 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/library/files/package.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "name": "<%= name %>", 3 | "version": "0.0.1" 4 | } 5 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/library/files/src/index.ts.template: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxext/nx-extensions/b394bd93c2a76d561fef468c4d9aaf3c7f85e0f8/packages/svelte/src/generators/library/files/src/index.ts.template -------------------------------------------------------------------------------- /packages/svelte/src/generators/library/files/svelte.config.cjs.template: -------------------------------------------------------------------------------- 1 | const sveltePreprocess = require('svelte-preprocess'); 2 | 3 | module.exports = { 4 | // Consult https://github.com/sveltejs/svelte-preprocess 5 | // for more information about preprocessors 6 | preprocess: sveltePreprocess() 7 | }; 8 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/library/files/tsconfig.spec.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "<%= offsetFromRoot %>dist/out-tsc", 5 | "module": "commonjs", 6 | "types": [<% if(unitTestRunner === 'jest') { %>"jest",<% } %><% if(unitTestRunner === 'vitest') { %>'vitest/globals', 'vitest/importMeta', 'vite/client',<% } %> "node"] 7 | }, 8 | "include": [ 9 | "**/*.spec.ts", 10 | "**/*.spec.tsx", 11 | "**/*.spec.js", 12 | "**/*.spec.jsx", 13 | "**/*.d.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/library/lib/add-jest.ts: -------------------------------------------------------------------------------- 1 | import { ensurePackage, NX_VERSION, Tree } from '@nx/devkit'; 2 | import { NormalizedSchema } from '../schema'; 3 | 4 | export async function addJest(host: Tree, options: NormalizedSchema) { 5 | if (options.unitTestRunner !== 'jest') { 6 | return () => {}; // eslint-disable-line @typescript-eslint/no-empty-function 7 | } 8 | 9 | const { jestProjectGenerator } = ensurePackage( 10 | '@nx/jest', 11 | NX_VERSION 12 | ); 13 | 14 | return await jestProjectGenerator(host, { 15 | project: options.name, 16 | supportTsx: false, 17 | skipSerializers: true, 18 | setupFile: 'none', 19 | babelJest: false, 20 | }); 21 | } 22 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/library/lib/add-project.ts: -------------------------------------------------------------------------------- 1 | import { NormalizedSchema } from '../schema'; 2 | import { addProjectConfiguration, Tree } from '@nx/devkit'; 3 | import { createLintAndCheckTargets } from '../../utils/targets'; 4 | 5 | export function addProject(tree: Tree, options: NormalizedSchema) { 6 | const targets = createLintAndCheckTargets(options); 7 | 8 | addProjectConfiguration(tree, options.name, { 9 | root: options.projectRoot, 10 | sourceRoot: `${options.projectRoot}/src`, 11 | projectType: 'library', 12 | tags: options.parsedTags, 13 | targets, 14 | }); 15 | } 16 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/library/schema.d.ts: -------------------------------------------------------------------------------- 1 | import { Linter } from '@nx/eslint'; 2 | 3 | export interface SvelteLibrarySchema { 4 | directory: string; 5 | name?: string; 6 | tags?: string; 7 | linter: Linter; 8 | unitTestRunner: 'jest' | 'vitest' | 'none'; 9 | e2eTestRunner: 'cypress' | 'none'; 10 | buildable?: boolean; 11 | publishable?: boolean; 12 | importPath?: string; 13 | skipFormat: boolean; 14 | simpleName?: boolean; 15 | } 16 | 17 | export interface NormalizedSchema extends SvelteLibrarySchema { 18 | projectRoot: string; 19 | projectDirectory: string; 20 | fileName: string; 21 | parsedTags: string[]; 22 | importPath: string; 23 | } 24 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/storybook-configuration/lib/update-main-js.ts: -------------------------------------------------------------------------------- 1 | import { readProjectConfiguration, Tree } from '@nx/devkit'; 2 | import { StorybookConfigureSchema } from '../schema'; 3 | 4 | export function updateMainJs(host: Tree, options: StorybookConfigureSchema) { 5 | const config = readProjectConfiguration(host, options.name); 6 | const mainJsFilePath = `${config.root}/.storybook/main.js`; 7 | const content = host.read(mainJsFilePath, 'utf-8'); 8 | const changedContend = content.replace(/src\/lib/gi, 'src/components'); 9 | host.write(mainJsFilePath, changedContend); 10 | } 11 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/storybook-configuration/schema.d.ts: -------------------------------------------------------------------------------- 1 | import { Linter } from '@nx/eslint'; 2 | 3 | export interface StorybookConfigureSchema { 4 | name: string; 5 | linter?: Linter; 6 | js?: boolean; 7 | standaloneConfig?: boolean; 8 | tsConfiguration?: boolean; 9 | interactionTests?: boolean; 10 | } 11 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/utils/add-plugin-to-nx-json.ts: -------------------------------------------------------------------------------- 1 | import { Tree, writeJson, readNxJson } from '@nx/devkit'; 2 | 3 | export function addPluginToNxJson(pluginName: string, tree: Tree) { 4 | const nxJson = readNxJson(tree); 5 | nxJson.plugins = nxJson.plugins || []; 6 | if (!nxJson.plugins.includes(pluginName)) { 7 | nxJson.plugins.push(pluginName); 8 | } 9 | 10 | writeJson(tree, 'nx.json', nxJson); 11 | } 12 | -------------------------------------------------------------------------------- /packages/svelte/src/generators/utils/versions.ts: -------------------------------------------------------------------------------- 1 | export const svelteVersion = '^4.2.12'; 2 | export const svelteJesterVersion = '^2.3.2'; 3 | export const svelteCheckVersion = '^2.10.2'; 4 | export const svelteLoaderVersion = '^3.1.9'; 5 | export const sveltePreprocessVersion = '^5.1.3'; 6 | export const eslintPluginSvelteVersion = '^4.0.0'; 7 | export const tsconfigSvelteVersion = '^4.0.1'; 8 | export const testingLibrarySvelteVersion = '^3.2.2'; 9 | export const vitePluginSvelteVersion = '^1.0.1'; 10 | -------------------------------------------------------------------------------- /packages/svelte/src/index.ts: -------------------------------------------------------------------------------- 1 | export { libraryGenerator } from './generators/library/library'; 2 | export { applicationGenerator } from './generators/application/application'; 3 | export { componentGenerator } from './generators/component/component'; 4 | export { processProjectGraph } from './graph/processProjectGraph'; 5 | -------------------------------------------------------------------------------- /packages/svelte/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "./tsconfig.lib.json" 8 | }, 9 | { 10 | "path": "./tsconfig.spec.json" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /packages/svelte/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | "outDir": "../../dist/out-tsc", 6 | "declaration": true, 7 | "types": ["node"] 8 | }, 9 | "exclude": ["**/*.spec.ts", "jest.config.ts"], 10 | "include": ["**/*.ts"] 11 | } 12 | -------------------------------------------------------------------------------- /packages/svelte/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 | "**/*.spec.ts", 10 | "**/*.spec.tsx", 11 | "**/*.spec.js", 12 | "**/*.spec.jsx", 13 | "**/*.d.ts", 14 | "jest.config.ts" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /packages/sveltekit/builders.json: -------------------------------------------------------------------------------- 1 | { 2 | "executors": { 3 | "dev": { 4 | "implementation": "./src/executors/dev/executor", 5 | "schema": "./src/executors/dev/schema.json", 6 | "description": "dev executor" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/sveltekit/executors.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema", 3 | "executors": { 4 | "add": { 5 | "implementation": "./src/executors/add/executor", 6 | "schema": "./src/executors/add/schema.json", 7 | "description": "add executor" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/sveltekit/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'sveltekit', 4 | 5 | globals: {}, 6 | transform: { 7 | '^.+\\.[tj]sx?$': [ 8 | 'ts-jest', 9 | { 10 | tsconfig: '/tsconfig.spec.json', 11 | }, 12 | ], 13 | }, 14 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], 15 | coverageDirectory: '../../coverage/packages/sveltekit', 16 | testEnvironment: 'node', 17 | preset: '../../jest.preset.js', 18 | }; 19 | -------------------------------------------------------------------------------- /packages/sveltekit/src/executors/add/schema.d.ts: -------------------------------------------------------------------------------- 1 | export interface AddExecutorSchema { 2 | package: string; 3 | } 4 | -------------------------------------------------------------------------------- /packages/sveltekit/src/executors/add/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "outputCapture": "direct-nodejs", 4 | "$schema": "http://json-schema.org/schema", 5 | "title": "Add executor", 6 | "description": "", 7 | "type": "object", 8 | "properties": { 9 | "package": { 10 | "description": "Package you want to install", 11 | "type": "string", 12 | "enum": [ 13 | "tailwindcss", 14 | "mdsvex", 15 | "graphql", 16 | "postcss", 17 | "picocss", 18 | "bulma", 19 | "windicss", 20 | "firebase-hosting" 21 | ] 22 | } 23 | }, 24 | "required": ["package"] 25 | } 26 | -------------------------------------------------------------------------------- /packages/sveltekit/src/executors/sveltekit/schema.d.ts: -------------------------------------------------------------------------------- 1 | export interface SveltekitExecutorOptions { 2 | command: string; 3 | port?: number; 4 | } 5 | -------------------------------------------------------------------------------- /packages/sveltekit/src/executors/sveltekit/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "outputCapture": "direct-nodejs", 4 | "$schema": "http://json-schema.org/schema", 5 | "title": "Dev executor", 6 | "description": "", 7 | "type": "object", 8 | "properties": { 9 | "command": { 10 | "type": "string", 11 | "description": "Sveltekit command to run" 12 | }, 13 | "port": { 14 | "type": "number", 15 | "description": "Port to listen on.", 16 | "default": 3000 17 | } 18 | }, 19 | "required": ["command"] 20 | } 21 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/application/files/app.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxext/nx-extensions/b394bd93c2a76d561fef468c4d9aaf3c7f85e0f8/packages/sveltekit/src/generators/application/files/app.css -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/application/files/package.json__template__: -------------------------------------------------------------------------------- 1 | { 2 | "name": "<%= fileName %>", 3 | "version": "0.0.1", 4 | "type": "module", 5 | "license": "MIT", 6 | "devDependencies": { 7 | "svelte": "<%= offsetFromRoot %>node_modules/svelte" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/application/files/src/app.d.ts__template__: -------------------------------------------------------------------------------- 1 | // See https://kit.svelte.dev/docs/types#app 2 | // for information about these interfaces 3 | // and what to do when importing types 4 | declare namespace App { 5 | // interface Error {} 6 | // interface Locals {} 7 | // interface PageData {} 8 | // interface Platform {} 9 | } 10 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/application/files/src/app.html__template__: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %sveltekit.head% 8 | 9 | 10 |
%sveltekit.body%
11 | 12 | 13 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/application/files/src/index.test.ts__template__: -------------------------------------------------------------------------------- 1 | import { describe, it, expect } from 'vitest'; 2 | 3 | describe('sum test', () => { 4 | it('adds 1 + 2 to equal 3', () => { 5 | expect(1 + 2).toBe(3); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/application/files/src/routes/+layout.svelte.__template: -------------------------------------------------------------------------------- 1 | 4 | 5 | 12 | 13 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/application/files/src/routes/+page.svelte__template__: -------------------------------------------------------------------------------- 1 | 2 |

Welcome to SvelteKit

3 |

Visit kit.svelte.dev to read the documentation

4 |
5 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/application/files/static/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/application/files/tsconfig.app.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | 4 | "compilerOptions": { 5 | "outDir": "<%= offsetFromRoot %>dist/out-tsc", 6 | }, 7 | 8 | "include": ["src/**/*"], 9 | "exclude": ["**/*.spec.ts", "**/*_spec.ts"], 10 | } 11 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/application/files/tsconfig.spec.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "<%= offsetFromRoot %>dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["vitest/globals", "vitest/importMeta", "vite/client", "node"] 7 | }, 8 | "include": [ 9 | "**/*.spec.ts", 10 | "**/*.spec.js", 11 | "**/*.d.ts" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/application/lib/add-project-files.ts: -------------------------------------------------------------------------------- 1 | import { generateFiles, names, offsetFromRoot, Tree } from '@nx/devkit'; 2 | import { NormalizedSchema } from '../schema'; 3 | import * as path from 'path'; 4 | 5 | export function addFiles(host: Tree, options: NormalizedSchema) { 6 | const templateOptions = { 7 | ...options, 8 | ...names(options.name), 9 | offsetFromRoot: offsetFromRoot(options.projectRoot), 10 | template: '', 11 | }; 12 | try { 13 | generateFiles( 14 | host, 15 | path.join(__dirname, '../files'), 16 | options.projectRoot, 17 | templateOptions 18 | ); 19 | } catch (e) { 20 | throw new Error(e); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/application/lib/add-vite.ts: -------------------------------------------------------------------------------- 1 | import { ensurePackage, NX_VERSION, Tree } from '@nx/devkit'; 2 | import { NormalizedSchema } from '../schema'; 3 | import { ViteConfigurationGeneratorSchema } from '@nx/vite'; 4 | 5 | export async function addVite(host: Tree, options: NormalizedSchema) { 6 | await ensurePackage('@nx/vite', NX_VERSION); 7 | const { viteConfigurationGenerator } = await import('@nx/vite'); 8 | 9 | const config: ViteConfigurationGeneratorSchema = { 10 | uiFramework: 'none', 11 | project: options.name, 12 | newProject: true, 13 | includeVitest: options.unitTestRunner === 'vitest', 14 | inSourceTests: false, 15 | }; 16 | 17 | return await viteConfigurationGenerator(host, config); 18 | } 19 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/application/lib/install-dependencies.ts: -------------------------------------------------------------------------------- 1 | import { addDependenciesToPackageJson, Tree } from '@nx/devkit'; 2 | import { 3 | svelteKitAdapterVersion, 4 | svelteKitVersion, 5 | svelteVersion, 6 | } from '../../utils/versions'; 7 | import { SveltekitGeneratorSchema } from '../schema'; 8 | 9 | export function installDependencies( 10 | host: Tree, 11 | options: SveltekitGeneratorSchema 12 | ) { 13 | return addDependenciesToPackageJson( 14 | host, 15 | {}, 16 | { 17 | '@sveltejs/adapter-auto': 18 | options.adapterVersion || svelteKitAdapterVersion, 19 | '@sveltejs/kit': options.svelteKitVersion || svelteKitVersion, 20 | svelte: options.svelteVersion || svelteVersion, 21 | } 22 | ); 23 | } 24 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/application/lib/targets.ts: -------------------------------------------------------------------------------- 1 | import { TargetConfiguration } from '@nx/devkit'; 2 | import { NormalizedSchema } from '../schema'; 3 | 4 | export function createSvelteCheckTarget( 5 | options: NormalizedSchema 6 | ): TargetConfiguration { 7 | return { 8 | executor: 'nx:run-commands', 9 | options: { 10 | command: 'svelte-check', 11 | cwd: options.projectRoot, 12 | }, 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/application/schema.d.ts: -------------------------------------------------------------------------------- 1 | import { Linter } from '@nx/eslint'; 2 | 3 | export interface SveltekitGeneratorSchema { 4 | name: string; 5 | unitTestRunner: 'none' | 'vitest'; 6 | tags?: string; 7 | directory?: string; 8 | port?: number; 9 | skipFormat: boolean; 10 | linter: Linter; 11 | skipPackageJson?: boolean; 12 | adapterVersion?: string; 13 | svelteVersion?: string; 14 | svelteKitVersion?: string; 15 | } 16 | 17 | export interface NormalizedSchema extends SveltekitGeneratorSchema { 18 | projectName: string; 19 | projectRoot: string; 20 | projectDirectory: string; 21 | distDir: string; 22 | parsedTags: string[]; 23 | } 24 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/component/files/src/lib/__fileName__/__className__.svelte.template: -------------------------------------------------------------------------------- 1 | 3 | 4 | 6 | 7 |

Hello component!

8 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/component/files/src/lib/__fileName__/__fileName__.spec.ts.template: -------------------------------------------------------------------------------- 1 | import <%= fileName %> from './<%= fileName %>.svelte' 2 | import { render } from '@testing-library/svelte' 3 | 4 | it('it works', async () => { 5 | const { getByText } = render(<%= fileName %>) 6 | 7 | expect(getByText('Hello component!')); 8 | }) 9 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/component/lib/create-component-in-project.ts: -------------------------------------------------------------------------------- 1 | import { 2 | generateFiles, 3 | joinPathFragments, 4 | names, 5 | readProjectConfiguration, 6 | Tree, 7 | } from '@nx/devkit'; 8 | import { SvelteComponentSchema } from '../component'; 9 | 10 | export function createComponentInProject( 11 | tree: Tree, 12 | options: SvelteComponentSchema 13 | ) { 14 | const projectConfig = readProjectConfiguration(tree, options.project); 15 | const projectDirectory = options.directory ?? ''; 16 | 17 | generateFiles( 18 | tree, 19 | joinPathFragments(__dirname, '../files/src'), 20 | joinPathFragments(`${projectConfig.sourceRoot}/${projectDirectory}`), 21 | names(options.name) 22 | ); 23 | } 24 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/library/files/src/__fileName__.spec.ts.template: -------------------------------------------------------------------------------- 1 | import <%= fileName %> from './<%= fileName %>.svelte' 2 | import { render } from '@testing-library/svelte' 3 | 4 | it('it works', async () => { 5 | const { getByText } = render(<%= fileName %>) 6 | 7 | expect(getByText('Hello component!')); 8 | }) 9 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/library/files/src/__fileName__.ts.template: -------------------------------------------------------------------------------- 1 | export const <%= name %> -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/library/lib/create-library-in-project.ts: -------------------------------------------------------------------------------- 1 | import { 2 | generateFiles, 3 | joinPathFragments, 4 | names, 5 | readProjectConfiguration, 6 | Tree, 7 | } from '@nx/devkit'; 8 | import { SvelteLibrarySchema } from '../library'; 9 | 10 | export function createLibInProject(tree: Tree, options: SvelteLibrarySchema) { 11 | const projectConfig = readProjectConfiguration(tree, options.project); 12 | const projectDirectory = options.directory ?? ''; 13 | 14 | generateFiles( 15 | tree, 16 | joinPathFragments(__dirname, '../files/src'), 17 | joinPathFragments(`${projectConfig.sourceRoot}/${projectDirectory}`), 18 | names(options.name) 19 | ); 20 | } 21 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/library/schema.d.ts: -------------------------------------------------------------------------------- 1 | export interface SvelteLibrarySchema { 2 | name: string; 3 | tags?: string; 4 | unitTestRunner: 'jest' | 'vitest' | 'none'; 5 | directory?: string; 6 | skipFormat: boolean; 7 | } 8 | 9 | export interface NormalizedSchema extends SvelteLibrarySchema { 10 | projectRoot: string; 11 | projectDirectory: string; 12 | fileName: string; 13 | parsedTags: string[]; 14 | importPath: string; 15 | } 16 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/route/files/src/api/__fileName__/__fileName__-server.spec.ts.template: -------------------------------------------------------------------------------- 1 | import * as api from './+page' 2 | 3 | describe('<%= name %> loader', () => { 4 | it('it works', async () => { 5 | const data = await api.load() 6 | expect(data).toEqual({}) 7 | }) 8 | }) 9 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/route/files/src/error/__fileName__/+error.svelte: -------------------------------------------------------------------------------- 1 | 4 | 5 |

Yikes!

6 | 7 |

Something went horribly wrong!

8 | 9 |
10 |     {JSON.stringify($page, null, 2)}
11 | 
-------------------------------------------------------------------------------- /packages/sveltekit/src/generators/route/files/src/layout/client/__fileName__/+layout.ts.template: -------------------------------------------------------------------------------- 1 | import { error } from '@sveltejs/kit' 2 | import type { LayoutLoad } from './$types'; 3 | 4 | export const load: LayoutLoad = async (event) => { 5 | return {} 6 | }; 7 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/route/files/src/layout/client/__fileName__/__fileName__-loader.spec.ts.template: -------------------------------------------------------------------------------- 1 | import * as loader from './+layout' 2 | 3 | describe('<%= name %> loader', () => { 4 | it('it works', async () => { 5 | const data = await api.load() 6 | expect(data).toEqual({}) 7 | }) 8 | }) 9 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/route/files/src/layout/page/__fileName__/+layout.svelte.__template: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/route/files/src/layout/page/__fileName__/__fileName__.spec.ts.template: -------------------------------------------------------------------------------- 1 | import <%= fileName %> from './+page.svelte' 2 | import { render } from '@testing-library/svelte' 3 | 4 | it('it works', async () => { 5 | const { getByText } = render(<%= fileName %>) 6 | 7 | expect(getByText('Hello component!')); 8 | }) 9 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/route/files/src/layout/server/__fileName__/+layout.server.ts.template: -------------------------------------------------------------------------------- 1 | import { error } from '@sveltejs/kit' 2 | import type { LayoutServerLoad } from './$types'; 3 | 4 | export const load: LayoutServerLoad = async (event) => { 5 | return {} 6 | }; 7 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/route/files/src/layout/server/__fileName__/__fileName__-loader.spec.ts.template: -------------------------------------------------------------------------------- 1 | import * as loader from './+layout.server' 2 | 3 | describe('<%= name %> loader', () => { 4 | it('it works', async () => { 5 | const data = await api.load() 6 | expect(data).toEqual({}) 7 | }) 8 | }) 9 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/route/files/src/page/client/__fileName__/+page.ts.template: -------------------------------------------------------------------------------- 1 | import type { PageLoad } from './$types'; 2 | 3 | export const load: PageLoad = async () => { 4 | return {} 5 | }; 6 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/route/files/src/page/client/__fileName__/__fileName__-loader.spec.ts.template: -------------------------------------------------------------------------------- 1 | import * as api from './+page' 2 | 3 | describe('<%= name %> loader', () => { 4 | it('it works', async () => { 5 | const data = await api.load() 6 | expect(data).toEqual({}) 7 | }) 8 | }) 9 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/route/files/src/page/page/__fileName__/+page.svelte.template: -------------------------------------------------------------------------------- 1 | 7 | 8 | <% if (layout) { %> 9 | 10 | <% } %> 11 |

<%= name %>

12 | 13 |
14 |     {JSON.stringify($page, null, 2)}
15 | 
16 | <% if (layout) { %> 17 |
18 | <% } %> -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/route/files/src/page/page/__fileName__/__fileName__.spec.ts.template: -------------------------------------------------------------------------------- 1 | import <%= fileName %> from './+page.svelte' 2 | import { render } from '@testing-library/svelte' 3 | 4 | it('it works', async () => { 5 | const { getByText } = render(<%= fileName %>) 6 | 7 | expect(getByText('Hello component!')); 8 | }) 9 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/route/files/src/page/server/__fileName__/+page.server.ts.template: -------------------------------------------------------------------------------- 1 | import { error } from '@sveltejs/kit' 2 | import type { PageServerLoad } from './$types'; 3 | 4 | export const load: PageServerLoad = async (event) => { 5 | return {} 6 | }; 7 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/route/files/src/page/server/__fileName__/__fileName__-loader.spec.ts.template: -------------------------------------------------------------------------------- 1 | import * as loader from './+page.server' 2 | 3 | describe('<%= name %> loader', () => { 4 | it('it works', async () => { 5 | const data = await api.load() 6 | expect(data).toEqual({}) 7 | }) 8 | }) 9 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/utils/lint.ts: -------------------------------------------------------------------------------- 1 | import { eslintPluginSvelteVersion } from './versions'; 2 | 3 | export const extraEslintDependencies = { 4 | dependencies: {}, 5 | devDependencies: { 6 | 'eslint-plugin-svelte': eslintPluginSvelteVersion, 7 | }, 8 | }; 9 | -------------------------------------------------------------------------------- /packages/sveltekit/src/generators/utils/versions.ts: -------------------------------------------------------------------------------- 1 | export const eslintPluginSvelteVersion = '^2.35.0'; 2 | export const svelteVersion = '^4.2.0'; 3 | export const svelteKitVersion = '^2.5.0'; 4 | export const svelteKitAdapterVersion = '^3.2.0'; 5 | -------------------------------------------------------------------------------- /packages/sveltekit/src/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nxext/nx-extensions/b394bd93c2a76d561fef468c4d9aaf3c7f85e0f8/packages/sveltekit/src/index.ts -------------------------------------------------------------------------------- /packages/sveltekit/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "./tsconfig.lib.json" 8 | }, 9 | { 10 | "path": "./tsconfig.spec.json" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /packages/sveltekit/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | "outDir": "../../dist/out-tsc", 6 | "declaration": true, 7 | "types": ["node"] 8 | }, 9 | "exclude": ["**/*.spec.ts", "jest.config.ts"], 10 | "include": ["**/*.ts"] 11 | } 12 | -------------------------------------------------------------------------------- /packages/sveltekit/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 | "**/*.spec.ts", 10 | "**/*.spec.tsx", 11 | "**/*.spec.js", 12 | "**/*.spec.jsx", 13 | "**/*.d.ts", 14 | "jest.config.ts" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nxext", 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 | "config": ".verdaccio/config.yml", 10 | "storage": "tmp/local-registry/storage" 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tools/scripts/notify-lockfile-changes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Originally from the Nx repo: https://github.com/nrwl/nx 3 | */ 4 | 5 | if (process.argv.slice(2).some((arg) => arg.includes('pnpm-lock.yaml'))) { 6 | console.warn( 7 | [ 8 | '⚠️ ----------------------------------------------------------------------------------------- ⚠️', 9 | '⚠️ pnpm-lock.yaml changed, please run `pnpm install` to ensure your packages are up to date. ⚠️', 10 | '⚠️ ----------------------------------------------------------------------------------------- ⚠️', 11 | ].join('\n') 12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /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 | if (global.stopLocalRegistry) { 8 | global.stopLocalRegistry(); 9 | } 10 | }; 11 | -------------------------------------------------------------------------------- /tools/scripts/tsconfig.scripts.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../scripts/tools-out", 5 | "module": "commonjs", 6 | "types": ["node"] 7 | }, 8 | "include": ["**/*.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /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 | --------------------------------------------------------------------------------