Skip to content

Commit

Permalink
Merge pull request #6 from dword-design/renovate/axios-0.x
Browse files Browse the repository at this point in the history
fix(deps): update dependency axios to ^0.20.0
  • Loading branch information
dword-design committed Aug 23, 2020
2 parents 59b03fe + 9c00f06 commit 94f39f0
Show file tree
Hide file tree
Showing 7 changed files with 4,138 additions and 4,377 deletions.
98 changes: 57 additions & 41 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,72 @@
name: build
on:
push:
branches:
- "**"
jobs:
test:
strategy:
matrix:
os:
- macos-latest
- windows-latest
- ubuntu-latest
node:
- 10
- 12
exclude:
- os: macos-latest
node: 10
- os: windows-latest
node: 10
runs-on: ${{ matrix.os }}
cancel-existing:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
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 }}
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: rokroskar/workflow-run-cleanup-action@v0.2.2
release:
needs: test
if: github.ref == 'refs/heads/master'
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- 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
- name: Push changed files
run: yarn dw-ci push-changed-files
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: yarn clean
- run: yarn lint
- env:
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }}
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: Push changed files
run: yarn dw-ci push-changed-files
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
name: Release
run: yarn semantic-release
test:
needs: cancel-existing
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: git config --global user.email "actions@github.com"
- run: git config --global user.name "GitHub Actions"
- run: yarn --frozen-lockfile
- run: yarn clean
- run: yarn test
- env:
COVERALLS_GIT_BRANCH: ${{ github.ref }}
COVERALLS_GIT_COMMIT: ${{ github.sha }}
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
if: matrix.os == 'ubuntu-latest' && matrix.node == 12
name: Coveralls
run: yarn dw-ci coveralls
strategy:
matrix:
exclude:
- node: 10
os: macos-latest
- node: 10
os: windows-latest
node:
- 10
- 12
os:
- macos-latest
- windows-latest
- ubuntu-latest
name: build
on:
push:
branches:
- "**"
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
.DS_Store
/.babelrc.json
/.commitlintrc.json
/.cz.json
/.editorconfig
/.env.json
/.eslintrc.json
/.huskyrc.json
/.nyc_output
/.releaserc.json
/.test.env.json
/.vscode
/coverage
/dist
Expand Down
8 changes: 5 additions & 3 deletions .renovaterc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"extends": [
":semanticCommits"
],
"labels": [
"maintenance"
],
"packageRules": [
{
"packagePatterns": [
Expand All @@ -20,7 +23,6 @@
}
],
"lockFileMaintenance": {
"enabled": true,
"schedule": "at any time"
"enabled": true
}
}
}
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
"dist"
],
"scripts": {
"clean": "base clean",
"commit": "base commit",
"depgraph": "base depgraph",
"dev": "base dev",
"lint": "base lint",
"prepare": "base prepare",
"prepublishOnly": "base prepublishOnly",
"release": "base release",
"test": "base test"
},
"dependencies": {
Expand All @@ -25,7 +26,7 @@
},
"devDependencies": {
"@dword-design/base": "^6.0.0",
"axios": "^0.19.2",
"axios": "^0.20.0",
"fs-extra": "^9.0.0",
"nuxt": "^2.11.0",
"postcss": "^7.0.26",
Expand Down
34 changes: 15 additions & 19 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,31 @@
import serveStatic from 'serve-static'
import { compact, flatMap } from '@dword-design/functions'
import getPackageName from 'get-package-name'
import P from 'path'
import { flatMap, compact } from '@dword-design/functions'

export default function (options) {
import serveStatic from 'serve-static'

options = { ...this.options.atomizer, ...options }
const { plugins = [] } = options
export default function (moduleOptions) {
const options = { plugins: [], ...this.options.atomizer, ...moduleOptions }
const cssDest = P.join(this.options.buildDir, 'acss.css')

this.extendBuild(config => {
config.module.rules
.find(({ test }) => test.test('.js'))
.use
.unshift({
.find(rule => rule.test.test('.js'))
.use.unshift({
loader: getPackageName(require.resolve('webpack-atomizer-loader')),
query: {
postcssPlugins: plugins |> flatMap('postcssPlugins') |> compact,
minimize: true,
config: {
configs: options,
cssDest: P.relative(process.cwd(), cssDest),
options: {
rules: plugins |> flatMap('rules') |> compact,
rules: options.plugins |> flatMap('rules') |> compact,
},
},
minimize: true,
postcssPlugins:
options.plugins |> flatMap('postcssPlugins') |> compact,
},
})
})

/*const { configs } = require(options.configPath)
/* const { configs } = require(options.configPath)
if (this.options.dev) {
this.options.serverMiddleware.push(
{
Expand All @@ -45,10 +41,10 @@ export default function (options) {
{ src: '/register-acss-browser-config.js' },
{ src: '/acss-browser' },
)
}*/
} */
this.options.serverMiddleware.push({
path: '/acss.css',
handler: serveStatic(cssDest),
path: '/acss.css',
})
this.options.head.link.push({ rel: 'stylesheet', href: '/acss.css' })
}
this.options.head.link.push({ href: '/acss.css', rel: 'stylesheet' })
}
Loading

0 comments on commit 94f39f0

Please sign in to comment.