Bladeren bron

[doc]Fix documents

dufu1991 3 jaren geleden
bovenliggende
commit
50a6810d87

+ 1 - 0
.eslintignore

@@ -0,0 +1 @@
+node_modules

+ 15 - 0
.eslintrc.cjs

@@ -0,0 +1,15 @@
+// JavaScript Project
+module.exports = {
+	root: true,
+	extends: ['eslint:recommended', 'plugin:svelte/recommended', 'prettier'],
+	parserOptions: {
+		sourceType: 'module',
+		ecmaVersion: 2020,
+		extraFileExtensions: ['.svelte', '.json'],
+	},
+	env: {
+		browser: true,
+		es2017: true,
+		node: true,
+	},
+};

+ 10 - 0
.eslintrcdfd

@@ -0,0 +1,10 @@
+{
+	"root": true,
+	"env": {
+		"es2022": true
+	},
+	"extends": ["plugin:prettier/recommended", "plugin:svelte/recommended"],
+	"rules": {
+		"comma-dangle": ["error", "always-multiline"]
+	}
+}

+ 5 - 1
.gitignore

@@ -2,6 +2,9 @@
 /.vscode
 
 .DS_Store
+/node_modules
+pnpm-lock.yaml
+/scripts
 
 # 忽略 demo 相关文件 ignore demo related files
 /demo/node_modules
@@ -17,7 +20,6 @@
 
 # 忽略全部 site 和 publish 文件
 /site
-/node_modules
 publish.md
 publish_en.md
 
@@ -35,10 +37,12 @@ publish_en.md
 /packages/create-stdf/templates/vite-tailwind/node_modules
 /packages/create-stdf/templates/vite-tailwind/pnpm-lock.yaml
 /packages/create-stdf/templates/vite-tailwind/public/fonts
+/packages/create-stdf/templates/vite-tailwind/dist
 
 /packages/create-stdf/templates/vite-uno/node_modules
 /packages/create-stdf/templates/vite-uno/pnpm-lock.yaml
 /packages/create-stdf/templates/vite-uno/public/fonts
+/packages/create-stdf/templates/vite-uno/dist
 
 /packages/create-stdf/templates/sveltekit-tailwind/node_modules
 /packages/create-stdf/templates/sveltekit-tailwind/pnpm-lock.yaml

+ 8 - 0
.prettierrc

@@ -0,0 +1,8 @@
+{
+	"useTabs": true,
+	"singleQuote": true,
+	"trailingComma": "all",
+	"printWidth": 140,
+	"arrowParens": "avoid",
+	"plugins": ["prettier-plugin-svelte"]
+}

+ 2 - 2
demo/src/App.svelte

@@ -3,8 +3,8 @@
     import Router, { querystring, location, push } from 'svelte-spa-router';
     import { routes, routes_en } from './route';
     import { NavBar, Icon } from 'stdf';
-    import zh_CN from 'stdf/dist/lang/zh_CN';
-    import en_US from 'stdf/dist/lang/en_US';
+    import zh_CN from 'stdf/lang/zh_CN';
+    import en_US from 'stdf/lang/en_US';
     import menuList from './data/menuList';
 
     // 循环 menuList,将所有元素的 childs 组成一个数组

+ 1 - 1
demo/tailwind.config.cjs

@@ -1,6 +1,6 @@
 /** @type {import('tailwindcss').Config} */
 module.exports = {
-    content: ['./index.html', './src/**/*.svelte', './node_modules/stdf/dist/**/*.svelte', '../packages/stdf/components/**/*.svelte'],
+    content: ['./index.html', './src/**/*.svelte', './node_modules/stdf/**/*.svelte', '../packages/stdf/components/**/*.svelte'],
     theme: {
         colors: {
             // 主题色

+ 24 - 0
package.json

@@ -0,0 +1,24 @@
+{
+	"name": "stdf",
+	"version": "1.0.0",
+	"description": "<div align=\"center\">",
+	"main": "index.js",
+	"directories": {
+		"doc": "doc"
+	},
+	"scripts": {
+		"test": "echo \"Error: no test specified\" && exit 1",
+		"lint": "eslint --ext .svelte,.js,.md ./packages/stdf --max-warnings 0",
+		"format": "prettier --write --plugin prettier-plugin-svelte ./packages/stdf/components "
+	},
+	"author": "",
+	"license": "ISC",
+	"devDependencies": {
+		"eslint": "^8.48.0",
+		"eslint-config-prettier": "^9.0.0",
+		"eslint-plugin-prettier": "^5.0.0",
+		"eslint-plugin-svelte": "^2.33.0",
+		"prettier-plugin-svelte": "^3.0.3",
+		"svelte": "^4.2.0"
+	}
+}

+ 2 - 2
packages/create-stdf/templates/sveltekit-tailwind/src/routes/+page.svelte

@@ -1,8 +1,8 @@
 <script>
     import { setContext } from 'svelte';
     import { Button, Cell, Icon, Calendar } from 'stdf';
-    import en_US from 'stdf/dist/lang/en_US';
-    import zh_CN from 'stdf/dist/lang/zh_CN';
+    import en_US from 'stdf/lang/en_US';
+    import zh_CN from 'stdf/lang/zh_CN';
     import Counter from './Counter.svelte';
 
     import { browser } from '$app/environment';

+ 1 - 1
packages/create-stdf/templates/sveltekit-tailwind/tailwind.config.js

@@ -1,6 +1,6 @@
 /** @type {import('tailwindcss').Config} */
 export default {
-    content: ['./src/**/*.{html,js,svelte,ts}', './node_modules/stdf/dist/**/*.svelte'],
+    content: ['./src/**/*.{html,js,svelte,ts}', './node_modules/stdf/**/*.svelte'],
     theme: {
         colors: {
             // 主题色

+ 2 - 2
packages/create-stdf/templates/sveltekit-uno/src/routes/+page.svelte

@@ -1,8 +1,8 @@
 <script>
     import { setContext } from 'svelte';
     import { Button, Cell, Icon, Calendar } from 'stdf';
-    import en_US from 'stdf/dist/lang/en_US';
-    import zh_CN from 'stdf/dist/lang/zh_CN';
+    import en_US from 'stdf/lang/en_US';
+    import zh_CN from 'stdf/lang/zh_CN';
     import Counter from './Counter.svelte';
 
     import { browser } from '$app/environment';

+ 1 - 1
packages/create-stdf/templates/sveltekit-uno/uno.config.js

@@ -4,7 +4,7 @@ import { defineConfig, presetUno } from 'unocss';
 export default defineConfig({
     // ...UnoCSS options
     content: {
-        filesystem: ['src/**/*.html', './node_modules/stdf/dist/**/*.svelte'],
+        filesystem: ['src/**/*.html', './node_modules/stdf/**/*.svelte'],
     },
     presets: [presetUno()],
     theme: {

+ 2 - 2
packages/create-stdf/templates/vite-tailwind/src/App.svelte

@@ -1,7 +1,7 @@
 <script>
     import { setContext } from 'svelte';
-    import en_US from 'stdf/dist/lang/en_US';
-    import zh_CN from 'stdf/dist/lang/zh_CN';
+    import en_US from 'stdf/lang/en_US';
+    import zh_CN from 'stdf/lang/zh_CN';
     import { Button, Cell, Calendar, Icon } from 'stdf';
     import Counter from './lib/Counter.svelte';
 

+ 1 - 1
packages/create-stdf/templates/vite-tailwind/tailwind.config.js

@@ -1,6 +1,6 @@
 /** @type {import('tailwindcss').Config} */
 export default {
-    content: ['./index.html', './src/**/*.svelte', './node_modules/stdf/dist/**/*.svelte'],
+    content: ['./index.html', './src/**/*.svelte', './node_modules/stdf/**/*.svelte'],
     theme: {
         colors: {
             // 主题色

+ 2 - 2
packages/create-stdf/templates/vite-uno/src/App.svelte

@@ -1,7 +1,7 @@
 <script>
     import { setContext } from 'svelte';
-    import en_US from 'stdf/dist/lang/en_US';
-    import zh_CN from 'stdf/dist/lang/zh_CN';
+    import en_US from 'stdf/lang/en_US';
+    import zh_CN from 'stdf/lang/zh_CN';
     import { Button, Cell, Calendar, Icon } from 'stdf';
     import Counter from './lib/Counter.svelte';
 

+ 1 - 1
packages/create-stdf/templates/vite-uno/uno.config.js

@@ -4,7 +4,7 @@ import { defineConfig, presetUno } from 'unocss';
 export default defineConfig({
     // ...UnoCSS options
     content: {
-        filesystem: ['./node_modules/stdf/dist/**/*.svelte'],
+        filesystem: ['./node_modules/stdf/**/*.svelte'],
     },
     presets: [presetUno()],
     theme: {