Skip to content

Commit d65b447

Browse files
committed
feat(init): split @nuxt-themes/kit design tokens feature to standalone module
0 parents  commit d65b447

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+10230
-0
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist

.eslintrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"root": true,
3+
"extends": ["@nuxtjs/eslint-config-typescript"],
4+
"rules": {
5+
"vue/multi-word-component-names": "off",
6+
"vue/no-multiple-template-root": "off",
7+
"no-redeclare": "off",
8+
"import/named": "off"
9+
}
10+
}

.github/FUNDING.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# These are supported funding model platforms
2+
3+
github: [nuxt]
4+
open_collective: nuxtjs
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: "\U0001F41E Bug Report"
2+
description: Create a report to help us improve Nuxt
3+
labels: ["pending triage"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Please carefully read the contribution docs before creating a bug report
9+
👉 https://v3.nuxtjs.org/community/reporting-bugs
10+
Please use the template below to create a minimal reproduction
11+
👉 https://stackblitz.com/github/nuxt/starter/tree/content
12+
- type: textarea
13+
id: bug-env
14+
attributes:
15+
label: Environment
16+
description: You can use `npx nuxi info` to fill this section
17+
placeholder: Environment
18+
validations:
19+
required: true
20+
- type: textarea
21+
id: reproduction
22+
attributes:
23+
label: Reproduction
24+
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.
25+
placeholder: Reproduction
26+
validations:
27+
required: true
28+
- type: textarea
29+
id: bug-description
30+
attributes:
31+
label: Describe the bug
32+
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!
33+
placeholder: Bug description
34+
validations:
35+
required: true
36+
- type: textarea
37+
id: additonal
38+
attributes:
39+
label: Additional context
40+
description: If applicable, add any other context about the problem here`
41+
- type: textarea
42+
id: logs
43+
attributes:
44+
label: Logs
45+
description: |
46+
Optional if provided reproduction. Please try not to insert an image but copy paste the log text.
47+
render: shell

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
contact_links:
2+
- name: 📚 Documentation
3+
url: https://nuxt-design-tokens.netlify.app
4+
about: Check documentation for usage
5+
- name: 💬 Discussions
6+
url: https://github.com/nuxt-community/design-tokens-module/discussions
7+
about: Use discussions if you have an idea for improvement and asking questions
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: "\U0001F4A1 Feature Request"
3+
about: Suggest an idea or enhancement for the module.
4+
title: ''
5+
labels: 'enhancement'
6+
assignees: ''
7+
---
8+
9+
### Is your feature request related to a problem? Please describe
10+
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
11+
12+
### Describe the solution you'd like
13+
<!-- A clear and concise description of what you want to happen. -->
14+
15+
### Describe alternatives you've considered
16+
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
17+
18+
### Additional context
19+
<!-- Add any other context or screenshots about the feature request here. -->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!---
2+
☝️ PR title should follow conventional commits (https://conventionalcommits.org)
3+
-->
4+
5+
### 🔗 Linked issue
6+
7+
### ❓ Type of change
8+
9+
<!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply. -->
10+
11+
- [ ] 📖 Documentation (updates to the documentation or readme)
12+
- [ ] 🐞 Bug fix (a non-breaking change that fixes an issue)
13+
- [ ] 👌 Enhancement (improving an existing functionality like performance)
14+
- [ ] ✨ New feature (a non-breaking change that adds functionality)
15+
- [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
16+
17+
### 📚 Description
18+
19+
<!-- Describe your changes in detail -->
20+
<!-- Why is this change required? What problem does it solve? -->
21+
<!-- If it resolves an open issue, please link to the issue here. For example "Resolves #1337" -->
22+
23+
### 📝 Checklist
24+
25+
<!-- Put an `x` in all the boxes that apply. -->
26+
<!-- If your change requires a documentation PR, please link it appropriately -->
27+
<!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
28+
29+
- [ ] I have linked an issue or discussion.
30+
- [ ] I have updated the documentation accordingly.

.github/scripts/bump-edge.ts

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
import { promises as fsp } from 'fs'
2+
import { execSync } from 'child_process'
3+
import { resolve } from 'pathe'
4+
import { globby } from 'globby'
5+
6+
// Temporary forked from nuxt/framework
7+
8+
async function loadPackage (dir: string) {
9+
const pkgPath = resolve(dir, 'package.json')
10+
const data = JSON.parse(await fsp.readFile(pkgPath, 'utf-8').catch(() => '{}'))
11+
const save = () => fsp.writeFile(pkgPath, JSON.stringify(data, null, 2) + '\n')
12+
13+
const updateDeps = (reviver: Function) => {
14+
for (const type of ['dependencies', 'devDependencies', 'optionalDependencies', 'peerDependencies']) {
15+
if (!data[type]) { continue }
16+
for (const e of Object.entries(data[type])) {
17+
const dep = { name: e[0], range: e[1], type }
18+
delete data[type][dep.name]
19+
const updated = reviver(dep) || dep
20+
data[updated.type] = data[updated.type] || {}
21+
data[updated.type][updated.name] = updated.range
22+
}
23+
}
24+
}
25+
26+
return {
27+
dir,
28+
data,
29+
save,
30+
updateDeps
31+
}
32+
}
33+
34+
type ThenArg<T> = T extends PromiseLike<infer U> ? U : T
35+
type Package = ThenArg<ReturnType<typeof loadPackage>>
36+
37+
async function loadWorkspace (dir: string) {
38+
const workspacePkg = await loadPackage(dir)
39+
const pkgDirs = await globby(workspacePkg.data.workspaces || [], { onlyDirectories: true })
40+
41+
const packages: Package[] = [workspacePkg]
42+
43+
for (const pkgDir of pkgDirs) {
44+
const pkg = await loadPackage(pkgDir)
45+
if (!pkg.data.name) { continue }
46+
packages.push(pkg)
47+
}
48+
49+
const find = (name: string) => {
50+
const pkg = packages.find(pkg => pkg.data.name === name)
51+
if (!pkg) {
52+
throw new Error('Workspace package not found: ' + name)
53+
}
54+
return pkg
55+
}
56+
57+
const rename = (from: string, to: string) => {
58+
find(from).data.name = to
59+
for (const pkg of packages) {
60+
pkg.updateDeps((dep) => {
61+
if (dep.name === from && !dep.range.startsWith('npm:')) {
62+
dep.range = 'npm:' + to + '@' + dep.range
63+
}
64+
})
65+
}
66+
}
67+
68+
const setVersion = (name: string, newVersion: string) => {
69+
find(name).data.version = newVersion
70+
for (const pkg of packages) {
71+
pkg.updateDeps((dep) => {
72+
if (dep.name === name) {
73+
dep.range = newVersion
74+
}
75+
})
76+
}
77+
}
78+
79+
const save = () => Promise.all(packages.map(pkg => pkg.save()))
80+
81+
return {
82+
dir,
83+
workspacePkg,
84+
packages,
85+
save,
86+
find,
87+
rename,
88+
setVersion
89+
}
90+
}
91+
92+
async function main () {
93+
const workspace = await loadWorkspace(process.cwd())
94+
95+
const commit = execSync('git rev-parse --short HEAD').toString('utf-8').trim()
96+
const date = Math.round(Date.now() / (1000 * 60))
97+
98+
for (const pkg of workspace.packages.filter(p => !p.data.private)) {
99+
workspace.setVersion(pkg.data.name, `${pkg.data.version}-${date}.${commit}`)
100+
workspace.rename(pkg.data.name, pkg.data.name + '-edge')
101+
}
102+
103+
await workspace.save()
104+
}
105+
106+
main().catch((err) => {
107+
// eslint-disable-next-line no-console
108+
console.error(err)
109+
process.exit(1)
110+
})

.github/scripts/clean.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Docs
2+
rm -rf docs/.nuxt
3+
rm -rf docs/.output
4+
rm -rf docs/dist
5+
6+
# Playground
7+
rm -rf playground/.nuxt
8+
rm -rf playground/.output
9+
rm -rf playground/dist
10+
11+
# Fixture
12+
rm -rf test/fixtures/basic/.nuxt
13+
rm -rf test/fixtures/basic/.output
14+
rm -rf test/fixtures/basic/dist
15+
16+
# Base
17+
rm -rf yarn.lock
18+
rm -rf node_modules
19+
rm -rf dist

.github/scripts/example.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
EXAMPLE_PATH=examples/$1
4+
5+
if [[ ! -d "$EXAMPLE_PATH/node_modules" ]] ; then
6+
(cd $EXAMPLE_PATH && yarn install)
7+
fi
8+
9+
(cd $EXAMPLE_PATH && yarn dev)

0 commit comments

Comments
 (0)