├── .eslintignore ├── .gitattributes ├── .prettierignore ├── angular ├── devkit │ ├── preview │ │ ├── preview-app │ │ │ ├── index.ts │ │ │ └── preview-app │ │ │ │ ├── src │ │ │ │ ├── assets │ │ │ │ │ └── .gitkeep │ │ │ │ ├── styles.scss │ │ │ │ ├── app │ │ │ │ │ ├── global.d.ts │ │ │ │ │ ├── app.component.ts │ │ │ │ │ ├── docs │ │ │ │ │ │ └── safe-html.pipe.ts │ │ │ │ │ └── app.module.ts │ │ │ │ ├── index.html │ │ │ │ ├── main.ts │ │ │ │ └── test.ts │ │ │ │ └── favicon.ico │ │ ├── preview │ │ │ ├── index.ts │ │ │ ├── mounter.ts │ │ │ ├── types.d.ts │ │ │ └── docs.ts │ │ ├── vite-preview │ │ │ ├── index.ts │ │ │ ├── mounter.ts │ │ │ ├── types.d.ts │ │ │ ├── component.json │ │ │ └── docs.ts │ │ ├── mounter │ │ │ ├── index.ts │ │ │ └── mounter.ts │ │ └── runtime │ │ │ ├── index.ts │ │ │ └── main.ts │ ├── linter │ │ └── eslint │ │ │ ├── index.js │ │ │ ├── bit-angular-eslint.docs.md │ │ │ └── eslintrc.js │ ├── ng-compat │ │ ├── build-angular │ │ │ ├── webpack │ │ │ │ ├── index.ts │ │ │ │ ├── configs.ts │ │ │ │ └── stats.ts │ │ │ ├── builder-options.ts │ │ │ ├── utils │ │ │ │ ├── normalize-cache.ts │ │ │ │ ├── package-chunk-sort.ts │ │ │ │ └── index.ts │ │ │ ├── index-html-webpack-plugin.ts │ │ │ └── builders │ │ │ │ └── application.ts │ │ └── index.ts │ ├── compiler │ │ ├── elements │ │ │ ├── index.ts │ │ │ ├── rollup │ │ │ │ ├── ngc-plugin │ │ │ │ │ ├── resolver.ts │ │ │ │ │ └── compile.ts │ │ │ │ └── utils │ │ │ │ │ ├── fs.ts │ │ │ │ │ └── path.ts │ │ │ └── preview │ │ │ │ └── mount.tsx │ │ ├── multi-compiler │ │ │ ├── index.ts │ │ │ ├── ng-multi-compiler.docs.md │ │ │ ├── config │ │ │ │ └── tsconfig.json │ │ │ └── ng-multi-compiler.task.ts │ │ └── ng-packagr │ │ │ ├── ng-packagr.docs.md │ │ │ ├── index.ts │ │ │ └── component.json │ ├── vite │ │ ├── index.ts │ │ ├── runtime │ │ │ ├── renderer.js │ │ │ └── api-middleware.js │ │ ├── utils │ │ │ └── types.ts │ │ ├── component.json │ │ └── plugins │ │ │ ├── define.plugin.ts │ │ │ └── md.plugin.ts │ ├── common │ │ ├── index.ts │ │ ├── templates.ts │ │ ├── component.json │ │ └── env-options.ts │ └── webpack │ │ ├── index.ts │ │ ├── webpack-plugins │ │ ├── utils.ts │ │ └── stats-logger.ts │ │ ├── utils.ts │ │ └── component.json ├── integration │ ├── demo-app │ │ ├── src │ │ │ ├── assets │ │ │ │ ├── .gitkeep │ │ │ │ └── favicon.ico │ │ │ ├── app │ │ │ │ ├── app.component.scss │ │ │ │ ├── app.routes.ts │ │ │ │ ├── app.routes.server.ts │ │ │ │ ├── app.module.ts │ │ │ │ ├── app.component.ts │ │ │ │ ├── app.config.ts │ │ │ │ ├── app.config.server.ts │ │ │ │ └── app.component.spec.ts │ │ │ ├── environments │ │ │ │ ├── environment.prod.ts │ │ │ │ └── environment.ts │ │ │ ├── styles.scss │ │ │ ├── main.server.ts │ │ │ ├── index.html │ │ │ └── main.ts │ │ ├── index.ts │ │ └── demo-app.docs.md │ ├── demo-lib-v17 │ │ ├── bit-test.component.scss │ │ ├── bit-test.service.ts │ │ ├── public-api.ts │ │ ├── bit-test2.component.ts │ │ ├── bit-test.module.ts │ │ ├── bit-test.component.ts │ │ ├── compositions │ │ │ ├── cmp1.composition.ts │ │ │ └── bit-test.composition.ts │ │ ├── bit-test.docs.md │ │ └── bit-test.spec.ts │ ├── demo-lib-v18 │ │ ├── bit-test.component.scss │ │ ├── bit-test.service.ts │ │ ├── public-api.ts │ │ ├── bit-test2.component.ts │ │ ├── bit-test.module.ts │ │ ├── bit-test.component.ts │ │ ├── compositions │ │ │ ├── cmp1.composition.ts │ │ │ └── bit-test.composition.ts │ │ ├── demo-lib-v18.docs.md │ │ └── bit-test.spec.ts │ ├── demo-lib-v19 │ │ ├── bit-test.component.scss │ │ ├── bit-test.service.ts │ │ ├── public-api.ts │ │ ├── bit-test2.component.ts │ │ ├── bit-test3.component.ts │ │ ├── bit-test.module.ts │ │ ├── bit-test.component.ts │ │ ├── compositions │ │ │ ├── bit-test.composition.ts │ │ │ └── cmp1.composition.ts │ │ ├── bit-test.docs.md │ │ └── bit-test.spec.ts │ ├── demo-lib │ │ ├── src │ │ │ ├── bit-test.component.scss │ │ │ ├── bit-test.service.ts │ │ │ ├── bit-test2.component.ts │ │ │ ├── bit-test3.component.ts │ │ │ ├── bit-test.module.ts │ │ │ ├── bit-test.component.ts │ │ │ ├── compositions │ │ │ │ ├── bit-test.composition.ts │ │ │ │ └── cmp1.composition.ts │ │ │ ├── bit-test.docs.md │ │ │ └── bit-test.spec.ts │ │ └── public-api.ts │ ├── demo-elements │ │ ├── demo-elements.component.scss │ │ ├── demo-elements.composition.ts │ │ ├── demo-elements.component.ts │ │ ├── demo-elements.spec.ts │ │ ├── demo-elements.docs.md │ │ └── demo-elements.ng-elements.ts │ ├── my-react-app │ │ ├── index.ts │ │ ├── vite.config.js │ │ ├── my-react-app.composition.tsx │ │ ├── my-react-app.tsx │ │ ├── my-react-app.docs.mdx │ │ ├── index.html │ │ ├── server.app-root.tsx │ │ └── my-react-app.app-root.tsx │ └── demo-lib-v16 │ │ ├── bit-test.service.ts │ │ ├── public-api.ts │ │ ├── bit-test2.component.ts │ │ ├── bit-test.module.ts │ │ ├── bit-test.component.ts │ │ ├── compositions │ │ ├── cmp1.composition.ts │ │ └── bit-test.composition.ts │ │ ├── bit-test.docs.md │ │ └── bit-test.spec.ts ├── docs │ ├── component-libs │ │ ├── component-libs.mdx │ │ ├── index.ts │ │ ├── component-libs.composition.tsx │ │ └── component-libs.docs.mdx │ ├── ng-app-build │ │ ├── index.ts │ │ ├── app-build.composition.tsx │ │ └── app-build.docs.mdx │ ├── ng-theming │ │ ├── index.ts │ │ ├── ng-theming.composition.tsx │ │ ├── code-snippets │ │ │ ├── my-base-theme-index.mdx │ │ │ ├── my-dark-theme-index.mdx │ │ │ ├── composition-provider-mounter.mdx │ │ │ ├── my-base-theme-module.mdx │ │ │ ├── composition-provider-wrapper.mdx │ │ │ ├── my-dark-theme-module.mdx │ │ │ └── composition-provider-env.mdx │ │ ├── ng-theming.docs.mdx │ │ └── commands.tsx │ ├── ng-app-deploy │ │ ├── index.ts │ │ ├── app-deployment.module.scss │ │ ├── app-deploy.composition.tsx │ │ ├── app-deploy.docs.mdx │ │ ├── deploy-examples.tsx │ │ └── netlify.mdx │ ├── angular-env-docs-data │ │ ├── index.ts │ │ └── angular-env-docs-data.docs.mdx │ ├── create-ng-app │ │ ├── index.ts │ │ ├── my-angular-app-files │ │ │ ├── index.ts │ │ │ ├── my-angular-app.docs-md.ts │ │ │ └── my-angular-app.ng-app.ts │ │ ├── create-ng-app.composition.tsx │ │ ├── create-ng-app.docs.mdx │ │ └── bubble-graphs.tsx │ ├── angular-docs-routes │ │ ├── index.ts │ │ └── angular-docs-routes.docs.mdx │ ├── angular-versions │ │ ├── index.ts │ │ ├── angular-versions.composition.tsx │ │ └── angular-versions.docs.mdx │ ├── create-custom-env │ │ ├── index.ts │ │ ├── create-custom-env.composition.tsx │ │ └── create-custom-env.docs.mdx │ ├── dependency-policy │ │ ├── index.ts │ │ ├── dependency-policy.composition.tsx │ │ └── dependency-policy.docs.mdx │ ├── development-tools │ │ ├── index.ts │ │ ├── development-tools.composition.tsx │ │ └── development-tools.docs.mdx │ ├── ng-base-components │ │ ├── index.ts │ │ ├── code-snippets │ │ │ ├── css │ │ │ │ ├── my-button-style-css-vars.mdx │ │ │ │ ├── app-main-style-css-vars.mdx │ │ │ │ └── my-base-theme-module-css-vars.mdx │ │ │ ├── scss │ │ │ │ ├── app-main-style-scss-vars.mdx │ │ │ │ ├── my-base-theme-module-scss-vars.mdx │ │ │ │ └── my-button-style-scss-vars.mdx │ │ │ └── js │ │ │ │ ├── my-base-theme-module-js-vars.mdx │ │ │ │ ├── my-theme-provider-js-vars.mdx │ │ │ │ ├── my-button-component-js-vars.mdx │ │ │ │ └── app-main-module-js-vars.mdx │ │ ├── base-components.composition.tsx │ │ ├── commands.tsx │ │ └── base-components.docs.mdx │ ├── components-preview │ │ ├── index.ts │ │ ├── components-preview.composition.tsx │ │ ├── snippets │ │ │ ├── composition-provider-mounter.mdx │ │ │ ├── composition-provider-mounter2.mdx │ │ │ ├── composition-mounter-mounter.mdx │ │ │ ├── composition-provider-wrapper.mdx │ │ │ ├── composition-mounter-env.mdx │ │ │ ├── composition-provider-env.mdx │ │ │ └── composition-provider-wrapper2.mdx │ │ └── components-preview.docs.mdx │ ├── ng-design-overview │ │ ├── index.ts │ │ ├── images │ │ │ └── example-modes.jpg │ │ ├── ng-design-overview.composition.tsx │ │ └── ng-design-overview.docs.mdx │ ├── workspace-starters │ │ ├── index.ts │ │ ├── workspace-starters.composition.tsx │ │ └── workspace-starters.docs.mdx │ ├── component-generators │ │ ├── index.ts │ │ ├── component-generators.composition.tsx │ │ └── component-generators.docs.mdx │ ├── components-overview │ │ ├── index.ts │ │ ├── components-overview.composition.tsx │ │ ├── commands.tsx │ │ └── components-overview.docs.mdx │ ├── ng-component-libraries │ │ ├── index.ts │ │ ├── ng-component-libraries.docs.mdx │ │ ├── ng-component-libraries.module.scss │ │ ├── ng-component-libraries.composition.tsx │ │ └── commands.tsx │ ├── bit-angular-introduction │ │ ├── index.ts │ │ ├── bit-angular-introduction.composition.tsx │ │ ├── bit-angular-introduction.docs.mdx │ │ └── commands.tsx │ ├── components-documentation │ │ ├── index.ts │ │ ├── components-documentation.composition.tsx │ │ └── components-documentation.docs.mdx │ └── build-pipelines │ │ ├── index.ts │ │ ├── build-pipelines.composition.tsx │ │ ├── build-pipelines-template.mdx │ │ ├── code-snippets │ │ ├── add-task-build.mdx │ │ ├── jest-build-task.mdx │ │ ├── jest-service.mdx │ │ ├── add-task-snap.mdx │ │ ├── add-task-tag.mdx │ │ └── add-replace-task-build.mdx │ │ └── build-pipelines.docs.mdx ├── readme │ ├── index.ts │ ├── readme.docs.mdx │ └── readme.composition.tsx ├── envs │ ├── angular-v16-env │ │ ├── index.ts │ │ ├── jest │ │ │ ├── jest.config.d.ts │ │ │ ├── tsconfig.spec.json │ │ │ └── jest-global-mocks.ts │ │ └── config │ │ │ └── mounter.ts │ ├── angular-v17-env │ │ ├── index.ts │ │ └── jest │ │ │ ├── jest.config.d.ts │ │ │ ├── tsconfig.spec.json │ │ │ └── jest-global-mocks.ts │ ├── angular-v18-env │ │ ├── index.ts │ │ └── jest │ │ │ ├── jest.config.d.ts │ │ │ ├── tsconfig.spec.json │ │ │ └── jest-global-mocks.ts │ ├── angular-v19-env │ │ ├── index.ts │ │ └── jest │ │ │ ├── jest.config.d.ts │ │ │ ├── setup-jest.cjs │ │ │ ├── tsconfig.spec.json │ │ │ ├── jest-global-mocks.ts │ │ │ └── jest.config.cjs │ ├── base-env │ │ ├── config │ │ │ ├── prettier.config.d.ts │ │ │ ├── prettier.config.cjs │ │ │ ├── eslintrc.cjs │ │ │ └── mounter.ts │ │ ├── index.ts │ │ ├── tsconfig.json │ │ ├── angular-base-env.composition.tsx │ │ ├── angular-base-env.docs.md │ │ └── angular-env.interface.ts │ └── angular-env │ │ ├── index.ts │ │ ├── jest │ │ └── jest.config.cjs │ │ ├── angular.bit-env.ts │ │ └── angular.composition.tsx ├── examples │ ├── my-angular-env │ │ ├── index.ts │ │ ├── config │ │ │ ├── eslintrc.cjs │ │ │ ├── tsconfig.json │ │ │ ├── prettier.config.cjs │ │ │ ├── tsconfig.spec.json │ │ │ ├── jest.config.cjs │ │ │ └── mounter.ts │ │ └── component.json │ ├── my-angular-v16-env │ │ ├── index.ts │ │ ├── config │ │ │ ├── eslintrc.cjs │ │ │ ├── tsconfig.json │ │ │ ├── prettier.config.cjs │ │ │ ├── tsconfig.spec.json │ │ │ ├── jest.config.cjs │ │ │ └── mounter.ts │ │ └── component.json │ ├── my-angular-v17-env │ │ ├── index.ts │ │ ├── config │ │ │ ├── eslintrc.cjs │ │ │ ├── tsconfig.json │ │ │ ├── prettier.config.cjs │ │ │ ├── tsconfig.spec.json │ │ │ ├── jest.config.cjs │ │ │ └── mounter.ts │ │ └── component.json │ ├── my-angular-v18-env │ │ ├── index.ts │ │ ├── config │ │ │ ├── eslintrc.cjs │ │ │ ├── tsconfig.json │ │ │ ├── prettier.config.cjs │ │ │ ├── tsconfig.spec.json │ │ │ ├── jest.config.cjs │ │ │ └── mounter.ts │ │ └── component.json │ └── my-angular-v19-env │ │ ├── index.ts │ │ ├── config │ │ ├── eslintrc.cjs │ │ ├── tsconfig.json │ │ ├── prettier.config.cjs │ │ ├── tsconfig.spec.json │ │ ├── jest.config.cjs │ │ └── mounter.ts │ │ └── component.json ├── templates │ ├── starters │ │ ├── constants.ts │ │ └── index.ts │ └── generators │ │ ├── ng-app │ │ └── template-files │ │ │ ├── src │ │ │ ├── assets │ │ │ │ └── gitkeep.ts │ │ │ ├── app │ │ │ │ ├── app.routes.ts │ │ │ │ ├── app.routes.server.ts │ │ │ │ ├── app.config.ts │ │ │ │ ├── app.config.server.ts │ │ │ │ ├── app.component.ts │ │ │ │ └── app.module.ts │ │ │ ├── styles.ts │ │ │ ├── server │ │ │ │ └── api │ │ │ │ │ └── hello.ts │ │ │ ├── index-html.ts │ │ │ ├── main.ts │ │ │ └── main.server.ts │ │ │ └── docs.ts │ │ ├── ng-env │ │ └── files │ │ │ ├── index.ts │ │ │ ├── env-jsonc.ts │ │ │ └── config │ │ │ ├── eslintrc.ts │ │ │ ├── tsconfig.json.ts │ │ │ ├── prettier.config.ts │ │ │ └── tsconfig-spec.json.ts │ │ ├── index.ts │ │ ├── ng-module │ │ └── files │ │ │ ├── component-styles.ts │ │ │ ├── public-api.ts │ │ │ ├── module.ts │ │ │ ├── component.ts │ │ │ ├── composition.ts │ │ │ ├── docs.ts │ │ │ └── component-spec.ts │ │ ├── ng-standalone │ │ └── files │ │ │ ├── component-styles.ts │ │ │ ├── public-api.ts │ │ │ ├── component.ts │ │ │ ├── composition.ts │ │ │ ├── docs.ts │ │ │ └── component-spec.ts │ │ └── ng-elements │ │ └── files │ │ └── docs.ts └── app-types │ └── angular-app-type │ ├── index.ts │ ├── component.json │ └── angular.app-type.ts ├── bit-angular.zip ├── .editorconfig ├── demo-elements.component.css.map └── package.json /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | .bitmap merge=bitmap-driver -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | fixtures 2 | e2e/fixtures -------------------------------------------------------------------------------- /angular/devkit/preview/preview-app/index.ts: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /angular/integration/demo-app/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /angular/docs/component-libs/component-libs.mdx: -------------------------------------------------------------------------------- 1 | # Ng 2 | -------------------------------------------------------------------------------- /angular/integration/demo-app/src/app/app.component.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v17/bit-test.component.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v18/bit-test.component.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v19/bit-test.component.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /angular/integration/demo-lib/src/bit-test.component.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /angular/devkit/preview/preview-app/preview-app/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /angular/integration/demo-app/index.ts: -------------------------------------------------------------------------------- 1 | export * from './demo-app.bit-app'; 2 | -------------------------------------------------------------------------------- /angular/devkit/linter/eslint/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./eslintrc'); 2 | -------------------------------------------------------------------------------- /angular/devkit/preview/preview/index.ts: -------------------------------------------------------------------------------- 1 | export * from './angular-preview.js'; 2 | -------------------------------------------------------------------------------- /angular/readme/index.ts: -------------------------------------------------------------------------------- 1 | export { default as readme, default } from './readme.mdx'; 2 | -------------------------------------------------------------------------------- /bit-angular.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teambit/bit-angular/HEAD/bit-angular.zip -------------------------------------------------------------------------------- /angular/devkit/preview/vite-preview/index.ts: -------------------------------------------------------------------------------- 1 | export * from './angular-vite-preview.js'; 2 | -------------------------------------------------------------------------------- /angular/docs/ng-app-build/index.ts: -------------------------------------------------------------------------------- 1 | export { default as AppBuild, default } from './app-build.mdx'; 2 | -------------------------------------------------------------------------------- /angular/docs/ng-theming/index.ts: -------------------------------------------------------------------------------- 1 | export { default as NgTheming, default } from './ng-theming.mdx'; 2 | -------------------------------------------------------------------------------- /angular/integration/demo-elements/demo-elements.component.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | font-size: inherit; 3 | } -------------------------------------------------------------------------------- /angular/docs/ng-app-deploy/index.ts: -------------------------------------------------------------------------------- 1 | export { default as AppDeploy, default } from './app-deploy.mdx'; 2 | -------------------------------------------------------------------------------- /angular/docs/angular-env-docs-data/index.ts: -------------------------------------------------------------------------------- 1 | export { angularEnvDocsData } from './angular-env-docs-data'; 2 | -------------------------------------------------------------------------------- /angular/docs/create-ng-app/index.ts: -------------------------------------------------------------------------------- 1 | export { default as CreateNgApp, default } from './create-ng-app.mdx'; 2 | -------------------------------------------------------------------------------- /angular/devkit/ng-compat/build-angular/webpack/index.ts: -------------------------------------------------------------------------------- 1 | export * from './configs'; 2 | export * from './stats'; 3 | -------------------------------------------------------------------------------- /angular/docs/angular-docs-routes/index.ts: -------------------------------------------------------------------------------- 1 | export { angularRouteBase, learnAngular } from './angular-docs-routes'; 2 | -------------------------------------------------------------------------------- /angular/docs/component-libs/index.ts: -------------------------------------------------------------------------------- 1 | export { default as ComponentLibs, default } from './component-libs.mdx'; 2 | -------------------------------------------------------------------------------- /angular/envs/angular-v16-env/index.ts: -------------------------------------------------------------------------------- 1 | export { AngularV16Env, ngEnvOptions } from './angular-v16-env.bit-env.js'; 2 | -------------------------------------------------------------------------------- /angular/envs/angular-v17-env/index.ts: -------------------------------------------------------------------------------- 1 | export { AngularV17Env, ngEnvOptions } from './angular-v17-env.bit-env.js'; 2 | -------------------------------------------------------------------------------- /angular/envs/angular-v18-env/index.ts: -------------------------------------------------------------------------------- 1 | export { AngularV18Env, ngEnvOptions } from './angular-v18-env.bit-env.js'; 2 | -------------------------------------------------------------------------------- /angular/envs/angular-v19-env/index.ts: -------------------------------------------------------------------------------- 1 | export { AngularV19Env, ngEnvOptions } from './angular-v19-env.bit-env.js'; 2 | -------------------------------------------------------------------------------- /angular/envs/base-env/config/prettier.config.d.ts: -------------------------------------------------------------------------------- 1 | declare const prettierConfig: any; 2 | export default prettierConfig; -------------------------------------------------------------------------------- /angular/readme/readme.docs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | description: 'An MDX component.' 3 | labels: ['content', 'mdx'] 4 | --- 5 | -------------------------------------------------------------------------------- /angular/docs/angular-versions/index.ts: -------------------------------------------------------------------------------- 1 | export { default as AngularVersions, default } from './angular-versions.mdx'; 2 | -------------------------------------------------------------------------------- /angular/docs/create-custom-env/index.ts: -------------------------------------------------------------------------------- 1 | export { default as CreateCustomEnv, default } from './create-custom-env.mdx'; 2 | -------------------------------------------------------------------------------- /angular/docs/create-ng-app/my-angular-app-files/index.ts: -------------------------------------------------------------------------------- 1 | export default `export * from './my-angular-app.ng-app';`; 2 | -------------------------------------------------------------------------------- /angular/docs/dependency-policy/index.ts: -------------------------------------------------------------------------------- 1 | export { default as DependencyPolicy, default } from './dependency-policy.mdx'; 2 | -------------------------------------------------------------------------------- /angular/docs/development-tools/index.ts: -------------------------------------------------------------------------------- 1 | export { default as DevelopmentTools, default } from './development-tools.mdx'; 2 | -------------------------------------------------------------------------------- /angular/docs/ng-app-deploy/app-deployment.module.scss: -------------------------------------------------------------------------------- 1 | .tabTitle { 2 | font-weight: 500; 3 | font-size: 18px; 4 | } -------------------------------------------------------------------------------- /angular/docs/ng-base-components/index.ts: -------------------------------------------------------------------------------- 1 | export { default as BaseComponents, default } from './base-components.mdx'; 2 | -------------------------------------------------------------------------------- /angular/docs/components-preview/index.ts: -------------------------------------------------------------------------------- 1 | export { default as ComponentsPreview, default } from './components-preview.mdx'; 2 | -------------------------------------------------------------------------------- /angular/docs/ng-design-overview/index.ts: -------------------------------------------------------------------------------- 1 | export { default as NgDesignOverview, default } from './ng-design-overview.mdx'; 2 | -------------------------------------------------------------------------------- /angular/docs/workspace-starters/index.ts: -------------------------------------------------------------------------------- 1 | export { default as WorkspaceStarters, default } from './workspace-starters.mdx'; 2 | -------------------------------------------------------------------------------- /angular/integration/demo-app/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /angular/integration/demo-app/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /angular/docs/component-generators/index.ts: -------------------------------------------------------------------------------- 1 | export { default as ComponentGenerators, default } from './component-generators.mdx'; 2 | -------------------------------------------------------------------------------- /angular/docs/components-overview/index.ts: -------------------------------------------------------------------------------- 1 | export { default as ComponentsOverview, default } from './components-overview.mdx'; 2 | -------------------------------------------------------------------------------- /angular/examples/my-angular-env/index.ts: -------------------------------------------------------------------------------- 1 | export { MyAngularEnv, MyAngularEnv as default } from './my-angular-env.bit-env.js'; 2 | -------------------------------------------------------------------------------- /angular/docs/ng-component-libraries/index.ts: -------------------------------------------------------------------------------- 1 | export { default as ngComponentLibraries, default } from './ng-component-libraries.mdx'; 2 | -------------------------------------------------------------------------------- /angular/docs/bit-angular-introduction/index.ts: -------------------------------------------------------------------------------- 1 | export { default as BitAngularIntroduction, default } from './bit-angular-introduction.mdx'; 2 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v16-env/index.ts: -------------------------------------------------------------------------------- 1 | export { MyAngularV16Env, MyAngularV16Env as default } from './my-angular-v16-env.bit-env.js'; 2 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v17-env/index.ts: -------------------------------------------------------------------------------- 1 | export { MyAngularV17Env, MyAngularV17Env as default } from './my-angular-v17-env.bit-env.js'; 2 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v18-env/index.ts: -------------------------------------------------------------------------------- 1 | export { MyAngularV18Env, MyAngularV18Env as default } from './my-angular-v18-env.bit-env.js'; 2 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v19-env/index.ts: -------------------------------------------------------------------------------- 1 | export { MyAngularV19Env, MyAngularV19Env as default } from './my-angular-v19-env.bit-env.js'; 2 | -------------------------------------------------------------------------------- /angular/integration/demo-app/src/app/app.routes.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | 3 | export const routes: Routes = []; 4 | -------------------------------------------------------------------------------- /angular/devkit/preview/mounter/index.ts: -------------------------------------------------------------------------------- 1 | export { createMounter } from './mounter.js'; 2 | export type { MounterOptions } from './mounter.js'; 3 | -------------------------------------------------------------------------------- /angular/docs/components-documentation/index.ts: -------------------------------------------------------------------------------- 1 | export { default as ComponentsDocumentation, default } from './components-documentation.mdx'; 2 | -------------------------------------------------------------------------------- /angular/docs/ng-component-libraries/ng-component-libraries.docs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | description: 'An MDX component.' 3 | labels: ['content', 'mdx'] 4 | --- -------------------------------------------------------------------------------- /angular/envs/angular-v16-env/jest/jest.config.d.ts: -------------------------------------------------------------------------------- 1 | import { Config } from 'jest'; 2 | 3 | declare const config: Config; 4 | export default config; -------------------------------------------------------------------------------- /angular/envs/angular-v17-env/jest/jest.config.d.ts: -------------------------------------------------------------------------------- 1 | import { Config } from 'jest'; 2 | 3 | declare const config: Config; 4 | export default config; -------------------------------------------------------------------------------- /angular/envs/angular-v18-env/jest/jest.config.d.ts: -------------------------------------------------------------------------------- 1 | import { Config } from 'jest'; 2 | 3 | declare const config: Config; 4 | export default config; -------------------------------------------------------------------------------- /angular/envs/angular-v19-env/jest/jest.config.d.ts: -------------------------------------------------------------------------------- 1 | import { Config } from 'jest'; 2 | 3 | declare const config: Config; 4 | export default config; -------------------------------------------------------------------------------- /angular/integration/my-react-app/index.ts: -------------------------------------------------------------------------------- 1 | // export the app component for potential reuse. 2 | export { MyReactApp } from "./my-react-app.js"; 3 | -------------------------------------------------------------------------------- /angular/envs/base-env/config/prettier.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | trailingComma: 'es5', 3 | tabWidth: 2, 4 | singleQuote: true, 5 | }; 6 | -------------------------------------------------------------------------------- /angular/envs/angular-v19-env/jest/setup-jest.cjs: -------------------------------------------------------------------------------- 1 | const { setupZoneTestEnv } = require('jest-preset-angular/setup-env/zone'); 2 | 3 | setupZoneTestEnv(); 4 | -------------------------------------------------------------------------------- /angular/integration/demo-app/src/assets/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teambit/bit-angular/HEAD/angular/integration/demo-app/src/assets/favicon.ico -------------------------------------------------------------------------------- /angular/readme/readme.composition.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Readme from './index'; 3 | 4 | export const PreviewMDX = () => 5 | -------------------------------------------------------------------------------- /angular/templates/starters/constants.ts: -------------------------------------------------------------------------------- 1 | export const DEFAULT_SCOPE_NAME = 'my-org.my-scope'; 2 | export const FORKED_ENV_NAME = 'envs/my-angular-env'; 3 | -------------------------------------------------------------------------------- /angular/envs/angular-env/index.ts: -------------------------------------------------------------------------------- 1 | export { AngularEnv } from './angular.bit-env.js'; 2 | export { ngEnvOptions } from '@bitdev/angular.envs.angular-v19-env'; 3 | -------------------------------------------------------------------------------- /angular/docs/ng-base-components/code-snippets/css/my-button-style-css-vars.mdx: -------------------------------------------------------------------------------- 1 | ```scss 2 | button { 3 | border-radius: var(--myBorderRadius, 5px); 4 | } 5 | ``` 6 | -------------------------------------------------------------------------------- /angular/docs/ng-design-overview/images/example-modes.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teambit/bit-angular/HEAD/angular/docs/ng-design-overview/images/example-modes.jpg -------------------------------------------------------------------------------- /angular/devkit/preview/preview-app/preview-app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teambit/bit-angular/HEAD/angular/devkit/preview/preview-app/preview-app/favicon.ico -------------------------------------------------------------------------------- /angular/envs/base-env/index.ts: -------------------------------------------------------------------------------- 1 | export { AngularBaseEnv } from './angular-base-env.bit-env.js'; 2 | export type { AngularEnvInterface } from './angular-env.interface.js'; 3 | -------------------------------------------------------------------------------- /angular/docs/ng-component-libraries/ng-component-libraries.module.scss: -------------------------------------------------------------------------------- 1 | .cardsGallery { 2 | grid-gap: 19px; 3 | > a > div { 4 | max-width: 230px; 5 | } 6 | } -------------------------------------------------------------------------------- /angular/envs/angular-env/jest/jest.config.cjs: -------------------------------------------------------------------------------- 1 | const jestConfig = require('@bitdev/angular.envs.angular-v19-env/jest/jest.config.cjs'); 2 | 3 | module.exports = jestConfig; 4 | -------------------------------------------------------------------------------- /angular/devkit/compiler/elements/index.ts: -------------------------------------------------------------------------------- 1 | export { RollupCompiler } from './rollup/rollup.compiler'; 2 | export { AngularElementsCompiler } from './angular-elements.compiler'; 3 | -------------------------------------------------------------------------------- /angular/devkit/compiler/multi-compiler/index.ts: -------------------------------------------------------------------------------- 1 | export { NgMultiCompiler } from './ng-multi-compiler.js'; 2 | export { NgMultiCompilerTask } from './ng-multi-compiler.task.js'; 3 | -------------------------------------------------------------------------------- /angular/devkit/compiler/ng-packagr/ng-packagr.docs.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: A bit compiler using ng-packagr for Angular libraries. 3 | labels: ['angular', 'ng-packagr'] 4 | --- 5 | -------------------------------------------------------------------------------- /angular/devkit/ng-compat/build-angular/builder-options.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export type { BrowserBuilderOptions, DevServerBuilderOptions } from '@angular-devkit/build-angular'; 3 | -------------------------------------------------------------------------------- /angular/docs/ng-app-build/app-build.composition.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { AppBuild } from './index'; 3 | 4 | export const BasicNg = () => ( 5 | 6 | ); 7 | -------------------------------------------------------------------------------- /angular/devkit/compiler/multi-compiler/ng-multi-compiler.docs.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: A bit compiler using ng-packagr for Angular libraries. 3 | labels: ['angular', 'ng-packagr'] 4 | --- 5 | -------------------------------------------------------------------------------- /angular/devkit/compiler/ng-packagr/index.ts: -------------------------------------------------------------------------------- 1 | export { NgPackagrCompiler, NG_PACKAGE_JSON } from './ng-packagr.compiler.js'; 2 | export type { NgPackagr } from './ng-packagr.compiler.js'; 3 | -------------------------------------------------------------------------------- /angular/devkit/preview/preview-app/preview-app/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | @use './styles/prism-theme-vsc-dark-plus'; 3 | -------------------------------------------------------------------------------- /angular/docs/ng-app-deploy/app-deploy.composition.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { AppDeploy } from './index'; 3 | 4 | export const BasicNg = () => ( 5 | 6 | ); 7 | -------------------------------------------------------------------------------- /angular/docs/ng-theming/ng-theming.composition.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { NgTheming } from './index'; 3 | 4 | export const BasicNg = () => ( 5 | 6 | ); 7 | -------------------------------------------------------------------------------- /angular/envs/base-env/tsconfig.json: -------------------------------------------------------------------------------- 1 | // bit-generated-typescript-config 2 | 3 | { 4 | "extends": "./../../../node_modules/.cache/tsconfig.bit.d3d4e4a560ca9ced8c4fb46e8e65bb230e5e21ef.json" 5 | } -------------------------------------------------------------------------------- /angular/docs/build-pipelines/index.ts: -------------------------------------------------------------------------------- 1 | export { default as BuildPipelines } from './build-pipelines.mdx'; 2 | export { default as BuildPipelinesTemplate, default } from './build-pipelines-template.mdx'; -------------------------------------------------------------------------------- /angular/docs/create-ng-app/create-ng-app.composition.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { CreateNgApp } from './index'; 3 | 4 | export const BasicNg = () => ( 5 | 6 | ); 7 | -------------------------------------------------------------------------------- /angular/docs/component-libs/component-libs.composition.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ComponentLibs } from './index'; 3 | 4 | export const BasicNg = () => ( 5 | 6 | ); 7 | -------------------------------------------------------------------------------- /angular/devkit/preview/preview/mounter.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-unresolved */ 2 | import { createMounter } from '@bitdev/angular.dev-services.preview.mounter'; 3 | 4 | export default createMounter(); 5 | -------------------------------------------------------------------------------- /angular/docs/ng-base-components/base-components.composition.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { BaseComponents } from './index'; 3 | 4 | export const BasicNg = () => ( 5 | 6 | ); 7 | -------------------------------------------------------------------------------- /angular/integration/my-react-app/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import react from '@vitejs/plugin-react'; 3 | 4 | export default defineConfig({ 5 | plugins: [react()] 6 | }); 7 | -------------------------------------------------------------------------------- /angular/devkit/preview/vite-preview/mounter.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-unresolved */ 2 | import { createMounter } from '@bitdev/angular.dev-services.preview.mounter'; 3 | 4 | export default createMounter(); 5 | -------------------------------------------------------------------------------- /angular/docs/create-custom-env/create-custom-env.composition.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { CreateCustomEnv } from './index'; 3 | 4 | export const BasicNg = () => ( 5 | 6 | ); 7 | -------------------------------------------------------------------------------- /angular/docs/dependency-policy/dependency-policy.composition.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { DependencyPolicy } from './index'; 3 | 4 | export const BasicNg = () => ( 5 | 6 | ); 7 | -------------------------------------------------------------------------------- /angular/docs/development-tools/development-tools.composition.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { DevelopmentTools } from './index'; 3 | 4 | export const BasicNg = () => ( 5 | 6 | ); 7 | -------------------------------------------------------------------------------- /angular/docs/ng-component-libraries/ng-component-libraries.composition.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import NgComponentLibraries from './index'; 3 | 4 | export const PreviewMDX = () => -------------------------------------------------------------------------------- /angular/docs/ng-theming/code-snippets/my-base-theme-index.mdx: -------------------------------------------------------------------------------- 1 | ```ts 2 | // @ts-ignore 3 | import styles from './_my-base-theme.module.scss'; 4 | 5 | // exporting styles via js 6 | export default styles; 7 | ``` 8 | -------------------------------------------------------------------------------- /angular/docs/ng-theming/code-snippets/my-dark-theme-index.mdx: -------------------------------------------------------------------------------- 1 | ```ts 2 | // @ts-ignore 3 | import styles from './_my-dark-theme.module.scss'; 4 | 5 | // exporting styles via js 6 | export default styles; 7 | ``` 8 | -------------------------------------------------------------------------------- /angular/docs/components-preview/components-preview.composition.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ComponentsPreview } from './index'; 3 | 4 | export const BasicNg = () => ( 5 | 6 | ); 7 | -------------------------------------------------------------------------------- /angular/docs/workspace-starters/workspace-starters.composition.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { WorkspaceStarters } from './index'; 3 | 4 | export const BasicNg = () => ( 5 | 6 | ); 7 | -------------------------------------------------------------------------------- /angular/templates/starters/index.ts: -------------------------------------------------------------------------------- 1 | export { AngularStarter } from './ng-workspace'; 2 | export { DesignSystemStarter } from './design-system'; 3 | export { MaterialDesignSystemStarter } from './material-design-system'; 4 | -------------------------------------------------------------------------------- /angular/docs/angular-versions/angular-versions.composition.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { AngularVersions } from './index'; 3 | 4 | export const BasicAngularVersions = () => ( 5 | 6 | ); 7 | -------------------------------------------------------------------------------- /angular/docs/components-overview/components-overview.composition.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ComponentsOverview } from './index'; 3 | 4 | export const BasicNg = () => ( 5 | 6 | ); 7 | -------------------------------------------------------------------------------- /angular/docs/component-generators/component-generators.composition.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ComponentGenerators } from './index'; 3 | 4 | export const BasicNg = () => ( 5 | 6 | ); 7 | -------------------------------------------------------------------------------- /angular/docs/ng-base-components/code-snippets/scss/app-main-style-scss-vars.mdx: -------------------------------------------------------------------------------- 1 | ```scss 2 | @use "@my-org/my-scope.theme.my-base-theme/my-base-theme.module" as bt; 3 | 4 | body { 5 | font-size: bt.$myFontSize; 6 | } 7 | ``` 8 | -------------------------------------------------------------------------------- /angular/integration/demo-app/demo-app.docs.md: -------------------------------------------------------------------------------- 1 | --- 2 | labels: ['angular', 'typescript'] 3 | description: 'An Angular application' 4 | --- 5 | 6 | # Demo app documentation 7 | 8 | Run your application with `bit run demo-app`. 9 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | end_of_line = lf 8 | indent_size = 2 9 | indent_style = space 10 | insert_final_newline = true 11 | trim_trailing_whitespace = true 12 | -------------------------------------------------------------------------------- /angular/docs/ng-base-components/code-snippets/scss/my-base-theme-module-scss-vars.mdx: -------------------------------------------------------------------------------- 1 | ```scss 2 | // Design tokens as Scss variables 3 | $myFontSize: 16px; 4 | $myFontFamily: "Roboto, sans-serif"; 5 | $myBorderRadius: 3px; 6 | ``` 7 | -------------------------------------------------------------------------------- /demo-elements.component.css.map: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "sources": ["demo-elements.component.scss"], 4 | "sourcesContent": [":host {\r\n font-size: inherit;\r\n}"], 5 | "mappings": ";AAAA;AACE,aAAA;;", 6 | "names": [] 7 | } 8 | -------------------------------------------------------------------------------- /angular/docs/bit-angular-introduction/bit-angular-introduction.composition.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { BitAngularIntroduction } from './index'; 3 | 4 | export const BasicNg = () => ( 5 | 6 | ); 7 | -------------------------------------------------------------------------------- /angular/docs/ng-base-components/code-snippets/scss/my-button-style-scss-vars.mdx: -------------------------------------------------------------------------------- 1 | ```scss 2 | @use "@my-org/my-scope.theme.my-base-theme/my-base-theme.module" as bt; 3 | 4 | button { 5 | border-radius: bt.$myBorderRadius; 6 | } 7 | ``` 8 | -------------------------------------------------------------------------------- /angular/devkit/vite/index.ts: -------------------------------------------------------------------------------- 1 | export * from './ng-vite.dev-server.js'; 2 | export * from './ng-vite.bundler.js'; 3 | export * from './application.dev-server.js'; 4 | export * from './application.bundler.js'; 5 | export * from './utils/utils.js'; 6 | -------------------------------------------------------------------------------- /angular/docs/components-documentation/components-documentation.composition.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ComponentsDocumentation } from './index'; 3 | 4 | export const BasicNg = () => ( 5 | 6 | ); 7 | -------------------------------------------------------------------------------- /angular/envs/angular-env/angular.bit-env.ts: -------------------------------------------------------------------------------- 1 | import { AngularV19Env } from '@bitdev/angular.envs.angular-v19-env'; 2 | 3 | export class AngularEnv extends AngularV19Env { 4 | name = 'Angular'; 5 | } 6 | 7 | export default new AngularEnv(); 8 | -------------------------------------------------------------------------------- /angular/devkit/common/index.ts: -------------------------------------------------------------------------------- 1 | export type { AngularEnvOptions, WebpackConfigFactory } from './env-options'; 2 | export * from './generic-angular-env'; 3 | export * from './utils'; 4 | export { AngularComponentTemplateOptions } from './templates'; 5 | -------------------------------------------------------------------------------- /angular/examples/my-angular-env/config/eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @see https://bit.dev/reference/eslint/eslint-config 3 | */ 4 | module.exports = { 5 | extends: [require.resolve('@bitdev/angular.dev-services.linter.eslint')], 6 | rules: {}, 7 | }; 8 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v16/bit-test.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | @Injectable({ providedIn: 'any' }) 4 | export class BitTestService { 5 | get content() { 6 | return 'Content from service'; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v17/bit-test.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | @Injectable({ providedIn: 'any' }) 4 | export class BitTestService { 5 | get content() { 6 | return 'Content from service'; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v18/bit-test.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | @Injectable({ providedIn: 'any' }) 4 | export class BitTestService { 5 | get content() { 6 | return 'Content from service'; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v19/bit-test.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | @Injectable({ providedIn: 'any' }) 4 | export class BitTestService { 5 | get content() { 6 | return 'Content from service'; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /angular/integration/demo-lib/src/bit-test.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | @Injectable({ providedIn: 'any' }) 4 | export class BitTestService { 5 | get content() { 6 | return 'Content from service'; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /angular/devkit/webpack/index.ts: -------------------------------------------------------------------------------- 1 | export * from './ng-webpack-dev-server'; 2 | export * from './ng-webpack-bundler'; 3 | export * from './utils'; 4 | export * from './webpack-plugins/angular-resolver'; 5 | export * from './webpack-plugins/stats-logger'; 6 | -------------------------------------------------------------------------------- /angular/examples/my-angular-env/config/tsconfig.json: -------------------------------------------------------------------------------- 1 | /** 2 | * @see https://bit.dev/reference/typescript/typescript-config 3 | */ 4 | { 5 | "extends": "@bitdev/angular.envs.base-env/config/tsconfig.json", 6 | "include": ["**/*", "**/*.json"] 7 | } 8 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v16-env/config/eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @see https://bit.dev/reference/eslint/eslint-config 3 | */ 4 | module.exports = { 5 | extends: [require.resolve('@bitdev/angular.dev-services.linter.eslint')], 6 | rules: {}, 7 | }; 8 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v17-env/config/eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @see https://bit.dev/reference/eslint/eslint-config 3 | */ 4 | module.exports = { 5 | extends: [require.resolve('@bitdev/angular.dev-services.linter.eslint')], 6 | rules: {}, 7 | }; 8 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v18-env/config/eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @see https://bit.dev/reference/eslint/eslint-config 3 | */ 4 | module.exports = { 5 | extends: [require.resolve('@bitdev/angular.dev-services.linter.eslint')], 6 | rules: {}, 7 | }; 8 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v19-env/config/eslintrc.cjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @see https://bit.dev/reference/eslint/eslint-config 3 | */ 4 | module.exports = { 5 | extends: [require.resolve('@bitdev/angular.dev-services.linter.eslint')], 6 | rules: {}, 7 | }; 8 | -------------------------------------------------------------------------------- /angular/integration/demo-app/src/app/app.routes.server.ts: -------------------------------------------------------------------------------- 1 | import { RenderMode, ServerRoute } from '@angular/ssr'; 2 | 3 | export const serverRoutes: ServerRoute[] = [ 4 | { 5 | path: '**', 6 | renderMode: RenderMode.Prerender 7 | } 8 | ]; 9 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v16-env/config/tsconfig.json: -------------------------------------------------------------------------------- 1 | /** 2 | * @see https://bit.dev/reference/typescript/typescript-config 3 | */ 4 | { 5 | "extends": "@bitdev/angular.envs.base-env/config/tsconfig.json", 6 | "include": ["**/*", "**/*.json"] 7 | } 8 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v17-env/config/tsconfig.json: -------------------------------------------------------------------------------- 1 | /** 2 | * @see https://bit.dev/reference/typescript/typescript-config 3 | */ 4 | { 5 | "extends": "@bitdev/angular.envs.base-env/config/tsconfig.json", 6 | "include": ["**/*", "**/*.json"] 7 | } 8 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v18-env/config/tsconfig.json: -------------------------------------------------------------------------------- 1 | /** 2 | * @see https://bit.dev/reference/typescript/typescript-config 3 | */ 4 | { 5 | "extends": "@bitdev/angular.envs.base-env/config/tsconfig.json", 6 | "include": ["**/*", "**/*.json"] 7 | } 8 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v19-env/config/tsconfig.json: -------------------------------------------------------------------------------- 1 | /** 2 | * @see https://bit.dev/reference/typescript/typescript-config 3 | */ 4 | { 5 | "extends": "@bitdev/angular.envs.base-env/config/tsconfig.json", 6 | "include": ["**/*", "**/*.json"] 7 | } 8 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v16/public-api.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Entry point for this Angular library, do not move or rename this file. 3 | */ 4 | export * from './bit-test.component'; 5 | export * from './bit-test2.component'; 6 | export * from './bit-test.module'; 7 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v17/public-api.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Entry point for this Angular library, do not move or rename this file. 3 | */ 4 | export * from './bit-test.component'; 5 | export * from './bit-test2.component'; 6 | export * from './bit-test.module'; 7 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v18/public-api.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Entry point for this Angular library, do not move or rename this file. 3 | */ 4 | export * from './bit-test.component'; 5 | export * from './bit-test2.component'; 6 | export * from './bit-test.module'; 7 | -------------------------------------------------------------------------------- /angular/envs/base-env/config/eslintrc.cjs: -------------------------------------------------------------------------------- 1 | // force bit to recognize this as dependency 2 | require('@bitdev/angular.dev-services.linter.eslint'); 3 | 4 | module.exports = { 5 | extends: [require.resolve('@bitdev/angular.dev-services.linter.eslint')], 6 | rules: {} 7 | }; 8 | -------------------------------------------------------------------------------- /angular/docs/ng-base-components/code-snippets/css/app-main-style-css-vars.mdx: -------------------------------------------------------------------------------- 1 | ```scss 2 | @use "@my-org/my-scope.theme.my-base-theme/my-base-theme.module" as bt; 3 | 4 | body { 5 | @include bt.setBaseTheme(); 6 | 7 | font-size: var(--myFontSize, 14px); 8 | } 9 | ``` 10 | -------------------------------------------------------------------------------- /angular/docs/ng-theming/code-snippets/composition-provider-mounter.mdx: -------------------------------------------------------------------------------- 1 | ```ts 2 | import { createMounter } from '@bitdev/angular.dev-services.preview.mounter'; 3 | import { WrapperComponent } from './wrapper.component'; 4 | 5 | export default createMounter(WrapperComponent); 6 | ``` 7 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-app/template-files/src/assets/gitkeep.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFile } from '@teambit/generator'; 2 | 3 | export const gitKeepFile = (): ComponentFile => { 4 | return { 5 | relativePath: `src/assets/.gitkeep`, 6 | content: ``, 7 | }; 8 | }; 9 | -------------------------------------------------------------------------------- /angular/docs/components-preview/snippets/composition-provider-mounter.mdx: -------------------------------------------------------------------------------- 1 | ```tsx 2 | import { createMounter } from '@bitdev/angular.dev-services.preview.mounter'; 3 | import { WrapperComponent } from './wrapper.component'; 4 | 5 | export default createMounter(WrapperComponent); 6 | ``` 7 | -------------------------------------------------------------------------------- /angular/envs/angular-v16-env/jest/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "@bitdev/angular.envs.base-env/config/tsconfig.json", 4 | "include": ["**/*.spec.+(js|ts)", "**/*.test.+(js|ts)", "**/*.d.ts"] 5 | } 6 | -------------------------------------------------------------------------------- /angular/envs/angular-v17-env/jest/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "@bitdev/angular.envs.base-env/config/tsconfig.json", 4 | "include": ["**/*.spec.+(js|ts)", "**/*.test.+(js|ts)", "**/*.d.ts"] 5 | } 6 | -------------------------------------------------------------------------------- /angular/envs/angular-v18-env/jest/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "@bitdev/angular.envs.base-env/config/tsconfig.json", 4 | "include": ["**/*.spec.+(js|ts)", "**/*.test.+(js|ts)", "**/*.d.ts"] 5 | } 6 | -------------------------------------------------------------------------------- /angular/envs/angular-v19-env/jest/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "@bitdev/angular.envs.base-env/config/tsconfig.json", 4 | "include": ["**/*.spec.+(js|ts)", "**/*.test.+(js|ts)", "**/*.d.ts"] 5 | } 6 | -------------------------------------------------------------------------------- /angular/examples/my-angular-env/config/prettier.config.cjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @see https://bit.dev/reference/prettier/prettier-config 3 | */ 4 | const prettierConfig = require('@bitdev/angular.envs.base-env/config/prettier.config.cjs'); 5 | 6 | module.exports = { 7 | ...prettierConfig, 8 | }; 9 | -------------------------------------------------------------------------------- /angular/devkit/common/templates.ts: -------------------------------------------------------------------------------- 1 | export interface AngularComponentTemplateOptions { 2 | name?: string; 3 | description?: string; 4 | // whether to hide the template from the `bit templates` command. 5 | hidden?: boolean; 6 | envName?: string; 7 | angularVersion?: number; 8 | } 9 | -------------------------------------------------------------------------------- /angular/devkit/preview/runtime/index.ts: -------------------------------------------------------------------------------- 1 | export { ngBootstrap } from './mount.loader.js'; 2 | export { ngToCustomElements } from './elements.loader.js'; 3 | export { ngToReact, customElementsToReact } from './react.loader.js'; 4 | export type { NgBootstrapOptions } from './mount.loader.js'; 5 | -------------------------------------------------------------------------------- /angular/docs/create-ng-app/my-angular-app-files/my-angular-app.docs-md.ts: -------------------------------------------------------------------------------- 1 | export default `--- 2 | labels: ['angular', 'typescript', 'apps'] 3 | description: 'An Angular application.' 4 | --- 5 | 6 | # MyAngularApp documentation 7 | 8 | Run your application with \`bit run my-angular-app\`.`; 9 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v16-env/config/prettier.config.cjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @see https://bit.dev/reference/prettier/prettier-config 3 | */ 4 | const prettierConfig = require('@bitdev/angular.envs.base-env/config/prettier.config.cjs'); 5 | 6 | module.exports = { 7 | ...prettierConfig, 8 | }; 9 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v17-env/config/prettier.config.cjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @see https://bit.dev/reference/prettier/prettier-config 3 | */ 4 | const prettierConfig = require('@bitdev/angular.envs.base-env/config/prettier.config.cjs'); 5 | 6 | module.exports = { 7 | ...prettierConfig, 8 | }; 9 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v18-env/config/prettier.config.cjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @see https://bit.dev/reference/prettier/prettier-config 3 | */ 4 | const prettierConfig = require('@bitdev/angular.envs.base-env/config/prettier.config.cjs'); 5 | 6 | module.exports = { 7 | ...prettierConfig, 8 | }; 9 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v19-env/config/prettier.config.cjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @see https://bit.dev/reference/prettier/prettier-config 3 | */ 4 | const prettierConfig = require('@bitdev/angular.envs.base-env/config/prettier.config.cjs'); 5 | 6 | module.exports = { 7 | ...prettierConfig, 8 | }; 9 | -------------------------------------------------------------------------------- /angular/examples/my-angular-env/config/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | /* This config is used for bit test */ 3 | { 4 | "extends": "./tsconfig.json", 5 | "include": ["**/*.spec.+(js|ts)", "**/*.test.+(js|ts)", "**/*.d.ts"] 6 | } 7 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v16-env/config/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | /* This config is used for bit test */ 3 | { 4 | "extends": "./tsconfig.json", 5 | "include": ["**/*.spec.+(js|ts)", "**/*.test.+(js|ts)", "**/*.d.ts"] 6 | } 7 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v17-env/config/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | /* This config is used for bit test */ 3 | { 4 | "extends": "./tsconfig.json", 5 | "include": ["**/*.spec.+(js|ts)", "**/*.test.+(js|ts)", "**/*.d.ts"] 6 | } 7 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v18-env/config/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | /* This config is used for bit test */ 3 | { 4 | "extends": "./tsconfig.json", 5 | "include": ["**/*.spec.+(js|ts)", "**/*.test.+(js|ts)", "**/*.d.ts"] 6 | } 7 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v19-env/config/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | /* This config is used for bit test */ 3 | { 4 | "extends": "./tsconfig.json", 5 | "include": ["**/*.spec.+(js|ts)", "**/*.test.+(js|ts)", "**/*.d.ts"] 6 | } 7 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v19/public-api.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Entry point for this Angular library, do not move or rename this file. 3 | */ 4 | export * from './bit-test.component'; 5 | export * from './bit-test2.component'; 6 | export * from './bit-test3.component'; 7 | export * from './bit-test.module'; 8 | -------------------------------------------------------------------------------- /angular/docs/components-preview/snippets/composition-provider-mounter2.mdx: -------------------------------------------------------------------------------- 1 | ```tsx 2 | import { createMounter } from '@bitdev/angular.dev-services.preview.mounter'; 3 | import { WrapperModule } from './wrapper'; 4 | 5 | export default createMounter(WrapperModule, {wrapperSelector: '#wrapper-host'}); 6 | ``` 7 | -------------------------------------------------------------------------------- /angular/docs/build-pipelines/build-pipelines.composition.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { BuildPipelines } from './index'; 3 | import { mockAngularEnvDocsData } from "@teambit/envs.docs.env-docs-data"; 4 | 5 | export const BasicNg = () => ( 6 | 7 | ); 8 | -------------------------------------------------------------------------------- /angular/app-types/angular-app-type/index.ts: -------------------------------------------------------------------------------- 1 | export { AngularAppType } from './angular.app-type.js'; 2 | export type { AngularAppOptions } from './angular-app-options.js'; 3 | export { NG_APP_NAME, NG_APP_PATTERN } from '@bitdev/angular.dev-services.common'; 4 | export { AngularApp } from './angular.application.js'; 5 | -------------------------------------------------------------------------------- /angular/devkit/preview/preview/types.d.ts: -------------------------------------------------------------------------------- 1 | import type { NgModuleRef } from '@angular/core'; 2 | import type { ReplaySubject } from 'rxjs'; 3 | 4 | declare global { 5 | interface Window { 6 | onDocsLoad$: ReplaySubject; 7 | ngMainStart: () => Promise | void>; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /angular/envs/angular-env/angular.composition.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export const Logo = () => ( 4 |
5 | Angular 6 |
7 | ); 8 | -------------------------------------------------------------------------------- /angular/integration/demo-lib/public-api.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Entry point for this Angular library, do not move or rename this file. 3 | */ 4 | export * from './src/bit-test.component'; 5 | export * from './src/bit-test2.component'; 6 | export * from './src/bit-test3.component'; 7 | export * from './src/bit-test.module'; 8 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-env/files/index.ts: -------------------------------------------------------------------------------- 1 | import { ComponentContext } from '@teambit/generator'; 2 | 3 | export function indexFile({ namePascalCase: Name, name }: ComponentContext) { 4 | // language=TypeScript 5 | return `export { ${Name}, ${Name} as default } from './${name}.bit-env.js'; 6 | `; 7 | } 8 | -------------------------------------------------------------------------------- /angular/devkit/preview/vite-preview/types.d.ts: -------------------------------------------------------------------------------- 1 | import type { NgModuleRef } from '@angular/core'; 2 | import type { ReplaySubject } from 'rxjs'; 3 | 4 | declare global { 5 | interface Window { 6 | onDocsLoad$: ReplaySubject; 7 | ngMainStart: () => Promise | void>; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /angular/integration/demo-app/src/main.server.ts: -------------------------------------------------------------------------------- 1 | import 'zone.js/node'; 2 | import { bootstrapApplication } from '@angular/platform-browser'; 3 | import { AppComponent } from './app/app.component'; 4 | import { config } from './app/app.config.server'; 5 | 6 | export default () => bootstrapApplication(AppComponent, config); 7 | -------------------------------------------------------------------------------- /angular/docs/components-preview/snippets/composition-mounter-mounter.mdx: -------------------------------------------------------------------------------- 1 | ```tsx 2 | import { createMounter } from '@my-org/my-scope.my-custom-mounter'; 3 | 4 | export function MyReactProvider({ children }) { 5 | return <>{children}; 6 | } 7 | 8 | export default createMounter(MyReactProvider) as any; 9 | ``` 10 | -------------------------------------------------------------------------------- /angular/envs/base-env/angular-base-env.composition.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export const Logo = () => ( 4 |
5 | Angular 6 |
7 | ); 8 | -------------------------------------------------------------------------------- /angular/integration/demo-lib/src/bit-test2.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'bit-test2', 5 | standalone: false, 6 | template: ` 7 |

8 | bit-test 2 works as well! 9 |

10 | ` 11 | }) 12 | export class BitTest2Component {} 13 | -------------------------------------------------------------------------------- /angular/devkit/ng-compat/build-angular/utils/normalize-cache.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { json } from '@angular-devkit/core'; 3 | 4 | export let normalizeCacheOptions: (metadata: json.JsonObject, worspaceRoot: string) => any 5 | = require('@angular-devkit/build-angular/src/utils/normalize-cache').normalizeCacheOptions; 6 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v16/bit-test2.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'bit-test2-v16', 5 | standalone: false, 6 | template: ` 7 |

8 | bit-test 2 works as well! 9 |

10 | ` 11 | }) 12 | export class BitTest2Component {} 13 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v17/bit-test2.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'bit-test2-v17', 5 | standalone: false, 6 | template: ` 7 |

8 | bit-test 2 works as well! 9 |

10 | ` 11 | }) 12 | export class BitTest2Component {} 13 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v18/bit-test2.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'bit-test2-v18', 5 | standalone: false, 6 | template: ` 7 |

8 | bit-test 2 works as well! 9 |

10 | ` 11 | }) 12 | export class BitTest2Component {} 13 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v19/bit-test2.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'bit-test2-v19', 5 | standalone: false, 6 | template: ` 7 |

8 | bit-test 2 works as well! 9 |

10 | ` 11 | }) 12 | export class BitTest2Component {} 13 | -------------------------------------------------------------------------------- /angular/integration/demo-lib/src/bit-test3.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'bit-test3', 5 | standalone: true, 6 | template: ` 7 |

8 | bit-test 3 standalone works! 9 |

10 | ` 11 | }) 12 | export class BitTest3Component {} 13 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v19/bit-test3.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'bit-test3-v19', 5 | standalone: true, 6 | template: ` 7 |

8 | bit-test 3 standalone works! 9 |

10 | ` 11 | }) 12 | export class BitTest3Component {} 13 | -------------------------------------------------------------------------------- /angular/templates/generators/index.ts: -------------------------------------------------------------------------------- 1 | export { NgModuleTemplate } from './ng-module/index.js'; 2 | export { NgStandaloneTemplate } from './ng-standalone/index.js'; 3 | export { NgElementsTemplate } from './ng-elements/index.js'; 4 | export { NgEnvTemplate } from './ng-env/index.js'; 5 | export { NgAppTemplate } from './ng-app/index.js'; 6 | -------------------------------------------------------------------------------- /angular/devkit/preview/preview-app/preview-app/src/app/global.d.ts: -------------------------------------------------------------------------------- 1 | import type { NgModuleRef } from '@angular/core'; 2 | import type { ReplaySubject } from 'rxjs'; 3 | 4 | declare global { 5 | interface Window { 6 | onDocsLoad$: ReplaySubject; 7 | ngMainStart: () => Promise | void>; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /angular/integration/my-react-app/my-react-app.composition.tsx: -------------------------------------------------------------------------------- 1 | import { MemoryRouter } from 'react-router-dom'; 2 | import { MyReactApp } from "./my-react-app.js"; 3 | 4 | export const MyReactAppBasic = () => { 5 | return ( 6 | // @ts-ignore 7 | 8 | 9 | 10 | ); 11 | } 12 | -------------------------------------------------------------------------------- /angular/devkit/ng-compat/index.ts: -------------------------------------------------------------------------------- 1 | export * from './build-angular/index-html-webpack-plugin'; 2 | export * from './build-angular/webpack'; 3 | export * from './build-angular/utils'; 4 | export * from './build-angular/builder-options'; 5 | export * from './build-angular/schemas/application.schema'; 6 | export * from './build-angular/builders/application'; 7 | -------------------------------------------------------------------------------- /angular/docs/ng-base-components/code-snippets/js/my-base-theme-module-js-vars.mdx: -------------------------------------------------------------------------------- 1 | ```ts 2 | import { Theme } from "@my-org/my-scope.theme.my-theme-provider"; 3 | 4 | // Design tokens as JS variables 5 | export const myTheme: Theme = { 6 | myFontSize: "16px", 7 | myFontFamily: "Roboto, sans-serif", 8 | myBorderRadius: "4px" 9 | }; 10 | ``` 11 | -------------------------------------------------------------------------------- /angular/devkit/compiler/elements/rollup/ngc-plugin/resolver.ts: -------------------------------------------------------------------------------- 1 | export function resolver() { 2 | return function resolveId(id: string, origin: string | undefined) { 3 | if (!origin || id.includes('node_modules')) { 4 | return id; 5 | } 6 | // anything else is to be considered external and not bundled 7 | return false; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /angular/docs/ng-base-components/code-snippets/js/my-theme-provider-js-vars.mdx: -------------------------------------------------------------------------------- 1 | ```ts 2 | import { InjectionToken } from '@angular/core'; 3 | 4 | export interface Theme { 5 | myFontSize: string, 6 | myFontFamily: string, 7 | myBorderRadius: string 8 | } 9 | 10 | // Theme injection token 11 | export const MY_THEME_TOKEN = new InjectionToken('ThemeToken'); 12 | ``` 13 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-app/template-files/src/app/app.routes.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFile } from '@teambit/generator'; 2 | 3 | export const appRoutesFile = (): ComponentFile => { 4 | return { 5 | relativePath: `src/app/app.routes.ts`, 6 | content: `import { Routes } from '@angular/router'; 7 | 8 | export const routes: Routes = []; 9 | `, 10 | }; 11 | }; 12 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-app/template-files/src/styles.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFile } from '@teambit/generator'; 2 | 3 | export const stylesFile = (styleSheet: string): ComponentFile => { 4 | return { 5 | relativePath: `src/styles.${styleSheet}`, 6 | content: `/* You can add global styles to this file, and also import other style files */ 7 | `, 8 | }; 9 | }; 10 | -------------------------------------------------------------------------------- /angular/integration/my-react-app/my-react-app.tsx: -------------------------------------------------------------------------------- 1 | // @ts-nocheck 2 | import { Routes, Route } from 'react-router-dom'; 3 | import { DemoElementsComponent } from '@bitdev/angular.integration.demo-elements'; 4 | 5 | export function MyReactApp() { 6 | return ( 7 | 8 | }/> 9 | 10 | ); 11 | } 12 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-env/files/env-jsonc.ts: -------------------------------------------------------------------------------- 1 | import { ComponentContext } from '@teambit/generator'; 2 | import { readFileSync } from 'fs-extra'; 3 | 4 | export const envJsoncFile = (context: ComponentContext, angularVersion: number) => { 5 | const jsoncFile = require.resolve(`@bitdev/angular.envs.angular-v${angularVersion}-env/env.jsonc`); 6 | return readFileSync(jsoncFile, 'utf-8'); 7 | }; 8 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-module/files/component-styles.ts: -------------------------------------------------------------------------------- 1 | import { ComponentContext, ComponentFile } from '@teambit/generator'; 2 | 3 | export const componentStylesFile = (context: ComponentContext): ComponentFile => { 4 | const { name } = context; 5 | return { 6 | relativePath: `${name}.component.scss`, 7 | content: `:host { 8 | font-size: inherit; 9 | }`, 10 | }; 11 | }; 12 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-standalone/files/component-styles.ts: -------------------------------------------------------------------------------- 1 | import { ComponentContext, ComponentFile } from '@teambit/generator'; 2 | 3 | export const componentStylesFile = (context: ComponentContext): ComponentFile => { 4 | const { name } = context; 5 | return { 6 | relativePath: `${name}.component.scss`, 7 | content: `:host { 8 | font-size: inherit; 9 | }`, 10 | }; 11 | }; 12 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-app/template-files/src/server/api/hello.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFile } from '@teambit/generator'; 2 | 3 | export const helloApiFile = (): ComponentFile => { 4 | return { 5 | relativePath: `src/server/api/hello.ts`, 6 | content: `import { defineEventHandler } from 'h3'; 7 | 8 | export default defineEventHandler(() => ({ message: 'Hello World' }));`, 9 | }; 10 | }; 11 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-env/files/config/eslintrc.ts: -------------------------------------------------------------------------------- 1 | export const eslintConfigFile = () => { 2 | return { 3 | relativePath: './config/eslintrc.cjs', 4 | content: `/** 5 | * @see https://bit.dev/reference/eslint/eslint-config 6 | */ 7 | module.exports = { 8 | extends: [require.resolve('@bitdev/angular.dev-services.linter.eslint')], 9 | rules: {}, 10 | }; 11 | `, 12 | }; 13 | }; 14 | -------------------------------------------------------------------------------- /angular/docs/components-overview/commands.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { CommandExample } from '@teambit/community.ui.bit-cli.command-example'; 3 | 4 | export const CreateComponent = () => { 5 | const values = { 6 | 'template-name': 'ng-module', 7 | 'component-names...': 'ui/my-button', 8 | }; 9 | 10 | return ; 11 | }; 12 | -------------------------------------------------------------------------------- /angular/docs/ng-base-components/commands.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { CommandsExplorer } from '@teambit/community.ui.bit-cli.commands-explorer'; 3 | 4 | export const CreateButtonComponent = () => { 5 | const values = { 6 | 'template-name': 'ng-module', 7 | 'component-names...': 'ui/button', 8 | }; 9 | return ; 10 | }; 11 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-env/files/config/tsconfig.json.ts: -------------------------------------------------------------------------------- 1 | export const tsConfigFile = () => { 2 | return { 3 | relativePath: './config/tsconfig.json', 4 | content: `/** 5 | * @see https://bit.dev/reference/typescript/typescript-config 6 | */ 7 | { 8 | "extends": "@bitdev/angular.envs.base-env/config/tsconfig.json", 9 | "include": ["**/*", "**/*.json"] 10 | } 11 | `, 12 | }; 13 | }; 14 | -------------------------------------------------------------------------------- /angular/docs/ng-base-components/code-snippets/css/my-base-theme-module-css-vars.mdx: -------------------------------------------------------------------------------- 1 | ```scss 2 | // Design tokens 3 | $myFontSize: 16px; 4 | $myFontFamily: "Roboto, sans-serif"; 5 | $myBorderRadius: 3px; 6 | 7 | // Mixin to output design tokens as CSS variables 8 | @mixin myBaseTheme() { 9 | --myFontSize: $myFontSize; 10 | --myFontFamily: $myFontFamily; 11 | --myBorderRadius: $myBorderRadius; 12 | } 13 | ``` 14 | -------------------------------------------------------------------------------- /angular/integration/demo-app/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | DemoApp 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /angular/envs/base-env/angular-base-env.docs.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: A generic Bit development environment for Angular Components 3 | labels: ['angular', 'aspect', 'extension'] 4 | --- 5 | 6 | **Do not use this directly.** If you want to add Angular support to your workspace, install the development environment for a specific Angular version. 7 | For example: [@bitdev.angular/angular-env](https://bit.cloud/bitdev/angular/angular-env). 8 | -------------------------------------------------------------------------------- /angular/devkit/ng-compat/build-angular/utils/package-chunk-sort.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { VERSION } from '@angular/cli'; 3 | 4 | export let generateEntryPoints: (options: { 5 | styles: any[]; 6 | scripts: any[]; 7 | isHMREnabled?: boolean; 8 | }) => any[]; 9 | 10 | if (VERSION.major) { 11 | generateEntryPoints = require('@angular-devkit/build-angular/src/utils/package-chunk-sort').generateEntryPoints; 12 | } 13 | -------------------------------------------------------------------------------- /angular/integration/demo-app/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | 4 | import { AppComponent } from './app.component'; 5 | 6 | @NgModule({ 7 | declarations: [ 8 | AppComponent 9 | ], 10 | imports: [ 11 | BrowserModule 12 | ], 13 | providers: [], 14 | bootstrap: [AppComponent] 15 | }) 16 | export class AppModule { } 17 | -------------------------------------------------------------------------------- /angular/devkit/preview/preview-app/preview-app/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-unused-vars */ 2 | import { Component } from '@angular/core'; 3 | 4 | @Component({ 5 | selector: 'app-root', 6 | standalone: false, 7 | template: ``, 8 | styleUrls: ['./app.component.scss'], 9 | }) 10 | export class AppComponent { 11 | title = 'bit-angular'; 12 | } 13 | -------------------------------------------------------------------------------- /angular/devkit/linter/eslint/bit-angular-eslint.docs.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: ESLint configurations for the Angular env 3 | labels: ['eslint', 'configurations', 'angular', 'env'] 4 | --- 5 | 6 | The default [Angular ESLint](https://github.com/angular-eslint/angular-eslint) configuration for the Angular environment ([@bitdev.angular/angular-env](https://bit.cloud/bitdev/angular/angular-env)). 7 | 8 | Review the configuration [here](bit-angular-eslint.ts). 9 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v16/bit-test.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BitTestComponent } from './bit-test.component'; 3 | import { BitTest2Component } from './bit-test2.component'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | BitTestComponent, 8 | BitTest2Component 9 | ], 10 | exports: [ 11 | BitTestComponent, 12 | BitTest2Component 13 | ] 14 | }) 15 | export class BitTestModule {} 16 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v17/bit-test.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BitTestComponent } from './bit-test.component'; 3 | import { BitTest2Component } from './bit-test2.component'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | BitTestComponent, 8 | BitTest2Component 9 | ], 10 | exports: [ 11 | BitTestComponent, 12 | BitTest2Component 13 | ] 14 | }) 15 | export class BitTestModule {} 16 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v18/bit-test.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BitTestComponent } from './bit-test.component'; 3 | import { BitTest2Component } from './bit-test2.component'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | BitTestComponent, 8 | BitTest2Component 9 | ], 10 | exports: [ 11 | BitTestComponent, 12 | BitTest2Component 13 | ] 14 | }) 15 | export class BitTestModule {} 16 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v19/bit-test.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BitTestComponent } from './bit-test.component'; 3 | import { BitTest2Component } from './bit-test2.component'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | BitTestComponent, 8 | BitTest2Component 9 | ], 10 | exports: [ 11 | BitTestComponent, 12 | BitTest2Component 13 | ] 14 | }) 15 | export class BitTestModule {} 16 | -------------------------------------------------------------------------------- /angular/integration/demo-lib/src/bit-test.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BitTestComponent } from './bit-test.component'; 3 | import { BitTest2Component } from './bit-test2.component'; 4 | 5 | @NgModule({ 6 | declarations: [ 7 | BitTestComponent, 8 | BitTest2Component 9 | ], 10 | exports: [ 11 | BitTestComponent, 12 | BitTest2Component 13 | ] 14 | }) 15 | export class BitTestModule {} 16 | -------------------------------------------------------------------------------- /angular/integration/my-react-app/my-react-app.docs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | description: 'A my-react-app app.' 3 | labels: ['app', 'react'] 4 | --- 5 | 6 | A React application for my-react-app. 7 | 8 | ## Run the application 9 | 10 | Import the app and add the following config to your workspace.jsonc: 11 | 12 | ``` 13 | bit use my-react-app 14 | ``` 15 | 16 | To run the app locally, run the following: 17 | 18 | ``` 19 | bit run my-react-app 20 | ``` 21 | -------------------------------------------------------------------------------- /angular/integration/demo-elements/demo-elements.composition.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { DemoElementsComponent } from './demo-elements.component'; 3 | 4 | @Component({ 5 | standalone: true, 6 | selector: 'demo-elements-composition-cmp', 7 | imports: [DemoElementsComponent], 8 | template: `DemoElements composition: ` 9 | }) 10 | export class DemoElementsCompositionComponent {} 11 | -------------------------------------------------------------------------------- /angular/integration/demo-lib/src/bit-test.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | import { BitTestService } from './bit-test.service'; 3 | 4 | @Component({ 5 | selector: 'bit-test', 6 | standalone: false, 7 | template: ` 8 |

bit-test component works!

9 | {{ service.content }} 10 | ` 11 | }) 12 | export class BitTestComponent { 13 | constructor(public service: BitTestService) {} 14 | } 15 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-env/files/config/prettier.config.ts: -------------------------------------------------------------------------------- 1 | export const prettierConfigFile = () => { 2 | return { 3 | relativePath: './config/prettier.config.cjs', 4 | content: `/** 5 | * @see https://bit.dev/reference/prettier/prettier-config 6 | */ 7 | const prettierConfig = require('@bitdev/angular.envs.base-env/config/prettier.config.cjs'); 8 | 9 | module.exports = { 10 | ...prettierConfig, 11 | }; 12 | `, 13 | }; 14 | }; 15 | -------------------------------------------------------------------------------- /angular/docs/ng-design-overview/ng-design-overview.composition.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { CommandsProvider } from '@teambit/community.ui.bit-cli.commands-provider'; 3 | import commands from '@teambit/harmony.content.cli-reference'; 4 | import { NgDesignOverview } from './index'; 5 | 6 | export const BasicVueDesignOverview = () => ( 7 | 8 | 9 | 10 | ); 11 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v16/bit-test.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | import { BitTestService } from './bit-test.service'; 3 | 4 | @Component({ 5 | selector: 'bit-test-v16', 6 | standalone: false, 7 | template: ` 8 |

bit-test component works!

9 | {{ service.content }} 10 | ` 11 | }) 12 | export class BitTestComponent { 13 | constructor(public service: BitTestService) {} 14 | } 15 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v17/bit-test.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | import { BitTestService } from './bit-test.service'; 3 | 4 | @Component({ 5 | selector: 'bit-test-v17', 6 | standalone: false, 7 | template: ` 8 |

bit-test component works!

9 | {{ service.content }} 10 | ` 11 | }) 12 | export class BitTestComponent { 13 | constructor(public service: BitTestService) {} 14 | } 15 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v19/bit-test.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | import { BitTestService } from './bit-test.service'; 3 | 4 | @Component({ 5 | selector: 'bit-test-v19', 6 | standalone: false, 7 | template: ` 8 |

bit-test component works!

9 | {{ service.content }} 10 | ` 11 | }) 12 | export class BitTestComponent { 13 | constructor(public service: BitTestService) {} 14 | } 15 | -------------------------------------------------------------------------------- /angular/devkit/preview/preview-app/preview-app/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Angular preview 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-env/files/config/tsconfig-spec.json.ts: -------------------------------------------------------------------------------- 1 | export const tsConfigSpecFile = () => { 2 | return { 3 | relativePath: './config/tsconfig.spec.json', 4 | content: `/* To learn more about this file see: https://angular.io/config/tsconfig. */ 5 | /* This config is used for bit test */ 6 | { 7 | "extends": "./tsconfig.json", 8 | "include": ["**/*.spec.+(js|ts)", "**/*.test.+(js|ts)", "**/*.d.ts"] 9 | } 10 | `, 11 | }; 12 | }; 13 | -------------------------------------------------------------------------------- /angular/integration/demo-app/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { RouterOutlet } from '@angular/router'; 4 | 5 | @Component({ 6 | selector: 'app-root', 7 | standalone: true, 8 | imports: [CommonModule, RouterOutlet], 9 | templateUrl: './app.component.html', 10 | styleUrls: ['./app.component.scss'], 11 | }) 12 | export class AppComponent { 13 | title = 'demo-app'; 14 | } 15 | -------------------------------------------------------------------------------- /angular/integration/my-react-app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Bit + React + Vite 10 | 11 | 12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v18/bit-test.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Inject } from "@angular/core"; 2 | import { BitTestService } from './bit-test.service'; 3 | 4 | @Component({ 5 | selector: 'bit-test-v18', 6 | standalone: false, 7 | template: ` 8 |

bit-test component works!

9 | {{ service.content }} 10 | ` 11 | }) 12 | export class BitTestComponent { 13 | constructor(@Inject(BitTestService) public service: BitTestService) {} 14 | } 15 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-app/template-files/src/app/app.routes.server.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFile } from '@teambit/generator'; 2 | 3 | export const appRoutesServerFile = (): ComponentFile => { 4 | return { 5 | relativePath: `src/app/app.routes.ts`, 6 | content: `import { RenderMode, ServerRoute } from '@angular/ssr'; 7 | 8 | export const serverRoutes: ServerRoute[] = [ 9 | { 10 | path: '**', 11 | renderMode: RenderMode.Prerender 12 | } 13 | ];`, 14 | }; 15 | }; 16 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-standalone/files/public-api.ts: -------------------------------------------------------------------------------- 1 | import { ComponentContext, ComponentFile } from '@teambit/generator'; 2 | 3 | export const publicApiFile = (context: ComponentContext): ComponentFile => { 4 | const { name } = context; 5 | return { 6 | isMain: true, 7 | relativePath: 'public-api.ts', 8 | content: `/** 9 | * Entry point for this Angular library, do not move or rename this file. 10 | */ 11 | export * from './${name}.component'; 12 | `, 13 | }; 14 | }; 15 | -------------------------------------------------------------------------------- /angular/integration/demo-app/src/app/app.config.ts: -------------------------------------------------------------------------------- 1 | import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; 2 | import { provideRouter } from '@angular/router'; 3 | import { provideClientHydration, withEventReplay } from '@angular/platform-browser'; 4 | import { routes } from './app.routes'; 5 | 6 | export const appConfig: ApplicationConfig = { 7 | providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes), provideClientHydration(withEventReplay())] 8 | }; 9 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-app/template-files/docs.ts: -------------------------------------------------------------------------------- 1 | import { ComponentContext, ComponentFile } from '@teambit/generator'; 2 | 3 | export const docsFile = (context: ComponentContext): ComponentFile => { 4 | const { name } = context; 5 | 6 | return { 7 | relativePath: `${name}.docs.md`, 8 | content: `--- 9 | labels: ['angular', 'typescript', 'apps'] 10 | description: 'An Angular application.' 11 | --- 12 | 13 | Run your application with \`bit run ${name}\`. 14 | `, 15 | }; 16 | }; 17 | -------------------------------------------------------------------------------- /angular/devkit/preview/preview-app/preview-app/src/main.ts: -------------------------------------------------------------------------------- 1 | import 'zone.js'; 2 | import { NgModuleRef } from '@angular/core'; 3 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 4 | import { AppModule } from './app/app.module'; 5 | 6 | window.ngMainStart = async function start(): Promise | void> { 7 | return platformBrowserDynamic().bootstrapModule(AppModule) 8 | // eslint-disable-next-line no-console 9 | .catch((err: any) => console.error(err)); 10 | } 11 | -------------------------------------------------------------------------------- /angular/docs/angular-env-docs-data/angular-env-docs-data.docs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | description: Constants for populating the Angular section of bit's documentation. 3 | --- 4 | 5 | A component that provides data such as the Angular env Name, templates etc, required for hydrating bit's Angular documentation 6 | 7 | ### Component usage 8 | ```js 9 | import { angularEnvDocsData } from '@bitdev/angular.docs.angular-env-docs-data'; 10 | 11 | 12 | 13 | ``` 14 | 15 | 16 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v16/compositions/cmp1.composition.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { BitTestModule } from '../bit-test.module'; 3 | 4 | @Component({ 5 | selector: 'bit-composition-v16', 6 | standalone: true, 7 | imports: [BitTestModule], 8 | template: ` 9 |

10 | Composition component 1 11 | 12 |

13 | `, 14 | styles: [ 15 | ] 16 | }) 17 | export class StandaloneCompositionComponent { 18 | } 19 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v17/compositions/cmp1.composition.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { BitTestModule } from '../bit-test.module'; 3 | 4 | @Component({ 5 | selector: 'bit-composition-v17', 6 | standalone: true, 7 | imports: [BitTestModule], 8 | template: ` 9 |

10 | Composition component 1 11 | 12 |

13 | `, 14 | styles: [ 15 | ] 16 | }) 17 | export class StandaloneCompositionComponent { 18 | } 19 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v18/compositions/cmp1.composition.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { BitTestModule } from '../bit-test.module'; 3 | 4 | @Component({ 5 | selector: 'bit-composition-v18', 6 | standalone: true, 7 | imports: [BitTestModule], 8 | template: ` 9 |

10 | Composition component 1 11 | 12 |

13 | `, 14 | styles: [ 15 | ] 16 | }) 17 | export class StandaloneCompositionComponent { 18 | } 19 | -------------------------------------------------------------------------------- /angular/docs/components-preview/snippets/composition-provider-wrapper.mdx: -------------------------------------------------------------------------------- 1 | ```tsx 2 | import { Component, ViewEncapsulation } from '@angular/core'; 3 | import { ThemeModule } from '@my-scope/my-theme.provider'; 4 | 5 | @Component({ 6 | selector: 'bit-wrapper', 7 | standalone: true, 8 | imports: [ThemeModule], 9 | encapsulation: ViewEncapsulation.None, 10 | template: ` 11 | 12 | 13 | 14 | `, 15 | }) export class WrapperComponent { 16 | } 17 | ``` 18 | -------------------------------------------------------------------------------- /angular/docs/angular-docs-routes/angular-docs-routes.docs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | description: Routes for the Angular section of bit's documentation. 3 | --- 4 | 5 | A component that exposes the Angular routes required for bit's Angular documentation 6 | 7 | ### Component usage 8 | ```js 9 | import { learnAngular } from '@bitdev/angular.docs.angular-docs-routes'; 10 | 11 | export const totalRoutes = DocsRoutes.from( 12 | [ 13 | // other application routes 14 | ...learnAngular, 15 | ], 16 | '/docs' 17 | ).toLinkList(); 18 | ``` -------------------------------------------------------------------------------- /angular/docs/ng-theming/code-snippets/my-base-theme-module.mdx: -------------------------------------------------------------------------------- 1 | ```scss 2 | // Design tokens 3 | $myFontSize: 16px; 4 | $myFontFamily: "Roboto, sans-serif"; 5 | $myBorderRadius: 3px; 6 | 7 | // Mixin to output design tokens as CSS variables 8 | @mixin myBaseTheme() { 9 | --myFontSize: $myFontSize; 10 | --myFontFamily: $myFontFamily; 11 | --myBorderRadius: $myBorderRadius; 12 | } 13 | 14 | :export { 15 | myFontSize: $myFontSize; 16 | myFontFamily: $myFontFamily; 17 | myBorderRadius: $myBorderRadius; 18 | } 19 | ``` 20 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-module/files/public-api.ts: -------------------------------------------------------------------------------- 1 | import { ComponentContext, ComponentFile } from '@teambit/generator'; 2 | 3 | export const publicApiFile = (context: ComponentContext): ComponentFile => { 4 | const { name } = context; 5 | return { 6 | isMain: true, 7 | relativePath: 'public-api.ts', 8 | content: `/** 9 | * Entry point for this Angular library, do not move or rename this file. 10 | */ 11 | export * from './${name}.component'; 12 | export * from './${name}.module'; 13 | `, 14 | }; 15 | }; 16 | -------------------------------------------------------------------------------- /angular/integration/demo-lib/src/compositions/bit-test.composition.ts: -------------------------------------------------------------------------------- 1 | import { Component, NgModule } from '@angular/core'; 2 | import { BitTestModule } from '../bit-test.module'; 3 | 4 | @Component({ 5 | selector: 'composition-cmp', 6 | standalone: false, 7 | template: `Composition: ` 8 | }) 9 | class CompositionComponent {} 10 | 11 | @NgModule({ 12 | declarations: [CompositionComponent], 13 | imports: [BitTestModule], 14 | bootstrap: [CompositionComponent] 15 | }) 16 | export class CompositionModule { 17 | } 18 | -------------------------------------------------------------------------------- /angular/devkit/vite/runtime/renderer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is written in JavaScript 3 | * because it is used by Nitro to build 4 | * the renderer for SSR. 5 | * 6 | * The package is shipped as commonjs 7 | * which won't be parsed by Nitro correctly. 8 | */ 9 | import { eventHandler } from 'h3'; 10 | 11 | import renderer from '#alias/entry.server'; 12 | import template from '#alias/index'; 13 | 14 | export default eventHandler(async (event) => { 15 | const html = await renderer(event.node.req.url, template); 16 | 17 | return html; 18 | }); 19 | -------------------------------------------------------------------------------- /angular/integration/demo-elements/demo-elements.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, input } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | 4 | @Component({ 5 | selector: 'demo-elements', 6 | standalone: true, 7 | imports: [CommonModule], 8 | template: ` 9 |

10 | demo-elements works!! 11 | Made by {{ name() }}. 12 |

13 | `, 14 | styleUrls: ['./demo-elements.component.scss'] 15 | }) 16 | export class DemoElementsComponent { 17 | name = input('Bit'); 18 | constructor() {} 19 | } 20 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v16/compositions/bit-test.composition.ts: -------------------------------------------------------------------------------- 1 | import { Component, NgModule } from '@angular/core'; 2 | import { BitTestModule } from '../bit-test.module'; 3 | 4 | @Component({ 5 | standalone: false, 6 | selector: 'composition-cmp-v16', 7 | template: `Composition: ` 8 | }) 9 | class CompositionComponent {} 10 | 11 | @NgModule({ 12 | declarations: [CompositionComponent], 13 | imports: [BitTestModule], 14 | bootstrap: [CompositionComponent] 15 | }) 16 | export class CompositionModule { 17 | } 18 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v17/compositions/bit-test.composition.ts: -------------------------------------------------------------------------------- 1 | import { Component, NgModule } from '@angular/core'; 2 | import { BitTestModule } from '../bit-test.module'; 3 | 4 | @Component({ 5 | standalone: false, 6 | selector: 'composition-cmp-v17', 7 | template: `Composition: ` 8 | }) 9 | class CompositionComponent {} 10 | 11 | @NgModule({ 12 | declarations: [CompositionComponent], 13 | imports: [BitTestModule], 14 | bootstrap: [CompositionComponent] 15 | }) 16 | export class CompositionModule { 17 | } 18 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v18/compositions/bit-test.composition.ts: -------------------------------------------------------------------------------- 1 | import { Component, NgModule } from '@angular/core'; 2 | import { BitTestModule } from '../bit-test.module'; 3 | 4 | @Component({ 5 | standalone: false, 6 | selector: 'composition-cmp-v18', 7 | template: `Composition: ` 8 | }) 9 | class CompositionComponent {} 10 | 11 | @NgModule({ 12 | declarations: [CompositionComponent], 13 | imports: [BitTestModule], 14 | bootstrap: [CompositionComponent] 15 | }) 16 | export class CompositionModule { 17 | } 18 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v19/compositions/bit-test.composition.ts: -------------------------------------------------------------------------------- 1 | import { Component, NgModule } from '@angular/core'; 2 | import { BitTestModule } from '../bit-test.module'; 3 | 4 | @Component({ 5 | selector: 'composition-cmp-v19', 6 | standalone: false, 7 | template: `Composition: ` 8 | }) 9 | class CompositionComponent {} 10 | 11 | @NgModule({ 12 | declarations: [CompositionComponent], 13 | imports: [BitTestModule], 14 | bootstrap: [CompositionComponent] 15 | }) 16 | export class CompositionModule { 17 | } 18 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v16/bit-test.docs.md: -------------------------------------------------------------------------------- 1 | --- 2 | labels: ['angular', 'typescript', 'bit-test'] 3 | description: 'A `bit-test` component.' 4 | --- 5 | 6 | # Bit test documentation 7 | Import `BitTestModule` : 8 | 9 | ```typescript 10 | import { BitTestModule } from './bit-test.module'; 11 | 12 | // add it to your module imports 13 | @NgModule({ 14 | // ... 15 | imports: [ 16 | BitTestModule 17 | ] 18 | // ... 19 | }) 20 | export class AppModule {} 21 | ``` 22 | 23 | Use `BitTestComponent` in your templates : 24 | 25 | ```html 26 | 27 | ``` 28 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v17/bit-test.docs.md: -------------------------------------------------------------------------------- 1 | --- 2 | labels: ['angular', 'typescript', 'bit-test'] 3 | description: 'A `bit-test` component.' 4 | --- 5 | 6 | # Bit test documentation 7 | Import `BitTestModule` : 8 | 9 | ```typescript 10 | import { BitTestModule } from './bit-test.module'; 11 | 12 | // add it to your module imports 13 | @NgModule({ 14 | // ... 15 | imports: [ 16 | BitTestModule 17 | ] 18 | // ... 19 | }) 20 | export class AppModule {} 21 | ``` 22 | 23 | Use `BitTestComponent` in your templates : 24 | 25 | ```html 26 | 27 | ``` 28 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v19/bit-test.docs.md: -------------------------------------------------------------------------------- 1 | --- 2 | labels: ['angular', 'typescript', 'bit-test'] 3 | description: 'A `bit-test` component.' 4 | --- 5 | 6 | # Bit test documentation 7 | Import `BitTestModule` : 8 | 9 | ```typescript 10 | import { BitTestModule } from './bit-test.module'; 11 | 12 | // add it to your module imports 13 | @NgModule({ 14 | // ... 15 | imports: [ 16 | BitTestModule 17 | ] 18 | // ... 19 | }) 20 | export class AppModule {} 21 | ``` 22 | 23 | Use `BitTestComponent` in your templates : 24 | 25 | ```html 26 | 27 | ``` 28 | -------------------------------------------------------------------------------- /angular/integration/demo-lib/src/bit-test.docs.md: -------------------------------------------------------------------------------- 1 | --- 2 | labels: ['angular', 'typescript', 'bit-test'] 3 | description: 'A `bit-test` component.' 4 | --- 5 | 6 | # Bit test documentation 7 | Import `BitTestModule` : 8 | 9 | ```typescript 10 | import { BitTestModule } from './bit-test.module'; 11 | 12 | // add it to your module imports 13 | @NgModule({ 14 | // ... 15 | imports: [ 16 | BitTestModule 17 | ] 18 | // ... 19 | }) 20 | export class AppModule {} 21 | ``` 22 | 23 | Use `BitTestComponent` in your templates : 24 | 25 | ```html 26 | 27 | ``` 28 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v18/demo-lib-v18.docs.md: -------------------------------------------------------------------------------- 1 | --- 2 | labels: ['angular', 'typescript', 'bit-test'] 3 | description: 'A `bit-test` component.' 4 | --- 5 | 6 | # Bit test documentation 7 | Import `BitTestModule` : 8 | 9 | ```typescript 10 | import { BitTestModule } from './bit-test.module'; 11 | 12 | // add it to your module imports 13 | @NgModule({ 14 | // ... 15 | imports: [ 16 | BitTestModule 17 | ] 18 | // ... 19 | }) 20 | export class AppModule {} 21 | ``` 22 | 23 | Use `BitTestComponent` in your templates : 24 | 25 | ```html 26 | 27 | ``` 28 | -------------------------------------------------------------------------------- /angular/devkit/ng-compat/build-angular/index-html-webpack-plugin.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { VERSION } from '@angular/cli'; 3 | 4 | export let IndexHtmlWebpackPlugin: any; 5 | if ((VERSION.major === '16' && Number(VERSION.minor) >= 2) || Number(VERSION.major) > 16) { 6 | // 16.2+ 7 | IndexHtmlWebpackPlugin = require('@angular-devkit/build-angular/src/tools/webpack/plugins/index-html-webpack-plugin').IndexHtmlWebpackPlugin; 8 | } else { 9 | IndexHtmlWebpackPlugin = require('@angular-devkit/build-angular/src/webpack/plugins/index-html-webpack-plugin').IndexHtmlWebpackPlugin; 10 | } 11 | -------------------------------------------------------------------------------- /angular/docs/build-pipelines/build-pipelines-template.mdx: -------------------------------------------------------------------------------- 1 | ```ts 2 | // my-env.bit-env.ts 3 | import { AngularEnv } from '@bitdev/angular.angular-env'; 4 | 5 | class MyEnv extends AngularEnv { 6 | build() { 7 | return Pipeline.from([ 8 | NgMultiCompiler.from({}), 9 | EslintTask.from({ 10 | tsconfig: this.tsconfigPath, 11 | configPath: this.eslintConfigPath, 12 | pluginsPath: __dirname, 13 | extensions: this.eslintExtensions, 14 | }), 15 | JestTask.from({ 16 | config: this.jestConfigPath, 17 | }), 18 | ]); 19 | } 20 | } 21 | ``` -------------------------------------------------------------------------------- /angular/docs/ng-theming/code-snippets/composition-provider-wrapper.mdx: -------------------------------------------------------------------------------- 1 | ```ts 2 | import { Component, ViewEncapsulation } from '@angular/core'; 3 | 4 | @Component({ 5 | selector: 'bit-wrapper', 6 | standalone: true, 7 | encapsulation: ViewEncapsulation.None, 8 | template: ` 9 | 10 | `, 11 | styles: [` 12 | @use "@my-org/my-scope.theme.my-base-theme/my-base-theme.module" as bt; 13 | 14 | body { 15 | @include bt.myBaseTheme(); 16 | font-size: var(--myFontSize, 16px); 17 | } 18 | `] 19 | }) export class WrapperComponent { 20 | } 21 | ``` 22 | -------------------------------------------------------------------------------- /angular/docs/ng-app-build/app-build.docs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | description: 'An MDX component.' 3 | labels: ['content', 'mdx'] 4 | --- 5 | 6 | import { AppBuild } from './index'; 7 | 8 | ### Component usage 9 | ```js 10 | 11 | ``` 12 | 13 | ### Render with theme and MDX providers 14 | 15 | ```js 16 | import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions'; 17 | import { MDXLayout } from '@teambit/mdx.ui.mdx-layout'; 18 | import { AppBuild } from './index'; 19 | 20 | 21 | 22 | 23 | 24 | 25 | ``` 26 | -------------------------------------------------------------------------------- /angular/docs/ng-base-components/code-snippets/js/my-button-component-js-vars.mdx: -------------------------------------------------------------------------------- 1 | ```ts 2 | import { Component, Inject } from '@angular/core'; 3 | import { MY_THEME_TOKEN, Theme } from "@my-org/my-scope.theme.my-theme-provider"; 4 | 5 | @Component({ 6 | selector: 'my-button', 7 | styleUrls: ['./my-button.component.scss'], 8 | template: ` 9 | `, 12 | }) 13 | export class MyButtonComponent { 14 | constructor(@Inject(MY_THEME_TOKEN) public myTheme: Theme) {} 15 | } 16 | ``` 17 | -------------------------------------------------------------------------------- /angular/docs/ng-theming/ng-theming.docs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | description: 'An MDX component.' 3 | labels: ['content', 'mdx'] 4 | --- 5 | 6 | import { NgTheming } from './index'; 7 | 8 | ### Component usage 9 | ```js 10 | 11 | ``` 12 | 13 | ### Render with theme and MDX providers 14 | 15 | ```js 16 | import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions'; 17 | import { MDXLayout } from '@teambit/mdx.ui.mdx-layout'; 18 | import { NgTheming } from './index'; 19 | 20 | 21 | 22 | 23 | 24 | 25 | ``` 26 | -------------------------------------------------------------------------------- /angular/integration/demo-app/src/app/app.config.server.ts: -------------------------------------------------------------------------------- 1 | import { mergeApplicationConfig, ApplicationConfig } from '@angular/core'; 2 | import { provideServerRendering } from '@angular/platform-server'; 3 | import { provideServerRoutesConfig } from '@angular/ssr'; 4 | import { appConfig } from './app.config'; 5 | import { serverRoutes } from './app.routes.server'; 6 | 7 | const serverConfig: ApplicationConfig = { 8 | providers: [ 9 | provideServerRendering(), 10 | provideServerRoutesConfig(serverRoutes), 11 | ] 12 | }; 13 | 14 | export const config = mergeApplicationConfig(appConfig, serverConfig); 15 | -------------------------------------------------------------------------------- /angular/docs/ng-app-deploy/app-deploy.docs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | description: 'An MDX component.' 3 | labels: ['content', 'mdx'] 4 | --- 5 | 6 | import { AppDeploy } from './index'; 7 | 8 | ### Component usage 9 | ```js 10 | 11 | ``` 12 | 13 | ### Render with theme and MDX providers 14 | 15 | ```js 16 | import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions'; 17 | import { MDXLayout } from '@teambit/mdx.ui.mdx-layout'; 18 | import { AppDeploy } from './index'; 19 | 20 | 21 | 22 | 23 | 24 | 25 | ``` 26 | -------------------------------------------------------------------------------- /angular/docs/build-pipelines/code-snippets/add-task-build.mdx: -------------------------------------------------------------------------------- 1 | The following code snippet adds a task to the default build pipeline of the Angular env. 2 | 3 | ```ts 4 | import { AngularV19Env } from '@bitdev/angular.envs.angular-v19-env'; 5 | /* import the task you want to add */ 6 | import { ComponentNameTask } from '@learnbit/extending-bit.build-tasks.component-name'; 7 | 8 | export class MyAngularEnv extends AngularV19Env { 9 | build() { 10 | /* add your task to the build pipeline */ 11 | return super.build().add([ComponentNameTask.from({})]); 12 | } 13 | } 14 | 15 | export default new MyAngularEnv(); 16 | ``` 17 | -------------------------------------------------------------------------------- /angular/docs/create-ng-app/create-ng-app.docs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | description: 'An MDX component.' 3 | labels: ['content', 'mdx'] 4 | --- 5 | 6 | import { CreateNgApp } from './index'; 7 | 8 | ### Component usage 9 | ```js 10 | 11 | ``` 12 | 13 | ### Render with theme and MDX providers 14 | 15 | ```js 16 | import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions'; 17 | import { MDXLayout } from '@teambit/mdx.ui.mdx-layout'; 18 | import { CreateNgApp } from './index'; 19 | 20 | 21 | 22 | 23 | 24 | 25 | ``` 26 | -------------------------------------------------------------------------------- /angular/devkit/vite/utils/types.ts: -------------------------------------------------------------------------------- 1 | import { ApplicationOptions, BrowserOptions, DevServerOptions } from '@bitdev/angular.dev-services.common'; 2 | 3 | export enum BuildMode { 4 | Development = 'development', 5 | Production = 'production', 6 | } 7 | 8 | export type NgViteOptions = { 9 | angularOptions: any;//Partial<(BrowserOptions | ApplicationOptions) & DevServerOptions>; 10 | 11 | /** name of the dev server */ 12 | name?: string; 13 | 14 | appRootPath: string; 15 | 16 | /** Output folder path for build files */ 17 | outputPath?: string; 18 | 19 | buildMode?: BuildMode; 20 | 21 | sourceRoot?: string; 22 | }; 23 | -------------------------------------------------------------------------------- /angular/docs/ng-theming/code-snippets/my-dark-theme-module.mdx: -------------------------------------------------------------------------------- 1 | ```scss 2 | // Design tokens 3 | $myPrimaryColor: #4571c4; 4 | $mySecondaryColor: #c42020cc; 5 | $myTextColor: #bae0ff; 6 | $myBgColor: #303030; 7 | 8 | // Mixin to output design tokens as CSS variables 9 | @mixin myDarkTheme() { 10 | --myPrimaryColor: $myPrimaryColor; 11 | --mySecondaryColor: $mySecondaryColor; 12 | --myTextColor: $myTextColor; 13 | --myBgColor: $myBgColor; 14 | } 15 | 16 | :export { 17 | myPrimaryColor: $myPrimaryColor; 18 | mySecondaryColor: $mySecondaryColor; 19 | myTextColor: $myTextColor; 20 | myBgColor: $myBgColor; 21 | } 22 | ``` 23 | -------------------------------------------------------------------------------- /angular/docs/component-libs/component-libs.docs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | description: 'An MDX component.' 3 | labels: ['content', 'mdx'] 4 | --- 5 | 6 | import { ComponentLibs } from './index'; 7 | 8 | ### Component usage 9 | ```js 10 | 11 | ``` 12 | 13 | ### Render with theme and MDX providers 14 | 15 | ```js 16 | import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions'; 17 | import { MDXLayout } from '@teambit/mdx.ui.mdx-layout'; 18 | import { ComponentLibs } from './index'; 19 | 20 | 21 | 22 | 23 | 24 | 25 | ``` 26 | -------------------------------------------------------------------------------- /angular/docs/ng-theming/code-snippets/composition-provider-env.mdx: -------------------------------------------------------------------------------- 1 | ```ts 2 | // @filename: my-angular-env.bit-env.ts 3 | import { AngularV19Env } from '@bitdev/angular.envs.angular-v19-env'; 4 | import { Preview } from '@teambit/preview'; 5 | import { EnvHandler } from '@teambit/envs'; 6 | import { AngularPreview } from '@bitdev/angular.dev-services.preview.preview'; 7 | 8 | export class MyAngularEnv extends AngularV19Env { 9 | preview(): EnvHandler { 10 | return AngularPreview.from({ 11 | mounterPath: require.resolve('./config/mounter') 12 | }); 13 | } 14 | } 15 | 16 | export default new MyAngularEnv(); 17 | ``` 18 | -------------------------------------------------------------------------------- /angular/docs/build-pipelines/build-pipelines.docs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | description: 'An MDX component.' 3 | labels: ['content', 'mdx'] 4 | --- 5 | 6 | import { BuildPipelines } from './index'; 7 | 8 | ### Component usage 9 | ```js 10 | 11 | ``` 12 | 13 | ### Render with theme and MDX providers 14 | 15 | ```js 16 | import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions'; 17 | import { MDXLayout } from '@teambit/mdx.ui.mdx-layout'; 18 | import { BuildPipelines } from './index'; 19 | 20 | 21 | 22 | 23 | 24 | 25 | ``` 26 | -------------------------------------------------------------------------------- /angular/docs/components-preview/snippets/composition-mounter-env.mdx: -------------------------------------------------------------------------------- 1 | ```tsx 2 | // @filename: my-angular-env.bit-env.ts 3 | import { AngularV19Env } from '@bitdev/angular.envs.angular-v19-env'; 4 | import { Preview } from '@teambit/preview'; 5 | import { EnvHandler } from '@teambit/envs'; 6 | import { AngularPreview } from '@bitdev/angular.dev-services.preview.preview'; 7 | 8 | export class MyAngularEnv extends AngularV19Env { 9 | preview(): EnvHandler { 10 | return AngularPreview.from({ 11 | mounterPath: require.resolve('./config/mounter') 12 | }); 13 | } 14 | } 15 | 16 | export default new MyAngularEnv(); 17 | ``` 18 | -------------------------------------------------------------------------------- /angular/docs/components-preview/snippets/composition-provider-env.mdx: -------------------------------------------------------------------------------- 1 | ```tsx 2 | // @filename: my-angular-env.bit-env.ts 3 | import { AngularV19Env } from '@bitdev/angular.envs.angular-v19-env'; 4 | import { Preview } from '@teambit/preview'; 5 | import { EnvHandler } from '@teambit/envs'; 6 | import { AngularPreview } from '@bitdev/angular.dev-services.preview.preview'; 7 | 8 | export class MyAngularEnv extends AngularV19Env { 9 | preview(): EnvHandler { 10 | return AngularPreview.from({ 11 | mounterPath: require.resolve('./config/mounter') 12 | }); 13 | } 14 | } 15 | 16 | export default new MyAngularEnv(); 17 | ``` 18 | -------------------------------------------------------------------------------- /angular/docs/angular-versions/angular-versions.docs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | description: 'An MDX component.' 3 | labels: ['content', 'mdx'] 4 | --- 5 | 6 | import { AngularVersions } from './index'; 7 | 8 | ### Component usage 9 | ```js 10 | 11 | ``` 12 | 13 | ### Render with theme and MDX providers 14 | 15 | ```js 16 | import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions'; 17 | import { MDXLayout } from '@teambit/mdx.ui.mdx-layout'; 18 | import { AngularVersions } from './index'; 19 | 20 | 21 | 22 | 23 | 24 | 25 | ``` 26 | -------------------------------------------------------------------------------- /angular/docs/ng-base-components/base-components.docs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | description: 'An MDX component.' 3 | labels: ['content', 'mdx'] 4 | --- 5 | 6 | import { BaseComponents } from './index'; 7 | 8 | ### Component usage 9 | ```js 10 | 11 | ``` 12 | 13 | ### Render with theme and MDX providers 14 | 15 | ```js 16 | import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions'; 17 | import { MDXLayout } from '@teambit/mdx.ui.mdx-layout'; 18 | import { BaseComponents } from './index'; 19 | 20 | 21 | 22 | 23 | 24 | 25 | ``` 26 | -------------------------------------------------------------------------------- /angular/docs/build-pipelines/code-snippets/jest-build-task.mdx: -------------------------------------------------------------------------------- 1 | ```ts 2 | // @filename: my-angular-env.bit-env.ts 3 | // ... 4 | import { AngularV19Env } from '@bitdev/angular.envs.angular-v19-env'; 5 | import { JestTask } from '@teambit/defender.jest-tester'; 6 | import { Pipeline } from '@teambit/builder'; 7 | 8 | export class MyAngularEnv extends AngularV19Env { 9 | build() { 10 | return Pipeline.from([ 11 | // ... 12 | JestTask.from({ 13 | jest: require.resolve('jest'), 14 | config: require.resolve('./configs/jest.config') 15 | }) 16 | ]); 17 | } 18 | } 19 | 20 | export default new MyAngularEnv(); 21 | ``` 22 | -------------------------------------------------------------------------------- /angular/docs/create-custom-env/create-custom-env.docs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | description: 'An MDX component.' 3 | labels: ['content', 'mdx'] 4 | --- 5 | 6 | import { CreateCustomEnv } from './index'; 7 | 8 | ### Component usage 9 | ```js 10 | 11 | ``` 12 | 13 | ### Render with theme and MDX providers 14 | 15 | ```js 16 | import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions'; 17 | import { MDXLayout } from '@teambit/mdx.ui.mdx-layout'; 18 | import { CreateCustomEnv } from './index'; 19 | 20 | 21 | 22 | 23 | 24 | 25 | ``` 26 | -------------------------------------------------------------------------------- /angular/docs/dependency-policy/dependency-policy.docs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | description: 'An MDX component.' 3 | labels: ['content', 'mdx'] 4 | --- 5 | 6 | import { DependencyPolicy } from './index'; 7 | 8 | ### Component usage 9 | ```js 10 | 11 | ``` 12 | 13 | ### Render with theme and MDX providers 14 | 15 | ```js 16 | import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions'; 17 | import { MDXLayout } from '@teambit/mdx.ui.mdx-layout'; 18 | import { DependencyPolicy } from './index'; 19 | 20 | 21 | 22 | 23 | 24 | 25 | ``` 26 | -------------------------------------------------------------------------------- /angular/docs/development-tools/development-tools.docs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | description: 'An MDX component.' 3 | labels: ['content', 'mdx'] 4 | --- 5 | 6 | import { DevelopmentTools } from './index'; 7 | 8 | ### Component usage 9 | ```js 10 | 11 | ``` 12 | 13 | ### Render with theme and MDX providers 14 | 15 | ```js 16 | import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions'; 17 | import { MDXLayout } from '@teambit/mdx.ui.mdx-layout'; 18 | import { DevelopmentTools } from './index'; 19 | 20 | 21 | 22 | 23 | 24 | 25 | ``` 26 | -------------------------------------------------------------------------------- /angular/docs/build-pipelines/code-snippets/jest-service.mdx: -------------------------------------------------------------------------------- 1 | ```ts 2 | // @filename: my-angular-env.bit-env.ts 3 | // ... 4 | import { AngularV19Env } from '@bitdev/angular.envs.angular-v19-env'; 5 | import { EnvHandler } from '@teambit/envs'; 6 | import { Tester } from '@teambit/tester'; 7 | import { JestTester } from '@teambit/defender.jest-tester'; 8 | 9 | export class MyAngularEnv extends AngularV19Env { 10 | tester(): EnvHandler { 11 | return JestTester.from({ 12 | jest: require.resolve('jest'), 13 | config: require.resolve('./configs/jest.config') 14 | }); 15 | } 16 | } 17 | 18 | export default new MyAngularEnv(); 19 | ``` 20 | -------------------------------------------------------------------------------- /angular/docs/ng-design-overview/ng-design-overview.docs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | description: 'An MDX component.' 3 | labels: ['content', 'mdx'] 4 | --- 5 | 6 | ### Component usage 7 | ```js 8 | import { NgDesignOverview } from './index'; 9 | 10 | 11 | ``` 12 | 13 | ### Render with theme and MDX providers 14 | 15 | ```js 16 | import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions'; 17 | import { MDXLayout } from '@teambit/mdx.ui.mdx-layout'; 18 | import { NgDesignOverview } from './index'; 19 | 20 | 21 | 22 | 23 | 24 | 25 | ``` 26 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-module/files/module.ts: -------------------------------------------------------------------------------- 1 | import { ComponentContext, ComponentFile } from '@teambit/generator'; 2 | 3 | export const moduleFile = (context: ComponentContext): ComponentFile => { 4 | const { name, namePascalCase: Name } = context; 5 | 6 | return { 7 | relativePath: `${name}.module.ts`, 8 | content: `import { NgModule } from '@angular/core'; 9 | import { ${Name}Component } from './${name}.component'; 10 | 11 | @NgModule({ 12 | declarations: [ 13 | ${Name}Component 14 | ], 15 | imports: [], 16 | exports: [ 17 | ${Name}Component 18 | ] 19 | }) 20 | export class ${Name}Module {} 21 | `, 22 | }; 23 | }; 24 | -------------------------------------------------------------------------------- /angular/docs/components-preview/components-preview.docs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | description: 'An MDX component.' 3 | labels: ['content', 'mdx'] 4 | --- 5 | 6 | import { ComponentsPreview } from './index'; 7 | 8 | ### Component usage 9 | ```js 10 | 11 | ``` 12 | 13 | ### Render with theme and MDX providers 14 | 15 | ```js 16 | import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions'; 17 | import { MDXLayout } from '@teambit/mdx.ui.mdx-layout'; 18 | import { ComponentsPreview } from './index'; 19 | 20 | 21 | 22 | 23 | 24 | 25 | ``` 26 | -------------------------------------------------------------------------------- /angular/docs/workspace-starters/workspace-starters.docs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | description: 'An MDX component.' 3 | labels: ['content', 'mdx'] 4 | --- 5 | 6 | import { WorkspaceStarters } from './index'; 7 | 8 | ### Component usage 9 | ```js 10 | 11 | ``` 12 | 13 | ### Render with theme and MDX providers 14 | 15 | ```js 16 | import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions'; 17 | import { MDXLayout } from '@teambit/mdx.ui.mdx-layout'; 18 | import { WorkspaceStarters } from './index'; 19 | 20 | 21 | 22 | 23 | 24 | 25 | ``` 26 | -------------------------------------------------------------------------------- /angular/devkit/preview/preview-app/preview-app/src/app/docs/safe-html.pipe.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-unused-vars */ 2 | import { Pipe, PipeTransform } from '@angular/core'; 3 | import { DomSanitizer } from '@angular/platform-browser'; 4 | import dompurify from 'dompurify'; 5 | 6 | @Pipe({ 7 | standalone: false, 8 | name: 'safeHtml' 9 | }) 10 | export class SafeHtmlPipe implements PipeTransform { 11 | constructor(private sanitizer: DomSanitizer) {} 12 | 13 | public transform(value: any): any { 14 | const sanitizedContent = dompurify.sanitize(value); 15 | return this.sanitizer.bypassSecurityTrustHtml(sanitizedContent); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /angular/docs/components-overview/components-overview.docs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | description: 'An MDX component.' 3 | labels: ['content', 'mdx'] 4 | --- 5 | 6 | import { ComponentsOverview } from './index'; 7 | 8 | ### Component usage 9 | ```js 10 | 11 | ``` 12 | 13 | ### Render with theme and MDX providers 14 | 15 | ```js 16 | import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions'; 17 | import { MDXLayout } from '@teambit/mdx.ui.mdx-layout'; 18 | import { ComponentsOverview } from './index'; 19 | 20 | 21 | 22 | 23 | 24 | 25 | ``` 26 | -------------------------------------------------------------------------------- /angular/docs/component-generators/component-generators.docs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | description: 'An MDX component.' 3 | labels: ['content', 'mdx'] 4 | --- 5 | 6 | import { ComponentGenerators } from './index'; 7 | 8 | ### Component usage 9 | ```js 10 | 11 | ``` 12 | 13 | ### Render with theme and MDX providers 14 | 15 | ```js 16 | import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions'; 17 | import { MDXLayout } from '@teambit/mdx.ui.mdx-layout'; 18 | import { ComponentGenerators } from './index'; 19 | 20 | 21 | 22 | 23 | 24 | 25 | ``` 26 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-module/files/component.ts: -------------------------------------------------------------------------------- 1 | import { ComponentContext, ComponentFile } from '@teambit/generator'; 2 | 3 | export const componentFile = (context: ComponentContext): ComponentFile => { 4 | const { name, namePascalCase: Name } = context; 5 | return { 6 | relativePath: `${name}.component.ts`, 7 | content: `import { Component } from '@angular/core'; 8 | 9 | @Component({ 10 | selector: '${name}', 11 | standalone: false, 12 | template: \` 13 |

14 | ${name} works! 15 |

16 | \`, 17 | styleUrls: ['./${name}.component.scss'] 18 | }) 19 | export class ${Name}Component { 20 | constructor() {} 21 | } 22 | `, 23 | }; 24 | }; 25 | -------------------------------------------------------------------------------- /angular/docs/bit-angular-introduction/bit-angular-introduction.docs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | description: 'An MDX component.' 3 | labels: ['content', 'mdx'] 4 | --- 5 | 6 | import { BitAngularIntroduction } from './index'; 7 | 8 | ### Component usage 9 | ```js 10 | 11 | ``` 12 | 13 | ### Render with theme and MDX providers 14 | 15 | ```js 16 | import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions'; 17 | import { MDXLayout } from '@teambit/mdx.ui.mdx-layout'; 18 | import { BitAngularIntroduction } from './index'; 19 | 20 | 21 | 22 | 23 | 24 | 25 | ``` 26 | -------------------------------------------------------------------------------- /angular/docs/components-preview/snippets/composition-provider-wrapper2.mdx: -------------------------------------------------------------------------------- 1 | ```tsx 2 | import { Component, NgModule, ViewEncapsulation } from '@angular/core'; 3 | import { ThemeModule } from '@my-scope/my-theme.provider'; 4 | 5 | @Component({ 6 | selector: 'bit-wrapper', 7 | encapsulation: ViewEncapsulation.ShadowDom, 8 | template: ` 9 | 10 |
11 |
12 | `, 13 | }) export class WrapperComponent { 14 | } 15 | 16 | @NgModule({ 17 | declarations: [WrapperComponent], 18 | imports: [ThemeModule], 19 | exports: [WrapperComponent], 20 | bootstrap: [WrapperComponent], 21 | }) export class WrapperModule { 22 | } 23 | ``` 24 | -------------------------------------------------------------------------------- /angular/docs/components-documentation/components-documentation.docs.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | description: 'An MDX component.' 3 | labels: ['content', 'mdx'] 4 | --- 5 | 6 | import { ComponentsDocumentation } from './index'; 7 | 8 | ### Component usage 9 | ```js 10 | 11 | ``` 12 | 13 | ### Render with theme and MDX providers 14 | 15 | ```js 16 | import { ThemeCompositions } from '@teambit/documenter.theme.theme-compositions'; 17 | import { MDXLayout } from '@teambit/mdx.ui.mdx-layout'; 18 | import { ComponentsDocumentation } from './index'; 19 | 20 | 21 | 22 | 23 | 24 | 25 | ``` 26 | -------------------------------------------------------------------------------- /angular/docs/build-pipelines/code-snippets/add-task-snap.mdx: -------------------------------------------------------------------------------- 1 | The Angular env does not register tasks to the snap pipeline. 2 | To add a new task, first create a new snap pipeline. 3 | 4 | ```ts 5 | import { AngularV19Env } from '@bitdev/angular.envs.angular-v19-env'; 6 | import { Pipeline } from '@teambit/builder'; 7 | /* import the task you want to add */ 8 | import { ComponentNameTask } from '@learnbit/extending-bit.build-tasks.component-name'; 9 | 10 | export class MyAngularEnv extends AngularV19Env { 11 | snap() { 12 | /* create a new pipeline and add your task */ 13 | return Pipeline.from([ComponentNameTask.from({})]); 14 | } 15 | } 16 | 17 | export default new MyAngularEnv(); 18 | ``` 19 | -------------------------------------------------------------------------------- /angular/docs/build-pipelines/code-snippets/add-task-tag.mdx: -------------------------------------------------------------------------------- 1 | The Angular env does not register tasks to the tag pipeline. 2 | To add a new task, first create a new tag pipeline. 3 | 4 | ```ts 5 | import { AngularV19Env } from '@bitdev/angular.envs.angular-v19-env'; 6 | import { Pipeline } from '@teambit/builder'; 7 | /* import the task you want to add */ 8 | import { ComponentNameTask } from '@learnbit/extending-bit.build-tasks.component-name'; 9 | 10 | export class MyAngularEnv extends AngularV19Env { 11 | tag() { 12 | /* create a new pipeline and add your task */ 13 | return Pipeline.from([ComponentNameTask.from({})]); 14 | } 15 | } 16 | 17 | export default new MyAngularEnv(); 18 | ``` 19 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-module/files/composition.ts: -------------------------------------------------------------------------------- 1 | import { ComponentContext, ComponentFile } from '@teambit/generator'; 2 | 3 | export const compositionFile = (context: ComponentContext): ComponentFile => { 4 | const { name, namePascalCase: Name } = context; 5 | 6 | return { 7 | relativePath: `${name}.composition.ts`, 8 | content: `import { Component } from '@angular/core'; 9 | import { ${Name}Module } from './${name}.module'; 10 | 11 | @Component({ 12 | standalone: true, 13 | selector: '${name}-composition-cmp', 14 | imports: [${Name}Module], 15 | template: \`${Name} composition: <${name}>\` 16 | }) 17 | export class ${Name}CompositionComponent {}`, 18 | }; 19 | }; 20 | -------------------------------------------------------------------------------- /angular/devkit/preview/runtime/main.ts: -------------------------------------------------------------------------------- 1 | import { ViewEncapsulation, ɵɵdefineComponent } from '@angular/core'; 2 | 3 | // The injector used to create custom elements from Angular components 4 | class AppComponent { 5 | static ɵfac = function AppComponent_Factory(__ngFactoryType__: any) { 6 | return new (__ngFactoryType__ || AppComponent)(); 7 | }; 8 | 9 | static ɵcmp = /* @__PURE__ */ ɵɵdefineComponent({ 10 | type: AppComponent, 11 | selectors: [["app-root"]], 12 | decls: 0, 13 | vars: 0, 14 | template: function AppComponent_Template(rf, ctx) { 15 | }, 16 | dependencies: [], 17 | encapsulation: ViewEncapsulation.None 18 | }); 19 | } 20 | 21 | export { AppComponent }; 22 | -------------------------------------------------------------------------------- /angular/integration/my-react-app/server.app-root.tsx: -------------------------------------------------------------------------------- 1 | import ReactDOMServer from "react-dom/server"; 2 | import { StaticRouter } from "react-router-dom/server.js"; 3 | import { MyReactApp } from "./my-react-app.js"; 4 | 5 | interface IRenderProps { 6 | path: string; 7 | } 8 | 9 | export const render = async ({ path }: IRenderProps) => { 10 | return ReactDOMServer.renderToString( 11 | // @ts-ignore 12 | 13 | 14 | 15 | ); 16 | }; 17 | 18 | /** 19 | * implement loadScripts() to inject scripts to the head 20 | * during SSR. 21 | */ 22 | // export const loadScripts = async () => { 23 | // return ''; 24 | // } 25 | -------------------------------------------------------------------------------- /angular/devkit/preview/preview-app/preview-app/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-unused-vars */ 2 | import { NgModule } from '@angular/core'; 3 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 4 | 5 | import { AppComponent } from './app.component'; 6 | import { DocsComponent } from './docs/docs.component'; 7 | import { SafeHtmlPipe } from './docs/safe-html.pipe'; 8 | import { LazyLoadComponent } from './lazy-load/lazy-load.component'; 9 | 10 | @NgModule({ 11 | declarations: [AppComponent, LazyLoadComponent, SafeHtmlPipe, DocsComponent], 12 | imports: [BrowserAnimationsModule], 13 | bootstrap: [AppComponent] 14 | }) 15 | export class AppModule { 16 | } 17 | -------------------------------------------------------------------------------- /angular/docs/ng-theming/commands.tsx: -------------------------------------------------------------------------------- 1 | import { CommandsExplorer } from '@teambit/community.ui.bit-cli.commands-explorer'; 2 | import React from 'react'; 3 | 4 | export const CreateBaseThemeComponent = () => { 5 | const values = { 6 | 'template-name': 'scss', 7 | 'component-names...': 'theme/my-base-theme', 8 | 'aspect': 'teambit.html/html-env' 9 | }; 10 | return ; 11 | }; 12 | 13 | export const CreateCustomThemeComponent = () => { 14 | const values = { 15 | 'template-name': 'scss', 16 | 'component-names...': 'theme/my-dark-theme', 17 | }; 18 | return 19 | }; 20 | -------------------------------------------------------------------------------- /angular/devkit/compiler/multi-compiler/config/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "sourceMap": true, 5 | "skipLibCheck": true, 6 | "esModuleInterop": true, 7 | "resolveJsonModule": true, 8 | "allowJs": true, 9 | "jsx": "react-jsx", 10 | "target": "es2020", 11 | "lib": ["esnext", "dom", "dom.Iterable"], 12 | "experimentalDecorators": true, 13 | "outDir": "./dist", 14 | "module": "NodeNext", 15 | "moduleResolution": "NodeNext" 16 | }, 17 | "exclude": [ 18 | "artifacts", 19 | "public", 20 | "dist", 21 | "node_modules", 22 | "package.json", 23 | "**/*.cjs" 24 | ], 25 | "include": ["**/*", "**/*.json"] 26 | } 27 | -------------------------------------------------------------------------------- /angular/docs/ng-app-deploy/deploy-examples.tsx: -------------------------------------------------------------------------------- 1 | import { ContentTabs, } from '@teambit/community.ui.content-tabs'; 2 | import React from 'react'; 3 | import styles from './app-deployment.module.scss'; 4 | import Netlify from './netlify.mdx'; 5 | // import Cloudflare from './cloudflare.mdx'; 6 | 7 | const StartNew = () => Netlify; 8 | // const Add = () => Cloudflare; 9 | 10 | const content = [ 11 | { title: , body: }, 12 | // { title: Add, Body: Cloudflare }, 13 | ]; 14 | 15 | export const DeployerExample = () => ( 16 | 20 | ); 21 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-app/template-files/src/index-html.ts: -------------------------------------------------------------------------------- 1 | import { ComponentContext, ComponentFile } from '@teambit/generator'; 2 | 3 | export const indexHtmlFile = (context: ComponentContext): ComponentFile => { 4 | const { namePascalCase: Name } = context; 5 | return { 6 | relativePath: `src/index.html`, 7 | content: ` 8 | 9 | 10 | 11 | ${Name} 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | ` 21 | }; 22 | }; 23 | -------------------------------------------------------------------------------- /angular/docs/ng-base-components/code-snippets/js/app-main-module-js-vars.mdx: -------------------------------------------------------------------------------- 1 | ```ts 2 | import { NgModule } from '@angular/core'; 3 | import { BrowserModule } from '@angular/platform-browser'; 4 | import { MY_THEME_TOKEN } from "@my-org/my-scope.theme.my-theme-provider"; 5 | import { myBaseTheme } from "@my-org/my-scope.theme.my-base-theme"; 6 | import { AppComponent } from './app.component'; 7 | 8 | @NgModule({ 9 | declarations: [ AppComponent ], 10 | imports: [ BrowserModule ], 11 | // Provide the theme through an InjectionToken, which decouples the theme itself from a specific implementation 12 | providers: [ {provide: MY_THEME_TOKEN, useValue: myBaseTheme} ], 13 | bootstrap: [ AppComponent ] 14 | }) 15 | export class AppModule {} 16 | ``` 17 | -------------------------------------------------------------------------------- /angular/devkit/webpack/webpack-plugins/utils.ts: -------------------------------------------------------------------------------- 1 | import { existsSync } from 'fs'; 2 | import { resolve } from 'path'; 3 | 4 | export function tryResolvePackage(resolver: any, moduleName: string, nodeModulesDir: string): string | undefined { 5 | try { 6 | const resolvedPath = resolver.resolveSync( 7 | {}, 8 | nodeModulesDir, 9 | `${moduleName}/package.json` 10 | ); 11 | 12 | return resolvedPath || undefined; 13 | } catch { 14 | // Ex: @angular/compiler/src/i18n/i18n_ast/package.json 15 | // or local libraries which don't reside in node_modules 16 | const packageJsonPath = resolve(nodeModulesDir, '../package.json'); 17 | 18 | return existsSync(packageJsonPath) ? packageJsonPath : undefined; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /angular/devkit/webpack/utils.ts: -------------------------------------------------------------------------------- 1 | import { BundlerSetup } from '@bitdev/angular.dev-services.common'; 2 | import { BundlerContext, DevServerContext } from '@teambit/bundler'; 3 | import { Logger } from '@teambit/logger'; 4 | import type { Configuration, WebpackPluginInstance } from 'webpack'; 5 | 6 | 7 | export type WebpackConfig = Configuration; 8 | 9 | export interface WebpackConfigFactoryOpts { 10 | tempFolder: string; 11 | context: DevServerContext | BundlerContext; 12 | tsConfigPath: string; 13 | rootPath: string; 14 | logger: Logger; 15 | setup: BundlerSetup; 16 | angularOptions: any; 17 | sourceRoot?: string; 18 | entryFiles: string[]; 19 | nodeModulesPaths: string[]; 20 | workspaceDir: string; 21 | plugins: WebpackPluginInstance[]; 22 | } 23 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-standalone/files/component.ts: -------------------------------------------------------------------------------- 1 | import { ComponentContext, ComponentFile } from '@teambit/generator'; 2 | 3 | export const componentFile = (context: ComponentContext): ComponentFile => { 4 | const { name, namePascalCase: Name } = context; 5 | return { 6 | relativePath: `${name}.component.ts`, 7 | content: `import { Component } from '@angular/core'; 8 | import { CommonModule } from '@angular/common'; 9 | 10 | @Component({ 11 | selector: '${name}', 12 | standalone: true, 13 | imports: [CommonModule], 14 | template: \` 15 |

16 | ${name} works! 17 |

18 | \`, 19 | styleUrls: ['./${name}.component.scss'] 20 | }) 21 | export class ${Name}Component { 22 | constructor() {} 23 | } 24 | `, 25 | }; 26 | }; 27 | -------------------------------------------------------------------------------- /angular/docs/bit-angular-introduction/commands.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { CommandsExplorer } from '@teambit/community.ui.bit-cli.commands-explorer'; 3 | 4 | export const BitNew = () => { 5 | const values = { 6 | 'template-name': 'hello-world-angular', 7 | env: 'teambit.community/starters/hello-world-angular', 8 | 'workspace-name': 'my-hello-world-angular', 9 | }; 10 | 11 | return 12 | }; 13 | 14 | export const BitNewEmpty = () => { 15 | const values = { 16 | 'template-name': 'angular', 17 | env: 'bitdev.angular/angular-env', 18 | 'workspace-name': 'my-angular-workspace' 19 | }; 20 | 21 | return 22 | }; -------------------------------------------------------------------------------- /angular/examples/my-angular-v17-env/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "componentId": { 3 | "scope": "bitdev.angular", 4 | "name": "examples/my-angular-v17-env", 5 | "version": "7.3.2" 6 | }, 7 | "propagate": false, 8 | "extensions": { 9 | "teambit.dependencies/dependency-resolver": { 10 | "policy": { 11 | "dependencies": { 12 | "@jest/globals": "^29.3.1", 13 | "@bitdev/angular.dev-services.linter.eslint": ">= 1.0.0", 14 | "@types/jest": "^29.5.0", 15 | "jest": "^29.5.0", 16 | "jest-preset-angular": "~13.1.3" 17 | } 18 | } 19 | }, 20 | "bitdev.general/envs/bit-env@1.0.21": {}, 21 | "teambit.envs/envs": { 22 | "env": "bitdev.general/envs/bit-env" 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /angular/integration/demo-app/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/plugins/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /angular/integration/demo-elements/demo-elements.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | import { DemoElementsComponent } from './demo-elements.component'; 3 | 4 | describe('DemoElementsComponent', () => { 5 | let component: DemoElementsComponent; 6 | let fixture: ComponentFixture; 7 | 8 | beforeEach(async () => { 9 | await TestBed.configureTestingModule({ 10 | imports: [ DemoElementsComponent ] 11 | }) 12 | .compileComponents(); 13 | 14 | fixture = TestBed.createComponent(DemoElementsComponent); 15 | component = fixture.componentInstance; 16 | fixture.detectChanges(); 17 | }); 18 | 19 | it('should create', () => { 20 | expect(component).toBeTruthy(); 21 | }); 22 | }); 23 | -------------------------------------------------------------------------------- /angular/devkit/ng-compat/build-angular/webpack/configs.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import type { Configuration } from 'webpack'; 3 | import { VERSION } from '@angular/cli'; 4 | 5 | type configFn = (wco: any) => Promise | Configuration; 6 | let configs: any; 7 | if ((VERSION.major === '16' && Number(VERSION.minor) >= 2) || Number(VERSION.major) > 16) { 8 | // 16.2+ 9 | configs = require('@angular-devkit/build-angular/src/tools/webpack/configs'); 10 | } else { 11 | configs = require('@angular-devkit/build-angular/src/webpack/configs'); 12 | } 13 | 14 | export const getCommonConfig: configFn = configs.getCommonConfig; 15 | export const getDevServerConfig: configFn = configs.getDevServerConfig; 16 | export const getStylesConfig: configFn = configs.getStylesConfig; 17 | -------------------------------------------------------------------------------- /angular/integration/demo-lib/src/compositions/cmp1.composition.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { BitTestModule } from '../bit-test.module'; 3 | import { BitTest3Component } from "../bit-test3.component"; 4 | 5 | @Component({ 6 | selector: 'bit-composition', 7 | standalone: true, 8 | imports: [BitTestModule, BitTest3Component], 9 | template: ` 10 |

11 | Composition component 1 12 | 13 |

14 |

15 | Composition component 2 16 | 17 |

18 |

19 | Composition component 3 20 | 21 |

22 | `, 23 | styles: [ 24 | ] 25 | }) 26 | export class StandaloneCompositionComponent { 27 | } 28 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-app/template-files/src/app/app.config.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFile } from '@teambit/generator'; 2 | 3 | export const appConfigFile = (ssr: boolean): ComponentFile => { 4 | return { 5 | relativePath: `src/app/app.config.ts`, 6 | content: `import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; 7 | import { provideRouter } from '@angular/router';${ssr ? ` 8 | import { provideClientHydration, withEventReplay } from '@angular/platform-browser';` : ''} 9 | import { routes } from './app.routes'; 10 | 11 | export const appConfig: ApplicationConfig = { 12 | providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes)${ssr ? ', provideClientHydration(withEventReplay())' : ''}] 13 | }; 14 | `, 15 | }; 16 | }; 17 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-standalone/files/composition.ts: -------------------------------------------------------------------------------- 1 | import { ComponentContext, ComponentFile } from '@teambit/generator'; 2 | 3 | export const compositionFile = (context: ComponentContext): ComponentFile => { 4 | const { name, namePascalCase: Name } = context; 5 | 6 | const standaloneComposition = `import { Component } from '@angular/core'; 7 | import { ${Name}Component } from './${name}.component'; 8 | 9 | @Component({ 10 | standalone: true, 11 | selector: '${name}-composition-cmp', 12 | imports: [${Name}Component], 13 | template: \`${Name} composition: <${name}>\` 14 | }) 15 | export class ${Name}CompositionComponent {} 16 | `; 17 | 18 | return { 19 | relativePath: `${name}.composition.ts`, 20 | content: standaloneComposition, 21 | }; 22 | }; 23 | -------------------------------------------------------------------------------- /angular/integration/demo-app/src/main.ts: -------------------------------------------------------------------------------- 1 | // import { enableProdMode } from '@angular/core'; 2 | // import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | // 4 | // import { AppModule } from './app/app.module'; 5 | // import { environment } from './environments/environment'; 6 | // 7 | // if (environment.production) { 8 | // enableProdMode(); 9 | // } 10 | // 11 | // platformBrowserDynamic().bootstrapModule(AppModule) 12 | // .catch(err => console.error(err)); 13 | 14 | import 'zone.js'; 15 | import { bootstrapApplication } from '@angular/platform-browser'; 16 | 17 | import { AppComponent } from './app/app.component'; 18 | import { appConfig } from './app/app.config'; 19 | 20 | bootstrapApplication(AppComponent, appConfig) 21 | .catch((err) => console.error(err)); 22 | 23 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v18-env/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "componentId": { 3 | "scope": "bitdev.angular", 4 | "name": "examples/my-angular-v18-env", 5 | "version": "3.3.2" 6 | }, 7 | "propagate": false, 8 | "extensions": { 9 | "teambit.dependencies/dependency-resolver": { 10 | "policy": { 11 | "dependencies": { 12 | "@jest/globals": "^29.3.1", 13 | "@bitdev/angular.dev-services.linter.eslint": ">= 1.0.0", 14 | "@types/eslint": "^8.40.0", 15 | "@types/jest": "^29.5.0", 16 | "jest": "^29.5.0", 17 | "jest-preset-angular": "~14.1.0" 18 | } 19 | } 20 | }, 21 | "bitdev.general/envs/bit-env@1.0.21": {}, 22 | "teambit.envs/envs": { 23 | "env": "bitdev.general/envs/bit-env" 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v19-env/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "componentId": { 3 | "scope": "bitdev.angular", 4 | "name": "examples/my-angular-v19-env", 5 | "version": "2.3.2" 6 | }, 7 | "propagate": false, 8 | "extensions": { 9 | "teambit.dependencies/dependency-resolver": { 10 | "policy": { 11 | "dependencies": { 12 | "@jest/globals": "^29.3.1", 13 | "@bitdev/angular.dev-services.linter.eslint": ">= 1.0.0", 14 | "@types/eslint": "^8.40.0", 15 | "@types/jest": "^29.5.0", 16 | "jest": "^29.5.0", 17 | "jest-preset-angular": "~14.4.0" 18 | } 19 | } 20 | }, 21 | "bitdev.general/envs/bit-env@1.0.21": {}, 22 | "teambit.envs/envs": { 23 | "env": "bitdev.general/envs/bit-env" 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v19/compositions/cmp1.composition.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { BitTestModule } from '../bit-test.module'; 3 | import { BitTest3Component } from "../bit-test3.component"; 4 | 5 | @Component({ 6 | selector: 'bit-composition-v18', 7 | standalone: true, 8 | imports: [BitTestModule, BitTest3Component], 9 | template: ` 10 |

11 | Composition component 1 12 | 13 |

14 |

15 | Composition component 2 16 | 17 |

18 |

19 | Composition component 3 20 | 21 |

22 | `, 23 | styles: [ 24 | ] 25 | }) 26 | export class StandaloneCompositionComponent { 27 | } 28 | -------------------------------------------------------------------------------- /angular/devkit/ng-compat/build-angular/webpack/stats.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { WebpackLoggingCallback } from '@angular-devkit/build-webpack'; 3 | import { logging } from '@angular-devkit/core'; 4 | import { VERSION } from '@angular/cli'; 5 | import { BrowserBuilderOptions } from '../builder-options'; 6 | 7 | export let createWebpackLoggingCallback: (options: BrowserBuilderOptions, logger: logging.LoggerApi) => WebpackLoggingCallback; 8 | 9 | if ((VERSION.major === '16' && Number(VERSION.minor) >= 2) || Number(VERSION.major) > 16) { 10 | createWebpackLoggingCallback = require('@angular-devkit/build-angular/src/tools/webpack/utils/stats').createWebpackLoggingCallback; 11 | } else { 12 | createWebpackLoggingCallback = require('@angular-devkit/build-angular/src/webpack/utils/stats').createWebpackLoggingCallback; 13 | } 14 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-app/template-files/src/main.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFile } from '@teambit/generator'; 2 | 3 | export const mainNgAppFile = (standalone: boolean): ComponentFile => { 4 | return { 5 | relativePath: `src/main.ts`, 6 | content: `import 'zone.js'; 7 | ${standalone ? `import { bootstrapApplication } from '@angular/platform-browser'; 8 | import { appConfig } from './app/app.config'; 9 | import { AppComponent } from './app/app.component'; 10 | 11 | bootstrapApplication(AppComponent, appConfig) 12 | .catch((err) => console.error(err)); 13 | ` : `import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 14 | import { AppModule } from './app/app.module'; 15 | 16 | platformBrowserDynamic().bootstrapModule(AppModule) 17 | .catch(err => console.error(err)); 18 | `}`, 19 | }; 20 | }; 21 | -------------------------------------------------------------------------------- /angular/examples/my-angular-env/config/jest.config.cjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @see https://bit.dev/reference/jest/jest-config 3 | */ 4 | const jestConfig = require('@bitdev/angular.angular-env/jest/jest.config.cjs'); 5 | const { generateNodeModulesPattern } = require('@teambit/dependencies.modules.packages-excluder'); 6 | const { createCjsPreset } = require('jest-preset-angular/presets'); 7 | 8 | const packagesToExclude = ['@angular', '@ngrx', 'apollo-angular']; 9 | const presetConfig = createCjsPreset({ 10 | tsconfig: require.resolve('./tsconfig.spec.json') 11 | }); 12 | 13 | module.exports = { 14 | ...jestConfig, 15 | ...presetConfig, 16 | transformIgnorePatterns: [ 17 | '^.+.module.(css|sass|scss)$', 18 | generateNodeModulesPattern({ 19 | packages: packagesToExclude, 20 | excludeComponents: true 21 | }) 22 | ] 23 | }; 24 | -------------------------------------------------------------------------------- /angular/integration/demo-elements/demo-elements.docs.md: -------------------------------------------------------------------------------- 1 | --- 2 | labels: ['angular', 'typescript', 'demo-elements'] 3 | description: 'A `demo-elements` component.' 4 | --- 5 | 6 | Import `DemoElementsComponent` into your application and use the returned selector to create a component 7 | in the framework of your choice. For example with react: 8 | 9 | ```ts 10 | import { DemoElementsComponent } from '@my-scope/demo-elements'; 11 | import type { ReactNode } from 'react'; 12 | 13 | export type DemoElementsProps = { 14 | /** 15 | * sets the component children. 16 | */ 17 | children?: ReactNode; 18 | }; 19 | 20 | // Use the component: 21 | export function DemoElements({ children }: DemoElementsProps) { 22 | return ( 23 | 24 | {children} 25 | 26 | ); 27 | } 28 | 29 | ``` 30 | -------------------------------------------------------------------------------- /angular/devkit/compiler/elements/preview/mount.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | // @ts-nocheck 3 | import React from 'react'; 4 | import { createRoot } from 'react-dom/client'; 5 | // required here to make sure that this is loaded before the compositions file 6 | import { ngToReact } from '@bitdev/angular.dev-services.preview.runtime'; 7 | 8 | const container = document.getElementById('root') as HTMLElement; 9 | const root = createRoot(container!); 10 | 11 | /** 12 | * this mounts compositions into the DOM in the component preview. 13 | * this function can be overridden through ReactAspect.overrideCompositionsMounter() API 14 | * to apply custom logic for component DOM mounting. 15 | */ 16 | export default async (composition: any/* , previewContext: RenderingContext */) => { 17 | root.render(
{await ngToReact([composition])}
); 18 | }; 19 | -------------------------------------------------------------------------------- /angular/devkit/compiler/elements/rollup/utils/fs.ts: -------------------------------------------------------------------------------- 1 | import * as fs from 'fs'; 2 | import { dirname } from 'path'; 3 | import { promisify } from 'util'; 4 | 5 | export const {readFile, writeFile, access, mkdir, stat} = fs.promises; 6 | // @ts-ignore 7 | export const rmdir = fs.promises.rm ?? fs.promises.rmdir; 8 | 9 | export async function exists(path: fs.PathLike): Promise { 10 | try { 11 | await access(path, fs.constants.F_OK); 12 | 13 | return true; 14 | } catch { 15 | return false; 16 | } 17 | } 18 | 19 | const cpFile = promisify(fs.copyFile); 20 | export async function copyFile(src: string, dest: string): Promise { 21 | const dir = dirname(dest); 22 | if (!(await exists(dir))) { 23 | await mkdir(dir, { recursive: true }); 24 | } 25 | 26 | await cpFile(src, dest, fs.constants.COPYFILE_FICLONE); 27 | } 28 | -------------------------------------------------------------------------------- /angular/devkit/preview/vite-preview/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "componentId": { 3 | "scope": "bitdev.angular", 4 | "name": "dev-services/preview/vite-preview", 5 | "version": "1.2.1" 6 | }, 7 | "propagate": false, 8 | "extensions": { 9 | "teambit.dependencies/dependency-resolver": { 10 | "policy": { 11 | "peerDependencies": { 12 | "@angular/core": ">= 16.0.0" 13 | } 14 | } 15 | }, 16 | "teambit.component/dev-files": {}, 17 | "teambit.pkg/pkg": {}, 18 | "teambit.preview/preview": {}, 19 | "teambit.compositions/compositions": {}, 20 | "teambit.docs/docs": {}, 21 | "teambit.pipelines/builder": {}, 22 | "teambit.semantics/schema": {}, 23 | "teambit.envs/envs": { 24 | "env": "bitdev.node/node-env" 25 | }, 26 | "bitdev.node/node-env@4.0.3": {} 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-app/template-files/src/app/app.config.server.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFile } from '@teambit/generator'; 2 | 3 | export const serverConfigFile = (): ComponentFile => { 4 | return { 5 | relativePath: `src/app/app.config.server.ts`, 6 | content: `import { ApplicationConfig, mergeApplicationConfig } from '@angular/core'; 7 | import { provideServerRendering } from '@angular/platform-server'; 8 | import { provideServerRouting } from '@angular/ssr'; 9 | import { appConfig } from './app.config'; 10 | import { serverRoutes } from './app.routes.server'; 11 | 12 | const serverConfig: ApplicationConfig = { 13 | providers: [ 14 | provideServerRendering(), 15 | provideServerRouting(serverRoutes) 16 | ] 17 | }; 18 | 19 | export const config = mergeApplicationConfig(appConfig, serverConfig); 20 | `, 21 | }; 22 | }; 23 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v19-env/config/jest.config.cjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @see https://bit.dev/reference/jest/jest-config 3 | */ 4 | const jestConfig = require('@bitdev/angular.envs.angular-v19-env/jest/jest.config.cjs'); 5 | const { generateNodeModulesPattern } = require('@teambit/dependencies.modules.packages-excluder'); 6 | const { createCjsPreset } = require('jest-preset-angular/presets'); 7 | 8 | const packagesToExclude = ['@angular', '@ngrx', 'apollo-angular']; 9 | const presetConfig = createCjsPreset({ 10 | tsconfig: require.resolve('./tsconfig.spec.json') 11 | }); 12 | 13 | module.exports = { 14 | ...jestConfig, 15 | ...presetConfig, 16 | transformIgnorePatterns: [ 17 | '^.+.module.(css|sass|scss)$', 18 | generateNodeModulesPattern({ 19 | packages: packagesToExclude, 20 | excludeComponents: true 21 | }) 22 | ] 23 | }; 24 | -------------------------------------------------------------------------------- /angular/envs/base-env/angular-env.interface.ts: -------------------------------------------------------------------------------- 1 | import { CompilerEnv } from '@teambit/compiler'; 2 | import { SchemaEnv } from '@teambit/schema'; 3 | import { Env } from '@teambit/envs'; 4 | import { PreviewEnv } from '@teambit/preview'; 5 | import { TesterEnv } from '@teambit/tester'; 6 | import { LinterEnv } from '@teambit/linter'; 7 | import { FormatterEnv } from '@teambit/formatter'; 8 | import { BuilderEnv } from '@teambit/builder'; 9 | import { GeneratorEnv } from '@teambit/generator'; 10 | import { PackageEnv } from '@teambit/pkg'; 11 | import { AppsEnv } from '@teambit/application'; 12 | 13 | export interface AngularEnvInterface 14 | extends Env, 15 | AppsEnv, 16 | CompilerEnv, 17 | TesterEnv, 18 | PreviewEnv, 19 | SchemaEnv, 20 | LinterEnv, 21 | FormatterEnv, 22 | BuilderEnv, 23 | GeneratorEnv, 24 | PackageEnv {} 25 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-module/files/docs.ts: -------------------------------------------------------------------------------- 1 | import { ComponentContext, ComponentFile } from '@teambit/generator'; 2 | 3 | export const docsFile = (context: ComponentContext): ComponentFile => { 4 | const { name, namePascalCase: Name } = context; 5 | 6 | return { 7 | relativePath: `${name}.docs.md`, 8 | content: `--- 9 | labels: ['angular', 'typescript', '${name}'] 10 | description: 'A \`${name}\` component.' 11 | --- 12 | 13 | Import \`${Name}Module\` into your application: 14 | 15 | \`\`\`ts 16 | import { ${Name}Module } from './${name}.module'; 17 | 18 | // add it to your module imports 19 | @NgModule({ 20 | imports: [ 21 | ${Name}Module 22 | ] 23 | }) 24 | export class AppModule {} 25 | \`\`\` 26 | 27 | Use \`${Name}Component\` in your generators: 28 | 29 | \`\`\`html 30 | <${name}> 31 | \`\`\` 32 | `, 33 | }; 34 | }; 35 | -------------------------------------------------------------------------------- /angular/app-types/angular-app-type/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "componentId": { 3 | "scope": "bitdev.angular", 4 | "name": "app-types/angular-app-type", 5 | "version": "8.2.1" 6 | }, 7 | "propagate": false, 8 | "extensions": { 9 | "teambit.dependencies/dependency-resolver": { 10 | "policy": { 11 | "dependencies": { 12 | "@angular/cli": "-" 13 | }, 14 | "peerDependencies": { 15 | "@angular/cli": ">= 13.0.0" 16 | } 17 | } 18 | }, 19 | "teambit.component/renaming": { 20 | "renamedFrom": { 21 | "scope": "bitdev.angular", 22 | "name": "dev-services/apps", 23 | "version": "02f8cd3d639894dea416cc38674a6887e11e939b" 24 | } 25 | }, 26 | "teambit.envs/envs": { 27 | "env": "bitdev.node/node-env" 28 | }, 29 | "bitdev.node/node-env@4.0.3": {} 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /angular/docs/ng-component-libraries/commands.tsx: -------------------------------------------------------------------------------- 1 | import { CommandsExplorer } from '@teambit/community.ui.bit-cli.commands-explorer'; 2 | import React from 'react'; 3 | 4 | export const CreateDesignSystemWS = () => { 5 | const example = { 6 | 'template-name': 'design-system', 7 | 'default-scope': 'my-org.my-scope', 8 | 'workspace-name': 'my-design-system', 9 | aspect: 'bitdev.angular/angular-env', 10 | }; 11 | return ; 12 | }; 13 | 14 | export const CreateMaterialDesignSystemWS = () => { 15 | const example = { 16 | 'template-name': 'material-design-system', 17 | 'default-scope': 'my-org.my-scope', 18 | 'workspace-name': 'my-material-design-system', 19 | aspect: 'bitdev.angular/angular-env', 20 | }; 21 | return ; 22 | }; 23 | -------------------------------------------------------------------------------- /angular/devkit/preview/preview-app/preview-app/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing'; 6 | 7 | declare const require: { 8 | context( 9 | path: string, 10 | deep?: boolean, 11 | filter?: RegExp 12 | ): { 13 | keys(): string[]; 14 | (id: string): T; 15 | }; 16 | }; 17 | 18 | // First, initialize the Angular testing environment. 19 | getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting()); 20 | // Then we find all the tests. 21 | const context = require.context('./', true, /\.spec\.ts$/); 22 | // And load the modules. 23 | context.keys().map(context); 24 | -------------------------------------------------------------------------------- /angular/envs/angular-v16-env/jest/jest-global-mocks.ts: -------------------------------------------------------------------------------- 1 | import { jest } from '@jest/globals'; 2 | 3 | Object.defineProperty(window, 'CSS', { value: null }); 4 | 5 | Object.defineProperty(document, 'doctype', { 6 | value: '', 7 | }); 8 | 9 | Object.defineProperty(window, 'getComputedStyle', { 10 | value: () => { 11 | return { 12 | display: 'none', 13 | appearance: ['-webkit-appearance'], 14 | }; 15 | }, 16 | }); 17 | 18 | /** 19 | * ISSUE: https://github.com/angular/material2/issues/7101 20 | * Workaround for JSDOM missing transform property 21 | */ 22 | Object.defineProperty(document.body.style, 'transform', { 23 | value: () => { 24 | return { 25 | enumerable: true, 26 | configurable: true, 27 | }; 28 | }, 29 | }); 30 | 31 | HTMLCanvasElement.prototype.getContext = jest.fn(); 32 | -------------------------------------------------------------------------------- /angular/envs/angular-v17-env/jest/jest-global-mocks.ts: -------------------------------------------------------------------------------- 1 | import { jest } from '@jest/globals'; 2 | 3 | Object.defineProperty(window, 'CSS', { value: null }); 4 | 5 | Object.defineProperty(document, 'doctype', { 6 | value: '', 7 | }); 8 | 9 | Object.defineProperty(window, 'getComputedStyle', { 10 | value: () => { 11 | return { 12 | display: 'none', 13 | appearance: ['-webkit-appearance'], 14 | }; 15 | }, 16 | }); 17 | 18 | /** 19 | * ISSUE: https://github.com/angular/material2/issues/7101 20 | * Workaround for JSDOM missing transform property 21 | */ 22 | Object.defineProperty(document.body.style, 'transform', { 23 | value: () => { 24 | return { 25 | enumerable: true, 26 | configurable: true, 27 | }; 28 | }, 29 | }); 30 | 31 | HTMLCanvasElement.prototype.getContext = jest.fn(); 32 | -------------------------------------------------------------------------------- /angular/envs/angular-v18-env/jest/jest-global-mocks.ts: -------------------------------------------------------------------------------- 1 | import { jest } from '@jest/globals'; 2 | 3 | Object.defineProperty(window, 'CSS', { value: null }); 4 | 5 | Object.defineProperty(document, 'doctype', { 6 | value: '', 7 | }); 8 | 9 | Object.defineProperty(window, 'getComputedStyle', { 10 | value: () => { 11 | return { 12 | display: 'none', 13 | appearance: ['-webkit-appearance'], 14 | }; 15 | }, 16 | }); 17 | 18 | /** 19 | * ISSUE: https://github.com/angular/material2/issues/7101 20 | * Workaround for JSDOM missing transform property 21 | */ 22 | Object.defineProperty(document.body.style, 'transform', { 23 | value: () => { 24 | return { 25 | enumerable: true, 26 | configurable: true, 27 | }; 28 | }, 29 | }); 30 | 31 | HTMLCanvasElement.prototype.getContext = jest.fn(); 32 | -------------------------------------------------------------------------------- /angular/envs/angular-v19-env/jest/jest-global-mocks.ts: -------------------------------------------------------------------------------- 1 | import { jest } from '@jest/globals'; 2 | 3 | Object.defineProperty(window, 'CSS', { value: null }); 4 | 5 | Object.defineProperty(document, 'doctype', { 6 | value: '', 7 | }); 8 | 9 | Object.defineProperty(window, 'getComputedStyle', { 10 | value: () => { 11 | return { 12 | display: 'none', 13 | appearance: ['-webkit-appearance'], 14 | }; 15 | }, 16 | }); 17 | 18 | /** 19 | * ISSUE: https://github.com/angular/material2/issues/7101 20 | * Workaround for JSDOM missing transform property 21 | */ 22 | Object.defineProperty(document.body.style, 'transform', { 23 | value: () => { 24 | return { 25 | enumerable: true, 26 | configurable: true, 27 | }; 28 | }, 29 | }); 30 | 31 | HTMLCanvasElement.prototype.getContext = jest.fn(); 32 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-app/template-files/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { ComponentContext, ComponentFile } from '@teambit/generator'; 2 | 3 | export const appComponentFile = (context: ComponentContext, styleSheet: string, standalone: boolean): ComponentFile => { 4 | const { name } = context; 5 | return { 6 | relativePath: `src/app/app.component.ts`, 7 | content: `import { Component } from '@angular/core';${standalone ? ` 8 | import { CommonModule } from '@angular/common';` : ''} 9 | import { RouterOutlet } from '@angular/router'; 10 | 11 | @Component({ 12 | selector: 'app-root',${standalone ? ` 13 | standalone: true, 14 | imports: [CommonModule, RouterOutlet],` : ''} 15 | templateUrl: './app.component.html', 16 | styleUrls: ['./app.component.${ styleSheet }'] 17 | }) 18 | export class AppComponent { 19 | title = '${name}'; 20 | } 21 | `, 22 | }; 23 | }; 24 | -------------------------------------------------------------------------------- /angular/integration/my-react-app/my-react-app.app-root.tsx: -------------------------------------------------------------------------------- 1 | import { BrowserRouter } from 'react-router-dom'; 2 | import { 3 | createRoot, 4 | // hydrateRoot 5 | } from 'react-dom/client'; 6 | import { MyReactApp } from "./my-react-app.js"; 7 | 8 | /** 9 | * comment this in for server-side rendering (ssr) and comment 10 | * out of the root.render() invocation below. 11 | */ 12 | // hydrateRoot( 13 | // document.getElementById("root") as HTMLElement, 14 | // 15 | // 16 | // 17 | // ); 18 | 19 | if (import.meta.hot) { 20 | import.meta.hot.accept(); 21 | } 22 | 23 | /** 24 | * mounting for client side rendering. 25 | */ 26 | const container = document.getElementById('root'); 27 | const root = createRoot(container!); 28 | 29 | root.render( 30 | // @ts-ignore 31 | 32 | 33 | 34 | ); 35 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-app/template-files/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFile } from '@teambit/generator'; 2 | 3 | export const appModuleFile = (ssr: boolean): ComponentFile => { 4 | return { 5 | relativePath: `src/app/app.module.ts`, 6 | content: `import { NgModule } from '@angular/core'; 7 | import { BrowserModule } from '@angular/platform-browser'; 8 | import { RouterModule } from '@angular/router';${ssr ? ` 9 | import { provideClientHydration } from '@angular/platform-browser';` : ''} 10 | import { routes } from './app.routes'; 11 | import { AppComponent } from './app.component'; 12 | 13 | @NgModule({ 14 | declarations: [ 15 | AppComponent 16 | ], 17 | imports: [ 18 | BrowserModule, 19 | RouterModule.forRoot(routes) 20 | ], 21 | providers: [${ssr ? `provideClientHydration()` : ``}], 22 | bootstrap: [AppComponent] 23 | }) 24 | export class AppModule { } 25 | `, 26 | }; 27 | }; 28 | -------------------------------------------------------------------------------- /angular/devkit/linter/eslint/eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | parser: '@typescript-eslint/parser', 3 | root: true, 4 | ignorePatterns: ['node_modules'], 5 | parserOptions: { 6 | createDefaultProgram: true, 7 | }, 8 | env: { 9 | browser: true, 10 | node: true, 11 | es6: true, 12 | jest: true, 13 | }, 14 | overrides: [ 15 | { 16 | files: ['*.ts', '*.tsx', '*.js', '*.jsx', '*.mjs'], 17 | parserOptions: { 18 | project: require.resolve('./config/tsconfig.json'), 19 | createDefaultProgram: true, 20 | }, 21 | extends: ['plugin:@angular-eslint/recommended', 'plugin:@angular-eslint/template/process-inline-templates'], 22 | }, 23 | { 24 | files: ['*.html'], 25 | extends: ['plugin:@angular-eslint/template/recommended'], 26 | }, 27 | { 28 | files: ['*.md'], 29 | extends: ['plugin:markdown/recommended'], 30 | }, 31 | ], 32 | }; 33 | -------------------------------------------------------------------------------- /angular/docs/build-pipelines/code-snippets/add-replace-task-build.mdx: -------------------------------------------------------------------------------- 1 | It is common to both replace tasks and add new tasks. 2 | 3 | ```ts 4 | import { AngularV19Env } from '@bitdev/angular.envs.angular-v19-env'; 5 | import { JestTask } from '@teambit/defender.jest-tester'; 6 | /* import the task you want to add */ 7 | import { ComponentNameTask } from '@learnbit/extending-bit.build-tasks.component-name'; 8 | 9 | export class MyAngularEnv extends AngularV19Env { 10 | build() { 11 | return ( 12 | super 13 | .build() 14 | /* replace some of the tasks in the build pipeline */ 15 | .replace([ 16 | JestTask.from({ 17 | config: require.resolve('./config/jest.config'), 18 | }), 19 | ]) 20 | /* add a new task to the build pipeline */ 21 | .add([ComponentNameTask.from({})]) 22 | ); 23 | } 24 | } 25 | 26 | export default new MyAngularEnv(); 27 | ``` 28 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-standalone/files/docs.ts: -------------------------------------------------------------------------------- 1 | import { ComponentContext, ComponentFile } from '@teambit/generator'; 2 | 3 | export const docsFile = (context: ComponentContext): ComponentFile => { 4 | const { name, namePascalCase: Name } = context; 5 | 6 | return { 7 | relativePath: `${name}.docs.md`, 8 | content: `--- 9 | labels: ['angular', 'typescript', '${name}'] 10 | description: 'A \`${name}\` component.' 11 | --- 12 | 13 | Import \`${Name}Component\` into your application: 14 | 15 | \`\`\`ts 16 | import { ${Name}Component } from './${name}.component'; 17 | 18 | // add it to your component imports 19 | @Component({ 20 | selector: 'app-root', 21 | standalone: true, 22 | imports: [ 23 | ${Name}Component 24 | ] 25 | }) 26 | export class AppComponent {} 27 | \`\`\` 28 | 29 | Use \`${Name}Component\` in your generators: 30 | 31 | \`\`\`html 32 | <${name}> 33 | \`\`\` 34 | `, 35 | }; 36 | }; 37 | -------------------------------------------------------------------------------- /angular/devkit/compiler/multi-compiler/ng-multi-compiler.task.ts: -------------------------------------------------------------------------------- 1 | // TODO: @gilad create compiler task as a component. (teambit.compilation/compiler-task) 2 | import { TaskHandler } from '@teambit/builder'; 3 | import { CompilerTask } from '@teambit/compilation.compiler-task'; 4 | import { Compiler } from '@teambit/compiler'; 5 | import { EnvHandler } from '@teambit/envs'; 6 | 7 | export interface NgMultiCompilerTaskOptions { 8 | name?: string; 9 | description?: string; 10 | ngMultiCompiler: EnvHandler; 11 | } 12 | 13 | export const NgMultiCompilerTask = { 14 | from: (options: NgMultiCompilerTaskOptions): TaskHandler => { 15 | const name = options.name || 'NgMultiCompiler'; 16 | const description = options.description || 'compiling components using NgMultiCompiler'; 17 | 18 | return CompilerTask.from({ 19 | name, 20 | description, 21 | compiler: options.ngMultiCompiler 22 | }); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /angular/devkit/vite/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "componentId": { 3 | "scope": "bitdev.angular", 4 | "name": "dev-services/vite", 5 | "version": "2.2.0" 6 | }, 7 | "propagate": false, 8 | "extensions": { 9 | "teambit.dependencies/dependency-resolver": { 10 | "policy": { 11 | "dependencies": { 12 | "#alias": "-", 13 | "h3": "^1.9.0", 14 | "nitropack": "^2.8.0", 15 | "@angular-devkit/build-angular": "-", 16 | "@angular/cli": "-", 17 | "typescript": "-" 18 | }, 19 | "peerDependencies": { 20 | "@angular-devkit/build-angular": ">= 0.0.1", 21 | "@angular/cli": ">= 13.0.0", 22 | "esbuild": ">= 0.14.0", 23 | "typescript": ">= 3.5.3" 24 | } 25 | } 26 | }, 27 | "teambit.envs/envs": { 28 | "env": "bitdev.node/node-env" 29 | }, 30 | "bitdev.node/node-env@4.0.3": {} 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /angular/app-types/angular-app-type/angular.app-type.ts: -------------------------------------------------------------------------------- 1 | import { NG_APP_NAME } from '@bitdev/angular.dev-services.common'; 2 | import { Application, ApplicationType } from '@teambit/application'; 3 | import { EnvHandler } from '@teambit/envs'; 4 | import { AngularAppOptions } from './angular-app-options.js'; 5 | import { AngularApp } from './angular.application.js'; 6 | 7 | interface AngularAppTypeOptions { 8 | name?: string; 9 | } 10 | 11 | export class AngularAppType implements ApplicationType { 12 | constructor(readonly name: string) {} 13 | 14 | createApp(options: AngularAppOptions): Application { 15 | return new AngularApp({ 16 | ...options, 17 | name: this.name 18 | }); 19 | } 20 | 21 | static from(options: AngularAppTypeOptions): EnvHandler { 22 | return () => { 23 | const name = options.name || NG_APP_NAME; 24 | return new AngularAppType(name); 25 | }; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v16/bit-test.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { BitTestComponent } from './bit-test.component'; 4 | 5 | describe('BitTestComponent', () => { 6 | let component: BitTestComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ BitTestComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(BitTestComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | 26 | it('should have a service', () => { 27 | expect(component.service).toBeDefined(); 28 | expect(component.service.content).toEqual('Content from service'); 29 | }) 30 | }); 31 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v17/bit-test.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { BitTestComponent } from './bit-test.component'; 4 | 5 | describe('BitTestComponent', () => { 6 | let component: BitTestComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ BitTestComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(BitTestComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | 26 | it('should have a service', () => { 27 | expect(component.service).toBeDefined(); 28 | expect(component.service.content).toEqual('Content from service'); 29 | }) 30 | }); 31 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v18/bit-test.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { BitTestComponent } from './bit-test.component'; 4 | 5 | describe('BitTestComponent', () => { 6 | let component: BitTestComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ BitTestComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(BitTestComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | 26 | it('should have a service', () => { 27 | expect(component.service).toBeDefined(); 28 | expect(component.service.content).toEqual('Content from service'); 29 | }) 30 | }); 31 | -------------------------------------------------------------------------------- /angular/integration/demo-lib-v19/bit-test.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { BitTestComponent } from './bit-test.component'; 4 | 5 | describe('BitTestComponent', () => { 6 | let component: BitTestComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ BitTestComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(BitTestComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | 26 | it('should have a service', () => { 27 | expect(component.service).toBeDefined(); 28 | expect(component.service.content).toEqual('Content from service'); 29 | }) 30 | }); 31 | -------------------------------------------------------------------------------- /angular/integration/demo-lib/src/bit-test.spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { BitTestComponent } from './bit-test.component'; 4 | 5 | describe('BitTestComponent', () => { 6 | let component: BitTestComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async () => { 10 | await TestBed.configureTestingModule({ 11 | declarations: [ BitTestComponent ] 12 | }) 13 | .compileComponents(); 14 | }); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(BitTestComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | 26 | it('should have a service', () => { 27 | expect(component.service).toBeDefined(); 28 | expect(component.service.content).toEqual('Content from service'); 29 | }) 30 | }); 31 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v16-env/config/jest.config.cjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @see https://bit.dev/reference/jest/jest-config 3 | */ 4 | const jestConfig = require('@bitdev/angular.envs.angular-v16-env/jest/jest.config.cjs'); 5 | const { generateNodeModulesPattern } = require('@teambit/dependencies.modules.packages-excluder'); 6 | const { defaultTransformerOptions } = require('jest-preset-angular/presets'); 7 | 8 | const packagesToExclude = ['@angular', '@ngrx', 'apollo-angular']; 9 | 10 | export default { 11 | ...jestConfig, 12 | transform: { 13 | '^.+\\.(ts|js|mjs|html|svg)$': [ 14 | 'jest-preset-angular', 15 | { 16 | ...defaultTransformerOptions, 17 | tsconfig: require.resolve('./tsconfig.spec.json') 18 | } 19 | ] 20 | }, 21 | transformIgnorePatterns: [ 22 | '^.+.module.(css|sass|scss)$', 23 | generateNodeModulesPattern({ 24 | packages: packagesToExclude, 25 | excludeComponents: true 26 | }) 27 | ] 28 | }; 29 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v17-env/config/jest.config.cjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @see https://bit.dev/reference/jest/jest-config 3 | */ 4 | const jestConfig = require('@bitdev/angular.envs.angular-v17-env/jest/jest.config.cjs'); 5 | const { generateNodeModulesPattern } = require('@teambit/dependencies.modules.packages-excluder'); 6 | const { defaultTransformerOptions } = require('jest-preset-angular/presets'); 7 | 8 | const packagesToExclude = ['@angular', '@ngrx', 'apollo-angular']; 9 | 10 | module.exports = { 11 | ...jestConfig, 12 | transform: { 13 | '^.+\\.(ts|js|mjs|html|svg)$': [ 14 | 'jest-preset-angular', 15 | { 16 | ...defaultTransformerOptions, 17 | tsconfig: require.resolve('./tsconfig.spec.json') 18 | } 19 | ] 20 | }, 21 | transformIgnorePatterns: [ 22 | '^.+.module.(css|sass|scss)$', 23 | generateNodeModulesPattern({ 24 | packages: packagesToExclude, 25 | excludeComponents: true 26 | }) 27 | ] 28 | }; 29 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v18-env/config/jest.config.cjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @see https://bit.dev/reference/jest/jest-config 3 | */ 4 | const jestConfig = require('@bitdev/angular.envs.angular-v18-env/jest/jest.config.cjs'); 5 | const { generateNodeModulesPattern } = require('@teambit/dependencies.modules.packages-excluder'); 6 | const { defaultTransformerOptions } = require('jest-preset-angular/presets'); 7 | 8 | const packagesToExclude = ['@angular', '@ngrx', 'apollo-angular']; 9 | 10 | module.exports = { 11 | ...jestConfig, 12 | transform: { 13 | '^.+\\.(ts|js|mjs|html|svg)$': [ 14 | 'jest-preset-angular', 15 | { 16 | ...defaultTransformerOptions, 17 | tsconfig: require.resolve('./tsconfig.spec.json') 18 | } 19 | ] 20 | }, 21 | transformIgnorePatterns: [ 22 | '^.+.module.(css|sass|scss)$', 23 | generateNodeModulesPattern({ 24 | packages: packagesToExclude, 25 | excludeComponents: true 26 | }) 27 | ] 28 | }; 29 | -------------------------------------------------------------------------------- /angular/devkit/ng-compat/build-angular/utils/index.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { json, logging } from '@angular-devkit/core'; 3 | import { VERSION } from '@angular/cli'; 4 | import { BrowserBuilderOptions } from '../builder-options'; 5 | 6 | export * from './normalize-cache'; 7 | export * from './package-chunk-sort'; 8 | export * from './webpack-browser-config'; 9 | 10 | export let normalizeBrowserSchema: (workspaceRoot: string, projectRoot: string, projectSourceRoot: string | undefined, options: BrowserBuilderOptions, metadata?: json.JsonObject, logger?: logging.LoggerApi) => any; 11 | export let normalizeOptimization: (optimization?: any) => any; 12 | export let BuildBrowserFeatures: any; 13 | 14 | if (VERSION.major) { 15 | const utils = require('@angular-devkit/build-angular/src/utils'); 16 | normalizeBrowserSchema = utils.normalizeBrowserSchema; 17 | normalizeOptimization = utils.normalizeOptimization; 18 | BuildBrowserFeatures = utils.BuildBrowserFeatures; 19 | } 20 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v16-env/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "componentId": { 3 | "scope": "bitdev.angular", 4 | "name": "examples/my-angular-v16-env", 5 | "version": "7.3.2" 6 | }, 7 | "propagate": false, 8 | "extensions": { 9 | "teambit.dependencies/dependency-resolver": { 10 | "policy": { 11 | "dependencies": { 12 | "@jest/globals": "^29.3.1", 13 | "@bitdev/angular.dev-services.linter.eslint": ">= 1.0.0", 14 | "@types/jest": "^29.5.0", 15 | "jest": "^29.5.0", 16 | "jest-preset-angular": "~13.1.0" 17 | } 18 | } 19 | }, 20 | "teambit.component/renaming": { 21 | "renamedFrom": { 22 | "scope": "bitdev.angular", 23 | "name": "examples/angular-v16-env", 24 | "version": "1.0.1" 25 | } 26 | }, 27 | "bitdev.general/envs/bit-env@1.0.21": {}, 28 | "teambit.envs/envs": { 29 | "env": "bitdev.general/envs/bit-env" 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /angular/devkit/compiler/elements/rollup/utils/path.ts: -------------------------------------------------------------------------------- 1 | import * as nodePath from 'path'; 2 | 3 | /* eslint-disable-next-line */ 4 | const PATH_REGEXP = new RegExp('\\' + nodePath.win32.sep, 'g'); 5 | const ensureUnixPathCache = new Map(); 6 | const IS_WINDOWS = process.platform === 'win32'; 7 | 8 | export const ensureUnixPath = IS_WINDOWS 9 | ? (path?: string): string | null => { 10 | if (!path) { 11 | return null; 12 | } 13 | 14 | const cachePath = ensureUnixPathCache.get(path); 15 | if (cachePath) { 16 | return cachePath; 17 | } 18 | 19 | // we use a regex instead of the character literal due to a bug in some versions of node.js 20 | // the path separator needs to be preceded by an escape character 21 | const normalizedPath = path.replace(PATH_REGEXP, nodePath.posix.sep); 22 | ensureUnixPathCache.set(path, normalizedPath); 23 | 24 | return normalizedPath; 25 | } 26 | : (path?: string) => path; 27 | -------------------------------------------------------------------------------- /angular/devkit/common/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "componentId": { 3 | "scope": "bitdev.angular", 4 | "name": "dev-services/common", 5 | "version": "8.2.0" 6 | }, 7 | "propagate": false, 8 | "extensions": { 9 | "teambit.dependencies/dependency-resolver": { 10 | "policy": { 11 | "dependencies": { 12 | "@angular-devkit/build-angular": "-", 13 | "typescript": "-", 14 | "normalize-path": "^3.0.0" 15 | }, 16 | "peerDependencies": { 17 | "@angular-devkit/build-angular": ">= 0.0.1", 18 | "typescript": ">= 3.5.3" 19 | } 20 | } 21 | }, 22 | "teambit.envs/envs": {}, 23 | "teambit.component/dev-files": {}, 24 | "teambit.pkg/pkg": {}, 25 | "teambit.preview/preview": {}, 26 | "teambit.compositions/compositions": {}, 27 | "teambit.docs/docs": {}, 28 | "teambit.pipelines/builder": {}, 29 | "teambit.semantics/schema": {}, 30 | "teambit.node/node@1.0.110": {} 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /angular/envs/angular-v19-env/jest/jest.config.cjs: -------------------------------------------------------------------------------- 1 | const { generateNodeModulesPattern } = require('@teambit/dependencies.modules.packages-excluder'); 2 | const { createCjsPreset } = require('jest-preset-angular/presets'); 3 | 4 | const packagesToExclude = ['@angular', '@ngrx', 'apollo-angular']; 5 | const presetConfig = createCjsPreset({ 6 | tsconfig: require.resolve('./tsconfig.spec.json') 7 | }); 8 | 9 | module.exports = { 10 | ...presetConfig, 11 | reporters: ['default'], 12 | setupFilesAfterEnv: [require.resolve('./setup-jest.cjs')], 13 | testPathIgnorePatterns: ['/.*/e2e/'], 14 | globals: { 15 | ngJest: { 16 | skipNgcc: true 17 | } 18 | }, 19 | resolver: require.resolve('./jest.resolver.cjs'), 20 | moduleDirectories: ['/node_modules', 'node_modules'], 21 | transformIgnorePatterns: [ 22 | '^.+.module.(css|sass|scss)$', 23 | generateNodeModulesPattern({ 24 | packages: packagesToExclude, 25 | excludeComponents: true 26 | }) 27 | ] 28 | }; 29 | -------------------------------------------------------------------------------- /angular/examples/my-angular-env/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "componentId": { 3 | "scope": "bitdev.angular", 4 | "name": "examples/my-angular-env", 5 | "version": "8.3.2" 6 | }, 7 | "propagate": false, 8 | "extensions": { 9 | "teambit.dependencies/dependency-resolver": { 10 | "policy": { 11 | "dependencies": { 12 | "@jest/globals": "^29.3.1", 13 | "@bitdev/angular.dev-services.linter.eslint": ">= 1.0.0", 14 | "@types/eslint": "^8.40.0", 15 | "@types/jest": "^29.5.0", 16 | "jest": "^29.5.0", 17 | "jest-preset-angular": "~14.4.0" 18 | } 19 | } 20 | }, 21 | "teambit.component/renaming": { 22 | "renamedFrom": { 23 | "scope": "bitdev.angular", 24 | "name": "examples/angular-env", 25 | "version": "1.0.1" 26 | } 27 | }, 28 | "bitdev.general/envs/bit-env@1.0.21": {}, 29 | "teambit.envs/envs": { 30 | "env": "bitdev.general/envs/bit-env" 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /angular/integration/demo-elements/demo-elements.ng-elements.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Entry point for this Angular library, do not move or rename this file. 3 | * The exports should be a call to ngToCustomElements which returns the list of custom elements selectors. 4 | */ 5 | import { provideExperimentalZonelessChangeDetection } from "@angular/core"; 6 | import { ngToCustomElements } from "@bitdev/angular.dev-services.preview.runtime"; 7 | import { DemoElementsComponent as Cmp } from "./demo-elements.component"; 8 | 9 | /** 10 | * Transform a component into a custom element, and returns the selector for this element. 11 | * It is automatically defined into the custom elements registry when imported. 12 | * Be aware of the risk of selector collision when defining the components (as the registry is global), so you should 13 | * try to always use a prefix. 14 | */ 15 | export const DemoElementsComponent = ngToCustomElements(Cmp, { 16 | providers: [ 17 | provideExperimentalZonelessChangeDetection() 18 | ] 19 | }); 20 | -------------------------------------------------------------------------------- /angular/devkit/compiler/elements/rollup/ngc-plugin/compile.ts: -------------------------------------------------------------------------------- 1 | // @ts-ignore 2 | import type { CompilerHost, CompilerOptions } from '@angular/compiler-cli'; 3 | import { CompilerOptions as TsCompilerOptions } from 'typescript'; 4 | import { ngCompilerCli } from '../utils/ng-compiler-cli'; 5 | 6 | export interface CompileOptions { 7 | id: string; 8 | host: CompilerHost; 9 | options: CompilerOptions & TsCompilerOptions; 10 | files: Map; 11 | } 12 | 13 | export async function compile(opts: CompileOptions) { 14 | const { id, host, options, files } = opts; 15 | // @ts-ignore 16 | const { createProgram } = await ngCompilerCli(); 17 | 18 | const program = createProgram({ rootNames: [id], options, host }); 19 | program.emit(); 20 | 21 | const file = id.replace(/\.tsx?/, ''); 22 | 23 | const map = files.get(`${ file }.js.map`); 24 | const code = files.get(`${ file }.js`); 25 | 26 | return { 27 | code: (code ?? '').replace(/\/\/# sourceMappingURL.*/, ''), 28 | map 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /angular/devkit/preview/mounter/mounter.ts: -------------------------------------------------------------------------------- 1 | // required here to make sure that this is loaded before the compositions file 2 | import '@angular/compiler'; 3 | // @ts-ignore 4 | import type { Type } from '@angular/core'; 5 | import { ngBootstrap, NgBootstrapOptions } from '@bitdev/angular.dev-services.preview.runtime'; 6 | 7 | export interface MounterOptions extends Omit { 8 | hostElement?: HTMLElement; 9 | } 10 | 11 | export function createMounter(Wrapper?: Type, options: MounterOptions = {}) { 12 | return async (Composition: Type) => { 13 | const root = options.hostElement ?? document.getElementById('root'); 14 | if (!root) { 15 | throw new Error('Host element not found, please provide an `hostElement` or add an element with id "root" to the DOM'); 16 | } 17 | await ngBootstrap(Composition, { 18 | ...options, 19 | hostElement: root, 20 | wrapper: Wrapper, 21 | }); 22 | }; 23 | } 24 | 25 | export default createMounter; 26 | -------------------------------------------------------------------------------- /angular/devkit/vite/runtime/api-middleware.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is written in JavaScript 3 | * because it is used by Nitro to build 4 | * the renderer for SSR. 5 | * 6 | * The package is shipped as commonjs 7 | * which won't be parsed by Nitro correctly. 8 | */ 9 | import { eventHandler, proxyRequest } from 'h3'; 10 | 11 | export default eventHandler(async (event) => { 12 | const apiPrefix = `/${import.meta.env.RUNTIME_CONFIG?.apiPrefix ?? 'api'}`; 13 | if (event.node.req.url?.startsWith(apiPrefix)) { 14 | const reqUrl = event.node.req.url?.replace(apiPrefix, ''); 15 | 16 | if ( 17 | event.node.req.method === 'GET' && 18 | // in the case of XML routes, we want to proxy the request so that nitro gets the correct headers 19 | // and can render the XML correctly as a static asset 20 | !event.node.req.url?.endsWith('.xml') 21 | ) { 22 | return $fetch(reqUrl); 23 | } 24 | 25 | return proxyRequest(event, reqUrl, { 26 | fetch: $fetch.native, 27 | }); 28 | } 29 | }); 30 | -------------------------------------------------------------------------------- /angular/devkit/webpack/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "componentId": { 3 | "scope": "bitdev.angular", 4 | "name": "dev-services/webpack", 5 | "version": "8.2.0" 6 | }, 7 | "propagate": false, 8 | "extensions": { 9 | "teambit.dependencies/dependency-resolver": { 10 | "policy": { 11 | "dependencies": { 12 | "typescript": "-" 13 | }, 14 | "peerDependencies": { 15 | "@angular-devkit/build-angular": ">= 0.0.1", 16 | "typescript": ">= 3.5.3", 17 | "webpack": ">= 4.44.2" 18 | }, 19 | "devDependencies": { 20 | "@babel/runtime": "7.22.15" 21 | } 22 | } 23 | }, 24 | "teambit.envs/envs": {}, 25 | "teambit.component/dev-files": {}, 26 | "teambit.pkg/pkg": {}, 27 | "teambit.preview/preview": {}, 28 | "teambit.compositions/compositions": {}, 29 | "teambit.docs/docs": {}, 30 | "teambit.pipelines/builder": {}, 31 | "teambit.semantics/schema": {}, 32 | "teambit.node/node@1.0.110": {} 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /angular/docs/create-ng-app/bubble-graphs.tsx: -------------------------------------------------------------------------------- 1 | // import { PlainBubbleNode } from '@teambit/community.entity.graph.bubble-graph'; 2 | import React from 'react'; 3 | import { 4 | createBubbleGraph, 5 | // PlainBubbleNode, 6 | } from '@teambit/community.entity.graph.bubble-graph'; 7 | import { BubbleGraph } from '@teambit/community.ui.graph.bubble-graph'; 8 | 9 | const appNodes = createBubbleGraph([ 10 | { 11 | id: 'teambit.community/apps/bit-dev@1.96.53', 12 | dependencies: ['teambit.docs/ui/community-docs@1.96.36'], 13 | payload: { 14 | icon: 'https://static.bit.dev/extensions-icons/react.svg', 15 | forceActive: true, 16 | }, 17 | row: 2, 18 | col: 1, 19 | }, 20 | { 21 | id: 'teambit.docs/ui/community-docs@1.96.36', 22 | dependencies: [], 23 | payload: { 24 | icon: 'https://static.bit.dev/extensions-icons/react.svg', 25 | forceActive: true, 26 | }, 27 | row: 2, 28 | col: 6, 29 | }, 30 | ]); 31 | 32 | export const AppGraph = () => ; 33 | -------------------------------------------------------------------------------- /angular/devkit/webpack/webpack-plugins/stats-logger.ts: -------------------------------------------------------------------------------- 1 | import type { Compiler, Stats } from 'webpack'; 2 | 3 | const PLUGIN_NAME = 'angular-stats-logger-plugin'; 4 | 5 | export class StatsLoggerPlugin { 6 | async apply(compiler: Compiler) { 7 | // eslint-disable-next-line no-console 8 | const logger = { 9 | ...console 10 | }; 11 | try { 12 | // "Executed when the compilation has completed." 13 | const { createWebpackLoggingCallback } = await import('@bitdev/angular.dev-services.ng-compat'); 14 | const loggingCallback = createWebpackLoggingCallback({} as any, logger as any) as any; 15 | compiler.hooks.done.tap(PLUGIN_NAME, (stats: Stats) => { 16 | loggingCallback(stats, { stats: { logging: 'info', colors: true } }); 17 | }); 18 | } catch (e) { 19 | // if it fails, just continue (we don't need logging to break the build) 20 | // eslint-disable-next-line no-console 21 | console.log('Failed to load @bitdev/angular.dev-services.ng-compat', e); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /angular/devkit/compiler/ng-packagr/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "componentId": { 3 | "scope": "bitdev.angular", 4 | "name": "dev-services/compiler/ng-packagr", 5 | "version": "8.2.0" 6 | }, 7 | "propagate": false, 8 | "extensions": { 9 | "teambit.dependencies/dependency-resolver": { 10 | "policy": { 11 | "dependencies": { 12 | "@angular/compiler-cli": "-", 13 | "chalk": "^4.1.2", 14 | "ng-packagr": "-" 15 | }, 16 | "peerDependencies": { 17 | "@angular/compiler-cli": ">= 13.0.0", 18 | "ng-packagr": ">=5.0.0" 19 | } 20 | } 21 | }, 22 | "teambit.component/dev-files": {}, 23 | "teambit.pkg/pkg": {}, 24 | "teambit.preview/preview": {}, 25 | "teambit.compositions/compositions": {}, 26 | "teambit.docs/docs": {}, 27 | "teambit.pipelines/builder": {}, 28 | "teambit.semantics/schema": {}, 29 | "teambit.envs/envs": { 30 | "env": "bitdev.node/node-env" 31 | }, 32 | "bitdev.node/node-env@4.0.3": {} 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-standalone/files/component-spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentContext, ComponentFile } from '@teambit/generator'; 2 | 3 | export const componentSpecFile = (context: ComponentContext): ComponentFile => { 4 | const { name, namePascalCase: Name } = context; 5 | 6 | return { 7 | relativePath: `${name}.spec.ts`, 8 | content: `import { ComponentFixture, TestBed } from '@angular/core/testing'; 9 | import { ${Name}Component } from './${name}.component'; 10 | 11 | describe('${Name}Component', () => { 12 | let component: ${Name}Component; 13 | let fixture: ComponentFixture<${Name}Component>; 14 | 15 | beforeEach(async () => { 16 | await TestBed.configureTestingModule({ 17 | imports: [ ${Name}Component ] 18 | }) 19 | .compileComponents(); 20 | 21 | fixture = TestBed.createComponent(${Name}Component); 22 | component = fixture.componentInstance; 23 | fixture.detectChanges(); 24 | }); 25 | 26 | it('should create', () => { 27 | expect(component).toBeTruthy(); 28 | }); 29 | }); 30 | `, 31 | }; 32 | }; 33 | -------------------------------------------------------------------------------- /angular/devkit/vite/plugins/define.plugin.ts: -------------------------------------------------------------------------------- 1 | import { PluginBuild } from 'esbuild'; 2 | import { merge } from 'lodash-es'; 3 | 4 | export const stringifyDefine = (define: any) => { 5 | return Object.entries(define).reduce((acc: any, [key, value]) => { 6 | acc[key] = JSON.stringify(value); 7 | return acc; 8 | }, {}); 9 | }; 10 | 11 | /** 12 | * Pass environment variables to esbuild. 13 | * @returns An esbuild plugin. 14 | */ 15 | export default function(defineValues: any = {}) { 16 | // set variables on global so that they also work during ssr 17 | merge(global, defineValues); 18 | 19 | return { 20 | name: 'env-define', 21 | setup(build: PluginBuild) { 22 | const { platform, define = {} } = build.initialOptions; 23 | if (platform === 'node') { 24 | return; 25 | } 26 | 27 | if (typeof defineValues !== 'string') { 28 | defineValues = stringifyDefine(defineValues); 29 | } 30 | 31 | build.initialOptions.define = { 32 | ...defineValues, 33 | ...define 34 | }; 35 | } 36 | }; 37 | } 38 | -------------------------------------------------------------------------------- /angular/devkit/common/env-options.ts: -------------------------------------------------------------------------------- 1 | import { WebpackConfigWithDevServer } from '@teambit/webpack'; 2 | 3 | export type WebpackConfigFactory = (opts: any) => Promise; 4 | 5 | export type AngularEnvOptions = { 6 | /** 7 | * Use Rollup & Angular Elements to compile compositions instead of webpack. 8 | * This transforms compositions into Web Components and replaces the Angular bundler by the React bundler. 9 | */ 10 | jestModulePath: string; 11 | ngPackagrModulePath: string; 12 | webpackConfigFactory?: WebpackConfigFactory; 13 | webpackDevServerModulePath?: string; 14 | webpackModulePath?: string; 15 | /** 16 | * The dev server to use: webpack or vite. 17 | * Vite only works for apps, not preview yet. 18 | * @default 'webpack' 19 | */ 20 | // devServer?: 'webpack' | 'vite'; 21 | /** 22 | * The bundler to use: webpack or vite. 23 | * Vite only works for apps, not preview yet. 24 | * @default 'webpack' 25 | */ 26 | // TODO: enable this once we have a working vite bundler 27 | // bundler?: 'webpack' | 'vite'; 28 | }; 29 | -------------------------------------------------------------------------------- /angular/docs/create-ng-app/my-angular-app-files/my-angular-app.ng-app.ts: -------------------------------------------------------------------------------- 1 | export default `import { AngularAppOptions } from '@bitdev/angular.app-types.angular-app-type'; 2 | import { BrowserOptions, DevServerOptions } from '@bitdev/angular.dev-services.common'; 3 | 4 | const angularOptions: BrowserOptions & DevServerOptions = { 5 | main: './src/main.ts', 6 | polyfills: './src/polyfills.ts', 7 | index: './src/index.html', 8 | tsConfig: './tsconfig.app.json', 9 | assets: ['./src/assets/**/*'], 10 | styles: ['./src/styles.scss'], 11 | }; 12 | 13 | export const MyAngularAppOptions: AngularAppOptions = { 14 | /** 15 | * Name of the app in Bit CLI. 16 | */ 17 | name: 'my-angular-app', 18 | 19 | /** 20 | * Angular options for \`bit build\` 21 | */ 22 | angularBuildOptions: angularOptions, 23 | 24 | /** 25 | * Angular options for \`bit run\` 26 | */ 27 | angularServeOptions: angularOptions, 28 | 29 | /** 30 | * Folder containing the main file of your application 31 | */ 32 | sourceRoot: './src', 33 | }; 34 | 35 | export default MyAngularAppOptions;`; 36 | -------------------------------------------------------------------------------- /angular/integration/demo-app/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | 4 | describe('AppComponent', () => { 5 | beforeEach(async () => { 6 | await TestBed.configureTestingModule({ 7 | imports: [AppComponent], 8 | }).compileComponents(); 9 | }); 10 | 11 | it('should create the app', () => { 12 | const fixture = TestBed.createComponent(AppComponent); 13 | const app = fixture.componentInstance; 14 | expect(app).toBeTruthy(); 15 | }); 16 | 17 | it(`should have as title 'demo-app'`, () => { 18 | const fixture = TestBed.createComponent(AppComponent); 19 | const app = fixture.componentInstance; 20 | expect(app.title).toEqual('demo-app'); 21 | }); 22 | 23 | it('should render title', () => { 24 | const fixture = TestBed.createComponent(AppComponent); 25 | fixture.detectChanges(); 26 | const compiled = fixture.nativeElement as HTMLElement; 27 | expect(compiled.querySelector('.content h1')?.textContent).toContain('Hello, demo-app'); 28 | }); 29 | }); 30 | -------------------------------------------------------------------------------- /angular/devkit/preview/preview/docs.ts: -------------------------------------------------------------------------------- 1 | import type { RenderingContext } from '@teambit/preview'; 2 | // @ts-ignore 3 | import type { Type } from '@angular/core'; 4 | import { ReplaySubject } from 'rxjs'; 5 | 6 | window.onDocsLoad$ = window.onDocsLoad$ || new ReplaySubject(); 7 | const root = document.getElementById('root'); 8 | 9 | export type DocsFile = { 10 | default: string; 11 | }; 12 | 13 | export type DocsRootProps = { 14 | Provider: Type | undefined, 15 | componentId: string, 16 | docs: DocsFile | string | undefined, 17 | compositions: { [key: string]: any }, 18 | context: RenderingContext 19 | } 20 | 21 | async function docsRoot({docs}: DocsRootProps): Promise { 22 | if (docs && root) { 23 | const appRoot = document.createElement('app-root'); 24 | root.replaceChildren(appRoot); 25 | await window.ngMainStart(); 26 | window.onDocsLoad$.next((docs as DocsFile).default ?? docs as string); 27 | } 28 | } 29 | 30 | // Add support for new api signature 31 | // TODO: remove by the end of 2022 32 | docsRoot.apiObject = true; 33 | 34 | export default docsRoot; 35 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-elements/files/docs.ts: -------------------------------------------------------------------------------- 1 | import { ComponentContext, ComponentFile } from '@teambit/generator'; 2 | 3 | export const docsFile = (context: ComponentContext): ComponentFile => { 4 | const { name, namePascalCase: Name } = context; 5 | 6 | return { 7 | relativePath: `${name}.docs.md`, 8 | content: `--- 9 | labels: ['angular', 'typescript', '${name}'] 10 | description: 'A \`${name}\` component.' 11 | --- 12 | 13 | Import \`${Name}Component\` into your application and use the returned selector to create a component 14 | in the framework of your choice. For example with react: 15 | 16 | \`\`\`ts 17 | import { ${Name}Component } from '@my-scope/${name}'; 18 | import type { ReactNode } from 'react'; 19 | 20 | export type ${Name}Props = { 21 | /** 22 | * sets the component children. 23 | */ 24 | children?: ReactNode; 25 | }; 26 | 27 | // Use the component: 28 | export function ${Name}({ children }: ${Name}Props) { 29 | return ( 30 | <${Name}Component> 31 | {children} 32 | 33 | ); 34 | } 35 | 36 | \`\`\` 37 | `, 38 | }; 39 | }; 40 | -------------------------------------------------------------------------------- /angular/devkit/preview/vite-preview/docs.ts: -------------------------------------------------------------------------------- 1 | import type { RenderingContext } from '@teambit/preview'; 2 | // @ts-ignore 3 | import type { Type } from '@angular/core'; 4 | import { ReplaySubject } from 'rxjs'; 5 | 6 | window.onDocsLoad$ = window.onDocsLoad$ || new ReplaySubject(); 7 | const root = document.getElementById('root'); 8 | 9 | export type DocsFile = { 10 | default: string; 11 | }; 12 | 13 | export type DocsRootProps = { 14 | Provider: Type | undefined, 15 | componentId: string, 16 | docs: DocsFile | string | undefined, 17 | compositions: { [key: string]: any }, 18 | context: RenderingContext 19 | } 20 | 21 | async function docsRoot({docs}: DocsRootProps): Promise { 22 | if (docs && root) { 23 | const appRoot = document.createElement('app-root'); 24 | root.replaceChildren(appRoot); 25 | await window.ngMainStart(); 26 | window.onDocsLoad$.next((docs as DocsFile).default ?? docs as string); 27 | } 28 | } 29 | 30 | // Add support for new api signature 31 | // TODO: remove by the end of 2022 32 | docsRoot.apiObject = true; 33 | 34 | export default docsRoot; 35 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-module/files/component-spec.ts: -------------------------------------------------------------------------------- 1 | import { ComponentContext, ComponentFile } from '@teambit/generator'; 2 | 3 | export const componentSpecFile = (context: ComponentContext): ComponentFile => { 4 | const { name, namePascalCase: Name } = context; 5 | 6 | return { 7 | relativePath: `${name}.spec.ts`, 8 | content: `import { ComponentFixture, TestBed } from '@angular/core/testing'; 9 | import { ${Name}Component } from './${name}.component'; 10 | import { ${Name}Module } from './${name}.module'; 11 | 12 | describe('${Name}Component', () => { 13 | let component: ${Name}Component; 14 | let fixture: ComponentFixture<${Name}Component>; 15 | 16 | beforeEach(async () => { 17 | await TestBed.configureTestingModule({ 18 | imports: [ ${Name}Module ] 19 | }) 20 | .compileComponents(); 21 | 22 | fixture = TestBed.createComponent(${Name}Component); 23 | component = fixture.componentInstance; 24 | fixture.detectChanges(); 25 | }); 26 | 27 | it('should create', () => { 28 | expect(component).toBeTruthy(); 29 | }); 30 | }); 31 | `, 32 | }; 33 | }; 34 | -------------------------------------------------------------------------------- /angular/examples/my-angular-env/config/mounter.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-unresolved */ 2 | import { createMounter } from '@bitdev/angular.dev-services.preview.mounter'; 3 | import { Component, ViewEncapsulation } from '@angular/core'; 4 | 5 | /** 6 | * Provide your component compositions (preview) with the context they need to run. 7 | * for example, a router, a theme, a data provider, etc. 8 | * components added here as providers should be listed as host-dependencies 9 | * @see https://bit.dev/docs/angular-env-env/components-preview#compositions-providers 10 | */ 11 | @Component({ 12 | selector: 'bit-wrapper', 13 | standalone: true, 14 | imports: [], 15 | encapsulation: ViewEncapsulation.None, 16 | template: ` 17 | 18 | `, 19 | }) export class WrapperComponent {} 20 | 21 | 22 | /** 23 | * the entry for the app (preview runtime) that renders your component previews. 24 | * use the default template or create your own. 25 | * @see https://bit.dev/docs/angular-env-env/components-preview#compositions-providers 26 | */ 27 | export default createMounter(WrapperComponent); 28 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v16-env/config/mounter.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-unresolved */ 2 | import { createMounter } from '@bitdev/angular.dev-services.preview.mounter'; 3 | import { Component, ViewEncapsulation } from '@angular/core'; 4 | 5 | /** 6 | * Provide your component compositions (preview) with the context they need to run. 7 | * for example, a router, a theme, a data provider, etc. 8 | * components added here as providers should be listed as host-dependencies 9 | * @see https://bit.dev/docs/angular-env-env/components-preview#compositions-providers 10 | */ 11 | @Component({ 12 | selector: 'bit-wrapper', 13 | standalone: true, 14 | imports: [], 15 | encapsulation: ViewEncapsulation.None, 16 | template: ` 17 | 18 | `, 19 | }) export class WrapperComponent {} 20 | 21 | 22 | /** 23 | * the entry for the app (preview runtime) that renders your component previews. 24 | * use the default template or create your own. 25 | * @see https://bit.dev/docs/angular-env-env/components-preview#compositions-providers 26 | */ 27 | export default createMounter(WrapperComponent); 28 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v17-env/config/mounter.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-unresolved */ 2 | import { createMounter } from '@bitdev/angular.dev-services.preview.mounter'; 3 | import { Component, ViewEncapsulation } from '@angular/core'; 4 | 5 | /** 6 | * Provide your component compositions (preview) with the context they need to run. 7 | * for example, a router, a theme, a data provider, etc. 8 | * components added here as providers should be listed as host-dependencies 9 | * @see https://bit.dev/docs/angular-env-env/components-preview#compositions-providers 10 | */ 11 | @Component({ 12 | selector: 'bit-wrapper', 13 | standalone: true, 14 | imports: [], 15 | encapsulation: ViewEncapsulation.None, 16 | template: ` 17 | 18 | `, 19 | }) export class WrapperComponent {} 20 | 21 | 22 | /** 23 | * the entry for the app (preview runtime) that renders your component previews. 24 | * use the default template or create your own. 25 | * @see https://bit.dev/docs/angular-env-env/components-preview#compositions-providers 26 | */ 27 | export default createMounter(WrapperComponent); 28 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v18-env/config/mounter.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-unresolved */ 2 | import { createMounter } from '@bitdev/angular.dev-services.preview.mounter'; 3 | import { Component, ViewEncapsulation } from '@angular/core'; 4 | 5 | /** 6 | * Provide your component compositions (preview) with the context they need to run. 7 | * for example, a router, a theme, a data provider, etc. 8 | * components added here as providers should be listed as host-dependencies 9 | * @see https://bit.dev/docs/angular-env-env/components-preview#compositions-providers 10 | */ 11 | @Component({ 12 | selector: 'bit-wrapper', 13 | standalone: true, 14 | imports: [], 15 | encapsulation: ViewEncapsulation.None, 16 | template: ` 17 | 18 | `, 19 | }) export class WrapperComponent {} 20 | 21 | 22 | /** 23 | * the entry for the app (preview runtime) that renders your component previews. 24 | * use the default template or create your own. 25 | * @see https://bit.dev/docs/angular-env-env/components-preview#compositions-providers 26 | */ 27 | export default createMounter(WrapperComponent); 28 | -------------------------------------------------------------------------------- /angular/examples/my-angular-v19-env/config/mounter.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-unresolved */ 2 | import { createMounter } from '@bitdev/angular.dev-services.preview.mounter'; 3 | import { Component, ViewEncapsulation } from '@angular/core'; 4 | 5 | /** 6 | * Provide your component compositions (preview) with the context they need to run. 7 | * for example, a router, a theme, a data provider, etc. 8 | * components added here as providers should be listed as host-dependencies 9 | * @see https://bit.dev/docs/angular-env-env/components-preview#compositions-providers 10 | */ 11 | @Component({ 12 | selector: 'bit-wrapper', 13 | standalone: true, 14 | imports: [], 15 | encapsulation: ViewEncapsulation.None, 16 | template: ` 17 | 18 | `, 19 | }) export class WrapperComponent {} 20 | 21 | 22 | /** 23 | * the entry for the app (preview runtime) that renders your component previews. 24 | * use the default template or create your own. 25 | * @see https://bit.dev/docs/angular-env-env/components-preview#compositions-providers 26 | */ 27 | export default createMounter(WrapperComponent); 28 | -------------------------------------------------------------------------------- /angular/templates/generators/ng-app/template-files/src/main.server.ts: -------------------------------------------------------------------------------- 1 | import { ComponentFile } from '@teambit/generator'; 2 | 3 | export const mainServerFile = (standalone: boolean): ComponentFile => { 4 | return { 5 | relativePath: `src/main.server.ts`, 6 | content: `import 'zone.js/node'; 7 | ${standalone ? `import { bootstrapApplication } from '@angular/platform-browser'; 8 | import { AppComponent } from './app/app.component'; 9 | import { config } from './app/app.config.server'; 10 | 11 | export default function bootstrap() { 12 | return bootstrapApplication(AppComponent, config); 13 | }` : `import { provideServerRendering } from '@angular/platform-server'; 14 | import { NgModule } from '@angular/core'; 15 | import { ServerModule } from '@angular/platform-server'; 16 | import { AppModule } from './app/app.module'; 17 | import { AppComponent } from './app/app.component'; 18 | 19 | @NgModule({ 20 | imports: [ 21 | AppModule, 22 | ServerModule, 23 | ], 24 | providers: [provideServerRendering()], 25 | bootstrap: [AppComponent], 26 | }) 27 | export default class AppServerModule {}`}`, 28 | }; 29 | }; 30 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bit-angular", 3 | "version": "1.0.0", 4 | "description": "

Bit Angular

", 5 | "directories": { 6 | "example": "integration" 7 | }, 8 | "dependencies": {}, 9 | "devDependencies": {}, 10 | "scripts": { 11 | "format": "prettier \"./packages/**/*.+(ts|js|jsx|css|scss|tsx|md|mdx)\" --write", 12 | "format:check": "prettier \"./packages/**/*.+(ts|js|jsx|css|scss|tsx|md)\" --check", 13 | "clean": "bit capsule delete --scope-aspects && rm node_modules -rf && rm yarn.lock" 14 | }, 15 | "repository": { 16 | "type": "git", 17 | "url": "git+https://github.com/teambit/bit-angular.git" 18 | }, 19 | "keywords": [], 20 | "author": "teambit", 21 | "license": "ISC", 22 | "bugs": { 23 | "url": "https://github.com/teambit/bit-angular/issues" 24 | }, 25 | "homepage": "https://github.com/teambit/bit-angular#readme", 26 | "packageManager": "pnpm@9.7.0+sha256.b35018fbfa8f583668b2649e407922a721355cd81f61beeb4ac1d4258e585559" 27 | } 28 | -------------------------------------------------------------------------------- /angular/docs/ng-app-deploy/netlify.mdx: -------------------------------------------------------------------------------- 1 | import { InstallNetlify } from './commands'; 2 | 3 | Run the following to install the Netlify deployer: 4 | 5 | 6 | 7 | Set the Netlify deployer in your app plugin file (`.ng-app.ts`): 8 | 9 | ```ts 10 | import { 11 | NetlifyOptions, 12 | Netlify, 13 | } from '@teambit/cloud-providers.deployers.netlify'; 14 | import { AngularAppOptions } from '@bitdev/angular.app-types.angular-app-type'; 15 | 16 | const netlify: NetlifyOptions = { 17 | /* 18 | * your Netlify authentication token. it's recommended to store the token it an env variable. 19 | * https://docs.netlify.com/cli/get-started/#obtain-a-token-in-the-netlify-ui 20 | */ 21 | accessToken: process.env.NETLIFY_AUTH_TOKEN as string, 22 | productionSiteName: 'my-awesome-site', 23 | stagingSiteName: 'my-awesome-staging-site', 24 | /** 25 | * your Netlify team slug 26 | */ 27 | team: 'a-team', 28 | }; 29 | 30 | export const MyAngularAppOptions: AngularAppOptions = { 31 | name: 'my-angular-app', 32 | // ... 33 | deploy: Netlify.deploy(netlify), 34 | }; 35 | 36 | export default MyAngularAppOptions; 37 | ``` 38 | -------------------------------------------------------------------------------- /angular/envs/base-env/config/mounter.ts: -------------------------------------------------------------------------------- 1 | import { createMounter } from '@bitdev/angular.dev-services.preview.mounter'; 2 | // eslint-disable-next-line @typescript-eslint/no-unused-vars 3 | import { Component, ViewEncapsulation } from '@angular/core'; 4 | 5 | /** 6 | * Provide your component compositions (preview) with the context they need to run. 7 | * for example, a router, a theme, a data provider, etc. 8 | * components added here as providers should be listed as host-dependencies 9 | * @see https://bit.dev/docs/angular-env-env/components-preview#compositions-providers 10 | */ 11 | @Component({ 12 | selector: 'bit-wrapper', 13 | // @ts-ignore 14 | standalone: true, 15 | imports: [], 16 | encapsulation: ViewEncapsulation.None, 17 | template: ` 18 | 19 | `, 20 | }) export class WrapperComponent {} 21 | 22 | /** 23 | * the entry for the app (preview runtime) that renders your component previews. 24 | * use the default template or create your own. 25 | * @see https://bit.dev/docs/angular-env-env/components-preview#compositions-providers 26 | */ 27 | export default createMounter(WrapperComponent); 28 | -------------------------------------------------------------------------------- /angular/devkit/ng-compat/build-angular/builders/application.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import type { BuilderContext, BuilderOutput } from '@angular-devkit/architect'; 3 | import { VERSION } from '@angular/cli'; 4 | import type { OutputFile, Plugin } from 'esbuild'; 5 | import { ApplicationBuilderOptions } from '../schemas/application.schema'; 6 | 7 | export let buildApplicationInternal = ( 8 | options: ApplicationBuilderOptions, 9 | context: BuilderContext & { 10 | signal?: AbortSignal; 11 | }, 12 | // infrastructureSettings?: { 13 | // write?: boolean; 14 | // }, 15 | plugins?: Plugin[] | { codePlugins: Plugin[], indexHtmlTransformer: any } 16 | // @ts-ignore 17 | ) => AsyncIterable; 24 | 25 | if(Number(VERSION.major) >= 18) { 26 | buildApplicationInternal = require('@angular/build').buildApplication; 27 | } else if (Number(VERSION.major) >= 16) { 28 | buildApplicationInternal = require('@angular-devkit/build-angular/src/builders/application').buildApplicationInternal; 29 | } 30 | -------------------------------------------------------------------------------- /angular/envs/angular-v16-env/config/mounter.ts: -------------------------------------------------------------------------------- 1 | import { createMounter } from '@bitdev/angular.dev-services.preview.mounter'; 2 | // eslint-disable-next-line @typescript-eslint/no-unused-vars 3 | import { Component, ViewEncapsulation } from '@angular/core'; 4 | 5 | /** 6 | * Provide your component compositions (preview) with the context they need to run. 7 | * for example, a router, a theme, a data provider, etc. 8 | * components added here as providers should be listed as host-dependencies 9 | * @see https://bit.dev/docs/angular-env-env/components-preview#compositions-providers 10 | */ 11 | @Component({ 12 | selector: 'bit-wrapper', 13 | // @ts-ignore 14 | standalone: true, 15 | imports: [], 16 | encapsulation: ViewEncapsulation.None, 17 | template: ` 18 | 19 | `, 20 | }) export class WrapperComponent {} 21 | 22 | /** 23 | * the entry for the app (preview runtime) that renders your component previews. 24 | * use the default template or create your own. 25 | * @see https://bit.dev/docs/angular-env-env/components-preview#compositions-providers 26 | */ 27 | export default createMounter(WrapperComponent); 28 | -------------------------------------------------------------------------------- /angular/devkit/vite/plugins/md.plugin.ts: -------------------------------------------------------------------------------- 1 | import markdoc from '@markdoc/markdoc'; 2 | import { Plugin, PluginBuild } from 'esbuild'; 3 | import { promises } from 'fs'; 4 | 5 | /** 6 | * This plugin uses build.onLoad to intercept .md filenames. 7 | * These files are then read from disk and parsed by remark. 8 | * @returns An esbuild plugin. 9 | */ 10 | export default function () { 11 | const plugin: Plugin = { 12 | name: 'md-loader', 13 | 14 | setup(build: PluginBuild) { 15 | // intercept .md files 16 | build.onResolve({ filter: /\.md$/ }, args => { 17 | return { 18 | path: args.path, 19 | namespace: 'md-ns', 20 | } 21 | }); 22 | 23 | build.onLoad({ filter: /.*/, namespace: 'md-ns' }, async args => { 24 | const data = await promises.readFile(args.path, 'utf8'); 25 | const ast = markdoc.parse(data); 26 | const content = markdoc.transform(ast, {}); 27 | const html = markdoc.renderers.html(content); 28 | return { 29 | contents: html, 30 | loader: 'text', 31 | }; 32 | }) 33 | } 34 | }; 35 | 36 | return plugin; 37 | } 38 | --------------------------------------------------------------------------------