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

Ci #188

Closed
wants to merge 47 commits into from
Closed

Ci #188

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
6629c76
test: update main tests
borisdamevin Jul 4, 2024
62e158c
refactor(validation): change internal variable name
borisdamevin Jul 4, 2024
e409756
refactor(create-name): update comments
borisdamevin Jul 4, 2024
5539343
refactor(color, shape): remove `show` restriction
borisdamevin Jul 7, 2024
8f84083
refactor(validation): change internal variable name
borisdamevin Jul 9, 2024
47f37c4
build(deps): remove unneeded dependencies
borisdamevin Jul 9, 2024
11bc4c0
chore(deps): bump to `@commitlint/cli` 19.3.0
borisdamevin Jul 9, 2024
1c99416
refactor(color, shape): remove unneeded `$_tokens` variable
borisdamevin Jul 9, 2024
1c82802
test(color, shape): add `index.scss`
borisdamevin Jul 19, 2024
feb106b
test: add `_config-variables.scss`
borisdamevin Jul 19, 2024
94c95ee
chore(deps): bump to `husky` 9.1.1
borisdamevin Jul 21, 2024
966ff1b
build(deps): bump to `sass` 1.77.8
borisdamevin Jul 21, 2024
f3f495d
refactor: removed unneeded `!default`
borisdamevin Jul 22, 2024
a4b09c9
refactor(core): rename `$theme` parameter for `$tokens` in `emit-them…
borisdamevin Jul 24, 2024
771963e
docs: update comments
borisdamevin Jul 24, 2024
d214333
refactor(core): rename `$theme` parameter for `$tokens` in `emit-cust…
borisdamevin Jul 24, 2024
408c8e2
docs: update comments
borisdamevin Jul 25, 2024
85f6988
refactor(core): renamed `$theme` parameter for `$tokens` in functions
borisdamevin Jul 25, 2024
6026df6
refactor(core): simplify `emit-custom-props()` mixin
borisdamevin Jul 24, 2024
ec4d8f4
docs: update comments
borisdamevin Jul 25, 2024
db9dbe7
refactor(core): renamed `$reference` to `$refs` in `validation()` fun…
borisdamevin Jul 24, 2024
e663302
test(core): update `functions.spec.scss`
borisdamevin Jul 25, 2024
cbe363f
chore: update `.gitignore`
borisdamevin Aug 31, 2024
f5d8ab4
chore(deps): bump to `husky` 9.1.5
borisdamevin Sep 3, 2024
58795bb
docs: update comments
borisdamevin Sep 20, 2024
c8e99b9
chore(deps): bump to `@commitlint/cli` 19.5.0
borisdamevin Sep 21, 2024
7f6a3cd
refactor(color): change `$theme` parameter for `$tokens`
borisdamevin Sep 21, 2024
5d39d93
refactor(shape): change `$theme` parameter for `$tokens`
borisdamevin Sep 21, 2024
c1bc7fb
test(shape): update tests
borisdamevin Sep 21, 2024
6bc942a
refactor(shape): rename `_mixins` to `_shape`
borisdamevin Sep 23, 2024
3651e07
refactor(color): rename `_mixins` to `_color`
borisdamevin Sep 23, 2024
0ae23c1
chore(deps): bump to `sass-true` 8.1.0
borisdamevin Oct 2, 2024
27c146e
chore(deps): bump to `semantic-release` 24.1.2
borisdamevin Oct 2, 2024
4394fcf
Revert "test(color, shape): add `index.scss`"
borisdamevin Oct 4, 2024
7ffe74e
chore: update `package.json` keywords
borisdamevin Oct 4, 2024
7812c0d
chore(deps): `release-it` replace `semantic-release`
borisdamevin Oct 9, 2024
b66afe8
ci: update `node.js.yml`
borisdamevin Oct 10, 2024
2c450e9
ci: test ci
borisdamevin Oct 10, 2024
5f214d0
ci: update `node.js.yml`
borisdamevin Oct 10, 2024
a715a71
chore: update `.gitignore`
borisdamevin Oct 10, 2024
0288a6c
ci: update `node.js.yml`
borisdamevin Oct 10, 2024
7feddcd
ci: update `node.js.yml`
borisdamevin Oct 10, 2024
98ae3bf
ci: update `node.js.yml`
borisdamevin Oct 10, 2024
d72ceaa
chore(release): publish version 4.4.1-beta.0
Oct 10, 2024
439e7c7
ci: update `node.js.yml`
borisdamevin Oct 10, 2024
88cfaa3
chore(release): publish version 4.4.1-beta.1
Oct 10, 2024
c6501d0
chore: update `.release-it.json`
borisdamevin Oct 10, 2024
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
48 changes: 44 additions & 4 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Node.js CI

on:
push:
branches: [ main, develop, beta ]
branches: [ main, develop, beta, ci ]
pull_request:
branches: [ main, develop, beta ]

Expand All @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
node-version: [ 18.x, 20.x ]
node-version: [ '20.x' ]

steps:
- uses: actions/checkout@v4
Expand All @@ -39,13 +39,23 @@ jobs:
publish:
runs-on: ubuntu-latest
needs: test
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta' }}
if: ${{ github.ref == 'refs/heads/main' }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: '20'

- name: git config
run: |
git config user.name "Release It"
git config user.email "[email protected]"

- name: Generate .npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc

- name: Install Dependencies
run: npm ci --ignore-scripts --no-audit
Expand All @@ -55,3 +65,33 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish_beta:
runs-on: ubuntu-latest
needs: test
if: ${{ github.ref == 'refs/heads/ci' }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '20'

- name: git config
run: |
git config user.name "Release It"
git config user.email "[email protected]"

- name: Generate .npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc

- name: Install Dependencies
run: npm ci --ignore-scripts --no-audit

- name: Release
run: npm run release:beta
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## Files
*.log
*.map
*.orig
*.log
.npmrc
junit.xml

## Folders
Expand Down
44 changes: 44 additions & 0 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"git": {
"requireBranch": [
"main",
"ci",
"beta"
],
"commitMessage": "chore(release): publish version ${version}"
},
"github": {
"release": false,
"releaseName": "v${version}"
},
"npm": {
"publish": false
},
"plugins": {
"@release-it/conventional-changelog": {
"infile": "CHANGELOG.md",
"header": "# Changelog\n\nAll notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.",
"preset": {
"name": "conventionalcommits",
"types": [
{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "build",
"section": "Build System"
},
{
"type": "refactor",
"section": "Code Refactoring"
}
]
}
}
}
}
73 changes: 0 additions & 73 deletions .releaserc.json

This file was deleted.

31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,37 @@

All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [4.4.1-beta.1](https://github.com/magnesiumlabs/magnesium/compare/v4.4.1-beta.0...v4.4.1-beta.1) (2024-10-10)

## [4.4.1-beta.0](https://github.com/magnesiumlabs/magnesium/compare/v4.4.0...v4.4.1-beta.0) (2024-10-10)


### Build System

* **deps:** bump to `sass` 1.77.8 ([966ff1b](https://github.com/magnesiumlabs/magnesium/commit/966ff1b560f0cd2111546358cec1b304b5b82839))
* **deps:** remove unneeded dependencies ([47f37c4](https://github.com/magnesiumlabs/magnesium/commit/47f37c4724e9d0628ece889a7518e06e5e613e6b))


### Code Refactoring

* **color, shape:** remove `show` restriction ([5539343](https://github.com/magnesiumlabs/magnesium/commit/553934349b1daf1b0b9d1ca79f3c382db8ea94d0))
* **color, shape:** remove unneeded `$_tokens` variable ([1c99416](https://github.com/magnesiumlabs/magnesium/commit/1c99416d40b779e778dde9c8bf6758278b4d23db))
* **color:** change `$theme` parameter for `$tokens` ([7f6a3cd](https://github.com/magnesiumlabs/magnesium/commit/7f6a3cd3b6cf8d079d6125cf77e9b0ba925a3ba1))
* **color:** rename `_mixins` to `_color` ([3651e07](https://github.com/magnesiumlabs/magnesium/commit/3651e07de0a96808869f86f8b7d3ffffc650d874))
* **core:** rename `$theme` parameter for `$tokens` in `emit-custom-props()` mixin ([d214333](https://github.com/magnesiumlabs/magnesium/commit/d21433322e8598bb87998de101dc5438f96b6e9c))
* **core:** rename `$theme` parameter for `$tokens` in `emit-theme-vars()` mixin ([a4b09c9](https://github.com/magnesiumlabs/magnesium/commit/a4b09c97ae9041be525ad88d0c4d2279caa60368))
* **core:** renamed `$reference` to `$refs` in `validation()` function ([db9dbe7](https://github.com/magnesiumlabs/magnesium/commit/db9dbe75f9b5a194c428d3d89a64706ca73d74ff))
* **core:** renamed `$theme` parameter for `$tokens` in functions ([85f6988](https://github.com/magnesiumlabs/magnesium/commit/85f69880cf3891832b03b63730d1c640eb3b2c30))
* **core:** simplify `emit-custom-props()` mixin ([6026df6](https://github.com/magnesiumlabs/magnesium/commit/6026df67836c4ddaa167f6998974aeb1428880c6))
* **create-name:** update comments ([e409756](https://github.com/magnesiumlabs/magnesium/commit/e40975659eeef703276285a5cfd92e8f50fc955e))
* removed unneeded `!default` ([f3f495d](https://github.com/magnesiumlabs/magnesium/commit/f3f495d2ec43d50485cdc2049f2db8e9b0a7edd4))
* **shape:** change `$theme` parameter for `$tokens` ([5d39d93](https://github.com/magnesiumlabs/magnesium/commit/5d39d9333f9b59d74a55be6348c97b7d6a9c3529))
* **shape:** rename `_mixins` to `_shape` ([6bc942a](https://github.com/magnesiumlabs/magnesium/commit/6bc942a93d6698a5fb3ed83b298c9b2357c519a5))
* **validation:** change internal variable name ([8f84083](https://github.com/magnesiumlabs/magnesium/commit/8f840837275b0250246877e19a4bad0ead2b06e1))
* **validation:** change internal variable name ([62e158c](https://github.com/magnesiumlabs/magnesium/commit/62e158cfb3ee2f8174e536a2e4409ed6bb7f2e6d))



## [4.4.0](https://github.com/magnesiumlabs/magnesium/compare/v4.3.1...v4.4.0) (2024-06-21)


Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ user-provided theme's tokens map.

## Mixins

### `emit-custom-props($theme, $prefix)`
### `emit-custom-props($tokens, $prefix)`

Emits CSS custom properties declarations from a user-provided theme's.

Expand All @@ -63,7 +63,7 @@ $theme: (

## Functions

### `emit-variable($theme, $token, $fallback, $prefix)`
### `emit-variable($tokens, $token, $fallback, $prefix)`

Emits CSS variable declaration from a user-provided theme's.

Expand Down
11 changes: 11 additions & 0 deletions __tests__/_config-variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@use "./tokens";

$color: (
"prefix": "sys-color",
"tokens": tokens.$color
);

$shape: (
"prefix": "sys-shape",
"tokens": tokens.$shape
);
14 changes: 2 additions & 12 deletions __tests__/_config.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
@use "./tokens";
@use "./config-variables" as config;
@use "../src/mixins";

$color: (
"prefix": "sys-color",
"tokens": tokens.$color
);

$shape: (
"prefix": "sys-shape",
"tokens": tokens.$shape
);

@include mixins.config("md", $color, $shape);
@include mixins.config("md", config.$color, config.$shape);
2 changes: 1 addition & 1 deletion __tests__/_tokens.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $shape: (
);

$button: (
"text-color": var(--mg-color-primary, darkcyan),
"text-color": darkcyan,
"text-size": 16px,
"padding": (
"top": 12px
Expand Down
52 changes: 52 additions & 0 deletions __tests__/config.spec.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// ============================================================================================= //
// TEST //
// ============================================================================================= //

@use "pkg:sass-true" as *;
@use "./config";
@use "./tokens";
@use "../src/mixins";

@include describe("core") {
@include describe("config") {
@include describe("mixins") {
@include describe("emit-custom-props()") {
@include it("Should return theme custom properties declarations.") {
@include assert {
@include output(false) {
.test {
@include mixins.emit-custom-props(tokens.$button, "button");
}
}

@include expect(false) {
.test {
--md-button-text-color: darkcyan;
--md-button-text-size: 16px;
--md-button-padding-top: 12px;
}
}
}
}

@include it("Should return theme custom properties declarations without component name.") {
@include assert {
@include output(false) {
.test {
@include mixins.emit-custom-props(tokens.$button);
}
}

@include expect(false) {
.test {
--md-text-color: darkcyan;
--md-text-size: 16px;
--md-padding-top: 12px;
}
}
}
}
}
}
}
}
10 changes: 5 additions & 5 deletions __tests__/functions.spec.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@
}

@include describe("create-theme-vars()") {
@include it("Should return a map of tokens with custom properties.") {
@include it("Should return a map of tokens with `var()` CSS function.") {
@include assert-equal(functions.create-theme-vars(tokens.$button, "button"), (
"text-color": var(--mg-button-text-color, var(--mg-color-primary, darkcyan)),
"text-color": var(--mg-button-text-color, darkcyan),
"text-size": var(--mg-button-text-size, 16px),
"padding": (
"top": var(--mg-button-padding-top, 12px)
)
));
}

@include it("Should return a map of tokens with custom properties without component name prefix.") {
@include it("Should return a map of tokens with `var()` CSS function without component name.") {
@include assert-equal(functions.create-theme-vars(tokens.$button, null), (
"text-color": var(--mg-text-color, var(--mg-color-primary, darkcyan)),
"text-color": var(--mg-text-color, darkcyan),
"text-size": var(--mg-text-size, 16px),
"padding": (
"top": var(--mg-padding-top, 12px)
Expand All @@ -52,7 +52,7 @@
}

@include it("Should return validated theme tokens with fallback.") {
@include assert-equal(functions.emit-variable(tokens.$button, "text-color", true, "button"), var(--mg-button-text-color, var(--mg-color-primary, darkcyan)));
@include assert-equal(functions.emit-variable(tokens.$button, "text-color", true, "button"), var(--mg-button-text-color, darkcyan));
}
}
}
Expand Down
Loading
Loading