Skip to content
This repository was archived by the owner on Sep 10, 2024. It is now read-only.

Commit ec4afd5

Browse files
authored
Release v2.2.0 (#35)
1 parent 947d924 commit ec4afd5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+3643
-9732
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Post Release Workflow
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
run-checks:
10+
uses: mercedes-benz/product-kit_actions/.github/workflows/post-release-workflow.yml@main
11+
secrets:
12+
npm-token: ${{ secrets.MBTI_NPM_TOKEN }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
3+
name: Pre Release Checks
4+
5+
on:
6+
pull_request:
7+
branches:
8+
- main
9+
10+
jobs:
11+
run-checks:
12+
uses: mercedes-benz/product-kit_actions/.github/workflows/pre-release-checks.yml@main
13+
with:
14+
npm-package-url: https://unpkg.com/@daimler/productkit-core/package.json
15+
black-duck-project-name: product-kit-core

3RD_PARTY_LICENSES.txt

Lines changed: 2 additions & 874 deletions
Large diffs are not rendered by default.

CHANGELOG.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,27 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
# 2.1.0
5+
## [2.2.0]
6+
7+
### Added
8+
9+
- Added MB color style
10+
- Added application info and warning color
11+
12+
## Changed
13+
14+
- Changed button font weight to bold
15+
- Changed `css` and `js` build to minify output
16+
17+
## [2.1.0]
618

719
## Changes
820
### Typography
921
* Updated font tokens
1022
* Added strong variants to subtitle1, subtitle2, body1, body2 and caption styles
1123
* Removed supscript tokens
1224

13-
# 2.0.0
25+
## [2.0.0]
1426

1527
## Changes
1628
### General
@@ -49,22 +61,22 @@ All notable changes to this project will be documented in this file.
4961
* Due to the addition of new brands import paths must now include the desired brand (i.e. MBTI)
5062
* Due to the addition of the new styleguide many tokens are now changed by name or value
5163

52-
# 1.3.2
64+
## [1.3.2]
5365

5466
### Breaking Changes
5567
* Changed white and black color variable names in exports
5668

57-
# 1.3.1
69+
## [1.3.1]
5870

5971
### Bug Fixes
6072
* Updated text transform capitalized to none
6173

62-
# 1.3.0
74+
## [1.3.0]
6375

6476
### Improvements
6577
* Added export for Javascript variables
6678

67-
# 1.2.0
79+
## [1.2.0]
6880

6981
### Bug Fixes
7082
* Updated contrast values for light and dark mode for better accessibility

CONTRIBUTING.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,43 @@
11
<!-- SPDX-License-Identifier: MIT -->
2+
23
# Contributing
34

45
This document explains how to contribute to this project.
56
By contributing you will agree that your contribution will be put under the same license as this repository.
67

78
## Table of Contents
9+
810
- CLA
911
- Communication
1012
- Contributions
1113
- Quality
1214

1315
## CLA
1416

15-
Before you can contribute, you will need to sign our cla [Contributor License Agreement](https://github.com/Daimler/daimler-foss/blob/master/cla/2019-09-11_Daimler_FOSS_CLA_DaimlerTSS.pdf) and send the signed CLA to <cla-tss@daimler.com>
17+
Before you can contribute, you will need to sign our cla [Contributor License Agreement](https://github.com/mercedes-benz/foss/blob/master/cla/2019-09-11_Daimler_FOSS_CLA_DaimlerTSS.pdf) and send the signed CLA to <cla-mbti@mercedes-benz.com>
1618

1719
## Communication
1820

19-
For communication please respect our [FOSS Code of Conduct](https://github.com/Daimler/daimler-foss/blob/master/CODE_OF_CONDUCT.md).
21+
For communication please respect our [FOSS Code of Conduct](https://github.com/mercedes-benz/foss/blob/master/CODE_OF_CONDUCT.md).
2022

2123
The following communication channels exist for this project:
22-
- Github for reporting and claiming issues:
2324

24-
Transparent and open communication is important to us.
25-
Thus, all project-related communication should happen only through these channels and in English.
25+
- Github for reporting and claiming issues: https://github.com/mercedes-benz/product-kit_core/issues
26+
27+
Transparent and open communication is important to us.
28+
Thus, all project-related communication should happen only through these channels and in English.
2629
Issue-related communication should happen within the concerned issue.
2730

2831
## Contributions
32+
2933
If you would like to contribute code you can do so through GitHub by forking the repository and sending a pull request.
3034

3135
When submitting code, please make every effort to follow existing conventions and style in order to keep the code as readable as possible.
3236

3337
If you are new to contributing in Github, [First Contributions](https://github.com/firstcontributions/first-contributions) might be a good starting point.
3438

3539
## Quality
36-
Please ensure that for all contributions, the corresponding documentation is in-sync and up-to-date. All documentation should be in English language.
3740

38-
We assume that for every non-trivial contribution, the project has been built and tested prior to the contribution.
41+
Please ensure that for all contributions, the corresponding documentation is in-sync and up-to-date. All documentation should be in English language.
42+
43+
We assume that for every non-trivial contribution, the project has been built and tested prior to the contribution.

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
# ![Product Kit Core Logo](./docs/images/pk_core_title_image.png)
44

55
![license](https://img.shields.io/badge/license-MIT-38de03e?style=flat)
6-
[![npm](https://img.shields.io/npm/v/@daimler/productkit-core)](https://www.npmjs.com/package/@daimler/productkit-core)
6+
[![npm](https://img.shields.io/npm/v/@mercedes-benz/productkit-core)](https://www.npmjs.com/package/@mercedes-benz/productkit-core)
7+
8+
> **Note** <br>
9+
> With the release of v2.2.0 and all future versions, product-kit_core is available under the npm scope @mercedes-benz/productkit-core.
710
811
Product Kit Core provides design tokens according to the Mercedes-Benz Tech Innovation styleguide. These tokens are used to create an export that can be used on web platforms using material design. The export is created with a build tool that is called [Style Dictionary](https://github.com/amzn/style-dictionary).
912

@@ -23,7 +26,7 @@ _Note that you must have node (and npm) installed._
2326
You can get the style dictionary for web as package through npm:
2427

2528
```bash
26-
npm install @daimler/productkit-core
29+
npm install @mercedes-benz/productkit-core
2730
```
2831

2932
Styles for web can be found in the `dist` directory. Feel free to contribute any missing platforms.

build.js

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
// SPDX-License-Identifier: MIT
22
const { hexToRgba } = require('./dist/web/utils/js/color')
33
const StyleDictionaryPackage = require('style-dictionary')
4-
const fs = require('fs-extra')
4+
const { formattedVariables } = StyleDictionaryPackage.formatHelpers;
5+
const fs = require('fs-extra');
6+
const { allTokens } = require('style-dictionary');
57

68
const distDirName = 'dist'
7-
const brands = [`hot`, `mbti`, `mbtm`]
9+
const brands = [`hot`, `mbti`, `mbtm`, 'mb']
810
const platforms = [`web`]
911
const modes = [`light`, `dark`]
1012

@@ -40,6 +42,33 @@ const transforms_js = [
4042
`size/px`,
4143
]
4244

45+
StyleDictionaryPackage.registerFormat({
46+
name: 'minifiedCSS',
47+
formatter: function({ dictionary, options={} }) {
48+
49+
const selector = options.selector ? options.selector : `:root`;
50+
const { outputReferences } = options;
51+
const unminifiedString = `${selector} {\n` + formattedVariables({format: 'css', dictionary, outputReferences}) + `}`;
52+
return createMinifiedCSS(unminifiedString)
53+
54+
function createMinifiedCSS(input) {
55+
return input
56+
.replaceAll(/\/\*.*?\*\//gm, '') // remove all css comments
57+
.replaceAll('\n', '') // remove all line breaks
58+
.replaceAll(' ', '') // remove all spaces
59+
}
60+
}
61+
});
62+
63+
StyleDictionaryPackage.registerFormat({
64+
name: 'minifiedJS',
65+
formatter: function({ dictionary }) {
66+
return dictionary.allTokens.map(function(token) {
67+
return 'export const ' + token.name + '=' + JSON.stringify(token.value) + ';';
68+
}).join('');
69+
}
70+
});
71+
4372
// before this runs we should clean the directories we are generating files in
4473
// to make sure they are ✨clean✨
4574
platforms.map(function (platform) {
@@ -93,7 +122,7 @@ function getStyleDictionaryLightConfig(brand, platform, exportPath) {
93122
files: [
94123
{
95124
destination: `css/variables.css`,
96-
format: `css/variables`,
125+
format: `minifiedCSS`,
97126
options: {
98127
outputReferences: true,
99128
},
@@ -124,7 +153,7 @@ function getStyleDictionaryLightConfig(brand, platform, exportPath) {
124153
files: [
125154
{
126155
destination: `js/variables.js`,
127-
format: `javascript/es6`,
156+
format: `minifiedJS`,
128157
},
129158
],
130159
},
@@ -155,10 +184,10 @@ function getStyleDictionaryDarkConfig(brand, platform, exportPath) {
155184
files: [
156185
{
157186
destination: `css/variables-dark.css`,
158-
format: `css/variables`,
187+
format: `minifiedCSS`,
159188
options: {
160189
outputReferences: true,
161-
selector: `.dark`,
190+
selector: `.dark`
162191
},
163192
},
164193
],
@@ -187,7 +216,7 @@ function getStyleDictionaryDarkConfig(brand, platform, exportPath) {
187216
files: [
188217
{
189218
destination: `js/variables-dark.js`,
190-
format: `javascript/es6`,
219+
format: `minifiedJS`,
191220
},
192221
],
193222
},

0 commit comments

Comments
 (0)