Skip to content

Commit e106813

Browse files
committed
initial commit
0 parents  commit e106813

19 files changed

+14128
-0
lines changed

.circleci/config.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
version: 2.1
2+
3+
orbs:
4+
codecov: codecov/[email protected]
5+
6+
jobs:
7+
build:
8+
docker:
9+
- image: cimg/node:15.4.0
10+
11+
steps:
12+
- checkout
13+
14+
# Download and cache dependencies
15+
- restore_cache:
16+
keys:
17+
- v1-dependencies-{{ checksum "package.json" }}
18+
# fallback to using the latest cache if no exact match is found
19+
- v1-dependencies-
20+
21+
- run: npm install
22+
23+
- save_cache:
24+
paths:
25+
- node_modules
26+
key: v1-dependencies-{{ checksum "package.json" }}
27+
28+
- run: npm run test:vue3
29+
30+
- codecov/upload:
31+
file: './coverage/coverage-final.json'
32+
flags: 'vue3'
33+
34+
- run: npm run test:vue2
35+
36+
- codecov/upload:
37+
file: './coverage/coverage-final.json'
38+
flags: 'vue2'

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.vscode
2+
.DS_Store
3+
node_modules/
4+
npm-debug.log
5+
stats.json
6+
.npmrc
7+
coverage/

.npmignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.gitignore
2+
.editorconfig
3+
.DS_Store
4+
npm-debug.log
5+
node_modules/
6+
.circleci
7+
assets/
8+
build/
9+
coverage/
10+
jest/
11+
node_modules/
12+
tests/
13+
.gitignore
14+
babel.config.js
15+
CODE_OF_CONDUCT.md

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## v1.0.0
2+
3+
> `2020-01-05`
4+
5+
### 🎉 Features
6+
- First release

CODE_OF_CONDUCT.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
* Trolling, insulting/derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: http://contributor-covenant.org
46+
[version]: http://contributor-covenant.org/version/1/4/

LICENSE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2020 Adam Berecz <[email protected]>.
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.

assets/logo-horizontal.svg

+17
Loading

assets/logo.svg

+16
Loading

babel.config.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
'presets': [
3+
['@babel/preset-env', {
4+
modules: false
5+
}],
6+
],
7+
'env': {
8+
'test': {
9+
'presets': [
10+
[
11+
'@babel/preset-env', {
12+
'targets': { 'node': 'current' }
13+
}
14+
]
15+
]
16+
}
17+
},
18+
}

build/themes.rollup.config.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const fs = require('fs')
2+
3+
import postcss from 'rollup-plugin-postcss'
4+
import autoprefixer from 'autoprefixer'
5+
6+
const themes = fs.readdirSync(__dirname + '/../themes').filter(f=>f.indexOf('.scss') !== -1).map(f=>f.replace('.scss',''))
7+
8+
export default themes.map((theme) => {
9+
return {
10+
input: `themes/${theme}.scss`,
11+
output: {
12+
file: `themes/${theme}.css`,
13+
format: 'esm',
14+
},
15+
plugins: [
16+
postcss({
17+
extract: true,
18+
minimize: true,
19+
plugins: [
20+
autoprefixer(),
21+
]
22+
}),
23+
]
24+
}
25+
})

build/vue2.rollup.config.js

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import vue from 'vue-prev-rollup-plugin-vue'
2+
import alias from '@rollup/plugin-alias'
3+
import babel from '@rollup/plugin-babel'
4+
import { terser } from 'rollup-plugin-terser'
5+
6+
export default [
7+
{
8+
input: 'src/Toggle.vue',
9+
output: {
10+
file: 'dist/toggle.vue2.js',
11+
format: 'esm',
12+
},
13+
plugins: [
14+
vue(),
15+
alias({
16+
entries: [
17+
{ find: 'composition-api', replacement: '@vue/composition-api' },
18+
]
19+
}),
20+
babel({
21+
babelHelpers: 'runtime',
22+
skipPreflightCheck: true,
23+
}),
24+
terser(),
25+
],
26+
external: ['@vue/composition-api'],
27+
},
28+
{
29+
input: 'src/Toggle.vue',
30+
output: {
31+
file: 'dist/toggle.vue2.global.js',
32+
format: 'iife',
33+
name: 'VueformToggle',
34+
globals: {
35+
'composition-api': 'VueCompositionAPI',
36+
'vue': 'Vue',
37+
}
38+
},
39+
plugins: [
40+
vue(),
41+
babel({
42+
babelHelpers: 'bundled',
43+
}),
44+
terser()
45+
],
46+
external: ['composition-api', 'vue'],
47+
}
48+
]

build/vue3.rollup.config.js

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import vue from 'vue-next-rollup-plugin-vue'
2+
import alias from '@rollup/plugin-alias'
3+
import babel from '@rollup/plugin-babel'
4+
import { terser } from 'rollup-plugin-terser'
5+
6+
export default [
7+
{
8+
input: 'src/Toggle.vue',
9+
output: {
10+
file: 'dist/toggle.js',
11+
format: 'esm',
12+
},
13+
plugins: [
14+
vue(),
15+
alias({
16+
entries: [
17+
{ find: 'composition-api', replacement: 'vue' },
18+
]
19+
}),
20+
babel({
21+
babelHelpers: 'runtime',
22+
skipPreflightCheck: true,
23+
}),
24+
terser(),
25+
],
26+
external: 'vue',
27+
},
28+
{
29+
input: 'src/Toggle.vue',
30+
output: {
31+
file: 'dist/toggle.global.js',
32+
format: 'iife',
33+
name: 'VueformToggle',
34+
globals: {
35+
'composition-api': 'Vue',
36+
'vue': 'Vue',
37+
}
38+
},
39+
plugins: [
40+
vue(),
41+
babel({
42+
babelHelpers: 'bundled',
43+
}),
44+
terser()
45+
],
46+
external: ['composition-api', 'vue'],
47+
}
48+
]

jest/jest.config.vue2.js

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
module.exports = {
2+
"rootDir": "../",
3+
"moduleFileExtensions": [
4+
"js",
5+
"json",
6+
"vue"
7+
],
8+
"testTimeout": 1000,
9+
"transform": {
10+
".*\\.(vue)$": "vue-prev-jest",
11+
"^.+\\.js$": "babel-jest"
12+
},
13+
"transformIgnorePatterns": [
14+
"/node_modules/"
15+
],
16+
"moduleNameMapper": {
17+
"^composition-api$": "<rootDir>/node_modules/vue-prev-composition-api",
18+
"^@vue/test-utils$": "<rootDir>/node_modules/vue-prev-test-utils",
19+
"^vue$": "<rootDir>/node_modules/vue-prev",
20+
'^vue-jest$': "<rootDir>/node_modules/vue-prev-jest",
21+
'^unit-test-helpers$': "<rootDir>/tests/unit/helpers/vue2"
22+
},
23+
"collectCoverage": true,
24+
"collectCoverageFrom": [
25+
"**/src/**/*.{js,vue}",
26+
],
27+
"coverageReporters": [
28+
"html",
29+
"text-summary",
30+
"clover",
31+
"json"
32+
]
33+
}

jest/jest.config.vue3.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
var base = require('./jest.config.vue2.js')
2+
3+
module.exports = Object.assign({}, base, {
4+
"transform": {
5+
".*\\.(vue)$": "vue-next-jest",
6+
"^.+\\.js$": "babel-jest",
7+
},
8+
"moduleNameMapper": {
9+
"^composition-api$": "<rootDir>/node_modules/vue-next",
10+
"^@vue/test-utils$": "<rootDir>/node_modules/vue-next-test-utils",
11+
"^vue$": "<rootDir>/node_modules/vue-next",
12+
'^vue-jest$': "<rootDir>/node_modules/vue-next-jest",
13+
'^unit-test-helpers$': "<rootDir>/tests/unit/helpers/vue3"
14+
},
15+
})

0 commit comments

Comments
 (0)