Skip to content

Commit

Permalink
generate files
Browse files Browse the repository at this point in the history
  • Loading branch information
dword-design committed Dec 31, 2019
1 parent 9cdc987 commit 8946b57
Show file tree
Hide file tree
Showing 7 changed files with 311 additions and 574 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<!-- DESCRIPTION/ -->

undefined


<!-- /DESCRIPTION -->

Expand Down
15 changes: 2 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"name": "@dword-design/base-config-sass",
"version": "2.0.1",
"bugs": {
"url": "https://github.com/dword-design/base-config-sass/issues"
},
"description": "",
"repository": "dword-design/base-config-sass",
"license": "MIT",
"author": "Sebastian Landwehr <info@dword-design.de>",
Expand All @@ -20,8 +18,6 @@
"@dword-design/base-config-node": "^1.3.3",
"@dword-design/depcheck-sass-parser": "^1.0.0",
"@dword-design/functions": "^2.2.2",
"chokidar": "^3.3.0",
"debounce": "^1.2.0",
"fs-extra": "^8.1.0"
},
"devDependencies": {
Expand All @@ -30,13 +26,6 @@
"expect": "^24.9.0",
"glob-promise": "^3.4.0",
"output-files": "^1.1.8",
"sort-package-json": "^1.31.0",
"wait-for-change": "^1.1.1",
"with-local-tmp-dir": "^2.2.2"
},
"contributors": [
"Renovate Bot (http://renovatebot.com)",
"dword-design (http://www.dword-design.de)"
],
"maintainers": []
}
}
18 changes: 1 addition & 17 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { remove, copy } from 'fs-extra'
import chokidar from 'chokidar'
import debounce from 'debounce'
import nodeConfig from '@dword-design/base-config-node'
import { merge } from '@dword-design/functions'
import depcheckSassParser from '@dword-design/depcheck-sass-parser'
Expand All @@ -14,25 +12,11 @@ const build = async () => {

export default {
build,
start: () => chokidar
.watch('src')
.on(
'all',
debounce(
async () => {
try {
await build()
} catch (error) {
console.log(error)
}
},
200
)
),
depcheckConfig: nodeConfig.depcheckConfig
|> merge({
parsers: {
'*.scss': depcheckSassParser,
},
}),
main: 'index.scss',
}
44 changes: 22 additions & 22 deletions test/build/valid.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,32 @@ import glob from 'glob-promise'
import { endent } from '@dword-design/functions'
import { readFile } from 'fs-extra'
import P from 'path'
import sortPackageJson from 'sort-package-json'
import packageConfig from '../package.config'

export default () => withLocalTmpDir(__dirname, async () => {
await outputFiles({
'dist/foo.txt': 'foo',
'package.json': JSON.stringify(sortPackageJson({
...packageConfig,
devDependencies: {
'@dword-design/base-config-sass': '^1.0.0',
},
}), undefined, 2),
'src/foo/test.scss': endent`
$color: blue
body
color: $color
`,
'src/test.txt': 'foo',
'src/index.scss': endent`
$color: red;
body {
background: $color;
'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 { stdout } = await spawn('base', ['build'], { capture: ['stdout'] })
expect(await glob('**', { cwd: 'dist', dot: true })).toEqual([
Expand All @@ -50,10 +52,8 @@ export default () => withLocalTmpDir(__dirname, async () => {
}
`)
expect(stdout).toMatch(new RegExp(endent`
^Copying config files …
Updating README.md …
Copying sass files …
Sass files successfully copied.
^Copying sass files …
Sass files successfully copied\.
$
`))
})
25 changes: 0 additions & 25 deletions test/package.config.js

This file was deleted.

73 changes: 0 additions & 73 deletions test/start/valid.test.js

This file was deleted.

Loading

0 comments on commit 8946b57

Please sign in to comment.