feat: initial release from fork

This commit is contained in:
joneff 2021-02-15 17:47:56 +02:00 коммит произвёл Иван Жеков
Родитель 1c987be8fe
Коммит 094ad94fa7
14 изменённых файлов: 8356 добавлений и 123 удалений

Просмотреть файл

@ -14,15 +14,15 @@ max_line_length = off
indent_style = space
indent_size = 4
[*.js]
[*.{js,json}]
indent_style = space
indent_size = 4
[*.yml]
indent_style = space
indent_size = 4
indent_size = 2
[*.json]
[*.md]
indent_style = space
indent_size = 4

1
.eslintignore Normal file
Просмотреть файл

@ -0,0 +1 @@
**/node_modules

53
.github/workflows/ci_nightly.yml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,53 @@
name: CI | Nightly
defaults:
run:
shell: bash
env:
CI: true
on:
schedule:
# Run at midnight every working day
- cron: '0 0 * * Mon-Fri'
workflow_dispatch:
jobs:
# Run only if current commit hash is differente prom previous run commit hash
ci-nightly:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x]
steps:
- name: Checkout branch
uses: actions/checkout@v2
with:
ref: develop
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Setup node cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- name: Install
run: npm ci
- name: Lint scripts
run: npm run lint
- name: Run tests
run: npm run test

41
.github/workflows/ci_unit.yml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,41 @@
name: CI | Unit
defaults:
run:
shell: bash
on:
push:
branches:
- '**'
jobs:
ci-unit:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Setup node cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- name: Install
run: npm ci
- name: Lint scripts
run: npm run lint
- name: Run tests
run: npm run test

33
.github/workflows/merge_develop.yml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,33 @@
name: Merge develop to master
defaults:
run:
shell: bash
env:
CI: true
on:
workflow_dispatch:
jobs:
merge:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: master
token: ${{ secrets.GH_TOKEN }}
- name: Merge develop to master
run: |
git checkout master
git fetch --quiet
git reset --hard origin/master
git merge --ff-only --quiet origin/develop
git push origin master

52
.github/workflows/release_nightly.yml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,52 @@
name: Release nightly channel
defaults:
run:
shell: bash
on:
workflow_run:
workflows: ["CI | Nightly"]
branches: [develop]
types:
- completed
workflow_dispatch:
jobs:
release-nightly:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v2
with:
ref: develop
token: ${{ secrets.GH_TOKEN }}
- name: Setup git
run: |
git config user.name "kendo-bot"
git config user.email "kendouiteam@progress.com"
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Setup node cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- name: Install
run: npm ci
- name: Publish
run: npx semantic-release --nightly
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

58
.github/workflows/release_stable.yml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,58 @@
name: Release stable channel
defaults:
run:
shell: bash
on: [workflow_dispatch]
jobs:
release-stable:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v2
with:
ref: master
token: ${{ secrets.GH_TOKEN }}
- name: Setup git
run: |
git config user.name "kendo-bot"
git config user.email "kendouiteam@progress.com"
- 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@v1
with:
node-version: 14.x
- name: Setup node cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- name: Install
run: npm ci
- name: Publish
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Update develop
run: |
git push origin master:develop --quiet > /dev/null 2>&1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

7
.gitignore поставляемый
Просмотреть файл

@ -4,12 +4,13 @@ node_modules/
dist/
modules/
# vs code
.vscode/
!.vscode/launch.json
# Log files
npm-debug.log
debug.log
# System files
.DS_Store
# Lock files
package-lock.json

Просмотреть файл

@ -1,22 +0,0 @@
Copyright (c) 2013 darcyclarke
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.

22
LICENSE.md Normal file
Просмотреть файл

@ -0,0 +1,22 @@
MIT License
Copyright (c) 2021 Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved. (as modified)
Copyright (c) 2013-2015 darcyclarke
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.

108
README.md
Просмотреть файл

@ -80,7 +80,7 @@ const file = fs.readFileSync('styles.scss');
// Run DSS Parser
dss.parse(file, {}, (parsed) => {
console.log(parsed.blocks);
console.log(parsed.blocks);
});
```
@ -88,57 +88,57 @@ dss.parse(file, {}, (parsed) => {
```json
[{
"name": "Button",
"description": "Your standard form button.",
"state": [
{
"name": ":hover",
"escaped": "pseudo-class-hover",
"description": "Highlights when hovering."
"name": "Button",
"description": "Your standard form button.",
"state": [
{
"name": ":hover",
"escaped": "pseudo-class-hover",
"description": "Highlights when hovering."
},
{
"name": ":disabled",
"escaped": "pseudo-class-disabled",
"description": "Dims the button when disabled."
},
{
"name": ".primary",
"escaped": "primary",
"description": "Indicates button is the primary action."
},
{
"name": ".smaller",
"escaped": "smaller",
"description": "A smaller button."
}
],
"example": {
"example": " <span>\n <button>This is a button</button>\n </span>",
"escaped": " &lt;span&gt;\n &lt;button&gt;This is a button&lt;/button&gt;\n &lt;/span&gt;"
},
{
"name": ":disabled",
"escaped": "pseudo-class-disabled",
"description": "Dims the button when disabled."
},
{
"name": ".primary",
"escaped": "primary",
"description": "Indicates button is the primary action."
},
{
"name": ".smaller",
"escaped": "smaller",
"description": "A smaller button."
"deprecated": "123.321",
"deprecatedDescription": "This is deprecated.",
"group": "buttons",
"type": "color",
"subtype": "text-color",
"key": "$button-bg",
"param": [
{
"type": "{string}",
"name": "par1",
"description": "ParmOne description."
},
{
"type": "{function}",
"name": "par2",
"description": "ParmTwo description."
}
],
"returns": {
"type": "{number}",
"name": null,
"description": "Return description."
}
],
"example": {
"example": " <span>\n <button>This is a button</button>\n </span>",
"escaped": " &lt;span&gt;\n &lt;button&gt;This is a button&lt;/button&gt;\n &lt;/span&gt;"
},
"deprecated": "123.321",
"deprecatedDescription": "This is deprecated.",
"group": "buttons",
"type": "color",
"subtype": "text-color",
"key": "$button-bg",
"param": [
{
"type": "{string}",
"name": "par1",
"description": "ParmOne description."
},
{
"type": "{function}",
"name": "par2",
"description": "ParmTwo description."
}
],
"returns": {
"type": "{number}",
"name": null,
"description": "Return description."
}
}]
```
@ -167,16 +167,16 @@ The parser aliases set their value in the `key` of the main parser in the output
```javascript
// Matches @link
dss.parser('link', (i, line, block, file) => {
// Replace link with HTML wrapped version
const exp = /(b(https?|ftp|file)://[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|])/ig;
// Replace link with HTML wrapped version
const exp = /(b(https?|ftp|file)://[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|])/ig;
return line.replace(exp, "<a href='$1'>$1</a>");
return line.replace(exp, "<a href='$1'>$1</a>");
});
```
```javascript
// Matches @version
dss.parser('version', (i, line, block, file) => {
return line;
return line;
});
```

7964
package-lock.json сгенерированный Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,46 +1,10 @@
{
"name": "dss",
"name": "@progress/dss",
"description": "Documented Style Sheets",
"version": "1.0.4",
"homepage": "https://github.com/darcyclarke/dss",
"author": {
"name": "darcyclarke",
"email": "darcy@darcyclarke.me",
"url": "https://darcyclarke.me"
},
"repository": {
"type": "git",
"url": "https://github.com/darcyclarke/dss"
},
"bugs": {
"url": "https://github.com/darcyclarke/dss/issues"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/darcyclarke/dss/blob/master/LICENSE-MIT"
}
],
"main": "dss.js",
"engines": {
"node": ">= 0.8.0"
},
"scripts": {
"test": "mocha",
"lint": "eslint **/*.js"
},
"dependencies": {
"lodash": "^4.17.20"
},
"devDependencies": {
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@commitlint/core": "^11.0.0",
"eslint": "^7.19.0",
"husky": "^4.3.8",
"mocha": "^8.2.1"
},
"peerDependencies": {},
"version": "0.0.0-development",
"homepage": "https://github.com/telerik/dss",
"author": "Progress",
"license": "Apache-2.0",
"keywords": [
"css",
"dss",
@ -48,6 +12,33 @@
"docs",
"documentation"
],
"main": "dss.js",
"repository": {
"type": "git",
"url": "https://github.com/telerik/dss"
},
"publishConfig": {
"access": "public"
},
"peerDependencies": {},
"dependencies": {
"lodash": "^4.17.20"
},
"devDependencies": {
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@commitlint/core": "^11.0.0",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/git": "^9.0.0",
"eslint": "^7.19.0",
"husky": "^4.3.8",
"mocha": "^8.2.1",
"semantic-release": "^17.3.9"
},
"scripts": {
"test": "mocha",
"lint": "eslint **/*.js"
},
"husky": {
"hooks": {
"pre-commit": "npm run lint",

39
release.config.js Normal file
Просмотреть файл

@ -0,0 +1,39 @@
function getArg(key) {
let index = process.argv.indexOf(key);
let next = process.argv[index + 1];
return (index < 0) ? null : (!next || next[0] === '-') ? true : next; // eslint-disable-line no-nested-ternary
}
const isNightly = getArg( '--nightly' );
const configNightly = {
branches: [
'master',
{
name: 'develop',
channel: 'dev',
prerelease: 'dev'
}
],
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/npm'
]
};
const configStable = {
branches: [
'master'
],
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
'@semantic-release/changelog',
'@semantic-release/npm',
'@semantic-release/git',
'@semantic-release/github'
]
};
module.exports = isNightly ? configNightly : configStable;