From ec23b422a9591409e81c02e9ca0e45c37f4f0fca Mon Sep 17 00:00:00 2001 From: yutent Date: Wed, 9 Aug 2023 11:09:39 +0800 Subject: [PATCH] init --- .gitignore | 19 ++++++++++ .prettierrc.yaml | 10 +++++ LICENSE | 21 +++++++++++ Readme.md | 98 ++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 18 +++++++++ 5 files changed, 166 insertions(+) create mode 100644 .gitignore create mode 100644 .prettierrc.yaml create mode 100644 LICENSE create mode 100644 Readme.md create mode 100644 package.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ac30e41 --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +*.min.js +.httpserver +index.html +test.js +.vscode +node_modules/ +dist/ +*.sublime-project +*.sublime-workspace +package-lock.json + + +._* + +.Spotlight-V100 +.Trashes +.DS_Store +.AppleDouble +.LSOverride \ No newline at end of file diff --git a/.prettierrc.yaml b/.prettierrc.yaml new file mode 100644 index 0000000..b007fb1 --- /dev/null +++ b/.prettierrc.yaml @@ -0,0 +1,10 @@ +jsxBracketSameLine: true +jsxSingleQuote: true +semi: false +singleQuote: true +printWidth: 80 +useTabs: false +tabWidth: 2 +trailingComma: none +bracketSpacing: true +arrowParens: avoid \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8e68c49 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..f33571d --- /dev/null +++ b/Readme.md @@ -0,0 +1,98 @@ +## Wkitd +> 基于`wkit`封装的一个应用框架, 提供`store`和`router`等基础服务。 + +![downloads](https://img.shields.io/npm/dt/wkitd.svg) +![version](https://img.shields.io/npm/v/wkitd.svg) + +### 开发文档 +[开发文档](https://github.com/bytedo/wkitd/wikid) + + +### 我们的特色 + +- 提供迷你的单页应用开发环境 +- 无需`node.js`编译, 即写即用。 + + + +### 示例 + + +app.js + +```js +// alias wkitd='//jscdn.ink/wkitd/latest/index.js' +import { css, html, createApp, createRouter, createWebHistory, createStore } from 'wkitd' + + +const store = createStore({ + foo: 123, + bar: 456 +}) + +import './views/home.js' // + +const router = createRouter({ + history: createWebHistory(), + routes: [ + { + path: '/', + name: 'wc-home' // element tagname !importent + }, + { + path: '/about', + name: 'wc-about', + component: () => import('./views/about.js') + } + ] +}) + + +createApp({ + data:{}, + methods: {}, + render(){ + return html` +
+ +
` + } +}) +.use(store) +.use(router) +.mount() + + +``` + + +index.html + +```html + + + + + + + wkitd example + + + + + + + + + + +``` \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..48db3e4 --- /dev/null +++ b/package.json @@ -0,0 +1,18 @@ +{ + "name": "wkitd", + "version": "0.0.0", + "type": "module", + "main": "dist/index.js", + "files": [ + "dist/*" + ], + "scripts": { + "build:next": "esbuild src/index.js --minify --bundle --format=esm --target=esnext --outfile=dist/index.js", + "build:es6": "esbuild src/index.js --minify --bundle --format=esm --target=es6 --outfile=dist/index.es6.js", + "build": "npm run build:next && npm run build:es6" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/bytedo/wkitd.git" + } +}