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

fix: postinstall of css artifact #149

Merged
merged 2 commits into from
Feb 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
node_modules
test/output
output
output
template/css/main.min.css
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@
"lint": "echo \"No linter specified yet\"",
"test": "ava",
"release": "semantic-release",
"develop": "ag https://raw.githubusercontent.com/asyncapi/generator/v1.1.5/test/docs/dummy.yml ./ -o test/output --force-write --watch-template",
"develop": "npm run postinstall && ag https://raw.githubusercontent.com/asyncapi/generator/v1.1.5/test/docs/dummy.yml ./ -o test/output --force-write --watch-template",
"//develop:install": "Force ag to install your local html-template source code",
"develop:install": " npm run develop -- --install",
"generate:assets": "cross-env NODE_ENV=production postcss template/css/main.css -o template/css/tailwind.min.css",
"generate:atomcss": "cross-env NODE_ENV=production postcss template/css/atom-one-dark.min.css -o template/css/main.min.css",
"generate:maincss": "cross-env NODE_ENV=production postcss template/css/custom.css -o template/css/main.min.css",
"generate:tailwind.css": "cross-env NODE_ENV=production postcss template/css/tailwind.min.css -o template/css/main.min.css",
"postinstall": "rimraf \"template/css/main.min.css\" && npm run generate:atomcss && npm run generate:maincss && npm run generate:tailwind.css",
Comment on lines +28 to +31
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have one question. Does postcss merge everything to one main.min.css, yes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

define everything 😄 there is no way to merge multiple files into one at once, nothing in the CLI that I've seen 😞

Copy link
Member

@magicmatatjahu magicmatatjahu Feb 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, postinstall script overrides main.min.css 3 times, or what? 😄 EDIT: Or only appends new content?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

appends/merges

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean not a simple append but smart merge 😄

"generate:assets": "echo \"no assets to generate at the moment\"",
"bump:version": "npm --no-git-tag-version --allow-same-version version $VERSION"
},
"publishConfig": {
Expand Down
File renamed without changes.
11 changes: 2 additions & 9 deletions template/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% if params.singleFile %}
<style type="text/css">
{% include "template/css/tailwind.min.css" %}
</style>
<style type="text/css">
{% include "template/css/atom-one-dark.min.css" %}
</style>
<style type="text/css">
{% include "template/css/main.css" %}
{% include "template/css/main.min.css" %}
</style>
{% else %}
<link href="css/tailwind.min.css" rel="stylesheet">
<link rel="stylesheet" href="css/atom-one-dark.min.css" />
<link href="css/main.min.css" rel="stylesheet">
{% endif %}
</head>
<body>
Expand Down