Skip to content

Commit

Permalink
chore: cleaup repository (nuxt#537)
Browse files Browse the repository at this point in the history
* chore: cleaup repository

* enable corepack before node setup

* checkout

* update readme
  • Loading branch information
pi0 authored Jan 4, 2023
1 parent 9ca19a0 commit 4f064a3
Show file tree
Hide file tree
Showing 9 changed files with 1,184 additions and 8,920 deletions.
18 changes: 2 additions & 16 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
{
"env": {
"browser": true,
"node": true
},
"extends": [
"@nuxtjs/eslint-config-typescript",
"plugin:nuxt/recommended"
],
"rules": {
"no-console": "off",
"import/no-named-as-default": "off",
// handled by Volar
"@typescript-eslint/no-unused-vars": "off",
"vue/multi-word-component-names": "off",
// vue 3, TODO: upgrade eslint-plugin-vue
"vue/no-v-for-template-key": "off"
}
"@nuxt/eslint-config"
]
}
51 changes: 14 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,65 +10,42 @@ on:

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

strategy:
matrix:
os: [ubuntu-latest]
node: [14]

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: corepack enable
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: checkout
uses: actions/checkout@master

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn --immutable

- name: Prepare
run: yarn prepare
node-version: 16
cache: "pnpm"
- run: pnpm install

- name: Lint
run: yarn lint
run: pnpm lint

- name: Sync
run: yarn sync
run: pnpm sync

- name: Sync check
- name: Sync Status
run: git diff --exit-code

- name: Build
run: yarn build
run: pnpm build

- uses: dorny/paths-filter@v2
if: github.event_name == 'push'
id: changes
with:
filters: |
modules:
- 'modules/**'
- 'lib/**'
- name: Release
- name: Publish to npm
if: github.event_name == 'push' && steps.changes.outputs.modules == 'true'
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN" >> ~/.npmrc
echo "//registry.yarnpkg.com/:_authToken=$NPM_AUTH_TOKEN" >> ~/.npmrc
yarn release
echo "//registry.pnpmpkg.com/:_authToken=$NPM_AUTH_TOKEN" >> ~/.npmrc
pnpm release
env:
NPM_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,4 @@ package-lock.json
modules.json
.idea
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
.history
783 changes: 0 additions & 783 deletions .yarn/releases/yarn-3.2.3.cjs

This file was deleted.

3 changes: 0 additions & 3 deletions .yarnrc.yml

This file was deleted.

29 changes: 7 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ Metadata of nuxt modules are maintained in [yml](https://en.wikipedia.org/wiki/Y
### Add/Update a module

```bash
yarn sync <name> <repo>
pnpm sync <name> <repo>
```

Example: `yarn sync tailwindcss nuxt-community/tailwindcss-module`
Example: `pnpm sync tailwindcss nuxt-modules/tailwindcss`

To sync with a branch different than `master`, suffix the repo with `#repo-branch`, example: `yarn sync tailwindcss nuxt-community/tailwindcss-module#dev`
To sync with a branch different than `main`, suffix the repo with `#repo-branch`, example: `pnpm sync tailwindcss nuxt-modules/tailwindcss#dev`

### Contribution

Expand All @@ -44,8 +44,8 @@ You can use the `@nuxt/modules` package by installing it in your project:
# npm
npm install @nuxt/modules

# yarn
yarn add @nuxt/modules
# pnpm
pnpm add @nuxt/modules
```

Then you can directly import the list of modules:
Expand Down Expand Up @@ -81,30 +81,15 @@ Field Name | Auto sync | Description
### Auto update all current modules

```bash
yarn sync
pnpm sync
```

### Generate `modules.json`

```bash
yarn build
pnpm build
```

## Website development

- Clone repository
- Install website depenedencies using `npx yarn install`

Start development:

```bash
npx yarn dev
```

Then visit http://localhost:3000

In the development, the npm downloads and GitHub stars will be mocked unless setting `USE_NUXT_API` variable.

## License

[MIT](./LICENSE) - Made by Nuxt Team
Expand Down
23 changes: 9 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,17 @@
"modules.json"
],
"scripts": {
"build": "yarn cli build",
"build": "pnpm cli build",
"cli": "jiti ./lib/cli",
"dev": "yarn website:dev",
"prepare": "nuxi prepare website",
"website:build": "yarn build && nuxi build website",
"website:dev": "yarn build && nuxi dev website",
"website:build": "pnpm build && nuxi build website",
"website:dev": "pnpm build && nuxi dev website",
"lint": "eslint --ext .vue,.ts .",
"release": "yarn cli version && npm publish",
"sync": "yarn cli sync",
"test": "yarn lint && yarn sync"
"release": "pnpm cli version && npm publish",
"sync": "pnpm cli sync",
"test": "pnpm lint && pnpm sync"
},
"devDependencies": {
"@nuxtjs/eslint-config-typescript": "^11.0.0",
"@nuxt/eslint-config": "^0.1.1",
"@types/js-yaml": "^4.0.5",
"@types/node": "^18.8.5",
"defu": "^6.1.0",
Expand All @@ -29,11 +27,8 @@
"hasha": "^5.2.2",
"jiti": "^1.16.0",
"js-yaml": "^4.1.0",
"nuxt": "^3.0.0-rc.11",
"ohmyfetch": "^0.4.19",
"p-limit": "^4.0.0",
"typescript": "^4.8.4",
"ufo": "^1.0.0"
"typescript": "^4.8.4"
},
"packageManager": "[email protected]"
"packageManager": "[email protected]"
}
Loading

0 comments on commit 4f064a3

Please sign in to comment.