Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bit.dev with angular, change imported class name #2064

Closed
rbalet opened this issue Oct 9, 2019 · 5 comments
Closed

bit.dev with angular, change imported class name #2064

rbalet opened this issue Oct 9, 2019 · 5 comments

Comments

@rbalet
Copy link

rbalet commented Oct 9, 2019

Description

Actualy, when publishing an angular component, it auto import the module like that

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';
import  ComponentName  from '@bit/name.collection.component';

@NgModule({
	declarations: [
		AppComponent,
	],
	imports: [
		BrowserModule,
		ComponentName
	],
	providers: [],
	bootstrap: [AppComponent]
})
export class AppModule { }

Describe the solution you'd like

Would make more sense to import the module with the following name

import { ComponentNameModule } from '@bit/name.collection.component';

since it's an angular standard to name the module like that

@KutnerUri
Copy link
Contributor

KutnerUri commented Oct 16, 2019

@rbalet - I don't understand, the Template Generator for Angular seems to already use import { UiAwesomeButtonModule } from '@bit/bit.ui.awesome.buttons'.

Can you show a screenshot with some context?

@rbalet
Copy link
Author

rbalet commented Oct 22, 2019

Well, I'll try to explain as good as possible what I'm doing.

  1. generating a new component with his module inside shared/vendors/ultrastark.fragments/test (with ng g)
    image

  2. exporting the component
    image

  3. Tacking the component with his test file (I'm tracking here, every component inside the ultrastark.fragments folder, even if I have one component, it's juste my snippets that I always use)

bit add src/app/shared/vendors/ultrastark.fragments/*/ --main src/app/shared/vendors/ultrastark.fragments/{PARENT}/{PARENT}.module.ts --tests src/app/shared/vendors/ultrastark.fragments/{PARENT}/{PARENT}.component.spec.ts
  1. tag all component, export it
bit tag --all
bit export ultrastark.fragments
  1. Opening the bit.dev website (it's an private scope) and there, I have to change the
    import Test from '@bit/ultrastark.fragments.test';
    to
    import {TestModule} from '@bit/ultrastark.fragments.test';
    image

I hope it will help.

@KutnerUri
Copy link
Contributor

OK! I reproduced it.
production is still using an old version of the code. :(
Will fix today!

@KutnerUri
Copy link
Contributor

updated, please try :)

@rbalet
Copy link
Author

rbalet commented Oct 23, 2019

@KutnerUri I'll try the next time I upload a new component. Thx a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants