Skip to content

Commit b4a5098

Browse files
committed
Automation
1 parent 63216dc commit b4a5098

File tree

10 files changed

+259
-19
lines changed

10 files changed

+259
-19
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Code owners for the entire repository
2+
* @Sarmaged

.github/workflows/create-pr.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Prepare Release Branch and Create PR
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
25+
- name: Install dependencies
26+
run: yarn install --frozen-lockfile
27+
28+
- name: Configure Git
29+
run: |
30+
git config --global user.name 'github-actions'
31+
git config --global user.email 'github-actions@github.com'
32+
33+
- name: Create and push new branch
34+
run: |
35+
NEW_VERSION=${GITHUB_REF#refs/tags/v}
36+
NEW_BRANCH=release-v${NEW_VERSION}
37+
git checkout -b ${NEW_BRANCH}
38+
git push origin ${NEW_BRANCH}
39+
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
40+
echo "NEW_BRANCH=$NEW_BRANCH" >> $GITHUB_ENV
41+
42+
- name: Update version in package.json
43+
run: |
44+
jq --arg new_version "$NEW_VERSION" '.version = $new_version' package.json > temp.json && mv temp.json package.json
45+
46+
- name: Build the package
47+
run: yarn build
48+
49+
- name: Create Pull Request
50+
uses: peter-evans/create-pull-request@v6
51+
with:
52+
token: ${{ secrets.GITHUB_TOKEN }}
53+
commit-message: "Update version to ${{ env.NEW_VERSION }} and upgrade dependencies"
54+
branch: ${{ env.NEW_BRANCH }}
55+
base: main
56+
title: "Release ${{ env.NEW_VERSION }}"
57+
body: "This PR updates the version to ${{ env.NEW_VERSION }} and upgrades dependencies."
58+
labels: release

.github/workflows/notify.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Notify style-forge
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
jobs:
8+
notify:
9+
if: github.event.pull_request.merged == true
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Determine version update type
14+
id: determine_version
15+
run: echo "update_type=patch" >> $GITHUB_ENV
16+
17+
- name: Send notification to style-forge
18+
run: |
19+
curl -X POST \
20+
-H "Accept: application/vnd.github.v3+json" \
21+
-H "Authorization: token ${{ secrets.PERSONAL_GITHUB_TOKEN }}" \
22+
https://api.github.com/repos/sarmaged/style-forge/dispatches \
23+
-d '{"event_type":"update-style-forge", "client_payload": {"update_type": "${{ env.update_type }}"}}'

.github/workflows/publish.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Publish
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
jobs:
8+
publish:
9+
if: github.event.pull_request.merged == true
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 20
20+
21+
- name: Set up NPM auth
22+
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
23+
24+
- name: Publish to npm
25+
run: yarn publish --non-interactive
26+
env:
27+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
node_modules/
2+
23
npm-debug.log
34
yarn-debug.log*
45
yarn-error.log*
6+
57
.idea/
68
.vscode/
9+
710
*.log
811
*.tmp
912
*.temp
@@ -13,12 +16,17 @@ yarn-error.log*
1316
*.sln
1417
*.sw?
1518
*.iml
19+
1620
.DS_Store
1721
Thumbs.db
22+
1823
dist/
1924
build/
25+
2026
config.js
2127
secrets.json
28+
2229
*.key
2330
*.pem
31+
2432
.coverage

.npmignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
!LICENSE
1+
22
!package.json
33
!README.md
44
!src/
5+
!dist/
56
!*.css
7+
68
*

CONTRIBUTING.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
2+
# Contributing to style-forge.themes
3+
4+
Thank you for your interest in contributing to the style-forge.themes project! We welcome contributions from the community. Please follow these guidelines to ensure a smooth contribution process.
5+
6+
## How to Contribute
7+
8+
1. **Fork the repository**
9+
- Click the "Fork" button at the top right corner of the repository page on GitHub.
10+
11+
2. **Clone the forked repository to your local machine**
12+
```bash
13+
git clone https://github.com/your-username/style-forge.themes.git
14+
```
15+
16+
3. **Create a new branch for your changes**
17+
```bash
18+
git checkout -b feature/branch-name
19+
```
20+
21+
4. **Make your changes and commit them**
22+
- Please ensure that your commits have descriptive messages.
23+
```bash
24+
git commit -am 'Add some feature'
25+
```
26+
27+
5. **Push your changes to the forked repository**
28+
```bash
29+
git push origin feature/branch-name
30+
```
31+
32+
6. **Create a pull request**
33+
- Go to the page of your forked repository on GitHub.
34+
- Click the "New pull request" button.
35+
- Select the base repository and branch you want to merge your changes into.
36+
- Provide a clear and detailed description of your changes.
37+
38+
## Code Style
39+
40+
- Please ensure your code follows the project's coding standards.
41+
- Run existing tests to make sure your changes do not break anything.
42+
- If applicable, add new tests to cover your changes.
43+
44+
## Reporting Issues
45+
46+
If you find a bug or have a feature request, please open an issue on GitHub. Provide as much detail as possible to help us understand and address the issue.
47+
48+
## Community
49+
50+
- Be respectful and considerate in your communications.
51+
- Follow the project's code of conduct.
52+
53+
Thank you for your contributions!
54+
55+
The style-forge.themes Team

README.md

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,40 @@
1-
# [style-forge](https://www.npmjs.com/package/style-forge) .themes
21

3-
[![npm](https://img.shields.io/npm/v/style-forge.themes)][npm-link]
4-
[![npm](https://img.shields.io/npm/dm/style-forge.themes)][npm-link]
2+
# Style-Forge.Themes
53

6-
<hr />
4+
![npm](https://img.shields.io/npm/v/style-forge.themes)
5+
![npm](https://img.shields.io/npm/dm/style-forge.themes)
6+
![license](https://img.shields.io/npm/l/style-forge.themes)
7+
![build](https://github.com/Sarmaged/style-forge.themes/actions/workflows/publish.yml/badge.svg)
8+
9+
## Description
10+
11+
Style Forge Base is a base CSS package for Style Forge, providing foundational styles and variables for web development. It includes default font settings, sizes for various heading levels, and color definitions using HSL.
712

813
## Installation
14+
15+
You can install the package via npm or yarn:
16+
917
```bash
1018
npm install style-forge.themes
1119
```
20+
1221
```bash
1322
yarn add style-forge.themes
1423
```
1524

16-
<hr />
25+
## Usage
1726

27+
After installation, you can import the CSS file into your project:
1828

19-
## Theme
29+
```css
30+
@import "style-forge.base";
31+
```
32+
33+
Or, if you are using Webpack or another module bundler:
34+
35+
```js
36+
import 'style-forge.base';
37+
```
2038

2139
⚠️ Skip this if you don't need to specify a color scheme. The default will always be a light theme.
2240

@@ -32,11 +50,36 @@ There are three standard modes `dark / light / auto (system)`
3250
<html ... data-theme="light">
3351
```
3452

35-
<hr />
53+
## Contributing
54+
55+
We welcome contributions from the community! Please follow these steps to contribute:
56+
57+
1. Fork the repository.
58+
2. Create a new branch: `git checkout -b feature/branch-name`.
59+
3. Make your changes and commit them: `git commit -am 'Add some feature'`.
60+
4. Push your changes to the forked repository: `git push origin feature/branch-name`.
61+
5. Create a pull request in the original repository.
62+
63+
For more detailed information, please refer to [CONTRIBUTING.md](CONTRIBUTING.md).
64+
65+
## License
66+
67+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
68+
69+
## Links
70+
71+
- [style-forge](https://github.com/Sarmaged/style-forge)
72+
- [style-forge.base](https://github.com/Sarmaged/style-forge.base)
73+
- [style-forge.colors](https://github.com/Sarmaged/style-forge.colors)
74+
- [style-forge.form](https://github.com/Sarmaged/style-forge.form)
75+
- [style-forge.helpers](https://github.com/Sarmaged/style-forge.helpers)
76+
- [style-forge.patterns](https://github.com/Sarmaged/style-forge.patterns)
77+
- [style-forge.themes](https://github.com/Sarmaged/style-forge.themes)
78+
79+
## Authors
3680

37-
## License [![NPM](https://img.shields.io/npm/l/style-forge.themes)](https://github.com/Sarmaged/style-forge.themes/blob/main/LICENSE)
81+
- **Dmitrii Sagalov** - *Expert in interface development* - [Sarmaged](https://github.com/Sarmaged)
3882

39-
Distributed under the MIT License. See `LICENSE` for more information.
83+
## Contact
4084

41-
[npm-link]: https://www.npmjs.com/package/style-forge.themes
42-
[github-link]: https://github.com/Sarmaged/style-forge.themes
85+
If you have any questions or suggestions, please open an issue in [Issues](https://github.com/Sarmaged/style-forge.themes/issues).

builder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const css = fs.readFileSync(from, 'utf8')
1010
const packageFile = JSON.parse(fs.readFileSync('package.json', 'utf8'))
1111
const title = packageFile.name + ' v' + packageFile.version
1212
const license = packageFile.license + ' License'
13-
const link = 'github.com/' + packageFile.repository.split(':')[1]
13+
const link = packageFile.repository.url.replace('git+', '').replace('.git', '')
1414
const header = '/*! ' + [title, license, link].join(' | ') + ' */'
1515

1616
const plugins = [pImport, pMinify]

package.json

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,46 @@
11
{
22
"name": "style-forge.themes",
33
"version": "1.0.5",
4-
"description": "Themes CSS for style-forge",
4+
"description": "Style Forge Themes package is a powerful and flexible tool designed for managing and applying themes to your web applications. It provides a streamlined way to handle theme customization, allowing developers to create, switch, and maintain multiple themes effortlessly.",
55
"type": "module",
66
"main": "themes.css",
7-
"repository": "github:sarmaged/style-forge.themes",
7+
"repository": {
8+
"type": "git",
9+
"url": "git+https://github.com/sarmaged/style-forge.base.git"
10+
},
811
"author": "Sarmaged <sarmaged@gmail.com>",
912
"license": "MIT",
1013
"keywords": [
11-
"style-forge.themes",
1214
"themes",
13-
"css"
15+
"theming",
16+
"style",
17+
"CSS-in-JS",
18+
"theme management",
19+
"theme switching",
20+
"customizable themes",
21+
"design",
22+
"UI",
23+
"web development",
24+
"frontend",
25+
"CSS",
26+
"JavaScript",
27+
"react",
28+
"style-forge",
29+
"dynamic themes"
1430
],
1531
"scripts": {
16-
"build": "node builder.js",
17-
"prepublishOnly": "yarn build"
32+
"build": "node builder.js"
1833
},
1934
"devDependencies": {
2035
"postcss": "^8.4.23",
2136
"postcss-import": "^15.1.0",
2237
"postcss-minify": "^1.1.0"
38+
},
39+
"bugs": {
40+
"url": "https://github.com/sarmaged/style-forge.themes/issues"
41+
},
42+
"homepage": "https://github.com/sarmaged/style-forge.themes#readme",
43+
"publishConfig": {
44+
"registry": "https://registry.npmjs.org/"
2345
}
2446
}

0 commit comments

Comments
 (0)