Skip to content

Commit 75bd519

Browse files
authored
feat: add opentiny-docs and tiny-ng-doc (#13)
1 parent 1225d62 commit 75bd519

335 files changed

Lines changed: 38697 additions & 195 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*.json
2+
/*.js
3+
dist
4+
src
5+
.eslintrc.js
6+
.prettierignore
7+
.stylelintrc.js
8+
babel.config
9+
commitlint.config
10+
md.extend.config
11+
config/plugin
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
const path = require('path');
2+
3+
module.exports = {
4+
root: true,
5+
parser: 'vue-eslint-parser',
6+
parserOptions: {
7+
// Parser that checks the content of the <script> tag
8+
parser: '@typescript-eslint/parser',
9+
sourceType: 'module',
10+
ecmaVersion: 2020,
11+
ecmaFeatures: {
12+
jsx: true,
13+
},
14+
},
15+
env: {
16+
'browser': true,
17+
'node': true,
18+
'vue/setup-compiler-macros': true,
19+
},
20+
plugins: ['@typescript-eslint'],
21+
extends: [
22+
// Airbnb JavaScript Style Guide https://github.com/airbnb/javascript
23+
'airbnb-base',
24+
'plugin:@typescript-eslint/recommended',
25+
'plugin:import/recommended',
26+
'plugin:import/typescript',
27+
'plugin:vue/vue3-recommended',
28+
'plugin:prettier/recommended',
29+
],
30+
settings: {
31+
'import/resolver': {
32+
typescript: {
33+
project: path.resolve(__dirname, './tsconfig.json'),
34+
},
35+
},
36+
},
37+
globals: {
38+
browser: true,
39+
node: true,
40+
Blob: true,
41+
document: 'readonly',
42+
window: 'readonly',
43+
},
44+
rules: {
45+
'@typescript-eslint/no-non-null-assertion': 'off',
46+
'no-unused-expressions': 'off',
47+
'import/prefer-default-export': 'off',
48+
'global-require': 0,
49+
'prefer-const': 'off',
50+
'prettier/prettier': 'off',
51+
// Vue: Recommended rules to be closed or modify
52+
'vue/require-default-prop': 0,
53+
'vue/singleline-html-element-content-newline': 0,
54+
'vue/max-attributes-per-line': 0,
55+
// Vue: Add extra rules
56+
'vue/custom-event-name-casing': [2, 'camelCase'],
57+
'vue/no-v-text': 1,
58+
'vue/padding-line-between-blocks': 1,
59+
'vue/require-direct-export': 1,
60+
'vue/multi-word-component-names': 0,
61+
// Allow @ts-ignore comment
62+
'@typescript-eslint/ban-ts-comment': 0,
63+
'@typescript-eslint/no-unused-vars': 0,
64+
'@typescript-eslint/no-empty-function': 1,
65+
'@typescript-eslint/no-explicit-any': 0,
66+
'no-use-before-define': 'off',
67+
'@typescript-eslint/no-use-before-define': 'off',
68+
'import/extensions': [
69+
2,
70+
'ignorePackages',
71+
{
72+
js: 'never',
73+
jsx: 'never',
74+
ts: 'never',
75+
tsx: 'never',
76+
},
77+
],
78+
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
79+
'no-param-reassign': 0,
80+
'prefer-regex-literals': 0,
81+
'import/no-extraneous-dependencies': 0,
82+
},
83+
};

packages/opentiny-docs/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
.DS_Store
3+
dist
4+
dist-ssr
5+
*.local
6+
*debug.log
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/dist/*
2+
.local
3+
.output.js
4+
/node_modules/**
5+
6+
**/*.svg
7+
**/*.sh
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
tabWidth: 2,
3+
semi: true,
4+
printWidth: 80,
5+
singleQuote: true,
6+
quoteProps: 'consistent',
7+
htmlWhitespaceSensitivity: 'strict',
8+
vueIndentScriptAndStyle: true,
9+
endOfLine: 'auto',
10+
};
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
module.exports = {
2+
extends: [
3+
'stylelint-config-standard',
4+
'stylelint-config-rational-order',
5+
'stylelint-config-prettier',
6+
],
7+
defaultSeverity: 'warning',
8+
plugins: ['stylelint-order'],
9+
rules: {
10+
'at-rule-no-unknown': [
11+
true,
12+
{
13+
ignoreAtRules: ['plugin'],
14+
},
15+
],
16+
'rule-empty-line-before': [
17+
'always',
18+
{
19+
except: ['after-single-line-comment', 'first-nested'],
20+
},
21+
],
22+
'selector-pseudo-class-no-unknown': [
23+
true,
24+
{
25+
ignorePseudoClasses: ['deep'],
26+
},
27+
],
28+
},
29+
};

packages/opentiny-docs/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# opentiny-docs
2+
3+
- TinyPro: [https://opentiny.design/pro](https://opentiny.design/pro)
4+
- TinyPro Vue: [https://opentiny.design/vue-pro](https://opentiny.design/vue-pro)
5+
- TinyCLI: [https://opentiny.design/tiny-cli](https://opentiny.design/tiny-cli)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
plugins: ['@vue/babel-plugin-jsx'],
3+
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
};
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* Used to package and output gzip. Note that this does not work properly in Vite, the specific reason is still being investigated
3+
* gzip压缩
4+
* https://github.com/anncwb/vite-plugin-compression
5+
*/
6+
import type { Plugin } from 'vite';
7+
import compressPlugin from 'vite-plugin-compression';
8+
9+
export default function configCompressPlugin(
10+
compress: 'gzip' | 'brotli',
11+
deleteOriginFile = false
12+
): Plugin | Plugin[] {
13+
const plugins: Plugin[] = [];
14+
15+
if (compress === 'gzip') {
16+
plugins.push(
17+
compressPlugin({
18+
ext: '.gz',
19+
deleteOriginFile,
20+
})
21+
);
22+
}
23+
24+
if (compress === 'brotli') {
25+
plugins.push(
26+
compressPlugin({
27+
ext: '.br',
28+
algorithm: 'brotliCompress',
29+
deleteOriginFile,
30+
})
31+
);
32+
}
33+
return plugins;
34+
}

0 commit comments

Comments
 (0)