Skip to content

Commit a8f3f29

Browse files
committed
init commit
0 parents  commit a8f3f29

21 files changed

+412
-0
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Myron
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Library Template

meta.js

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
module.exports = {
2+
helpers: {
3+
escape: function(value) {
4+
return value.replace(/'/g, ''');
5+
}
6+
},
7+
prompts: {
8+
name: {
9+
'type': 'string',
10+
'required': true,
11+
'message': 'Project name'
12+
},
13+
description: {
14+
'type': 'string',
15+
'required': false,
16+
'message': 'Project description',
17+
'default': 'Nuxt.js project'
18+
},
19+
author: {
20+
'type': 'string',
21+
'message': 'Author'
22+
},
23+
globalName: {
24+
type: 'String',
25+
message: 'window.XXX'
26+
}
27+
},
28+
completeMessage: '{{#inPlace}}To get started:\n\n npm install # Or yarn\n npm run dev{{else}}To get started:\n\n cd {{destDirName}}\n npm install # Or yarn\n npm run dev{{/inPlace}}'
29+
};

package.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "library-template",
3+
"version": "1.0.0",
4+
"description": "javascript library template",
5+
"main": "meta.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"author": "myron.liu",
10+
"license": "MIT"
11+
}

template/.babelrc

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"presets": [
3+
["env",{"modules": false}],
4+
"stage-2"
5+
],
6+
"comments": false,
7+
"env": {
8+
"test": {
9+
"presets": ["env", "stage-2"],
10+
"plugins": [ "istanbul" ]
11+
}
12+
}
13+
}

template/.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

template/.eslintignore

Whitespace-only changes.

template/.eslintrc

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
root: true,
3+
parser: "babel-eslint",
4+
parserOptions: {
5+
ecmaVersion: 7,
6+
sourceType: "module",
7+
allowImportExportEverywhere: false,
8+
ecmaFeatures: {
9+
jsx: true,
10+
modules: true
11+
}
12+
},
13+
env: {
14+
es6: true,
15+
node: true,
16+
browser: true
17+
},
18+
extends: "vue",
19+
globals: {
20+
expect: true,
21+
describe: true,
22+
it: true,
23+
const: true,
24+
test: true,
25+
jest: true
26+
},
27+
rules: {
28+
quotes: [2, "single", { "allowTemplateLiterals": true }],
29+
linebreak-style: [2, "unix"],
30+
semi: [2, "always"],
31+
eqeqeq: [2, "always"],
32+
strict: [2, "global"],
33+
key-spacing: [2, { "afterColon": true }]
34+
}
35+
}

template/.gitattributes

Whitespace-only changes.

template/.gitignore

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### Node template
3+
# Logs
4+
logs
5+
*.log
6+
npm-debug.log*
7+
8+
# Runtime data
9+
pids
10+
*.pid
11+
*.seed
12+
13+
# Directory for instrumented libs generated by jscoverage/JSCover
14+
lib-cov
15+
16+
# Coverage directory used by tools like istanbul
17+
coverage
18+
19+
# nyc test coverage
20+
.nyc_output
21+
22+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
23+
.grunt
24+
25+
# node-waf configuration
26+
.lock-wscript
27+
28+
# Compiled binary addons (http://nodejs.org/api/addons.html)
29+
build/Release
30+
31+
# Dependency directories
32+
node_modules
33+
jspm_packages
34+
35+
# Optional npm cache directory
36+
.npm
37+
38+
# Optional REPL history
39+
.node_repl_history
40+
41+
lib/
42+
dist/
43+
.idea
44+
.DS_Store
45+
.cache
46+
.vscode
47+
reports
48+
.cache

template/.npmignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
node_modules
2+
demo
3+
coverage
4+
test
5+
rollup.config.js
6+
yarn.lock
7+
src
8+
.DS_Store
9+
.*

template/.postcssrc.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const plugins = [
2+
require('autoprefixer')({
3+
browsers: [
4+
'> 1%',
5+
'last 5 versions',
6+
'ios >= 7',
7+
'android > 4.4',
8+
'not ie < 10'
9+
]
10+
})
11+
];
12+
if (process.env.NODE_ENV === 'production') {
13+
plugins.push(require('cssnano')({
14+
safe: true
15+
}));
16+
}
17+
18+
module.exports = {
19+
plugins: plugins
20+
};

template/.travis.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
language: node_js
3+
node_js:
4+
- "8.11.2"
5+
6+
before_script:
7+
- yarn global add codecov
8+
9+
script:
10+
- yarn
11+
- yarn run lint
12+
- yarn run test:coverage && codecov
13+
- yarn run build
14+
15+
cache:
16+
yarn: true

template/LICENSE

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
The MIT License (MIT)
3+
4+
Copyright (c) 2018-present, Myron.Liu
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.

template/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# {{ name }}
2+
3+
> {{ description }}
4+
5+
## Build Setup
6+
7+
``` bash
8+
yarn
9+
10+
yarn run dev
11+
12+
yarn run build
13+
```

template/demo/index.html

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7+
<title>{{ name }}</title>
8+
</head>
9+
<body>
10+
<script src="./main.js"></script>
11+
</body>
12+
</html>

template/demo/main.js

Whitespace-only changes.

template/package.json

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"name": "{{ name }}",
3+
"version": "0.1.0",
4+
"description": "{{ description }}",
5+
"author": "{{ author }}",
6+
"main": "dist/{{ name }}.common.js",
7+
"module": "dist/{{ name }}.esm.js",
8+
"unpkg": "dist/{{ name }}.js",
9+
"jsdelivr": "dist/{{ name }}.js",
10+
"directories": {
11+
"test": "test"
12+
},
13+
"scripts": {
14+
"test": "NODE_ENV=test jest -i",
15+
"dev": "NODE_ENV=development parcel demo/index.html",
16+
"lint": "eslint --ext .js src",
17+
"test:coverage": "NODE_ENV=test jest -i --coverage",
18+
"build": "rm -rf dist && NODE_ENV=module rollup --config rollup.config.js && NODE_ENV=production rollup --config rollup.config.js"
19+
},
20+
"repository": {
21+
"type": "git",
22+
"url": "git+https://github.com/{{author}}/{{name}}.git"
23+
},
24+
"license": "MIT",
25+
"bugs": {
26+
"url": "https://github.com/{{author}}/{{name}}/issues"
27+
},
28+
"homepage": "https://github.com/{{author}}/{{name}}#readme",
29+
"peerDependencies": {
30+
"vue": "^2.5.0"
31+
},
32+
"devDependencies": {
33+
"autoprefixer": "^8.6.2",
34+
"babel-core": "^6.26.3",
35+
"babel-eslint": "^8.2.3",
36+
"babel-jest": "^23.0.1",
37+
"babel-plugin-transform-runtime": "^6.23.0",
38+
"babel-preset-env": "^1.7.0",
39+
"babel-preset-es2015-rollup": "^3.0.0",
40+
"babel-preset-stage-2": "^6.24.1",
41+
"eslint": "^4.19.1",
42+
"eslint-config-vue": "^2.0.2",
43+
"eslint-plugin-vue": "^4.5.0",
44+
"jest": "^23.1.0",
45+
"jest-cli": "^23.1.0",
46+
"jest-css-modules": "^1.1.0",
47+
"jest-serializer-html": "^5.0.0",
48+
"less": "^3.0.4",
49+
"parcel-bundler": "1.7.1",
50+
"parcel-plugin-vue": "^1.5.0",
51+
"postcss-modules": "^1.1.0",
52+
"rollup": "^0.60.7",
53+
"rollup-plugin-babel": "^3.0.4",
54+
"rollup-plugin-commonjs": "^9.1.3",
55+
"rollup-plugin-node-resolve": "^3.3.0",
56+
"rollup-plugin-postcss": "^1.6.2",
57+
"rollup-plugin-uglify": "^4.0.0",
58+
"vue": "^2.5.16",
59+
"vue-jest": "^2.6.0"
60+
},
61+
"jest": {
62+
"verbose": false,
63+
"roots": [
64+
"<rootDir>/test"
65+
],
66+
"moduleFileExtensions": [
67+
"js",
68+
"vue"
69+
],
70+
"moduleDirectories": [
71+
"node_modules"
72+
],
73+
"transform": {
74+
".*\\.(vue)$": "<rootDir>/node_modules/vue-jest",
75+
"\\.(less)$": "<rootDir>/node_modules/jest-css-modules",
76+
"\\.(css)$": "<rootDir>/node_modules/jest-css-modules",
77+
".*\\.(vue|js)$": "<rootDir>/node_modules/babel-jest"
78+
},
79+
"transformIgnorePatterns": [
80+
"node_modules/(?!vue-router)"
81+
],
82+
"snapshotSerializers": [
83+
"jest-serializer-html"
84+
]
85+
}
86+
}

0 commit comments

Comments
 (0)