Skip to content

Commit

Permalink
fix: upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
test123456789012345 committed Jun 29, 2020
1 parent 53647e8 commit ea01f75
Show file tree
Hide file tree
Showing 6 changed files with 904 additions and 771 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,8 @@ jobs:
- run: git config --global user.name "GitHub Actions"
- run: yarn --frozen-lockfile
- run: yarn test
- name: Push changed files
run: yarn dw-ci push-changed-files
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }}
- name: Coveralls
if: matrix.os == 'ubuntu-latest' && matrix.node == 12
run: yarn dw-ci coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -54,12 +50,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v1
with:
node-version: 12
- run: git config --global user.email "actions@github.com"
- run: git config --global user.name "GitHub Actions"
- run: yarn --frozen-lockfile
- run: yarn lint
- 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 }}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@
"scripts": {
"commit": "base commit",
"dev": "base dev",
"lint": "base lint",
"prepare": "base prepare",
"prepublishOnly": "base prepublishOnly",
"test": "base test"
},
"dependencies": {
"@dword-design/depcheck-config": "^1.1.1",
"@dword-design/depcheck-sass-parser": "^1.0.0",
"fs-extra": "^9.0.0"
},
"devDependencies": {
"@dword-design/base": "^6.0.0",
"@dword-design/functions": "^2.7.0",
"execa": "^4.0.0",
"glob-promise": "^3.4.0",
"globby": "^11.0.1",
"output-files": "^1.1.8",
"with-local-tmp-dir": "^2.2.2"
},
Expand Down
14 changes: 6 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
import depcheckConfig from '@dword-design/depcheck-config'
import depcheckSassParser from '@dword-design/depcheck-sass-parser'

import prepublishOnly from './prepublish-only'

export default {
commands: {
prepublishOnly,
},
depcheckConfig: {
...depcheckConfig,
parsers: {
...depcheckConfig.parsers,
'*.scss': depcheckSassParser,
},
},
gitignore: ['/dist'],
editorIgnore: ['dist'],
gitignore: ['/dist'],
npmPublish: true,
packageConfig: {
main: 'dist/index.scss',
},
commands: {
prepublishOnly,
},
npmPublish: true,
}
2 changes: 1 addition & 1 deletion src/prepublish-only.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { remove, copy } from 'fs-extra'
import { copy, remove } from 'fs-extra'

export default async () => {
console.log('Copying sass files …')
Expand Down
29 changes: 15 additions & 14 deletions src/prepublish-only.spec.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import { endent, identity, sortBy } from '@dword-design/functions'
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 globby from 'globby'
import outputFiles from 'output-files'
import P from 'path'
import withLocalTmpDir from 'with-local-tmp-dir'

export default {
valid: () =>
withLocalTmpDir(async () => {
await outputFiles({
'dist/foo.txt': 'foo',
'node_modules/base-config-foo/index.js':
"module.exports = require('../../../src')",
'package.json': JSON.stringify(
{
baseConfig: require.resolve('.'),
baseConfig: 'foo',
},
undefined,
2
Expand All @@ -24,23 +26,22 @@ export default {
body
color: $color
`,
'test.txt': 'foo',
'index.scss': endent`
$color: red;
body {
background: $color;
}
`,
'test.txt': 'foo',
},
})
await execa.command('base prepare')
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',
])
const output = await execa.command('base prepublishOnly', { all: true })
expect(
globby('**', { cwd: 'dist', dot: true, filesOnly: false })
|> await
|> sortBy(identity)
).toEqual(['foo/test.scss', 'index.scss', 'test.txt'])
expect(await readFile(P.resolve('dist', 'foo', 'test.scss'), 'utf8'))
.toEqual(endent`
$color: blue
Expand All @@ -54,7 +55,7 @@ export default {
background: $color;
}
`)
expect(all).toEqual(endent`
expect(output.all).toEqual(endent`
Copying sass files …
Sass files successfully copied.
`)
Expand Down
Loading

0 comments on commit ea01f75

Please sign in to comment.