Skip to content

Commit

Permalink
Merge branch 'release/0.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
hiukky committed Jul 13, 2020
2 parents 2142cbf + 43f2dd7 commit aa7e173
Show file tree
Hide file tree
Showing 47 changed files with 1,592 additions and 400 deletions.
33 changes: 33 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"env": {
"es2020": true,
"node": true
},
"extends": ["airbnb-base", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 11,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"settings": {
"import/resolver": {
"node": {
"extensions": [".ts"]
}
}
},
"rules": {
"class-methods-use-this": "off",
"no-unused-vars": "off",
"global-require": "off",
"@typescript-eslint/no-unused-vars": "error",
"import/extensions": [
"error",
"ignorePackages",
{
"ts": "never"
}
]
}
}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules/
node_modules/
dist/
*.vsix
5 changes: 3 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"trailingComma": "es5",
"trailingComma": "all",
"tabWidth": 2,
"semi": false,
"singleQuote": true
"singleQuote": true,
"arrowParens": "avoid"
}
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</div>

<p align="center">
<a href="httdivs://github.com/hiukky/flate/blob/master/LICENSE">
<a href="httdivs://github.com/hiukky/flate/blob/develop/LICENSE">
<img alt="GitHub license" src="https://img.shields.io/github/license/hiukky/flate?color=%236BF178&style=flat-square" />
</a>
<a href="https://github.com/hiukky/flate/stargazers">
Expand All @@ -18,16 +18,16 @@
</p>

<p align="center">
<sub>Built with ❤︎ by <a href="https://github.com/hiukky">Romullo</a>
<sub>Built with ❤︎ by <a href="https://hiukky.com">Hiukky</a>
<br/>
</p>

<h2 align="center"> A package of dark themes with a mix of cool colors. </h2>

### [VS Code](https://github.com/hiukky/flate/blob/master/packages/vscode/README.md)
### [VS Code](https://github.com/hiukky/flate/blob/develop/packages/vscode/README.md)

<img src="https://github.com/hiukky/flate/blob/develop/packages/vscode/assets/vscode.png?raw=true" />

### [Insomnia](https://github.com/hiukky/flate/blob/master/packages/insomnia/README.md)
### [Insomnia](https://github.com/hiukky/flate/blob/develop/packages/insomnia/README.md)

<img src="https://github.com/hiukky/flate/blob/master/packages/insomnia/assets/insomnia.png?raw=true" />
<img src="https://github.com/hiukky/flate/blob/develop/packages/insomnia/assets/insomnia.png?raw=true" />
Binary file modified assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.0.0",
"version": "0.5.0",
"useWorkspaces": true,
"packages": ["packages/*"],
"npmClient": "yarn"
Expand Down
21 changes: 16 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "root",
"private": true,
"workspaces": {
"packages": [
"packages/*"
Expand All @@ -19,13 +20,23 @@
"type": "git",
"url": "https://github.com/hiukky/flate"
},
"private": true,
"scripts": {
"format": "prettier --write \"./packages/**/*.{ts,js}\""
},
"devDependencies": {
"@commitlint/cli": "^8.3.5",
"@commitlint/config-conventional": "^8.3.4",
"@types/node": "^14.0.13",
"@commitlint/cli": "^9.1.1",
"@commitlint/config-conventional": "^9.1.1",
"@types/node": "^14.0.23",
"@typescript-eslint/eslint-plugin": "^3.6.1",
"@typescript-eslint/parser": "^3.6.1",
"eslint": "^7.4.0",
"eslint-config-airbnb-base": "^14.2.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.22.0",
"husky": "^4.2.5",
"lerna": "^3.22.1",
"prettier": "^2.0.5"
"prettier": "^2.0.5",
"ts-node": "^8.10.2",
"typescript": "^3.9.6"
}
}
21 changes: 21 additions & 0 deletions packages/core/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 R o m u l l o

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 NONINFRINGEMENT. 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.
13 changes: 13 additions & 0 deletions packages/core/colors/_colors.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
$green: #6bf178;
$beige: #8f8d88;
$purple: #a29bfe;
$cyan: #00cecb;
$red: #e84855;
$yellow: #ffe066;
$grey: #424b54;
$orange: #f0aa85;
$pink: #ff5d8f;
$quince: #f49e4c;
$spiced: #eab464;
$squash: #f38375;
$white: #e9dbdb;
4 changes: 4 additions & 0 deletions packages/core/colors/flate-arc.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@import "./colors";

$primaryColor: #22252f;
$secondaryColor: $cyan;
4 changes: 4 additions & 0 deletions packages/core/colors/flate-exodus.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@import "./colors";

$primaryColor: #170227;
$secondaryColor: $squash;
4 changes: 4 additions & 0 deletions packages/core/colors/flate.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@import "./colors";

$primaryColor: #1c1d27;
$secondaryColor: $green;
1 change: 1 addition & 0 deletions packages/core/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './tools'
19 changes: 19 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "@flate/core",
"main": "index.ts",
"version": "0.5.0",
"author": {
"name": "Romullo",
"email": "developermarsh@gmail.com",
"url": "https://hiukky.com"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/hiukky/flate/issues"
},
"homepage": "https://github.com/hiukky/flate#readme",
"repository": {
"type": "git",
"url": "https://github.com/hiukky/flate"
}
}
134 changes: 134 additions & 0 deletions packages/core/tools/build.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
import fs from 'fs'

import SCSS from './scss'

import { IBuild, TRootDir, TCreateFile, TTheme } from './types'

class Build implements IBuild {
readonly rootDir: TRootDir

public scss = new SCSS()

public theme: TTheme = {
stage: '',
final: {},
}

/**
* @constructor
*
* @param {TRootDir} rootDir
*/
constructor(rootDir: TRootDir) {
this.rootDir = rootDir
}

/**
* @method listThemes
*
* List all themes in a directory.
*/
get listThemes(): string[] {
return fs
.readdirSync(this.rootDir.themes)
.filter(theme => theme.match(/\.[0-9a-z]+$/i))
}

/**
* @method getFile
*
* Loads the JSON file with theme specifications.
*
* @param {String} pathFile
*/
static getFile(pathFile: string): object {
return JSON.parse(fs.readFileSync(pathFile, 'utf8'))
}

/**
* @method createFile
*
* Creates the compiled theme.
*
* @param {TCreateFile} options
* @param {String} options.path
* @param {String} options.file
* @param {String} options.fileName
*/
static createFile({ path, file, fileName }: TCreateFile): void {
fs.readdir(path, error => {
if (error) fs.mkdirSync(path)
})

fs.writeFile(`${path}/${fileName}`, JSON.stringify(file), error => {
if (error) throw error
})
}

/**
* @method mergeColors
*
* Replace all colors.
*
* @param {any} theme
*/
mergeColors(theme: any): this {
this.theme.stage = JSON.stringify(theme)

Object.entries(this.scss.getColors(theme.variant)).flatMap(
([nameColor, color]) => {
this.theme.stage = this.theme.stage.replace(
new RegExp(`\\${nameColor}`, 'g'),
color,
)

return true
},
)

return this
}

/**
* @method stage
*
* Stage method where the finishing touches are applied.
*
* @param {Function} callback
*/
stage(): this {
this.listThemes.map(themeName => {
this.mergeColors({
...Build.getFile(`${this.rootDir.themes}/common/base.json`),
...Build.getFile(`${this.rootDir.themes}/${themeName}`),
})

this.theme.final[themeName] = JSON.parse(this.theme.stage)

return themeName
})

return this
}

/**
* @method compile
*
* Responsible for the construction.
*/
compile(): void {
this.stage()

if (this.theme.final) {
Object.entries(this.theme.final).map(([name, theme]) =>
Build.createFile({
path: this.rootDir.build,
file: theme,
fileName: name,
}),
)
}
}
}

export default Build
2 changes: 2 additions & 0 deletions packages/core/tools/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default as Build } from './build'
export { default as SCSS } from './scss'
Loading

0 comments on commit aa7e173

Please sign in to comment.