-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: initial commit from https://lass.js.org
- Loading branch information
0 parents
commit 4dd7908
Showing
17 changed files
with
7,629 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,5 @@ | ||
{ | ||
"extends": [ | ||
"@commitlint/config-conventional" | ||
] | ||
} |
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,9 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
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 @@ | ||
* text=auto |
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,24 @@ | ||
# OS # | ||
################### | ||
.DS_Store | ||
.idea | ||
Thumbs.db | ||
tmp/ | ||
temp/ | ||
|
||
|
||
# Node.js # | ||
################### | ||
node_modules | ||
|
||
|
||
# NYC # | ||
################### | ||
coverage | ||
*.lcov | ||
.nyc_output | ||
|
||
|
||
# Files # | ||
################### | ||
*.log |
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,6 @@ | ||
{ | ||
"hooks": { | ||
"pre-commit": "lint-staged", | ||
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS" | ||
} | ||
} |
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,7 @@ | ||
module.exports = { | ||
"*.md,!test/**/*.md": [ | ||
filenames => filenames.map(filename => `remark ${filename} -qfo`) | ||
], | ||
'package.json': 'fixpack', | ||
'*.js': 'xo --fix' | ||
}; |
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,9 @@ | ||
{ | ||
"extension": [ | ||
".js" | ||
], | ||
"report-dir": "./coverage", | ||
|
||
"temp-dir": "./.nyc_output" | ||
|
||
} |
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 @@ | ||
{ | ||
"singleQuote": true, | ||
"bracketSpacing": true, | ||
"trailingComma": "none" | ||
} |
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 @@ | ||
test/snapshots/**/*.md |
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 @@ | ||
{ | ||
"plugins": [ | ||
"preset-github" | ||
] | ||
} |
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,7 @@ | ||
language: node_js | ||
node_js: | ||
- 12 | ||
script: | ||
- npm run test-coverage | ||
after_success: | ||
- npm run coverage |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021 Spencer Snyder <[email protected]> (https://spencersnyder.io) | ||
|
||
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. |
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,65 @@ | ||
# better-pug-loader | ||
|
||
[](https://travis-ci.com/Spence-S/better-pug-loader) | ||
[](https://codecov.io/gh/Spence-S/better-pug-loader) | ||
[](https://github.com/sindresorhus/xo) | ||
[](https://github.com/prettier/prettier) | ||
[](https://lass.js.org) | ||
[](LICENSE) | ||
[](https://npm.im/better-pug-loader) | ||
|
||
> Pug loader for webpack that's better than the original | ||
|
||
## Table of Contents | ||
|
||
* [Install](#install) | ||
* [Usage](#usage) | ||
* [Contributors](#contributors) | ||
* [License](#license) | ||
|
||
|
||
## Install | ||
|
||
[npm][]: | ||
|
||
```sh | ||
npm install better-pug-loader | ||
``` | ||
|
||
[yarn][]: | ||
|
||
```sh | ||
yarn add better-pug-loader | ||
``` | ||
|
||
|
||
## Usage | ||
|
||
```js | ||
const BetterPugLoader = require('better-pug-loader'); | ||
|
||
const betterPugLoader = new BetterPugLoader(); | ||
|
||
console.log(betterPugLoader.renderName()); | ||
// script | ||
``` | ||
|
||
|
||
## Contributors | ||
|
||
| Name | Website | | ||
| ------------------ | -------------------------- | | ||
| **Spencer Snyder** | <https://spencersnyder.io> | | ||
|
||
|
||
## License | ||
|
||
[MIT](LICENSE) © [Spencer Snyder](https://spencersnyder.io) | ||
|
||
|
||
## | ||
|
||
[npm]: https://www.npmjs.com/ | ||
|
||
[yarn]: https://yarnpkg.com/ |
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,14 @@ | ||
class Script { | ||
constructor(config) { | ||
config = { ...config }; | ||
this._name = config.name || 'script'; | ||
|
||
this.renderName = this.renderName.bind(this); | ||
} | ||
|
||
renderName() { | ||
return this._name; | ||
} | ||
} | ||
|
||
module.exports = Script; |
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,60 @@ | ||
{ | ||
"name": "better-pug-loader", | ||
"description": "Pug loader for webpack that's better than the original", | ||
"version": "0.0.0", | ||
"author": "Spencer Snyder <[email protected]> (https://spencersnyder.io)", | ||
"bugs": { | ||
"url": "https://github.com/Spence-S/better-pug-loader/issues", | ||
"email": "[email protected]" | ||
}, | ||
"contributors": [ | ||
"Spencer Snyder <[email protected]> (https://spencersnyder.io)" | ||
], | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@commitlint/cli": "latest", | ||
"@commitlint/config-conventional": "latest", | ||
"ava": "latest", | ||
"codecov": "latest", | ||
"cross-env": "latest", | ||
"eslint": "latest", | ||
"eslint-config-xo-lass": "latest", | ||
"fixpack": "latest", | ||
"husky": "latest", | ||
"lint-staged": "latest", | ||
"nyc": "latest", | ||
"remark-cli": "latest", | ||
"remark-preset-github": "latest", | ||
"xo": "latest" | ||
}, | ||
"engines": { | ||
"node": ">= 10" | ||
}, | ||
"homepage": "https://github.com/Spence-S/better-pug-loader", | ||
"keywords": [ | ||
"better-pug-loader", | ||
"lass" | ||
], | ||
"license": "MIT", | ||
"main": "index.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Spence-S/better-pug-loader" | ||
}, | ||
"scripts": { | ||
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov", | ||
"lint": "yarn run lint:js && yarn run lint:md", | ||
"lint:js": "xo", | ||
"lint:md": "remark . -qfo", | ||
"pretest": "yarn run lint", | ||
"test": "cross-env NODE_ENV=test ava", | ||
"test-coverage": "cross-env NODE_ENV=test nyc yarn run test" | ||
}, | ||
"xo": { | ||
"prettier": true, | ||
"space": true, | ||
"extends": [ | ||
"xo-lass" | ||
] | ||
} | ||
} |
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,27 @@ | ||
const test = require('ava'); | ||
|
||
const Script = require('..'); | ||
|
||
test.beforeEach((t) => { | ||
const script = new Script({}); | ||
Object.assign(t.context, { script }); | ||
}); | ||
|
||
test('returns itself', (t) => { | ||
t.true(t.context.script instanceof Script); | ||
}); | ||
|
||
test('sets a config object', (t) => { | ||
const script = new Script(false); | ||
t.true(script instanceof Script); | ||
}); | ||
|
||
test('renders name', (t) => { | ||
const { script } = t.context; | ||
t.is(script.renderName(), 'script'); | ||
}); | ||
|
||
test('sets a default name', (t) => { | ||
const { script } = t.context; | ||
t.is(script._name, 'script'); | ||
}); |
Oops, something went wrong.