felquis / react-credit-cards-2

Beautiful credit cards for your payment forms - community edition ⚡️
https://ovvwzkzry9.codesandbox.io/
MIT License
62 stars 9 forks source link

build: revert back to the build output prior to the ts migration #13

Closed SeanCassiere closed 1 year ago

SeanCassiere commented 1 year ago

Description

Reverting the file structure, used before the changes introduced to the build-step in the migration to typescript. This change inadvertently introduced a breaking change, requiring users to import the stylesheets from the dist folder.

Old: import from 'react-credit-cards-2/es/styles-compiled.css' Borked New: import from 'react-credit-cards-2/dist/es/styles-compiled.css'

As such, a patch was released in #12 that updated the docs, with the patched imports.

This PR, matches the build-step to what was being used previously. Going forward, those who install the package should be able to use it as a drop-in replacement for the main package of react-credit-cards.

File structure

Accordingly, this is the file structure that is being re-introduced into the build process.

es/
└─ /* Contains the bundled esm code, including the .scss and compiled .css stylesheets. */
lib/
└─ /* Contains the bundled commonjs code, including the .scss and compiled .css stylesheets. */
index.d.ts
└─ /* The typescript type declarations file. */
SeanCassiere commented 1 year ago

TLDR; This restores the importing of the stylesheets to what it was before.

SeanCassiere commented 1 year ago

https://github.com/felquis/react-credit-cards-2/issues/12#issuecomment-1492643762 As mentioned in the comment, the imports for the stylesheets in 1.0.0 and going forwards will be from the /dist/ folder.