Skip to content

Commit

Permalink
Merge pull request #2 from dword-design/renovate/dword-design-base-6.x
Browse files Browse the repository at this point in the history
Update dependency @dword-design/base to v6
  • Loading branch information
dword-design committed Feb 22, 2020
2 parents c09beff + 35f6053 commit 0590fff
Show file tree
Hide file tree
Showing 13 changed files with 3,195 additions and 1,262 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
55 changes: 55 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: build

on:
push:
branches:
- '**'

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
node: [10, 12]
exclude:
- os: macos-latest
node: 10
- os: windows-latest
node: 10
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: yarn --frozen-lockfile
- run: yarn test
- name: Coveralls
run: yarn dw-ci coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
COVERALLS_GIT_COMMIT: ${{ github.sha }}
COVERALLS_GIT_BRANCH: ${{ github.ref }}

release:
needs: test
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- run: yarn --frozen-lockfile
- name: Push changed files
run: yarn dw-ci push-changed-files
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }}
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
yarn semantic-release
30 changes: 0 additions & 30 deletions .github/workflows/nodejs.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
.DS_Store
/.cz.json
/.editorconfig
/.env
/.eslintrc.json
/.nyc_output
/.releaserc.json
/.vscode
/coverage
/dist
Expand Down
2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ image:

tasks:
- init: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >>~/.npmrc
- init: yarn
- init: yarn --frozen-lockfile

vscode:
extensions:
Expand Down
20 changes: 20 additions & 0 deletions .renovaterc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
{
"extends": [
":semanticCommits"
],
"packageRules": [
{
"packagePatterns": [
"*"
],
"semanticCommitType": "chore"
},
{
"depTypeList": [
"dependencies",
"devDependencies",
"peerDependencies",
"optionalDependencies"
],
"semanticCommitType": "fix"
}
],
"lockFileMaintenance": {
"enabled": true,
"schedule": "at any time"
Expand Down
18 changes: 7 additions & 11 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
<!-- LICENSEFILE/ -->

<h1>License</h1>
# License

Unless stated otherwise all works are:

<ul><li>Copyright &copy; Sebastian Landwehr</li></ul>
Copyright &copy; Sebastian Landwehr <info@dword-design.de>

and licensed under:

<ul><li><a href="http://spdx.org/licenses/MIT.html">MIT License</a></li></ul>
[MIT License](https://opensource.org/licenses/MIT)

## MIT License

<h2>MIT License</h2>
MIT License Copyright (c) <year> <copyright holders>

<pre>
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 (including the next paragraph) 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.
</pre>

<!-- /LICENSEFILE -->
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.
45 changes: 18 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,43 @@
<!-- TITLE/ -->

<h1>@dword-design/nuxt-atomizer</h1>

# @dword-design/nuxt-atomizer
<!-- /TITLE -->


<!-- BADGES/ -->
[![NPM version](https://img.shields.io/npm/v/@dword-design/nuxt-atomizer.svg)](https://npmjs.org/package/@dword-design/nuxt-atomizer)
![Linux macOS Windows compatible](https://img.shields.io/badge/os-linux%20%7C%C2%A0macos%20%7C%C2%A0windows-blue)

<span class="badge-npmversion"><a href="https://npmjs.org/package/@dword-design/nuxt-atomizer" title="View this project on NPM"><img src="https://img.shields.io/npm/v/@dword-design/nuxt-atomizer.svg" alt="NPM version" /></a></span>
<span class="badge-travisci"><a href="http://travis-ci.org/dword-design/nuxt-atomizer" title="Check this project's build status on TravisCI"><img src="https://img.shields.io/travis/dword-design/nuxt-atomizer/master.svg" alt="Travis CI Build Status" /></a></span>
<span class="badge-coveralls"><a href="https://coveralls.io/r/dword-design/nuxt-atomizer" title="View this project's coverage on Coveralls"><img src="https://img.shields.io/coveralls/dword-design/nuxt-atomizer.svg" alt="Coveralls Coverage Status" /></a></span>
<span class="badge-daviddm"><a href="https://david-dm.org/dword-design/nuxt-atomizer" title="View the status of this project's dependencies on DavidDM"><img src="https://img.shields.io/david/dword-design/nuxt-atomizer.svg" alt="Dependency Status" /></a></span>
<span class="badge-shields"><a href="https://img.shields.io/badge/renovate-enabled-brightgreen.svg"><img src="https://img.shields.io/badge/renovate-enabled-brightgreen.svg" /></a></span>
[![Build status](https://img.shields.io/github/workflow/status/dword-design/nuxt-atomizer/build)](https://github.com/dword-design/nuxt-atomizer/actions)
[![Coverage status](https://img.shields.io/coveralls/dword-design/nuxt-atomizer)](https://coveralls.io/github/dword-design/nuxt-atomizer)
[![Dependency status](https://img.shields.io/david/dword-design/nuxt-atomizer)](https://david-dm.org/dword-design/nuxt-atomizer)
![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen)

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/dword-design/nuxt-atomizer)
<!-- /BADGES -->


<!-- DESCRIPTION/ -->



<!-- /DESCRIPTION -->


<!-- INSTALL/ -->
# Install

<h2>Install</h2>

<a href="https://npmjs.com" title="npm is a package manager for javascript"><h3>npm</h3></a>
<ul>
<li>Install: <code>npm install --save @dword-design/nuxt-atomizer</code></li>
<li>Import: <code>import * as pkg from ('@dword-design/nuxt-atomizer')</code></li>
<li>Require: <code>const pkg = require('@dword-design/nuxt-atomizer')</code></li>
</ul>
```bash
# NPM
$ npm install @dword-design/nuxt-atomizer

# Yarn
$ yarn add @dword-design/nuxt-atomizer
```
<!-- /INSTALL -->


<!-- LICENSE/ -->

<h2>License</h2>
# License

Unless stated otherwise all works are:

<ul><li>Copyright &copy; Sebastian Landwehr</li></ul>
Copyright &copy; Sebastian Landwehr <info@dword-design.de>

and licensed under:

<ul><li><a href="http://spdx.org/licenses/MIT.html">MIT License</a></li></ul>

[MIT License](https://opensource.org/licenses/MIT)
<!-- /LICENSE -->
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
"dist"
],
"scripts": {
"commit": "base commit",
"depgraph": "base depgraph",
"prepare": "base prepare",
"prepublishOnly": "base prepublishOnly",
"release": "base release",
"test": "base test"
},
"dependencies": {
Expand All @@ -22,7 +24,7 @@
"webpack-atomizer-loader": "dword-design/webpack-atomizer-loader#fork"
},
"devDependencies": {
"@dword-design/base": "^5.3.1",
"@dword-design/base": "^6.0.0",
"axios": "^0.19.2",
"fs-extra": "^8.1.0",
"nuxt": "^2.11.0",
Expand Down
73 changes: 73 additions & 0 deletions src/index.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import withLocalTmpDir from 'with-local-tmp-dir'
import { endent, property } from '@dword-design/functions'
import { outputFile } from 'fs-extra'
import { Nuxt, Builder } from 'nuxt'
import atomizerModule from '@dword-design/nuxt-atomizer'
import axios from 'axios'
import postcss from 'postcss'

export default {
css: () => withLocalTmpDir(async () => {
await outputFile('pages/index.js', endent`
export default {
render: h => <div class="C(red)">Hello world</div>,
}
`)
const nuxt = new Nuxt({ modules: [atomizerModule], dev: false })
await new Builder(nuxt).build()
try {
await nuxt.server.listen()
expect(nuxt.renderRoute('/') |> await |> property('html'))
.toMatch('"/acss.css"')
expect(axios.get('http://localhost:3000/acss.css') |> await |> property('data'))
.toEqual('.C\\(red\\){color:red}')
} finally {
nuxt.close()
}
}),
plugin: () => withLocalTmpDir(async () => {
await outputFile('pages/index.js', endent`
export default {
render: () => <div class="C(red) Foo">Hello world</div>,
}
`)
const nuxt = new Nuxt({
modules: [atomizerModule],
atomizer: {
plugins: [
{
postcssPlugins: [
postcss.plugin('test', () => root => root.walkDecls(decl => {
if (decl.prop === 'color') {
decl.prop = 'background'
}
})),
],
},
{
rules: [
{
type: 'helper',
name: 'Foo',
matcher: 'Foo',
noParams: true,
styles: {
'font-weight': 'bold',
},
},
],
},
],
},
dev: false,
})
await new Builder(nuxt).build()
try {
await nuxt.server.listen()
expect(axios.get('http://localhost:3000/acss.css') |> await |> property('data'))
.toEqual('.C\\(red\\){background:red}.Foo{font-weight:700}')
} finally {
nuxt.close()
}
}),
}
25 changes: 0 additions & 25 deletions test/css.test.js

This file was deleted.

Loading

0 comments on commit 0590fff

Please sign in to comment.