-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit aa4e875
Showing
45 changed files
with
24,147 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"extends": [ | ||
"@commitlint/config-conventional" | ||
], | ||
"rules": { | ||
"header-max-length": [ | ||
2, | ||
"always", | ||
100 | ||
], | ||
"type-case": [ | ||
1, | ||
"always", | ||
[ | ||
"lower-case", | ||
"upper-case" | ||
] | ||
], | ||
"type-enum": [ | ||
2, | ||
"always", | ||
[ | ||
"ci", | ||
"chore", | ||
"docs", | ||
"feat", | ||
"fix", | ||
"perf", | ||
"refactor", | ||
"revert", | ||
"test", | ||
"WIP" | ||
] | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
**/node_modules | ||
**/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
{ | ||
"root": true, | ||
"extends": [ | ||
"eslint:recommended" | ||
], | ||
"parserOptions": { | ||
"ecmaVersion": 2018, | ||
"sourceType": "module" | ||
}, | ||
"env": { | ||
"browser": true, | ||
"node": true, | ||
"es6": true | ||
}, | ||
"rules": { | ||
"no-unexpected-multiline": "error", | ||
"block-scoped-var": "error", | ||
"complexity": [ 1, 15 ], | ||
"consistent-return": "error", | ||
"curly": "error", | ||
"default-case": "error", | ||
"dot-location": ["error", "property"], | ||
"eqeqeq": ["error", "smart"], | ||
"no-alert": "error", | ||
"no-caller": "error", | ||
"no-console": "error", | ||
"no-else-return": "error", | ||
"no-eval": "error", | ||
"no-implied-eval": "error", | ||
"no-extend-native": "error", | ||
"no-extra-bind": "error", | ||
"no-implicit-coercion": "error", | ||
"no-invalid-this": "error", | ||
"no-lone-blocks": "error", | ||
"no-loop-func": "error", | ||
"no-multi-spaces": "error", | ||
"no-native-reassign": "error", | ||
"no-new": "error", | ||
"no-param-reassign": "error", | ||
"no-return-assign": "error", | ||
"no-sequences": "error", | ||
"no-useless-call": "error", | ||
"array-bracket-spacing": ["error", "always"], | ||
"brace-style": ["error", "1tbs", { "allowSingleLine": true }], | ||
"camelcase": "error", | ||
"comma-style": "error", | ||
"consistent-this": ["error", "that"], | ||
"indent": ["error", 4, { "SwitchCase": 1 }], | ||
"jsx-quotes": "error", | ||
"key-spacing": ["error", { "beforeColon": false, "afterColon": true }], | ||
"keyword-spacing": ["error", { "before": true, "after": true }], | ||
"linebreak-style": ["error", "unix"], | ||
"max-params": ["error", 4], | ||
"no-multiple-empty-lines": ["error", {"max": 2}], | ||
"no-nested-ternary": "error", | ||
"no-spaced-func": "error", | ||
"no-trailing-spaces": "error", | ||
"object-curly-spacing": ["error", "always"], | ||
"semi": [ "error", "always" ], | ||
"semi-spacing": "error", | ||
"space-before-blocks": "error", | ||
"space-before-function-paren": ["error", "never"], | ||
"space-infix-ops": ["error", {"int32Hint": false} ], | ||
"arrow-body-style": "error", | ||
"no-confusing-arrow": "error", | ||
"no-class-assign": "error", | ||
"no-const-assign": "error", | ||
"no-dupe-class-members": "error", | ||
"no-this-before-super": "error", | ||
"no-var": "error", | ||
"yoda": ["error", "never", { "exceptRange": true }] | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": [ | ||
"**/*.ts" | ||
], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"rules": { | ||
"@typescript-eslint/ban-types": "off", | ||
"@typescript-eslint/triple-slash-reference": "off", | ||
"@typescript-eslint/no-empty-function": "off", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/no-non-null-assertion": "off" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: CI | Unit | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
|
||
run-tests: | ||
name: Run tests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Checkout branch | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16.x | ||
|
||
- name: Install | ||
run: npm ci | ||
|
||
- name: Lint scripts | ||
run: npm run eslint | ||
|
||
- name: Run tests | ||
run: npm run test | ||
|
||
|
||
ci-unit: | ||
name: CI | Unit | ||
needs: run-tests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
# IMPORTANT NOTE | ||
# | ||
# You can not set a workflow to be status check. The job is. Hence the trickery... | ||
|
||
- name: Done | ||
run: echo "Done!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Merge develop to master | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
on: [workflow_dispatch] | ||
|
||
jobs: | ||
|
||
merge: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: master | ||
|
||
- name: Merge develop to master | ||
run: | | ||
git fetch --quiet | ||
git reset --hard origin/master | ||
git merge --ff-only --quiet origin/develop | ||
git push origin master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Release stable channel | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
on: [workflow_dispatch] | ||
|
||
jobs: | ||
|
||
release-stable: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: master | ||
|
||
- name: Merge develop to master | ||
run: | | ||
git fetch --quiet | ||
git reset --hard origin/master | ||
git merge --ff-only --quiet origin/develop | ||
- name: Setup node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16.x | ||
|
||
- name: Install | ||
run: npm ci | ||
|
||
- name: Publish | ||
run: npx semantic-release | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Update develop | ||
run: | | ||
git push origin master:develop --quiet > /dev/null 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Folders | ||
.vscode/ | ||
.tmp/ | ||
node_modules/ | ||
dist/ | ||
modules/ | ||
|
||
# Log files | ||
npm-debug.log | ||
lerna-debug.log | ||
debug.log | ||
|
||
# System files | ||
.DS_Store | ||
|
||
# Lock files | ||
# package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx commitlint -e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npm run eslint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npm run eslint | ||
npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.husky/ | ||
__tests__/ | ||
scripts/ | ||
src/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@import "simple.scss"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
lorem ipsum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@import "simple.scss"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
$var: red; | ||
body { | ||
color: $var; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/// <reference path="../../lib/types/index.d.ts" /> | ||
|
||
import fs from 'fs'; | ||
import path from 'path'; | ||
import assert from 'assert'; | ||
import { sassBuild } from '../../src/sass-build'; | ||
import { logger, fileExists } from '../../src/utils'; | ||
|
||
const FIXTURES_PATH = path.resolve( __dirname, '../__fixtures__' ); | ||
|
||
[ 'modern', 'legacy' ].forEach( apiType => { | ||
|
||
describe( `${apiType}-sass`, () => { | ||
|
||
beforeAll(() => { | ||
logger.level = 'error'; | ||
}); | ||
|
||
beforeEach(() => { | ||
fs.rmSync( `${FIXTURES_PATH}/dist`, { recursive: true, force: true } ); | ||
}); | ||
afterEach(() => { | ||
fs.rmSync( `${FIXTURES_PATH}/dist`, { recursive: true, force: true } ); | ||
}); | ||
|
||
const opts : Partial<CliOptions> = { | ||
api: 'legacy' | ||
}; | ||
|
||
const file = `${FIXTURES_PATH}/simple.scss`; | ||
const outFile = `${FIXTURES_PATH}/dist/simple.css`; | ||
|
||
describe( 'sassBuild', () => { | ||
|
||
test('sassBuild compiles', () => { | ||
sassBuild( file, outFile, <CliOptions> opts ); | ||
assert.equal( fileExists( outFile ), true ); | ||
}); | ||
|
||
}); | ||
|
||
}); | ||
|
||
}); |
Oops, something went wrong.