Skip to content

Commit

Permalink
feat(v3): prepare for release (#593)
Browse files Browse the repository at this point in the history
Co-authored-by: Yaël Guilloux <[email protected]>
Co-authored-by: Clément Ollivier <[email protected]>
Co-authored-by: Ahad Birang <[email protected]>
Co-authored-by: Maxime Senard <[email protected]>
Co-authored-by: Sébastien Chopin <[email protected]>
Co-authored-by: Benjamin Canac <[email protected]>
Co-authored-by: Daniel Roe <[email protected]>
Co-authored-by: Baptiste Leproux <[email protected]>
  • Loading branch information
8 people authored Jul 14, 2022
1 parent b983504 commit 90e6c79
Show file tree
Hide file tree
Showing 210 changed files with 10,261 additions and 13,683 deletions.
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = {
browser: true,
node: true,
},
ignorePatterns: ['dist/**/*', '.output/**/*', '.nuxt/**/*', '*.css', '*.md'],
extends: ['@nuxtjs/eslint-config-typescript', '@antfu', 'plugin:prettier-vue/recommended', 'prettier'],
settings: {
'import/ignore': ['vue'],
Expand Down
22 changes: 2 additions & 20 deletions .github/scripts/bump-edge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@ 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 loadPackage = async (dir: string) => {
const pkgPath = resolve(dir, 'package.json')

const data = JSON.parse(await fsp.readFile(pkgPath, 'utf-8').catch(() => '{}'))
Expand All @@ -21,17 +16,7 @@ async function loadPackage(dir: string) {
}
}

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 main = async () => {
const path = process.argv[2]

const pkg = await loadPackage(path)
Expand All @@ -44,13 +29,10 @@ async function main() {

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)
})
31 changes: 6 additions & 25 deletions .github/scripts/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,13 @@

# 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

rm -rf yarn.lock

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


# Theme
rm -rf .nuxt
rm -rf .output
14 changes: 8 additions & 6 deletions .github/scripts/release-edge.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
#!/bin/bash

# Bump versions to edge
npx jiti ../../.github/scripts/bump-edge $PWD
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
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" >> ~/.npmrc
echo "registry=https://registry.npmjs.org/" >> ~/.npmrc
echo "always-auth=true" >> ~/.npmrc
echo "npmAuthToken: ${NODE_AUTH_TOKEN}" >> ~/.yarnrc.yml
npm whoami
fi

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

# Resolve yarn
YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install

# 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
echo "npmAuthToken: ${NODE_AUTH_TOKEN}" >> ~/.yarnrc.yml
npm whoami
fi

# Release package
echo "Publishing $PWD"
# npm publish -q --access public
# npm publish --access public --tolerate-republish
echo "Published!"
28 changes: 8 additions & 20 deletions .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,21 @@ jobs:
node: [16]

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

- uses: pnpm/[email protected]
with:
version: 6.32.2
- uses: actions/checkout@v3

- name: Setup Node.js environment
uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'pnpm'
node-version: ${{ matrix.node }}
cache: 'yarn'

- name: Install dependencies
run: pnpm install
run: yarn --immutable

- name: Build
run: pnpm build

# - name: Test
# run: pnpm test
run: yarn build

- name: Release Edge version
if: github.event_name == 'push'
run: pnpm run release:edge
run: ./.github/scripts/release-edge.sh
env:
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
25 changes: 7 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,26 @@ jobs:
node: [16]

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

- uses: pnpm/[email protected]
with:
version: 6.32.2
- uses: actions/checkout@v3

- name: Setup Node.js environment
uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'pnpm'
node-version: ${{ matrix.node }}
cache: 'yarn'

- name: Install dependencies
run: pnpm install
run: yarn --immutable

- name: Build
run: pnpm build

# - name: Test
# run: pnpm test
run: yarn build

- name: Check if the version has been bumped
id: check
uses: EndBug/version-check@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}

# Temporarily disable CI main package releases
# - name: Release Main version
# if: github.event_name == 'push' && steps.check.outputs.changed == 'true'
# run: pnpm release
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,5 @@ dist
.yarn/cache
.yarn/*state*

# Turbo
.turbo

# Local History
.history
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

80 changes: 50 additions & 30 deletions packages/docs-theme/assets/css/main.css → app/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@

@layer components {
/* Images */

.light-img {
@apply block dark:hidden;
}

.dark-img {
@apply hidden dark:block;
}
Expand Down Expand Up @@ -74,32 +72,7 @@
.u-ring-black { @apply ring-black dark:ring-white; }
}

/* Variables */
:root {
--header-height: 4rem;
--footer-height: 108px;
--page-height: calc(100vh - calc(var(--header-height) + var(--footer-height) + 50px));
}

@screen sm {
:root {
--header-height: 4rem;
--footer-height: 4rem;
--page-height: calc(100vh - calc(var(--header-height) + var(--footer-height)));
}
}

.dark:root {
color-scheme: dark;
}

html.dark {
@apply bg-black;
}

body {
@apply antialiased font-sans text-gray-700 dark:text-gray-200 bg-white dark:bg-black;
}
/* Components */

.docus-content {
& > :first-child {
Expand All @@ -111,8 +84,6 @@ body {
.badge,
.callout,
.card {


/*
Color Schemes
TODO: Improve the usage of these styles across components.
Expand Down Expand Up @@ -221,3 +192,52 @@ body {
}
}
}

/* Base */

.dark:root {
color-scheme: dark;
/* DocSearch */
--docsearch-primary-color: theme('colors.primary.500') !important;
--docsearch-text-color: rgb(245, 246, 247);
--docsearch-container-background: rgba(9, 10, 17, 0.8);
--docsearch-modal-background: rgb(21, 23, 42);
--docsearch-modal-shadow: inset 1px 1px 0 0 rgb(44, 46, 64),
0 3px 8px 0 rgb(0, 3, 9);
--docsearch-searchbox-background: rgb(9, 10, 17);
--docsearch-searchbox-focus-background: #000;
--docsearch-hit-color: rgb(190, 195, 201);
--docsearch-hit-shadow: none;
--docsearch-hit-background: rgb(9, 10, 17);
--docsearch-key-gradient: linear-gradient(
-26.5deg,
rgb(86, 88, 114) 0%,
rgb(49, 53, 91) 100%
);
--docsearch-key-shadow: inset 0 -2px 0 0 rgb(40, 45, 85),
inset 0 0 1px 1px rgb(81, 87, 125), 0 2px 2px 0 rgba(3, 4, 9, 0.3);
--docsearch-footer-background: rgb(30, 33, 54);
--docsearch-footer-shadow: inset 0 1px 0 0 rgba(73, 76, 106, 0.5),
0 -4px 8px 0 rgba(0, 0, 0, 0.2);
--docsearch-logo-color: rgb(255, 255, 255);
--docsearch-muted-color: rgb(127, 132, 151);
}

body {
@apply antialiased text-gray-700 dark:text-gray-200 bg-white dark:bg-black overflow-y-scroll;
font-family: var(--fonts-primary);
}

:root {
/* DocSearch */
--docsearch-primary-color: theme('colors.primary.500') !important;
}

html.dark {
@apply bg-black;
}

code, kbd, pre, samp {
font-family: var(--fonts-code);
font-size: 1em;
}
Loading

0 comments on commit 90e6c79

Please sign in to comment.