3fe066e9 by McLemore

feat(n): prefect basic template

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