Skip to content

Commit

Permalink
feat!: 1.0 release (nuxt-themes#577)
Browse files Browse the repository at this point in the history
Co-authored-by: Sébastien Chopin <seb@nuxtjs.com>
Co-authored-by: Sergey Bedritsky <sergey.bedritsky@gmail.com>
Co-authored-by: Daniel Roe <daniel@roe.dev>
Co-authored-by: Yaël Guilloux <yael.guilloux@gmail.com>
Co-authored-by: Clément Ollivier <clement.o2p@gmail.com>
Co-authored-by: Serhii <bedrytskyi@gmail.com>
Co-authored-by: Ahad Birang <farnabaz@gmail.com>
Co-authored-by: Alexandre Chopin <alex@nuxtjs.com>
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
  • Loading branch information
9 people authored Jun 10, 2022
1 parent 0567c4b commit b983504
Show file tree
Hide file tree
Showing 562 changed files with 18,061 additions and 34,837 deletions.
1 change: 0 additions & 1 deletion .editorconfig
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# editorconfig.org
root = true

[*]
Expand Down
13 changes: 3 additions & 10 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
# Common
node_modules
dist
.output
.nuxt
coverage

# Docus

# Ignore sw.js as it's a generated file
sw.js
# Ignore every `plugin.js` as it's using <% %> syntaxes, that are not supported by ESLint
plugin.js
*.css
*.md
82 changes: 27 additions & 55 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,65 +2,37 @@ module.exports = {
root: true,
env: {
browser: true,
node: true
node: true,
},
extends: ['@nuxtjs/eslint-config-typescript', '@antfu', 'plugin:prettier-vue/recommended', 'prettier'],
settings: {
'import/ignore': ['vue'],
},
plugins: ['prettier'],
extends: [
'@nuxtjs',
'prettier',
'plugin:prettier/recommended',
'plugin:nuxt/recommended',
'@nuxtjs/eslint-config-typescript'
],
rules: {
// Vue rules
'vue/component-name-in-template-casing': [
semi: 'error',
'antfu/if-newline': 0,
'vue/static-class-names-order': 'off',
'vue/multi-word-component-names': 'off',
'vue/require-component-is': 'off',
'vue/no-multiple-template-root': 'off',
'vue/no-v-text-v-html-on-component': 'off',
'@typescript-eslint/no-unused-vars': ['off'],
'@typescript-eslint/semi': ['error'],
'@typescript-eslint/comma-dangle': ['error'],
'comma-dangle': 'error',
'no-unused-vars': 0,
'prettier-vue/prettier': [
'error',
'PascalCase',
{
registeredComponentsOnly: true
}
// Override all options of `prettier` here
// @see https://prettier.io/docs/en/options.html
// plugins: ['prettier-plugin-tailwindcss'],
printWidth: 180,
semi: false,
singleQuote: true,
tabWidth: 2,
trailingComma: 'all',
},
],
'vue/singleline-html-element-content-newline': [0],
'vue/multiline-html-element-content-newline': [0],
'vue/html-self-closing': [0],
'vue/no-v-html': [0],
'vue/max-attributes-per-line': [0],
'vue/html-closing-bracket-newline': [0],
'vue/html-indent': [0],
// Prettier rules
'max-len': [0, 120],
code: [0, 120],
'print-width': [0, 120],
'no-console': [1],
'space-before-function-paren': [0],
'arrow-parens': [0],
curly: [0],
'keyword-spacing': [0],
// TODO: Remove all configs below
//
// This is done in order to avoid src/admin/app
// Errors on multiple roots, as this is a Vue 3 project
// And Vue 3 allows multiple roots.
//
// Note:
// If you still have the error displayed, it means Vetur is trying
// To lint your file with Vue 2 configuration, to avoid that
// Add:
// 'vetur.validation.template': false,
// 'vetur.validation.script': false,
// 'vetur.validation.style': false,
// To your `settings.json`, from VSCode.
//
'vue/no-multiple-template-root': 0
},
// controlled by Volar
overrides: [
{
files: ['*.vue'],
rules: {
'@typescript-eslint/no-unused-vars': 'off'
}
}
]
}
30 changes: 0 additions & 30 deletions .github/ISSUE_TEMPLATE/bug-report.md

This file was deleted.

5 changes: 0 additions & 5 deletions .github/ISSUE_TEMPLATE/config.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/ISSUE_TEMPLATE/feature-request.md

This file was deleted.

16 changes: 0 additions & 16 deletions .github/ISSUE_TEMPLATE/question.md

This file was deleted.

22 changes: 0 additions & 22 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

56 changes: 56 additions & 0 deletions .github/scripts/bump-edge.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { promises as fsp } from 'fs'
import { resolve } from 'path'
import { execSync } from 'child_process'

const packages = {
'@docus/base': 'npm:@docus/base-edge@',
'@docus/docs-theme': 'npm:@docus/docs-theme-edge@',
}

async function loadPackage(dir: string) {
const pkgPath = resolve(dir, 'package.json')

const data = JSON.parse(await fsp.readFile(pkgPath, 'utf-8').catch(() => '{}'))

const save = () => fsp.writeFile(pkgPath, `${JSON.stringify(data, null, 2)}\n`)

return {
dir,
data,
save,
}
}

function replaceWithEdge(pkg: any, commit: string, version: string) {
;[pkg.data.dependencies || {}, pkg.data.devDependencies || {}, pkg.data.peerDependencies || {}].forEach((deps) => {
Object.entries(deps).forEach(([key, value]: any) => {
if (value.includes(commit)) return

if (packages[key]) pkg.data.dependencies[key] = packages[key] + version
})
})
}

async function main() {
const path = process.argv[2]

const pkg = await loadPackage(path)

const commit = execSync('git rev-parse --short HEAD').toString('utf-8').trim()

const version = `${pkg.data.version}-${commit}`

if (!pkg.data.name.includes('-edge')) pkg.data.name = `${pkg.data.name}-edge`

if (!pkg.data.version.includes(commit)) pkg.data.version = version

replaceWithEdge(pkg, commit, version)

pkg.save()
}

main().catch((err) => {
// eslint-disable-next-line no-console
console.error(err)
process.exit(1)
})
33 changes: 33 additions & 0 deletions .github/scripts/cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

# Root
rm -rf node_modules
rm -rf pnpm-lock.yaml

# Base
rm -rf packages/base/.nuxt
rm -rf packages/base/.output
rm -rf packages/base/.turbo
rm -rf packages/base/node_modules

# Docs Theme
rm -rf packages/docs-theme/.nuxt
rm -rf packages/docs-theme/.output
rm -rf packages/docs-theme/.turbo
rm -rf packages/docs-theme/node_modules

# GitHub
rm -rf packages/github/playground/.nuxt
rm -rf packages/github/playground/.output
rm -rf packages/github/test/fixtures/basic/.nuxt
rm -rf packages/github/test/fixtures/basic/.output
rm -rf packages/github/dist
rm -rf packages/github/.turbo
rm -rf packages/github/node_modules


# Docs
rm -rf docs/.nuxt
rm -rf docs/.output
rm -rf docs/.turbo
rm -rf docs/node_modules
16 changes: 16 additions & 0 deletions .github/scripts/release-edge.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Bump versions to edge
npx jiti ../../.github/scripts/bump-edge $PWD

# Update token
if [[ ! -z ${NODE_AUTH_TOKEN} ]] ; then
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" >> ~/.npmrc
echo "registry=https://registry.npmjs.org/" >> ~/.npmrc
echo "always-auth=true" >> ~/.npmrc
npm whoami
fi

# # Release package
echo "Publishing $PWD"
npm publish -q --access public
14 changes: 14 additions & 0 deletions .github/scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

# Update token
if [[ ! -z ${NODE_AUTH_TOKEN} ]] ; then
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" >> ~/.npmrc
echo "registry=https://registry.npmjs.org/" >> ~/.npmrc
echo "always-auth=true" >> ~/.npmrc
npm whoami
fi

# Release package
echo "Publishing $PWD"
# npm publish -q --access public
echo "Published!"
51 changes: 51 additions & 0 deletions .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: ci-dev

on:
push:
branches:
- dev
pull_request:
types: [opened, synchronize]
branches:
- dev

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest] # macos-latest, windows-latest
node: [16]

steps:
- name: Checkout
uses: actions/checkout@master
with:
persist-credentials: false
fetch-depth: 2

- uses: pnpm/action-setup@v2.0.1
with:
version: 6.32.2

- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: 16
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm build

# - name: Test
# run: pnpm test

- name: Release Edge version
if: github.event_name == 'push'
run: pnpm run release:edge
env:
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
Loading

0 comments on commit b983504

Please sign in to comment.