Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
Merge pull request #5443 from mcdmaster/re-renovate/autoprefixer-10.x
Browse files Browse the repository at this point in the history
Re-renovate Autoprefixer (included in Nuxt.js)
  • Loading branch information
nyagihime committed Oct 1, 2020
2 parents ecfc977 + 78b7531 commit 3d489dc
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 39 deletions.
18 changes: 12 additions & 6 deletions components/cards/CardRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ const options: ThisTypedComponentOptionsWithRecordProps<
const [self, side] = this.cardElements
if (self) {
self.style.height = ''
self.style.maxHeight = ''
self.dataset.height = `${self.offsetHeight}`
}
if (side) {
side.style.height = ''
side.style.maxHeight = ''
side.dataset.height = `${side.offsetHeight}`
}
},
Expand All @@ -61,10 +61,10 @@ const options: ThisTypedComponentOptionsWithRecordProps<
self.dataset.height = self.dataset.height || `${self.offsetHeight}`
side.dataset.height = side.dataset.height || `${side.offsetHeight}`
self.style.height =
self.style.height === 'auto' ? `${self.dataset.height}px` : 'auto'
side.style.height =
side.style.height === 'auto' ? 'auto' : `${side.dataset.height}px`
self.style.maxHeight =
self.style.maxHeight === '100%' ? `${self.dataset.height}px` : '100%'
side.style.maxHeight =
side.style.maxHeight === '100%' ? '100%' : `${side.dataset.height}px`
},
},
computed: {
Expand Down Expand Up @@ -98,3 +98,9 @@ const options: ThisTypedComponentOptionsWithRecordProps<
export default Vue.extend(options)
</script>

<style lang="scss">
.DataCard {
transition: max-height 0.3s;
}
</style>
49 changes: 28 additions & 21 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { NuxtConfig } from '@nuxt/types'

import i18n from './nuxt-i18n.config'
const purgecss = require('@fullhuman/postcss-purgecss')
const autoprefixer = require('autoprefixer')
const environment = process.env.NODE_ENV || 'development'

const config: NuxtConfig = {
mode: 'universal',
// Since nuxt@2.14.5, there have been significant changes.
// We dealt with typical two (2) out of them:
// 1) The "mode:" directive got deprecated (seen right below);
// 2) Autoprefixer has been included so that we can lessen upgrade burden.
// mode: 'universal',
target: 'static',
/*
** Headers of the page
Expand Down Expand Up @@ -62,7 +63,7 @@ const config: NuxtConfig = {
/*
** Global CSS
*/
css: ['~assets/global.scss'],
css: ['@/assets/global.scss'],
/*
** Plugins to load before mounting the App
*/
Expand Down Expand Up @@ -99,15 +100,14 @@ const config: NuxtConfig = {
['@nuxtjs/dotenv', { filename: `.env.${environment}` }],
['nuxt-i18n', i18n],
'nuxt-svg-loader',
'nuxt-purgecss',
['vue-scrollto/nuxt', { duration: 1000, offset: -72 }],
],
/*
** vuetify module configuration
** https://github.com/nuxt-community/vuetify-module
*/
vuetify: {
customVariables: ['~/assets/variables.scss'],
customVariables: ['@/assets/variables.scss'],
treeShake: true,
defaultAssets: {
icons: false,
Expand Down Expand Up @@ -140,20 +140,12 @@ const config: NuxtConfig = {
], */
build: {
postcss: {
plugins: [
autoprefixer({ grid: 'autoplace' }),
purgecss({
content: [
'./pages/**/*.vue',
'./layouts/**/*.vue',
'./components/**/*.vue',
'./node_modules/vuetify/dist/vuetify.js',
'./node_modules/vue-spinner/src/ScaleLoader.vue',
],
whitelist: ['html', 'body', 'nuxt-progress', 'DataCard'],
whitelistPatterns: [/(col|row)/],
}),
],
preset: {
autoprefixer: {
// Built-in since nuxt@2.14.5
grid: 'autoplace',
},
},
},
extend(config) {
// default externals option is undefined
Expand All @@ -162,6 +154,21 @@ const config: NuxtConfig = {
// https://ja.nuxtjs.org/api/configuration-build/#hardsource
// hardSource: process.env.NODE_ENV === 'development'
},
'nuxt-purgecss': {
mode: 'postcss',
enabled: ({ isDev, isClient }) => !isDev && isClient,
'@fullhuman/postcss-purgecss': {
content: [
'@/pages/**/*.vue',
'@/layouts/**/*.vue',
'@/components/**/*.vue',
'vuetify/dist/vuetify.js',
'vue-spinner/src/ScaleLoader.vue',
],
whitelist: ['html', 'body', 'nuxt-progress', 'DataCard'],
whitelistPatterns: [/(col|row)/],
},
},
manifest: {
name: '東京都 新型コロナウイルス感染症対策サイト',
theme_color: '#00a040',
Expand Down
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
"dev-no-axe": "cross-env NODE_ENV=dev-no-axe GENERATE_ENV=development nuxt-ts",
"build": "nuxt-ts build",
"start": "cross-env NODE_ENV=production nuxt-ts start",
"generate:deploy": "cross-env GENERATE_ENV=production nuxt-ts generate",
"generate:dev": "cross-env GENERATE_ENV=development nuxt-ts generate",
"generate": "eslint './**/*.{js,ts,vue}' && nuxt-ts generate",
"generate:deploy": "cross-env GENERATE_ENV=production NODE_OPTIONS=--max_old_space_size=2048 nuxt-ts generate",
"generate:dev": "cross-env GENERATE_ENV=development NODE_OPTIONS=--max_old_space_size=2048 nuxt-ts generate",
"generate": "eslint \"./**/*.{js,ts,vue}\" && nuxt-ts generate",
"test": "echo 'skip tests (there is no test)'",
"lint": "eslint './**/*.{js,ts,vue}'",
"lint:fix": "eslint './**/*.{js,ts,vue}' --fix",
"lint": "eslint \"./**/*.{js,ts,vue}\"",
"lint:fix": "eslint \"./**/*.{js,ts,vue}\" --fix",
"stylelint": "stylelint '**/*.{css,scss,vue}'",
"stylelint:fix": "stylelint --fix '**/*.{css,scss,vue}'",
"clean-hardsource": "rimraf ./node_modules/.cache/hard-source"
Expand Down Expand Up @@ -66,7 +66,6 @@
"@nuxtjs/vuetify": "1.11.2",
"@types/chart.js": "2.9.24",
"@vue/test-utils": "1.1.0",
"autoprefixer": "9.8.6",
"babel-jest": "26.3.0",
"core-js": "3.6.5",
"eslint": "7.7.0",
Expand Down
56 changes: 50 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@
# yarn lockfile v1


"@babel/cli@^7.10.5":
version "7.11.6"
resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.11.6.tgz#1fcbe61c2a6900c3539c06ee58901141f3558482"
integrity sha512-+w7BZCvkewSmaRM6H4L2QM3RL90teqEIHDIFXAmrW33+0jhlymnDAEdqVeCZATvxhQuio1ifoGVlJJbIiH9Ffg==
dependencies:
commander "^4.0.1"
convert-source-map "^1.1.0"
fs-readdir-recursive "^1.1.0"
glob "^7.0.0"
lodash "^4.17.19"
make-dir "^2.1.0"
slash "^2.0.0"
source-map "^0.5.0"
optionalDependencies:
chokidar "^2.1.8"

"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.8.3":
version "7.10.4"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a"
Expand Down Expand Up @@ -750,7 +766,7 @@
"@babel/helper-create-regexp-features-plugin" "^7.10.4"
"@babel/helper-plugin-utils" "^7.10.4"

"@babel/preset-env@^7.11.5":
"@babel/preset-env@^7.11.0", "@babel/preset-env@^7.11.5":
version "7.11.5"
resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.11.5.tgz#18cb4b9379e3e92ffea92c07471a99a2914e4272"
integrity sha512-kXqmW1jVcnB2cdueV+fyBM8estd5mlNfaQi6lwLgRwCby4edpavgbFhiBNjmWA3JpB/yZGSISa7Srf+TwxDQoA==
Expand Down Expand Up @@ -2891,6 +2907,11 @@ async-limiter@~1.0.0:
resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd"
integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==

async@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/async/-/async-3.2.0.tgz#b3a2685c5ebb641d3de02d161002c60fc9f85720"
integrity sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==

asynckit@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
Expand All @@ -2906,7 +2927,7 @@ atob@^2.1.2:
resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"
integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==

autoprefixer@9.8.6, autoprefixer@^9.6.1, autoprefixer@^9.8.0:
autoprefixer@^9.6.1, autoprefixer@^9.8.0:
version "9.8.6"
resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.8.6.tgz#3b73594ca1bf9266320c5acf1588d74dea74210f"
integrity sha512-XrvP4VVHdRBCdX1S3WXVD8+RyG9qeb1D5Sn1DeLiG2xfSpzellk5k54xbUERJ3M5DggQxes39UGOTP8CFrEGbg==
Expand Down Expand Up @@ -3851,7 +3872,7 @@ commander@^2.18.0, commander@^2.19.0, commander@^2.20.0:
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==

commander@^4.1.1:
commander@^4.0.1, commander@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068"
integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==
Expand Down Expand Up @@ -3965,7 +3986,7 @@ consola@^1.4.5:
lodash "^4.17.5"
std-env "^1.1.0"

consola@^2.10.0, consola@^2.10.1, consola@^2.12.1, consola@^2.14.0, consola@^2.15.0, consola@^2.3.2, consola@^2.6.0, consola@^2.9.0:
consola@^2.10.0, consola@^2.10.1, consola@^2.12.1, consola@^2.14.0, consola@^2.15.0, consola@^2.3.2, consola@^2.4.0, consola@^2.6.0, consola@^2.9.0:
version "2.15.0"
resolved "https://registry.yarnpkg.com/consola/-/consola-2.15.0.tgz#40fc4eefa4d2f8ef2e2806147f056ea207fcc0e9"
integrity sha512-vlcSGgdYS26mPf7qNi+dCisbhiyDnrN1zaRbw3CSuc2wGOMEGGPsp46PdRG5gqXwgtJfjxDkxRNAgRPr1B77vQ==
Expand Down Expand Up @@ -4004,7 +4025,7 @@ content-type@~1.0.4:
resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b"
integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==

convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0:
convert-source-map@^1.1.0, convert-source-map@^1.4.0, convert-source-map@^1.6.0, convert-source-map@^1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442"
integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==
Expand Down Expand Up @@ -5810,6 +5831,11 @@ fs-monkey@1.0.1:
resolved "https://registry.yarnpkg.com/fs-monkey/-/fs-monkey-1.0.1.tgz#4a82f36944365e619f4454d9fff106553067b781"
integrity sha512-fcSa+wyTqZa46iWweI7/ZiUfegOZl0SG8+dltIwFXo7+zYU9J9kpS3NB6pZcSlJdhvIwp81Adx2XhZorncxiaA==

fs-readdir-recursive@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27"
integrity sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==

fs-write-stream-atomic@^1.0.8:
version "1.0.10"
resolved "https://registry.yarnpkg.com/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9"
Expand Down Expand Up @@ -7967,7 +7993,7 @@ make-dir@^1.0.0:
dependencies:
pify "^3.0.0"

make-dir@^2.0.0:
make-dir@^2.0.0, make-dir@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5"
integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==
Expand Down Expand Up @@ -10805,6 +10831,19 @@ sass-loader@^8.0.2:
schema-utils "^2.6.1"
semver "^6.3.0"

sass-resources-loader@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/sass-resources-loader/-/sass-resources-loader-2.1.0.tgz#7b78eca011f099c460ce68123c224d470e5d6d1e"
integrity sha512-rPs9E/slQgpam3Mm864XzH4mYpLBBfXyIG4yzcmtoIFRj0sE1oXuImFe4UqcqbknzFVb6w7Fd7AuOXp0Pg1gSg==
dependencies:
"@babel/cli" "^7.10.5"
"@babel/preset-env" "^7.11.0"
async "^3.2.0"
babel-eslint "^10.1.0"
chalk "^4.1.0"
glob "^7.1.6"
loader-utils "^2.0.0"

sass@^1.26.5:
version "1.26.11"
resolved "https://registry.yarnpkg.com/sass/-/sass-1.26.11.tgz#0f22cc4ab2ba27dad1d4ca30837beb350b709847"
Expand Down Expand Up @@ -11056,6 +11095,11 @@ sisteransi@^1.0.4:
resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed"
integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==

slash@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44"
integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==

slash@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
Expand Down

0 comments on commit 3d489dc

Please sign in to comment.