Skip to content

Commit

Permalink
chore(release): first release
Browse files Browse the repository at this point in the history
BREAKING CHANGE: First stable release
  • Loading branch information
supersnager committed Sep 21, 2020
0 parents commit cfa0a33
Show file tree
Hide file tree
Showing 35 changed files with 4,045 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: build

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
scope: '@chatscope'
- name: Install dependencies
run: yarn
- name: Build
run: yarn build
- name: Publish package
env:
GITHUB_TOKEN: ${{secrets.RELEASE_TOKEN}}
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
GIT_AUTHOR_NAME: supersnager
GIT_AUTHOR_EMAIL: ${{secrets.GIT_AUTHOR_EMAIL}}
GIT_COMMITTER_NAME: supersnager
GIT_COMMITTER_EMAIL: ${{secrets.GIT_AUTHOR_EMAIL}}
run: npx semantic-release
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.idea
node_modules
yarn_error.log
dist
yarn-error.log
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2020 chatscope.io <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Chat UI Kit Styles

[![Actions Status](https://github.com/chatscope/chat-ui-kit-styles/workflows/build/badge.svg)](https://github.com/chatscope/chat-ui-kit-styles/actions) [![npm version](https://img.shields.io/npm/v/@chatscope-chat-ui-kit-styles.svg?style=flat)](https://npmjs.com/chatscope/chat-ui-kit-styles) [![](https://img.shields.io/npm/l/@chatscope/chat-ui-kit-react)]() [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) [![Storybook](https://cdn.jsdelivr.net/gh/storybookjs/brand@master/badge/badge-storybook.svg)](https://chatscope.io/storybook)

Base theme for [chat-ui-kit-react](https://github.com/chatscope/chat-ui-kit-react).

You can use this theme, or create your own by customizing scss variables.

## Install

Using yarn.
```sh
yarn add @chatscope/chat-ui-kit-styles
```

Using npm.
```sh
npm install @chatscope/chat-ui-kit-styles
````

## Usage

```jsx
import styles from '@chatscope/chat-ui-kit-styles/dist/default/styles.min.css';
```

For more information please visit [Chat UI Kit React repository](https://github.com/chatscope/chat-ui-kit-react)
or check our friendly [Storybook](https://chatscope.io/storybook/react/).


## Community and support
* Twitting via [@chatscope](https://twitter.com/chatscope)
* Chatting at [Discord](https://discord.gg/ZSuESK)
* Facebooking at [Facebook](https://www.facebook.com/chatscope)

## Website
[https://chatscope.io](https://chatscope.io)

## License

[MIT](https://github.com/chatscope/chat-ui-kit-styles/blob/master/LICENSE)
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {extends: ['@commitlint/config-conventional']}
90 changes: 90 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"name": "@chatscope/chat-ui-kit-styles",
"version": "0.0.9",
"description": "SCSS themes for @chatscope/chat-ui-kit-react library",
"license": "MIT",
"homepage": "https://chatscope.io/",
"keywords": [
"chat",
"styles",
"css",
"scss",
"ui",
"user interface",
"components",
"ui kit",
"communication",
"conversation",
"toolkit",
"library",
"skin",
"theme",
"frontend",
"reusable",
"responsive"
],
"repository": {
"type": "git",
"url": "https://github.com/chatscope/chat-ui-kit-styles.git"
},
"dependencies": {},
"devDependencies": {
"@commitlint/cli": "11.0.0",
"@commitlint/config-conventional": "11.0.0",
"@semantic-release/changelog": "5.0.1",
"@semantic-release/git": "9.0.0",
"@semantic-release/github": "^7.1.1",
"autoprefixer": "10.0.0",
"husky": "4.3.0",
"node-sass-chokidar": "1.5.0",
"npm-run-all": "4.1.5",
"semantic-release": "17.1.1"
},
"scripts": {
"build:clean": "rm -Rf dist",
"build:autoprefixer": "postcss dist/**/*.css -r -m --no-map --use autoprefixer",
"build:sass": "node ./scripts/build-all",
"build": "npm-run-all -s build:clean build:sass build:autoprefixer",
"pack": "yarn pack",
"watch": "chokidar 'themes/**/*.scss' -c 'npm-run-all -s build:sass build:autoprefixer'"
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"files": [
"dist",
"scripts",
"themes"
],
"publishConfig": {
"access": "public"
},
"release": {
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md",
"changelogTitle": "# @chatscope/chat-ui-kit-styles changelog"
}
],
"@semantic-release/github",
"@semantic-release/npm",
[
"@semantic-release/git",
{
"assets": [
"package.json",
"CHANGELOG.md"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}

}
82 changes: 82 additions & 0 deletions scripts/build-all.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// Build all themes

const fs = require("fs");
const path = require("path");
var sass = require('node-sass');

function writeOutput(error, result, outputFile ) {

if ( !error ) {

// No errors during the compilation, write this result on the disk
fs.writeFile(outputFile, result.css, function(err){
if ( !err ) {
console.log("\x1b[32m%s\x1b[36m%s\x1b[0m", "build-all: sass compiled file: ", outputFile)
} else {
console.error("\x1b[31m%s\x1b[0m", "build-all: sass error writing output file");
throw (err);
}
});

if ( result.map ) {

const mapFile = outputFile + ".map";
fs.writeFile( mapFile, result.map, function(err){
if ( !err ) {
console.log("\x1b[32m%s\x1b[36m%s\x1b[0m", "build-all: sass compiled map file: ", mapFile);
} else {
console.error("\x1b[31m%s\x1b[0m", "build-all: sass error writing output map file");
throw (err);
}
});

}

} else {
console.error("\x1b[31m%s\x1b[0m", "build-all: sass compile error");
throw (error);
}
}

const getAllDirs = (dirPath) => fs.readdirSync(dirPath).map( dir => ({ name: dir, path: path.join(dirPath, dir)}));

const dirs = getAllDirs("./themes");

const sassOptions = {
indentType: "space",
indentWidth: 2,
sourceMap: true,
sourceMapContents: true,
};

const sassCompressedOptions = {
outputStyle: "compressed",
...sassOptions
};

dirs.forEach( dir => {

const distDirectory = `./dist/${dir.name}`;
const outputFile = path.join( distDirectory, "styles" );
const outputFileName = outputFile + ".css";
const outputMinFileName = outputFile + ".min.css";

if (!fs.existsSync(distDirectory)){
fs.mkdirSync(distDirectory, { recursive: true});
}

// Non compressed output
sass.render({
file: path.join( dir.path, "main.scss" ),
outFile: outputFileName, // Required for sourceMap
...sassOptions
} , (error, result ) => writeOutput(error, result, outputFileName ) );

// Compressed output
sass.render({
file: path.join( dir.path, "main.scss" ),
outFile: outputMinFileName, // Required for sourceMap
...sassCompressedOptions
} , ( error, result ) => writeOutput(error, result, outputMinFileName ) );

});
Loading

0 comments on commit cfa0a33

Please sign in to comment.