3fe066e9 by McLemore

feat(n): prefect basic template

1 parent a3c5a70e
1 node_modules/
...\ No newline at end of file ...\ No newline at end of file
1 # 小程序组件模版
...\ No newline at end of file ...\ No newline at end of file
File mode changed
1 module.exports = {extends: ['@commitlint/config-conventional']}
1 App({
2
3 })
...\ No newline at end of file ...\ No newline at end of file
1 {
2 "pages": [
3 "pages/index/index"
4 ]
5 }
...\ No newline at end of file ...\ No newline at end of file
1 Page({
2 data: {
3 greeting: 'Nice to meet you'
4 }
5 })
...\ No newline at end of file ...\ No newline at end of file
1 {
2 "usingComponents": {
3 "comp": "../../components/index"
4 }
5 }
...\ No newline at end of file ...\ No newline at end of file
1 <comp greeting="{{greeting}}" />
...\ No newline at end of file ...\ No newline at end of file
1 *.js
2 miniprogram_dist
3 demo/components
...\ No newline at end of file ...\ No newline at end of file
1 {
2 "parser": "@typescript-eslint/parser",
3 "plugins": ["@typescript-eslint"],
4 "extends": ["airbnb-base", "plugin:@typescript-eslint/recommended"],
5 "globals": {
6 "window": true,
7 "document": true,
8 "App": true,
9 "Page": true,
10 "Component": true,
11 "Behavior": true,
12 "wx": true,
13 "getCurrentPages": true,
14 "getApp": true
15 }
16 }
...\ No newline at end of file ...\ No newline at end of file
1 node_modules/
2 miniprogram_dist/
3 demo/components/
...\ No newline at end of file ...\ No newline at end of file
1 const gulp = require('gulp')
2 const rename = require('gulp-rename')
3 const less = require('gulp-less')
4 const ts = require('gulp-typescript')
5
6 const dist = 'miniprogram_dist'
7 const demoDir = 'demo'
8 const lessFiles = ['./src/index.less']
9 const tsFiles = ['./src/index.ts']
10
11 const tsProject = ts.createProject('tsconfig.json')
12
13 function buildts() {
14 return gulp.src(tsFiles)
15 .pipe(tsProject())
16 .pipe(gulp.dest(dist))
17 }
18
19 function buildless() {
20 return gulp.src(lessFiles)
21 .pipe(less())
22 .pipe(rename({extname: '.wxss'}))
23 .pipe(gulp.dest(dist))
24 }
25
26 function cp() {
27 return gulp.src([
28 './src/index.json',
29 './src/index.wxml'
30 ]).pipe(gulp.dest(dist))
31 }
32
33 function demo() {
34 return gulp.src(`${dist}/**/*`).pipe(gulp.dest(`${demoDir}/components`))
35 }
36
37 function watchless() {
38 return gulp.watch(lessFiles, gulp.series(buildless, cp, demo))
39 }
40
41 function watchts() {
42 return gulp.watch(tsFiles, gulp.series(buildts, cp, demo))
43 }
44
45 function watch() {
46 return gulp.watch([
47 'src/**/*',
48 ...[...lessFiles, ...tsFiles].map(v => `!${v}`)
49 ], gulp.series(cp, demo))
50 }
51
52 exports.build = gulp.series(gulp.parallel(buildless, buildts), cp, demo)
53 exports.default = gulp.parallel(exports.build, watch, watchless, watchts)
...\ No newline at end of file ...\ No newline at end of file
1 demo/
2 src/
3 .eslintignore
4 .eslintrc.json
5 .gitignore
6 commitlint.config.js
7 gulpfile.js
8 tsconfig.json
...\ No newline at end of file ...\ No newline at end of file
1 {
2 "name": "@zb100/${repository}",
3 "version": "1.0.0",
4 "description": "",
5 "dependencies": {},
6 "devDependencies": {
7 "@commitlint/cli": "^8.2.0",
8 "@commitlint/config-conventional": "^8.2.0",
9 "@typescript-eslint/eslint-plugin": "^2.11.0",
10 "@typescript-eslint/parser": "^2.11.0",
11 "commitizen": "^4.0.3",
12 "cz-conventional-changelog": "^3.0.2",
13 "eslint": "^6.7.2",
14 "eslint-config-airbnb-base": "^14.0.0",
15 "eslint-plugin-import": "^2.19.1",
16 "gulp": "^4.0.2",
17 "gulp-less": "^4.0.1",
18 "gulp-rename": "^2.0.0",
19 "gulp-typescript": "^6.0.0-alpha.1",
20 "husky": "^3.1.0",
21 "lint-staged": "^9.5.0",
22 "miniprogram-api-typings": "^2.9.3",
23 "standard-version": "^7.0.1",
24 "typescript": "^3.7.3"
25 },
26 "scripts": {
27 "dev": "gulp",
28 "commit": "npx git-cz",
29 "release": "standard-version",
30 "lint-staged": "lint-staged",
31 "lint-staged:js": "eslint --ext .ts --max-warnings 0"
32 },
33 "repository": {
34 "type": "git",
35 "url": "ssh://git@gitlab.zb100.com:10022/mui/${repository}.git"
36 },
37 "author": "${author}",
38 "license": "ISC",
39 "config": {
40 "commitizen": {
41 "path": "./node_modules/cz-conventional-changelog"
42 }
43 },
44 "husky": {
45 "hooks": {
46 "pre-commit": "npm run lint-staged",
47 "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
48 }
49 },
50 "publishConfig": {
51 "registry": "https://npm.registry.zb100.com"
52 },
53 "lint-staged": {
54 "**/*.{ts}": "npm run lint-staged:js"
55 },
56 "standard-version": {
57 "commitUrlFormat": "https://gitlab.zb100.com/mui/{{repository}}/commit/{{hash}}",
58 "compareUrlFormat": "https://gitlab.zb100.com/mui/{{repository}}/compare/{{previousTag}}...{{currentTag}}",
59 "issueUrlFormat": "https://gitlab.zb100.com/mui/{{repository}}/issues/{{id}}",
60 "userUrlFormat": "https://gitlab.zb100.com/{{user}}"
61 }
62 }
1 {
2 "component": true,
3 "usingComponents": {}
4 }
...\ No newline at end of file ...\ No newline at end of file
1 .greeting {
2 color: green;
3 font-size: 32rpx;
4 line-height: 48rpx;
5 text-align: center;
6 }
...\ No newline at end of file ...\ No newline at end of file
1 Component({
2 properties: {
3 greeting: {
4 type: String,
5 value: 'Hello World!'
6 }
7 }
8 })
...\ No newline at end of file ...\ No newline at end of file
1 <view class="greeting">{{ greeting }}</view>
...\ No newline at end of file ...\ No newline at end of file
1 {
2 "compilerOptions": {
3 "typeRoots": [
4 "./node_modules/miniprogram-api-typings"
5 ],
6 "lib": ["ES6", "ES7"],
7 "target": "es2017"
8 }
9 }
...\ No newline at end of file ...\ No newline at end of file
1 module.exports = {extends: ['@commitlint/config-conventional']}
This diff could not be displayed because it is too large.
1 {
2 "name": "@zb100/mui-template",
3 "version": "1.0.0",
4 "description": "小程序组件模版",
5 "scripts": {
6 "release": "standard-version",
7 "commit": "npx git-cz"
8 },
9 "repository": {
10 "type": "git",
11 "url": "ssh://git@gitlab.zb100.com:10022/templates/mui-template.git"
12 },
13 "author": "",
14 "license": "ISC",
15 "publishConfig": {
16 "registry": "https://npm.registry.zb100.com"
17 },
18 "husky": {
19 "hooks": {
20 "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
21 }
22 },
23 "standard-version": {
24 "commitUrlFormat": "https://gitlab.zb100.com/templates/{{repository}}/commit/{{hash}}",
25 "compareUrlFormat": "https://gitlab.zb100.com/templates/{{repository}}/compare/{{previousTag}}...{{currentTag}}",
26 "issueUrlFormat": "https://gitlab.zb100.com/templates/{{repository}}/issues/{{id}}",
27 "userUrlFormat": "https://gitlab.zb100.com/{{user}}"
28 },
29 "devDependencies": {
30 "@commitlint/cli": "^8.2.0",
31 "@commitlint/config-conventional": "^8.2.0",
32 "commitizen": "^4.0.3",
33 "cz-conventional-changelog": "^3.0.2",
34 "husky": "^3.1.0",
35 "standard-version": "^7.0.1"
36 },
37 "config": {
38 "commitizen": {
39 "path": "./node_modules/cz-conventional-changelog"
40 }
41 },
42 "dependencies": {}
43 }