RodrigoTomeES / astro-rename

Astro-Rename is an Astro integration that brings postcss-rename functionality to your Astro project without the need for configuration.
https://www.npmjs.com/package/astro-rename
GNU General Public License v3.0
15 stars 4 forks source link

Feat: Small improvements #7

Closed LucJosin closed 8 months ago

LucJosin commented 8 months ago

Hi @RodrigoTomeES, this PR will fix and introduce a few things:

Features

Screenshot from 2023-10-17 12-51-23

Changes

Fixes

For some reason, the classMap always return a single item after the for await:

https://github.com/RodrigoTomeES/astro-rename/blob/44ce009567ef82067a86e4099a517a0cdeccb926/src/index.ts#L94-L99

After this PR, we first wait for the readFile method and then parse with JSON.parse:

for await (const map of walkFiles(MAPS_DIRECTORY)) {
  const res = await readFile(map, 'utf8');
  classMap = {
    ...classMap,
    ...JSON.parse(res),
  };
}

Issues

RodrigoTomeES commented 8 months ago

@LucJosin Hi!, thanks for the pr I will to check it and merge it

RodrigoTomeES commented 8 months ago

@LucJosin It will take me a while to publish the release since the packages I used to build astro-rename have been removed

RodrigoTomeES commented 8 months ago

@all-contributors please add @LucJosin for

allcontributors[bot] commented 8 months ago

@RodrigoTomeES

I couldn't determine any contributions to add, did you specify any contributions? Please make sure to use valid contribution names.

RodrigoTomeES commented 8 months ago

@all-contributors please add @jakebolam for bug

allcontributors[bot] commented 8 months ago

@RodrigoTomeES

I've put up a pull request to add @jakebolam! :tada: