Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
wiidede committed Aug 18, 2023
0 parents commit cbd1664
Show file tree
Hide file tree
Showing 32 changed files with 9,361 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
indent_size = 2
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
4 changes: 4 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"root": true,
"extends": ["@antfu"]
}
56 changes: 56 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Dependencies
node_modules

# Logs
*.log*

# Temp directories
.temp
.tmp
.cache

# Yarn
**/.yarn/cache
**/.yarn/*state*

# Generated dirs
dist

# Nuxt
.nuxt
.output
.data
.vercel_build_output
.build-*
.netlify

# Env
.env

# Testing
reports
coverage
*.lcov
.nyc_output

# VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Intellij idea
*.iml
.idea

# OSX
.DS_Store
.AppleDouble
.LSOverride
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
shamefully-hoist=true
strict-peer-dependencies=false
2 changes: 2 additions & 0 deletions .nuxtrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
imports.autoImport=false
typescript.includeWorkspace=true
34 changes: 34 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "server: nuxt",
"outputCapture": "std",
"program": "${workspaceFolder}/node_modules/nuxi/bin/nuxi.mjs",
"args": [
"dev",
"playground"
],
},
{
"type": "chrome",
"request": "launch",
"name": "client: chrome",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
}
],
"compounds": [
{
"name": "fullstack: nuxt",
"configurations": [
"server: nuxt",
"client: chrome"
]
}
]
}
94 changes: 94 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<!--
Get your module up and running quickly.
Find and replace all on all files (CMD+SHIFT+F):
- Name: Arco Design Nuxt Module
- Package name: arco-design-nuxt-module
- Description: Arco Design Nuxt Module
-->

# Arco Design Nuxt Module

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![License][license-src]][license-href]
[![Nuxt][nuxt-src]][nuxt-href]

Arco Design Nuxt Module for doing amazing things.

- [&nbsp;Release Notes](/CHANGELOG.md)
<!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/arco-design-nuxt-module?file=playground%2Fapp.vue) -->
<!-- - [📖 &nbsp;Documentation](https://example.com) -->

## Features

<!-- Highlight some of the features your module provide here -->
-&nbsp;Foo
- 🚠 &nbsp;Bar
- 🌲 &nbsp;Baz

## Quick Setup

1. Add `arco-design-nuxt-module` dependency to your project

```bash
# Using pnpm
pnpm add -D arco-design-nuxt-module

# Using yarn
yarn add --dev arco-design-nuxt-module

# Using npm
npm install --save-dev arco-design-nuxt-module
```

2. Add `arco-design-nuxt-module` to the `modules` section of `nuxt.config.ts`

```js
export default defineNuxtConfig({
modules: [
'arco-design-nuxt-module'
]
})
```

That's it! You can now use Arco Design Nuxt Module in your Nuxt app ✨

## Development

```bash
# Install dependencies
npm install

# Generate type stubs
npm run dev:prepare

# Develop with the playground
npm run dev

# Build the playground
npm run dev:build

# Run ESLint
npm run lint

# Run Vitest
npm run test
npm run test:watch

# Release new version
npm run release
```

<!-- Badges -->
[npm-version-src]: https://img.shields.io/npm/v/arco-design-nuxt-module/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
[npm-version-href]: https://npmjs.com/package/arco-design-nuxt-module

[npm-downloads-src]: https://img.shields.io/npm/dm/arco-design-nuxt-module.svg?style=flat&colorA=18181B&colorB=28CF8D
[npm-downloads-href]: https://npmjs.com/package/arco-design-nuxt-module

[license-src]: https://img.shields.io/npm/l/arco-design-nuxt-module.svg?style=flat&colorA=18181B&colorB=28CF8D
[license-href]: https://npmjs.com/package/arco-design-nuxt-module

[nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt.js
[nuxt-href]: https://nuxt.com
51 changes: 51 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "arco-design-nuxt-module",
"type": "module",
"version": "1.0.0",
"description": "arco-design-nuxt-module",
"license": "MIT",
"repository": "wiidede/arco-design-nuxt-module",
"exports": {
".": {
"types": "./dist/types.d.ts",
"import": "./dist/module.mjs",
"require": "./dist/module.cjs"
}
},
"main": "./dist/module.cjs",
"types": "./dist/types.d.ts",
"files": [
"dist"
],
"scripts": {
"prepack": "nuxt-module-build",
"dev": "nuxi dev playground",
"dev:build": "nuxi build playground",
"dev:prepare": "nuxt-module-build --stub && nuxi prepare playground",
"release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
"lint": "eslint .",
"test": "vitest run",
"test:watch": "vitest watch"
},
"peerDependencies": {
"@arco-design/web-vue": ">=2"
},
"dependencies": {
"@nuxt/kit": "^3.6.5",
"magic-string": "^0.30.2",
"unplugin": "^1.4.0"
},
"devDependencies": {
"@antfu/eslint-config": "^0.40.2",
"@arco-design/web-vue": "^2.50.0",
"@nuxt/devtools": "latest",
"@nuxt/module-builder": "^0.4.0",
"@nuxt/schema": "^3.6.5",
"@nuxt/test-utils": "^3.6.5",
"@types/node": "^18.17.3",
"changelogen": "^0.5.4",
"eslint": "^8.46.0",
"nuxt": "^3.6.5",
"vitest": "^0.34.1"
}
}
24 changes: 24 additions & 0 deletions playground/app.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<script setup lang="ts">
useHead({
title: 'Arco Design Nuxt Module Playground',
})
</script>

<template>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</template>

<style>
html, body , #__nuxt{
height: 100vh;
margin: 0;
padding: 0;
}
html.dark {
background: #222;
color: white;
}
</style>
12 changes: 12 additions & 0 deletions playground/components/MyInput.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export default defineComponent({
emits: ['update:modelValue'],
setup(_, { emit }) {
const { mergedDisabled, eventHandlers } = useFormItem()
const handleInput = (ev: any) => {
const { value } = ev.target
emit('update:modelValue', value)
eventHandlers.value?.onChange?.(ev)
}
return () => h('input', { disabled: mergedDisabled.value, onInput: handleInput })
},
})
Loading

0 comments on commit cbd1664

Please sign in to comment.