Skip to content

Commit

Permalink
fix: fixes after upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
dword-design committed Feb 18, 2020
1 parent 0c39cda commit fe06b86
Show file tree
Hide file tree
Showing 15 changed files with 5,334 additions and 938 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
3 changes: 3 additions & 0 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM gitpod/workspace-full

RUN sudo apt-get update && sudo apt-get install -y libgtk-3-0 libx11-xcb1 libnss3 libxss1 libasound2
8 changes: 6 additions & 2 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
image:
file: .gitpod.Dockerfile

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

vscode:
extensions:
- karlito40.fix-irregular-whitespace@0.0.3:8jjyZYuYF6yW6nwsAiulrg==
- karlito40.fix-irregular-whitespace@0.0.3:8jjyZYuYF6yW6nwsAiulrg==
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/base-config-sass</h1>

# @dword-design/base-config-sass
<!-- /TITLE -->


<!-- BADGES/ -->
[![NPM version](https://img.shields.io/npm/v/@dword-design/base-config-sass.svg)](https://npmjs.org/package/@dword-design/base-config-sass)
![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/base-config-sass" title="View this project on NPM"><img src="https://img.shields.io/npm/v/@dword-design/base-config-sass.svg" alt="NPM version" /></a></span>
<span class="badge-travisci"><a href="http://travis-ci.org/dword-design/base-config-sass" title="Check this project's build status on TravisCI"><img src="https://img.shields.io/travis/dword-design/base-config-sass/master.svg" alt="Travis CI Build Status" /></a></span>
<span class="badge-coveralls"><a href="https://coveralls.io/r/dword-design/base-config-sass" title="View this project's coverage on Coveralls"><img src="https://img.shields.io/coveralls/dword-design/base-config-sass.svg" alt="Coveralls Coverage Status" /></a></span>
<span class="badge-daviddm"><a href="https://david-dm.org/dword-design/base-config-sass" title="View the status of this project's dependencies on DavidDM"><img src="https://img.shields.io/david/dword-design/base-config-sass.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/base-config-sass/build)](https://github.com/dword-design/base-config-sass/actions)
[![Coverage status](https://img.shields.io/coveralls/dword-design/base-config-sass)](https://coveralls.io/github/dword-design/base-config-sass)
[![Dependency status](https://img.shields.io/david/dword-design/base-config-sass)](https://david-dm.org/dword-design/base-config-sass)
![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/base-config-sass)
<!-- /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/base-config-sass</code></li>
<li>Import: <code>import * as pkg from ('@dword-design/base-config-sass')</code></li>
<li>Require: <code>const pkg = require('@dword-design/base-config-sass')</code></li>
</ul>
```bash
# NPM
$ npm install @dword-design/base-config-sass

# Yarn
$ yarn add @dword-design/base-config-sass
```
<!-- /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 @@ -23,7 +25,7 @@
"devDependencies": {
"@dword-design/base": "^6.0.0",
"@dword-design/functions": "^2.7.0",
"child-process-promise": "^2.2.1",
"execa": "^4.0.0",
"glob-promise": "^3.4.0",
"output-files": "^1.1.8",
"with-local-tmp-dir": "^2.2.2"
Expand Down
9 changes: 2 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { remove, copy } from 'fs-extra'
import depcheckConfig from '@dword-design/depcheck-config'
import depcheckSassParser from '@dword-design/depcheck-sass-parser'
import prepublishOnly from './prepublish-only'

export default {
depcheckConfig: {
Expand All @@ -12,11 +12,6 @@ export default {
},
main: 'index.scss',
commands: {
prepublishOnly: async () => {
console.log('Copying sass files …')
await remove('dist')
await copy('src', 'dist')
console.log('Sass files successfully copied.')
},
prepublishOnly,
},
}
8 changes: 8 additions & 0 deletions src/prepublish-only.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { remove, copy } from 'fs-extra'

export default async () => {
console.log('Copying sass files …')
await remove('dist')
await copy('src', 'dist')
console.log('Sass files successfully copied.')
}
59 changes: 59 additions & 0 deletions src/prepublish-only.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import execa from 'execa'
import withLocalTmpDir from 'with-local-tmp-dir'
import outputFiles from 'output-files'
import glob from 'glob-promise'
import { endent } from '@dword-design/functions'
import { readFile } from 'fs-extra'
import P from 'path'

export default {
valid: () => withLocalTmpDir(async () => {
await outputFiles({
'dist/foo.txt': 'foo',
'package.json': endent`
{
"baseConfig": "sass",
"devDependencies": {
"@dword-design/base-config-sass": "^1.0.0"
}
}
`,
src: {
'foo/test.scss': endent`
$color: blue
body
color: $color
`,
'test.txt': 'foo',
'index.scss': endent`
$color: red;
body {
background: $color;
}
`,
},
})
const { all } = await execa.command('base prepublishOnly', { all: true })
expect(await glob('**', { cwd: 'dist', dot: true })).toEqual([
'foo',
'foo/test.scss',
'index.scss',
'test.txt',
])
expect(await readFile(P.resolve('dist', 'foo', 'test.scss'), 'utf8')).toEqual(endent`
$color: blue
body
color: $color
`)
expect(await readFile(P.resolve('dist', 'index.scss'), 'utf8')).toEqual(endent`
$color: red;
body {
background: $color;
}
`)
expect(all).toEqual(endent`
Copying sass files …
Sass files successfully copied.
`)
}),
}
Loading

0 comments on commit fe06b86

Please sign in to comment.