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

Point main to CSS file for usage by bundlers #263

Merged
merged 4 commits into from
Jan 14, 2024
Merged

Conversation

navaati
Copy link
Contributor

@navaati navaati commented Jan 5, 2024

This allows to just do

import 'tacit-css'

instead of

import 'tacit-css/dist/tacit-css-1.6.0.css'

in your JS code when using a bundler like Webpack.

@yegor256
Copy link
Owner

yegor256 commented Jan 8, 2024

@navaati maybe it's not a good idea to hardcode the 1.6.0 version in the package.json file?

@navaati
Copy link
Contributor Author

navaati commented Jan 10, 2024

Hi !

I… actually agree, haha, but the generated package that’s uploaded to NPM only has the files with the version number.
So the solutions are:

  1. Change the build system to produce a non-versioned filename in dist (prefered solution I’d say, the NPM package is versioned already), either instead of or in addition to the current versioned filename.
  2. Merge this change as is (agree with you, don’t love it, but it’s at least an easy improvement to the user experience at a cost of maintainability)
  3. Status quo, we just close this PR and abandon the idea, but the user experience is not great.

What do you prefer ?

@yegor256
Copy link
Owner

@navaati I like the first option: create two files. One with the version, another one without it.

Done using command: `for f in $(git ls-files); do sed -i 's/2015-2023/2015-2024/' $f; done`
This allows to just do
```typescript
import 'tacit-css'
```
instead of
```typescript
import 'tacit-css/dist/tacit-css-1.6.0.css'
```
in your JS code when using a bundler like Webpack.
@navaati
Copy link
Contributor Author

navaati commented Jan 12, 2024

Hi.

So I re-pushed a series of commits to achieve that. I dived into the build system and realize the default task was broken due to a missing dependency, the first commit in the series fixes that. Then the build still failed due to 2024 being there and the checkYear task not being happy with it, I fixed that with the second commit. By the way, I’m not sure why the Github build was green: see https://github.com/yegor256/tacit/actions/runs/7287245373/job/19857523850#step:6:13 for the current state, grunt fails but GH seems ok with it, I don’t know enough Github Actions to understand… Anyway grunt default build is fine now.

Then in 3rd and last commits I add the unversionned file and expose it in package.json. I decided to expose the uncompressed file because usually people requiring the CSS in JS that way will have their own CSS minimizing pipeline anyway.

Tell me what you think.

@yegor256
Copy link
Owner

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Jan 14, 2024

@rultor merge

@yegor256 OK, I'll try to merge now. You can check the progress of the merge here

@rultor rultor merged commit 866e9cb into yegor256:master Jan 14, 2024
4 checks passed
yegor256 added a commit that referenced this pull request Jan 14, 2024
@rultor
Copy link
Collaborator

rultor commented Jan 14, 2024

@rultor merge

@yegor256 Done! FYI, the full log is here (took me 3min)

@yegor256
Copy link
Owner

@rultor release, tag is 1.7.0

@rultor
Copy link
Collaborator

rultor commented Jan 14, 2024

@rultor release, tag is 1.7.0

@yegor256 OK, I will release it now. Please check the progress here

@rultor
Copy link
Collaborator

rultor commented Jan 14, 2024

@rultor release, tag is 1.7.0

@yegor256 Done! FYI, the full log is here (took me 2min)

@yegor256
Copy link
Owner

@navaati thanks a lot for your contribution! New version 1.7.0 has already been published.

@navaati
Copy link
Contributor Author

navaati commented Jan 15, 2024

Hum, so… unfortunately, it doesn’t work ><. I’m not sure why, but the resulting files are not in the package on NPM. I get it now that it is this "rultor" tool doing the publish, and there is this .rultor.yml file, but I don’t completely get all that happens before the npm publish.

yegor256 added a commit that referenced this pull request Jan 15, 2024
@yegor256
Copy link
Owner

@rultor release, tag is 1.7.1

@rultor
Copy link
Collaborator

rultor commented Jan 15, 2024

@rultor release, tag is 1.7.1

@yegor256 OK, I will release it now. Please check the progress here

@rultor
Copy link
Collaborator

rultor commented Jan 15, 2024

@rultor release, tag is 1.7.1

@yegor256 Done! FYI, the full log is here (took me 2min)

@navaati navaati deleted the patch-1 branch January 15, 2024 13:53
@navaati
Copy link
Contributor Author

navaati commented Jan 15, 2024

Cool, it works now, thanks !

@yegor256
Copy link
Owner

@navaati thanks for your help!

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants