goetzrobin / spartan

Cutting-edge tools powering Angular full-stack development.
https://spartan.ng
MIT License
1.31k stars 137 forks source link

Missing modules in hlm-form-field and hlm-input #365

Open aghwotu opened 2 weeks ago

aghwotu commented 2 weeks ago

Please provide the environment you discovered this bug in.

    "@angular/cli": "^18.2.2",
    "@angular/compiler-cli": "^18.2.0",
    "@spartan-ng/cli": "^0.0.1-alpha.361",

Which area/package is the issue in?

input

Description

There are errors generated in two files:

  1. hlm-input.directive.ts
    import { BrnFormFieldControl } from '@spartan-ng/ui-form-field-brain';
    import { ErrorStateMatcher, ErrorStateTracker } from '@spartan-ng/ui-forms-brain';
Cannot find module '@spartan-ng/ui-form-field-brain' or its corresponding type declarations
Cannot find module '@spartan-ng/ui-forms-brain' or its corresponding type declarations
  1. hlm-form-field.component.ts
    import { BrnFormFieldControl } from '@spartan-ng/ui-form-field-brain';
    import { HlmErrorDirective } from './hlm-error.directive';
Cannot find module '@spartan-ng/ui-form-field-brain' or its corresponding type declarations
image

Please provide the exception or error you saw

✘ [ERROR] TS2307: Cannot find module '@spartan-ng/ui-form-field-brain' or its corresponding type declarations. [plugin angular-compiler]

    components/ui-input-helm/src/lib/hlm-input.directive.ts:4:36:
      4 │ import { BrnFormFieldControl } from '@spartan-ng/ui-form-field-brain';
        ╵                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

✘ [ERROR] TS2307: Cannot find module '@spartan-ng/ui-forms-brain' or its corresponding type declarations. [plugin angular-compiler]

    components/ui-input-helm/src/lib/hlm-input.directive.ts:5:53:
      5 │ ...tateMatcher, ErrorStateTracker } from '@spartan-ng/ui-forms-brain';
        ╵                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Other information

Tailwind config

/** @type {import('tailwindcss').Config} */
module.exports = {
  presets: [require("@spartan-ng/ui-core/hlm-tailwind-preset")],
  content: ["./src/**/*.{html,ts}", "./components/**/*.{html,ts}"],
  theme: {
    extend: {},
  },
  plugins: [],
};

I would be willing to submit a PR to fix this issue

lreiner commented 1 week ago

Is there a temporary fix for this? Even though the bugfix got merged I still get the same result using npx nx g @spartan-ng/cli:ui formfield

goetzrobin commented 1 week ago

I released the new cli which should fix this! Let me know if you get it to work now

ajitzero commented 1 week ago

Hi, @goetzrobin, I'm facing a similar issue with installing input & label. Where can I see the latest releases on GitHub? I'm on 0.0.1-alpha.362

goetzrobin commented 1 week ago

That is the newest. Are you still getting the exact same error? I'll take a look

ajitzero commented 1 week ago

I'm facing an issue during installation itself:

image

3 different error logs:

ajitzero commented 1 week ago

Also, maybe unrelated, @spartan-ng/ui-core is on 0.0.1-alpha.354 - Should that be bumped to 362 as well?

goetzrobin commented 1 week ago

@ajitzero just pushed a new version. if you wanna try it. i am testing it now, too

ajitzero commented 1 week ago

It works now! (but) I'm seeing two versions of form field:

image

goetzrobin commented 1 week ago

i just pushed the final version (hopefully)

cli 0.0.1-alpha.364 & ui 0.0.1-alpha.355

you should be able to remove the ui-form-field-brain and dependency issues should be resolved

goetzrobin commented 1 week ago

@ajitzero let me know if everything looks good from your side now

ajitzero commented 1 week ago

All good! Thanks for helping out so quickly!

image

For some reason, the CLI generator had added these to the main package.json in the dependencies section, which I removed manually. I'll try this out in a different repo to check if that happens again or if I mistyped something.

ajitzero commented 1 week ago

@goetzrobin I just tried again after deleting node modules, and the original issue is happening again :(

image

'@spartan-ng/ui-forms-brain' clearly doesn't exist, so should this just be '@spartan-ng/ui-core'? Manually changing it doesn't work.

It's almost 3 am here, so I'll check again tomorrow. Good night!

goetzrobin commented 1 week ago

Hey there! The cli should install it the ui-forms-brain for you 🤔 I'll check it out tomorrow also

marcjulian commented 6 days ago

I think @spartan-ng/ui-formfield-brain is not yet published to npm, the package name was changed in the last commit chore: release cli 0.0.1-alpha.364 & ui 0.0.1-alpha.355

ajitzero commented 6 days ago

@marcjulian It's available on npm:

marcjulian commented 6 days ago

I was trying to install @spartan-ng/ui-formfield-brain. Now i can find it on npm too https://www.npmjs.com/package/@spartan-ng/ui-formfield-brain

marcjulian commented 5 days ago

There is a peer dependency issue with select pointing to @spartan-ng/ui-form-field-brain@0.0.1-alpha.355 which only exists as @spartan-ng/ui-formfield-brain@0.0.1-alpha.355. Fixed with #374