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

bug: 9.0 Using valueAccessorConfigs does not add the base value-accessor file to the generated outputs #469

Open
3 tasks done
istvanherbak opened this issue Aug 29, 2024 · 3 comments
Labels
help wanted a good issue for the community package: angular @stencil/angular-output-target package type: bug Something isn't working

Comments

@istvanherbak
Copy link

Prerequisites

Stencil Version

4.21.0

Stencil Framework Output Target

Angular

Stencil Framework Output Target Version

9.0

Current Behavior

All my custom value-accessors are generated for the selectors, however the referenced base vale-accessor directive file is not added to the output folder.

Expected Behavior

The previously added base value-accessor.ts file is also present in the output folder.

Steps to Reproduce

Create a valueaccessor that is targeting 'value'.
Build the stencil project and find that the generated file is trying to import ./value-accessor.ts which is missing.

Code Reproduction URL

https://github.com/istvanherbak/stencil

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Aug 29, 2024
Copy link

ionitron-bot bot commented Aug 29, 2024

Thanks for the issue!

This project is currently maintained for the purposes of supporting Ionic Framework. At this time, only new issues & pull requests that support Ionic Framework will be prioritized. For the latest updates regarding the maintenance status of this project, please see this section of the project's README

@Loic57
Copy link

Loic57 commented Sep 16, 2024

I have the same issue but it depends, sometimes I have a folder named "value-accessor.ts" with a file inside named "value-accessor.ts"

Sometimes nothing is created.

But I never have the classic value-accessor.ts file created so I created manually a script to detect if the value-accessor.ts foler exists and if yes, I move the file outside the folder.

If the folder doesn't exist I execute the stencil build again and again until the folder is created.

And no need to target the value to see the bug, here is my stencil.config.ts :

import {Config} from '@stencil/core';
import {angularOutputTarget as angular, ValueAccessorConfig} from '@stencil/angular-output-target';

const componentCorePackage = '@test/webc-ds';
const customElementsDir = 'dist/components';

const angularValueAccessorBindings: ValueAccessorConfig[] = [
    {
        // Boolean
        elementSelectors: ['webc-ds-checkbox, webc-ds-switch'],
        event: 'clickCheckbox',
        targetAttr: 'checked',
        type: 'boolean',
    }
];

export const config: Config = {
    namespace: 'webc-ds',
    globalStyle: 'src/styles/_app.scss',
    enableCache: false,
    outputTargets: [
        {
            type: 'www'
        },
        {
            type: 'dist', // to generate the components as a reusable library that can be self-lazy loading
            esmLoaderPath: '../loader',
            copy: [
                {src: '../public/assets', dest: 'assets', warn: true},
            ]
        },
        {
            type: 'dist-custom-elements',
            dir: customElementsDir,
            customElementsExportBehavior: 'single-export-module',
        },
        angular({
            componentCorePackage,
            directivesProxyFile: '../angular/workspace-18/projects/webc-ds-ng/src/lib/stencil-generated/components.ts',
            directivesArrayFile: '../angular/workspace-18/projects/webc-ds-ng/src/lib/stencil-generated/index.ts',
            customElementsDir,
            valueAccessorConfigs: angularValueAccessorBindings,
            outputType: 'standalone'
        }),
    ]
};

@christian-bromann christian-bromann added type: bug Something isn't working package: angular @stencil/angular-output-target package help wanted a good issue for the community and removed triage labels Oct 14, 2024
Copy link

ionitron-bot bot commented Oct 14, 2024

This issue has been labeled as help wanted. This label is added to issues that we believe would be good for contributors.

If you'd like to work on this issue, please comment here letting us know that you would like to submit a pull request for it. This helps us to keep track of the pull request and make sure there isn't duplicated effort.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted a good issue for the community package: angular @stencil/angular-output-target package type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants