Skip to content

Commit

Permalink
feat!: bump all upgradable (dev)Deps
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Nov 16, 2023
1 parent 149f35a commit 6554524
Show file tree
Hide file tree
Showing 64 changed files with 24,824 additions and 15,426 deletions.
16 changes: 8 additions & 8 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
root = true
root=true

[*]
indent_style = space
indent_size = 2
tab_width = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style=space
indent_size=2
tab_width=2
end_of_line=lf
charset=utf-8
trim_trailing_whitespace=true
insert_final_newline=true
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.*.js
!/.*.js
.yarn
dist
src/types/schema.ts
20 changes: 18 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@
"root": true,
"extends": "@1stg",
"rules": {
"@typescript-eslint/no-unnecessary-condition": 0
}
"@typescript-eslint/no-unnecessary-condition": "off",
"markup/markup": "off",
"unicorn/prefer-node-protocol": "off"
},
"overrides": [
{
"files": "packtracker__webpack-plugin.d.ts",
"rules": {
"unicorn/filename-case": "off"
}
},
{
"files": "*.d.ts",
"rules": {
"no-var": "off"
}
}
]
}
54 changes: 20 additions & 34 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,42 @@
name: Node CI

on: [push, pull_request]
on:
- push
- pull_request

jobs:
default:
strategy:
matrix:
node: [12]
os: [macOS-latest, ubuntu-latest]
node:
- 18
- 20
os:
- macOS-latest
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v4

- uses: actions/setup-node@master
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: yarn

- name: Setup yarn
run: |
curl -o- -L https://yarnpkg.com/install.sh | bash
export PATH="$HOME/.yarn/bin:$PATH"
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ matrix.os }}-${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.node }}-yarn-
- name: Enable Corepack
run: corepack enable

- name: Install Dependencies
run: yarn --frozen-lockfile
run: yarn --immutable
env:
CI: 'true'
CI: true

- name: Lint, Build
run: |
yarn lint
yarn typecov
yarn build
env:
CI: 'true'
EFF_NO_LINK_RULES: 'true'
PARSER_NO_WATCH: 'true'

- name: Code Checks
if: matrix.os == 'macOS-latest' && github.event_name == 'push'
run: |
yarn global add @codechecks/client @codechecks/build-size-watcher typecov typescript
codechecks
env:
CI: 'true'
CC_SECRET: ${{ secrets.CC_SECRET }}
CI: true
EFF_NO_LINK_RULES: true
PARSER_NO_WATCH: true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ node_modules
sync
.env.js
.env.local
.yarn/*
!.yarn/plugins
1 change: 0 additions & 1 deletion .huskyrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('@1stg/lint-staged')
module.exports = require('@1stg/lint-staged/tsc')
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.yarn
dist
node_modules
20 changes: 20 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// @ts-check

const config = require('@1stg/prettier-config/vue')

/**
* @type {import('prettier').Config}
*/
module.exports = {
...config,
overrides: [
...config.overrides,
{
files: '.env.*',
excludeFiles: ['*.js'],
options: {
parser: 'sh',
},
},
],
}
1 change: 1 addition & 0 deletions .simple-git-hooks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@1stg/simple-git-hooks')
1 change: 1 addition & 0 deletions .yarn/plugins/plugin-prepare-lifecycle.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports={name:"plugin-prepare-lifecycle",factory:e=>({hooks:{afterAllInstalled(r){if(!r.topLevelWorkspace.manifest.scripts.get("prepare"))return;e("@yarnpkg/shell").execute("yarn prepare")}}})};
1 change: 0 additions & 1 deletion .yarnrc

This file was deleted.

8 changes: 8 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
compressionLevel: mixed

nodeLinker: node-modules

plugins:
- checksum: 37b2361b1502b2054e6779788c0e9bdd6a90ce49852a8cad2feda79b0614ec94f06fb6e78951f5f95429c610d7934dd077caa47413a0227378a102c55161616d
path: .yarn/plugins/plugin-prepare-lifecycle.cjs
spec: 'https://github.com/un-es/yarn-plugin-prepare-lifecycle/releases/download/v0.0.1/index.js'
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

[![GitHub Actions](https://github.com/JounQin/blog/workflows/Node%20CI/badge.svg)](https://github.com/JounQin/blog/actions?query=workflow%3A%22Node+CI%22)
[![Codacy Grade](https://img.shields.io/codacy/grade/16adf18f305e454db18b5ddb3d63cf20)](https://www.codacy.com/app/JounQin/blog)
[![David](https://img.shields.io/david/JounQin/blog.svg)](https://david-dm.org/JounQin/blog)
[![David Dev](https://img.shields.io/david/dev/JounQin/blog.svg)](https://david-dm.org/JounQin/blog?type=dev)
[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2FJounQin%2Fblog%2Fmaster%2Fpackage.json)](https://github.com/plantain-00/type-coverage)

[![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![codechecks.io](https://raw.githubusercontent.com/codechecks/docs/master/images/badges/badge-default.svg?sanitize=true)](https://codechecks.io)

a Blog system built on GitHub GraphQL GraphQL API with Vue SSR
16 changes: 10 additions & 6 deletions build/base.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin'
import { VueLoaderPlugin } from 'vue-loader'
import MiniCssExtractPlugin from 'mini-css-extract-plugin'
import webpack, { Configuration } from 'webpack'
import { VueLoaderPlugin } from 'vue-loader'
import webpack, { Configuration, WebpackPluginInstance } from 'webpack'

import { DEFAULT_PORT, NODE_ENV, __DEV__, publicPath, resolve } from './config'

Expand All @@ -13,8 +13,8 @@ const cssLoaders = (modules?: boolean) => [
loader: 'css-loader',
options: {
sourceMap,
localsConvention: 'camelCase',
modules: modules && {
exportLocalsConvention: 'camelCase',
localIdentName: __DEV__
? '[name]__[local]___[hash:base64:5]'
: '[hash:base64:10]',
Expand Down Expand Up @@ -146,13 +146,17 @@ const config: Configuration = {
DEFAULT_PORT,
}),
new ForkTsCheckerWebpackPlugin({
tsconfig: resolve('src/tsconfig.json'),
vue: true,
typescript: {
configFile: resolve('src/tsconfig.json'),
extensions: {
vue: true,
},
},
}),
new MiniCssExtractPlugin({
filename: '[name].[contenthash].css',
}),
new VueLoaderPlugin(),
new VueLoaderPlugin() as WebpackPluginInstance,
],
}

Expand Down
2 changes: 2 additions & 0 deletions build/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ export const serverPort = +process.env.PORT || DEFAULT_PORT

export const publicPath = '/'

// eslint-disable-next-line @typescript-eslint/unbound-method
export const { resolve } = path

// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
export const runtimeRequire: NodeRequire =
typeof __non_webpack_require__ === 'undefined'
? require
Expand Down
3 changes: 2 additions & 1 deletion build/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ const config: webpack.Configuration = {
filename: 'server.js',
libraryTarget: 'commonjs2',
},
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
externals: nodeExternals({
whitelist: [/\.css/],
allowlist: [/\.css/],
}),
plugins: [
new webpack.DefinePlugin({
Expand Down
4 changes: 2 additions & 2 deletions build/template.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs'
import path from 'path'
import fs from 'node:fs'
import path from 'node:path'

import { minify } from 'html-minifier'
import pug from 'pug'
Expand Down
28 changes: 15 additions & 13 deletions build/vue-client.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import PurgecssWebpackPlugin from 'purgecss-webpack-plugin'
import { sync as glob } from 'glob'
import HtmlWebpackPlugin from 'html-webpack-plugin'
import PurgeCSSPlugin from 'purgecss-webpack-plugin'
import purgecssWhitelister from 'purgecss-whitelister'
import VueSSRClientPlugin from 'vue-server-renderer/client-plugin'
import glob from 'glob'
import HtmlWebpackPlugin from 'html-webpack-plugin'
import { GenerateSW } from 'workbox-webpack-plugin'
import webpack from 'webpack'
import webpack, { Configuration, WebpackPluginInstance } from 'webpack'
import merge from 'webpack-merge'
import { GenerateSW } from 'workbox-webpack-plugin'

import { __DEV__ } from './config'
import baseConfig from './base'
import { __DEV__ } from './config'

const config = merge.smart(baseConfig, {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const config: Configuration = merge.smart(baseConfig, {
entry: {
app: ['./src/entry-client.ts'],
},
Expand Down Expand Up @@ -50,16 +51,17 @@ const config = merge.smart(baseConfig, {

if (!__DEV__) {
config.plugins.push(
new PurgecssWebpackPlugin({
paths: glob.sync('src/**/*', {
new PurgeCSSPlugin({
paths: glob('src/**/*', {
nodir: true,
}),
whitelist: purgecssWhitelister('node_modules/github-markdown-css/*.css'),
}),
safelist: purgecssWhitelister('node_modules/github-markdown-css/*.css'),
blocklist: [],
}) as WebpackPluginInstance,
new GenerateSW({
cacheId: 'blog',
dontCacheBustUrlsMatching: /\./,
ignoreUrlParametersMatching: [/index\.html$/, /\.map$/, /\.json$/],
dontCacheBustURLsMatching: /\./,
ignoreURLParametersMatching: [/index\.html$/, /\.map$/, /\.json$/],
runtimeCaching: [
{
urlPattern: /^https?:\/\//,
Expand Down
10 changes: 7 additions & 3 deletions build/vue-server.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import VueSSRServerPlugin from 'vue-server-renderer/server-plugin'
import webpack from 'webpack'
import webpack, { Configuration } from 'webpack'
import merge from 'webpack-merge'
import nodeExternals from 'webpack-node-externals'

import baseConfig from './base'

export default merge.smart(baseConfig, {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const config: Configuration = merge.smart(baseConfig, {
entry: './src/entry-server.ts',
target: 'node',
output: {
filename: 'server-bundle.js',
libraryTarget: 'commonjs2',
},
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
externals: nodeExternals({
whitelist: [/\.css$/],
allowlist: [/\.css$/],
}),
plugins: [
new webpack.DefinePlugin({
Expand All @@ -25,3 +27,5 @@ export default merge.smart(baseConfig, {
}),
],
})

export default config
4 changes: 2 additions & 2 deletions env.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const fs = require('fs')
const fs = require('node:fs')

const { parse } = require('dotenv')

Expand Down Expand Up @@ -29,7 +29,7 @@ module.exports = {
'PR: reviewed-changes-requested',
'PR: unreviewed',
'security',
].join(),
].join(','),
...localEnv,
NODE_ENV: process.env.NODE_ENV || localEnv.NODE_ENV,
}
Loading

0 comments on commit 6554524

Please sign in to comment.