feat(n): prefect basic template
Showing
24 changed files
with
239 additions
and
0 deletions
.gitignore
0 → 100644
1 | node_modules/ | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
boilerplate/README.md
0 → 100644
File mode changed
boilerplate/commitlint.config.js
0 → 100644
1 | module.exports = {extends: ['@commitlint/config-conventional']} |
boilerplate/demo/app.js
0 → 100644
boilerplate/demo/app.json
0 → 100644
boilerplate/demo/pages/index/index.js
0 → 100644
boilerplate/demo/pages/index/index.json
0 → 100644
boilerplate/demo/pages/index/index.wxml
0 → 100644
1 | <comp greeting="{{greeting}}" /> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
boilerplate/demo/pages/index/index.wxss
0 → 100644
File mode changed
boilerplate/eslintignore
0 → 100644
boilerplate/eslintrc
0 → 100644
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 |
boilerplate/gitignore
0 → 100644
boilerplate/gulpfile.js
0 → 100644
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 |
boilerplate/npmignore
0 → 100644
boilerplate/package.json
0 → 100644
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 | } |
boilerplate/src/index.json
0 → 100644
boilerplate/src/index.less
0 → 100644
boilerplate/src/index.ts
0 → 100644
boilerplate/src/index.wxml
0 → 100644
1 | <view class="greeting">{{ greeting }}</view> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
boilerplate/tsconfig.json
0 → 100644
commitlint.config.js
0 → 100644
1 | module.exports = {extends: ['@commitlint/config-conventional']} |
package-lock.json
0 → 100644
This diff could not be displayed because it is too large.
package.json
0 → 100644
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 | } |
-
Please register or sign in to post a comment