forked from nuxt-themes/docus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: 1.0 release (nuxt-themes#577)
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
1 parent
0567c4b
commit b983504
Showing
562 changed files
with
18,061 additions
and
34,837 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}} |
Oops, something went wrong.