Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"extends": [
"@nuxtjs/eslint-config-typescript"
],
"root": true,
"extends": ["@nuxtjs/eslint-config-typescript"],
"rules": {
"@typescript-eslint/no-unused-vars": [
"off"
]
"vue/multi-word-component-names": "off",
"vue/no-multiple-template-root": "off",
"no-redeclare": "off",
"import/named": "off"
}
}
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These are supported funding model platforms

github: [nuxt]
open_collective: nuxtjs
47 changes: 47 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "\U0001F41E Bug Report"
description: Create a report to help us improve Nuxt
labels: ["pending triage"]
body:
- type: markdown
attributes:
value: |
Please carefully read the contribution docs before creating a bug report
👉 https://v3.nuxtjs.org/community/reporting-bugs
Please use the template below to create a minimal reproduction
👉 https://stackblitz.com/github/nuxt/starter/tree/content
- type: textarea
id: bug-env
attributes:
label: Environment
description: You can use `npx nuxi info` to fill this section
placeholder: Environment
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Reproduction
description: Please provide a link to a repo that can reproduce the problem you ran into. A [**minimal reproduction**](https://v3.nuxtjs.org/community/reporting-bugs#create-a-minimal-reproduction) is required unless you are absolutely sure that the issue is obvious and the provided information is enough to understand the problem. If a report is vague (e.g. just a generic error message) and has no reproduction, it will receive a "need reproduction" label. If no reproduction is provided we might close it.
placeholder: Reproduction
validations:
required: true
- type: textarea
id: bug-description
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is. If you intend to submit a PR for this issue, tell us in the description. Thanks!
placeholder: Bug description
validations:
required: true
- type: textarea
id: additonal
attributes:
label: Additional context
description: If applicable, add any other context about the problem here`
- type: textarea
id: logs
attributes:
label: Logs
description: |
Optional if provided reproduction. Please try not to insert an image but copy paste the log text.
render: shell
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
contact_links:
- name: 📚 Documentation
url: https://nuxt-github.netlify.app
about: Check documentation for usage
- name: 💬 Discussions
url: https://github.com/nuxtlabs/github-module/discussions
about: Use discussions if you have an idea for improvement and asking questions
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: "\U0001F4A1 Feature Request"
about: Suggest an idea or enhancement for the module.
title: ''
labels: 'enhancement'
assignees: ''
---

### Is your feature request related to a problem? Please describe
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->

### Describe the solution you'd like
<!-- A clear and concise description of what you want to happen. -->

### Describe alternatives you've considered
<!-- A clear and concise description of any alternative solutions or features you've considered. -->

### Additional context
<!-- Add any other context or screenshots about the feature request here. -->
30 changes: 30 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!---
☝️ PR title should follow conventional commits (https://conventionalcommits.org)
-->

### 🔗 Linked issue

### ❓ Type of change

<!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply. -->

- [ ] 📖 Documentation (updates to the documentation or readme)
- [ ] 🐞 Bug fix (a non-breaking change that fixes an issue)
- [ ] 👌 Enhancement (improving an existing functionality like performance)
- [ ] ✨ New feature (a non-breaking change that adds functionality)
- [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

### 📚 Description

<!-- Describe your changes in detail -->
<!-- Why is this change required? What problem does it solve? -->
<!-- If it resolves an open issue, please link to the issue here. For example "Resolves #1337" -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->

- [ ] I have linked an issue or discussion.
- [ ] I have updated the documentation accordingly.
110 changes: 110 additions & 0 deletions .github/scripts/bump-edge.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
import { promises as fsp } from 'fs'
import { execSync } from 'child_process'
import { resolve } from 'pathe'
import { globby } from 'globby'

// Temporary forked from nuxt/framework

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')

const updateDeps = (reviver: Function) => {
for (const type of ['dependencies', 'devDependencies', 'optionalDependencies', 'peerDependencies']) {
if (!data[type]) { continue }
for (const e of Object.entries(data[type])) {
const dep = { name: e[0], range: e[1], type }
delete data[type][dep.name]
const updated = reviver(dep) || dep
data[updated.type] = data[updated.type] || {}
data[updated.type][updated.name] = updated.range
}
}
}

return {
dir,
data,
save,
updateDeps
}
}

type ThenArg<T> = T extends PromiseLike<infer U> ? U : T
type Package = ThenArg<ReturnType<typeof loadPackage>>

async function loadWorkspace (dir: string) {
const workspacePkg = await loadPackage(dir)
const pkgDirs = await globby(workspacePkg.data.workspaces || [], { onlyDirectories: true })

const packages: Package[] = [workspacePkg]

for (const pkgDir of pkgDirs) {
const pkg = await loadPackage(pkgDir)
if (!pkg.data.name) { continue }
packages.push(pkg)
}

const find = (name: string) => {
const pkg = packages.find(pkg => pkg.data.name === name)
if (!pkg) {
throw new Error('Workspace package not found: ' + name)
}
return pkg
}

const rename = (from: string, to: string) => {
find(from).data.name = to
for (const pkg of packages) {
pkg.updateDeps((dep) => {
if (dep.name === from && !dep.range.startsWith('npm:')) {
dep.range = 'npm:' + to + '@' + dep.range
}
})
}
}

const setVersion = (name: string, newVersion: string) => {
find(name).data.version = newVersion
for (const pkg of packages) {
pkg.updateDeps((dep) => {
if (dep.name === name) {
dep.range = newVersion
}
})
}
}

const save = () => Promise.all(packages.map(pkg => pkg.save()))

return {
dir,
workspacePkg,
packages,
save,
find,
rename,
setVersion
}
}

async function main () {
const workspace = await loadWorkspace(process.cwd())

const commit = execSync('git rev-parse --short HEAD').toString('utf-8').trim()
const date = Math.round(Date.now() / (1000 * 60))

for (const pkg of workspace.packages.filter(p => !p.data.private)) {
workspace.setVersion(pkg.data.name, `${pkg.data.version}-${date}.${commit}`)
workspace.rename(pkg.data.name, pkg.data.name + '-edge')
}

await workspace.save()
}

main().catch((err) => {
// eslint-disable-next-line no-console
console.error(err)
process.exit(1)
})
19 changes: 19 additions & 0 deletions .github/scripts/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Docs
rm -rf docs/.nuxt
rm -rf docs/.output
rm -rf docs/dist

# Playground
rm -rf playground/.nuxt
rm -rf playground/.output
rm -rf playground/dist

# Fixture
rm -rf test/fixtures/basic/.nuxt
rm -rf test/fixtures/basic/.output
rm -rf test/fixtures/basic/dist

# Base
rm -rf yarn.lock
rm -rf node_modules
rm -rf dist
9 changes: 9 additions & 0 deletions .github/scripts/example.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

EXAMPLE_PATH=examples/$1

if [[ ! -d "$EXAMPLE_PATH/node_modules" ]] ; then
(cd $EXAMPLE_PATH && yarn install)
fi

(cd $EXAMPLE_PATH && yarn dev)
27 changes: 27 additions & 0 deletions .github/scripts/release-edge.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# Temporary forked from nuxt/framework

set -xe

# Restore all git changes
git restore -s@ -SW -- .

# Bump versions to edge
yarn jiti ./.github/scripts/bump-edge

# Build
yarn build

# 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 packages
echo "Publishing package..."
npm publish --access public --tolerate-republish
21 changes: 21 additions & 0 deletions .github/scripts/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

CWD=$(pwd)
ARG1=${1}

# Remove all .nuxt directories in the test/fixtures directory
for d in $(find $CWD/test/fixtures -maxdepth 1 -mindepth 1 -type d); do
cd $d
rm -rf .nuxt
npx nuxi prepare
cd $CWD
done

if [[ $ARG1 ]]
then
echo "npx vitest run -t $ARG1"
(npx vitest run -t $ARG1.test)
else
echo "npx vitest run"
(npx vitest run)
fi
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ jobs:
- run: yarn install
- run: yarn dev:prepare
- run: yarn lint
- run: yarn prepack
- run: yarn test
- run: yarn build
# - run: yarn test
8 changes: 8 additions & 0 deletions build.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineBuildConfig } from 'unbuild'

export default defineBuildConfig({
externals: [
'defu',
'consola'
]
})
3 changes: 3 additions & 0 deletions docs/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Create one with no scope selected on https://github.com/settings/tokens/new
# This token is used for fetching the repository releases.
GITHUB_TOKEN=
12 changes: 12 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
node_modules
*.iml
.idea
*.log*
.nuxt
.vscode
.DS_Store
coverage
dist
sw.*
.env
.output
11 changes: 11 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[![nuxt-content](/docs/public/cover_dark.png "@nuxt/content image")](https://content.nuxtjs.org)

# Documentation

This documentation uses [Docus](https://github.com/nuxtlabs/docus).

## 💻 Development

- Install dependencies using `yarn install`
- Start using `yarn dev`
- Build using `yarn build`
14 changes: 14 additions & 0 deletions docs/components/content/Ellipsis.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<template>
<div class="absolute left-0 top-0 w-full max-w-full">
<div class="ellipsis" />
</div>
</template>

<style lang="postcss" scoped>
.ellipsis {
@apply h-[160px] md:w-[600px];
background: linear-gradient(97.62deg, rgba(0, 71, 225, 0.22) 2.27%, rgba(26, 214, 255, 0.22) 50.88%, rgba(0, 220, 130, 0.22) 98.48%);
filter: blur(169px);
transform: matrix(-0.95, -0.3, -0.3, 0.95, 200, 250);
}
</style>
15 changes: 15 additions & 0 deletions docs/components/content/examples/Contributor.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<script setup lang="ts">
defineProps({
contributor: {
type: Object,
required: true
}
})
</script>

<template>
<div :id="contributor.login" class="flex items-center font-semibold">
<img style="height: 32px; width: 32px" class="rounded-lg" :src="contributor.avatar_url">
<span class="ml-2">{{ contributor.login }}</span>
</div>
</template>
Loading