update
This commit is contained in:
+47
@@ -0,0 +1,47 @@
|
||||
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
|
||||
|
||||
name: Node.js Package
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12
|
||||
- run: npm ci
|
||||
- run: npm test
|
||||
|
||||
publish-npm:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12
|
||||
registry-url: https://registry.npmjs.org/
|
||||
- run: npm ci
|
||||
- run: npm publish
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
||||
|
||||
publish-gpr:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12
|
||||
registry-url: https://npm.pkg.github.com/
|
||||
- run: npm ci
|
||||
- run: npm publish
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"cSpell.words": [
|
||||
"Koretskiy",
|
||||
"Maksim"
|
||||
]
|
||||
}
|
||||
+4
-1
@@ -2,7 +2,10 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
### [3.0.2](https://github.com/maximkoretskiy/postcss-initial/compare/v3.0.1...v3.0.2) (2019-10-31)
|
||||
## [3.0.3] - 2020-07-14
|
||||
- Update deps
|
||||
|
||||
## [3.0.2](https://github.com/maximkoretskiy/postcss-initial/compare/v3.0.1...v3.0.2) (2019-10-31)
|
||||
|
||||
## [3.0.1] - 2019-08-09
|
||||
- Fix lodash.template vulnerability. See https://github.com/lodash/lodash/pull/4336
|
||||
|
||||
+2
@@ -49,6 +49,8 @@ p {
|
||||
}
|
||||
```
|
||||
|
||||
[](https://caniuse.com/#feat=css-initial-value)
|
||||
|
||||
**Killer feature!**
|
||||
|
||||
Universal reset from future css!
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ module.exports = postcss.plugin('postcss-initial', function (opts) {
|
||||
};
|
||||
return function (css) {
|
||||
css.walkDecls(function (decl) {
|
||||
if (decl.value.indexOf('initial') < 0) {
|
||||
if (!/\binitial\b/.test(decl.value)) {
|
||||
return;
|
||||
}
|
||||
var fallBackRules = getFallback(decl.prop, decl.value);
|
||||
|
||||
+16
-11
@@ -1,6 +1,12 @@
|
||||
var template = require('lodash.template');
|
||||
var decls = require('./decls.json');
|
||||
|
||||
function template(string, data) {
|
||||
return string.replace(/\$\{([\w\-\.]*)\}/g, function (_str, key) {
|
||||
var v = data[key];
|
||||
return typeof v !== 'undefined' && v !== null ? v : '';
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
Rules legend:
|
||||
- combined - if rule is combined it will be rendered with template
|
||||
@@ -23,8 +29,7 @@ function _compileDecls(inputDecls) {
|
||||
var templateVars = _getRulesMap(inputDecls);
|
||||
return inputDecls.map(function (decl) {
|
||||
if (decl.combined && decl.initial) {
|
||||
var t = template(decl.initial.replace(/\-/g, ''));
|
||||
decl.initial = t(templateVars);
|
||||
decl.initial = template(decl.initial.replace(/\-/g, ''), templateVars);
|
||||
}
|
||||
return decl;
|
||||
});
|
||||
@@ -33,8 +38,8 @@ function _compileDecls(inputDecls) {
|
||||
function _getRequirements(inputDecls) {
|
||||
return inputDecls.reduce(function (map, decl) {
|
||||
if (!decl.contains) return map;
|
||||
return decl.contains.reduce(function (mapInner, dependensy) {
|
||||
mapInner[dependensy] = decl;
|
||||
return decl.contains.reduce(function (mapInner, dependency) {
|
||||
mapInner[dependency] = decl;
|
||||
return mapInner;
|
||||
}, map);
|
||||
}, {});
|
||||
@@ -46,11 +51,11 @@ function _expandContainments(inputDecls) {
|
||||
.filter(function (decl) {
|
||||
return !decl.contains;
|
||||
}).map(function (decl) {
|
||||
var dependensy = requiredMap[decl.prop];
|
||||
if (dependensy) {
|
||||
decl.requiredBy = dependensy.prop;
|
||||
decl.basic = decl.basic || dependensy.basic;
|
||||
decl.inherited = decl.inherited || dependensy.inherited;
|
||||
var dependency = requiredMap[decl.prop];
|
||||
if (dependency) {
|
||||
decl.requiredBy = dependency.prop;
|
||||
decl.basic = decl.basic || dependency.basic;
|
||||
decl.inherited = decl.inherited || dependency.inherited;
|
||||
}
|
||||
return decl;
|
||||
});
|
||||
@@ -62,7 +67,7 @@ function _clearDecls(rules, value) {
|
||||
return rules.map(function (rule) {
|
||||
return {
|
||||
prop: rule.prop,
|
||||
value: value.replace(/initial/g, rule.initial)
|
||||
value: value.replace(/\binitial\b/g, rule.initial)
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
+16
-17
@@ -1,32 +1,32 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"postcss-initial@3.0.2",
|
||||
"/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series"
|
||||
"postcss-initial@3.0.4",
|
||||
"/home/node/nuxt"
|
||||
]
|
||||
],
|
||||
"_from": "postcss-initial@3.0.2",
|
||||
"_id": "postcss-initial@3.0.2",
|
||||
"_from": "postcss-initial@3.0.4",
|
||||
"_id": "postcss-initial@3.0.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-ugA2wKonC0xeNHgirR4D3VWHs2JcU08WAi1KFLVcnb7IN89phID6Qtg2RIctWbnvp1TM2BOmDtX8GGLCKdR8YA==",
|
||||
"_integrity": "sha512-3RLn6DIpMsK1l5UUy9jxQvoDeUN4gP939tDcKUHD/kM8SGSKbFAnvkpFpj3Bhtz3HGk1jWY5ZNWX6mPta5M9fg==",
|
||||
"_location": "/postcss-initial",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "postcss-initial@3.0.2",
|
||||
"raw": "postcss-initial@3.0.4",
|
||||
"name": "postcss-initial",
|
||||
"escapedName": "postcss-initial",
|
||||
"rawSpec": "3.0.2",
|
||||
"rawSpec": "3.0.4",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "3.0.2"
|
||||
"fetchSpec": "3.0.4"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/postcss-preset-env"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/postcss-initial/-/postcss-initial-3.0.2.tgz",
|
||||
"_spec": "3.0.2",
|
||||
"_where": "/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series",
|
||||
"_resolved": "https://registry.npmjs.org/postcss-initial/-/postcss-initial-3.0.4.tgz",
|
||||
"_spec": "3.0.4",
|
||||
"_where": "/home/node/nuxt",
|
||||
"author": {
|
||||
"name": "Maksim Koretskiy",
|
||||
"email": "mr.green.tv@gmail.com"
|
||||
@@ -35,7 +35,6 @@
|
||||
"url": "https://github.com/maximkoretskiy/postcss-initial/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"lodash.template": "^4.5.0",
|
||||
"postcss": "^7.0.2"
|
||||
},
|
||||
"description": "PostCSS plugin to fallback initial keyword.",
|
||||
@@ -44,13 +43,13 @@
|
||||
"eslint": "^4.18.2",
|
||||
"husky": "^3.0.9",
|
||||
"mocha": "^3.3.0",
|
||||
"standard-version": "^7.0.0"
|
||||
"standard-version": "^8.0.1"
|
||||
},
|
||||
"homepage": "https://github.com/maximkoretskiy/postcss-initial#readme",
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "yarn test",
|
||||
"pre-push": "yarn test"
|
||||
"pre-commit": "npm test",
|
||||
"pre-push": "npm test"
|
||||
}
|
||||
},
|
||||
"keywords": [
|
||||
@@ -73,8 +72,8 @@
|
||||
},
|
||||
"standard-version": {
|
||||
"scripts": {
|
||||
"prerelease": "yarn test"
|
||||
"prerelease": "npm test"
|
||||
}
|
||||
},
|
||||
"version": "3.0.2"
|
||||
"version": "3.0.4"
|
||||
}
|
||||
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"optOut": false,
|
||||
"lastUpdateCheck": 1618430037808
|
||||
}
|
||||
Reference in New Issue
Block a user