Skip to content

Commit 1e1a8e2

Browse files
committed
initial commit
0 parents  commit 1e1a8e2

34 files changed

+11669
-0
lines changed

Diff for: .editorconfig

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

Diff for: .gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

Diff for: .github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: kiaking

Diff for: .github/ISSUE_TEMPLATE/bug_report.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
#### Describe the bug
11+
12+
A clear and concise description of what the bug is.
13+
14+
#### Steps to reproduce the bug
15+
16+
1. Define models [...]
17+
2. Create data [...]
18+
3. Retrieve data [...]
19+
4. See error
20+
21+
#### Expected behavior
22+
23+
A clear and concise description of what you expected to happen.
24+
25+
#### Versions
26+
27+
- Vuex ORM Axios: 0.#.#
28+
- Vuex ORM: 0.#.#
29+
30+
#### Link to minimal reproduction
31+
32+
If applicable, add a minimal demo link to help explain your problem. Some options for that are [CodePen](https://codepen.io/), [CodeSandbox](https://codesandbox.io/), [JS Bin](https://jsbin.com/) or [JSFiddle](https://jsfiddle.net/).
33+
34+
#### Additional context
35+
36+
Add any other context about the bug here.

Diff for: .github/ISSUE_TEMPLATE/feature_request.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
#### Is your feature request related to a problem? Please describe...
11+
12+
A clear and concise description of what the problem is.
13+
14+
#### Describe the solution you'd like
15+
16+
A clear and concise description of what you want to happen.
17+
18+
#### Describe alternatives you've considered
19+
20+
A clear and concise description of any alternative solutions or features you've considered.
21+
22+
#### Additional context
23+
24+
Add any other context or screenshots about the feature request here.

Diff for: .github/PULL_REQUEST_TEMPLATE.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!-- PULL REQUEST TEMPLATE -->
2+
3+
<!-- Please describe a summary of this PR. -->
4+
5+
#### Type of PR:
6+
7+
- [ ] Bugfix
8+
- [ ] Feature
9+
- [ ] Code style update
10+
- [ ] Refactor
11+
- [ ] Build-related changes
12+
- [ ] Documentation
13+
- [ ] Other, please describe:
14+
15+
#### Breaking changes:
16+
17+
- [ ] No
18+
- [ ] Yes
19+
20+
### Details
21+
22+
<!-- Please describe the details of the PR. -->

Diff for: .gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/.nyc_output
2+
/.tmp
3+
/coverage
4+
/dist
5+
/docs/.vuepress/dist
6+
/docs/node_modules
7+
/node_modules
8+
/temp
9+
.idea/*
10+
.vscode/*
11+
yarn-error.log

Diff for: .prettierrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"arrowParens": "always",
3+
"endOfLine": "lf",
4+
"printWidth": 80,
5+
"semi": false,
6+
"singleQuote": true,
7+
"trailingComma": "none"
8+
}

Diff for: .travis.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
language: node_js
2+
node_js:
3+
- "10"
4+
- "12"
5+
script:
6+
- npm run lint:fail
7+
- npm run coverage
8+
- cat ./coverage/lcov.info | ./node_modules/.bin/codecov

Diff for: CHANGELOG.md

Whitespace-only changes.

Diff for: LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Kia Ishii
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.

Diff for: README.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# vuex-orm-apollo-next [![Travis CI](https://travis-ci.org/vuex-orm/plugin-apollo-next.svg?branch=master)](https://travis-ci.org/vuex-orm/plugin-apollo-next) [![codecov](https://codecov.io/gh/vuex-orm/plugin-apollo-next/branch/master/graph/badge.svg)](https://codecov.io/gh/vuex-orm/plugin-apollo-next)
2+
3+
## Status: Draft
4+
5+
This repo is for the next iteration of Vuex ORM Apollo. It’s in an active development state and we are hoping it is going to be the foundation of the version 1.0.0 release. Any and all feedback is welcome!
6+
7+
Join us on our [Slack Channel](https://join.slack.com/t/vuex-orm/shared_invite/enQtNDQ0NjE3NTgyOTY2LTc1YTI2N2FjMGRlNGNmMzBkMGZlMmYxOTgzYzkzZDM2OTQ3OGExZDRkN2FmMGQ1MGJlOWM1NjU0MmRiN2VhYzQ) for any questions and discussions.
8+
9+
## Contribution
10+
11+
Community contributions will be applicable as soon as this repo reaches **alpha** stage.
12+
13+
## License
14+
15+
Vuex ORM is open-sourced software licensed under the [MIT License](./LICENSE).

Diff for: api-extractor.json

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3+
4+
"mainEntryPointFilePath": "./dist/src/index.d.ts",
5+
6+
"apiReport": {
7+
"enabled": true,
8+
"reportFolder": "<projectFolder>/temp/"
9+
},
10+
11+
"docModel": {
12+
"enabled": true
13+
},
14+
15+
"dtsRollup": {
16+
"enabled": false
17+
},
18+
19+
"tsdocMetadata": {
20+
"enabled": false
21+
},
22+
23+
"messages": {
24+
"compilerMessageReporting": {
25+
"default": {
26+
"logLevel": "warning"
27+
}
28+
},
29+
30+
"extractorMessageReporting": {
31+
"default": {
32+
"logLevel": "warning",
33+
"addToApiReportFile": true
34+
},
35+
36+
"ae-missing-release-tag": {
37+
"logLevel": "none"
38+
}
39+
},
40+
41+
"tsdocMessageReporting": {
42+
"default": {
43+
"logLevel": "warning"
44+
}
45+
}
46+
}
47+
}

Diff for: jest.config.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
preset: 'ts-jest',
3+
rootDir: __dirname,
4+
globals: {
5+
__DEV__: true
6+
},
7+
moduleNameMapper: {
8+
'^@/(.*)$': '<rootDir>/src/$1',
9+
'^test/(.*)$': '<rootDir>/test/$1'
10+
},
11+
testMatch: ['<rootDir>/test/**/*.spec.ts'],
12+
testPathIgnorePatterns: ['/node_modules/'],
13+
coverageDirectory: 'coverage',
14+
coverageReporters: ['json', 'lcov', 'text-summary', 'clover'],
15+
collectCoverageFrom: ['src/**/*.ts', '!src/index.cjs.ts']
16+
}

Diff for: logo-vuex-orm.png

19.5 KB
Loading

Diff for: package.json

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
{
2+
"name": "@vuex-orm/plugin-apollo",
3+
"version": "1.0.0-draft.1",
4+
"description": "Vuex ORM plugin for adding smooth integration with apollo.",
5+
"main": "dist/vuex-orm-apollo.cjs.js",
6+
"browser": "dist/vuex-orm-apollo.esm-browser.js",
7+
"module": "dist/vuex-orm-apollo.esm-bundler.js",
8+
"unpkg": "dist/vuex-orm-apollo.global.js",
9+
"jsdelivr": "dist/vuex-orm-apollo.global.js",
10+
"typings": "dist/src/index.d.ts",
11+
"files": [
12+
"dist",
13+
"types"
14+
],
15+
"scripts": {
16+
"build": "node scripts/build.js",
17+
"build:dts": "api-extractor run --local --verbose",
18+
"clean": "rm -rf dist coverage temp .nyc_output .tmp",
19+
"lint": "prettier --check --write --parser typescript \"{src,test}/**/*.ts\"",
20+
"lint:fail": "prettier --check --parser typescript \"{src,test}/**/*.ts\"",
21+
"test": "jest",
22+
"test:watch": "jest --watch",
23+
"coverage": "jest --collect-coverage",
24+
"docs": "vuepress dev docs",
25+
"docs:build": "yarn docs:build:guide && yarn docs:build:api",
26+
"docs:build:guide": "vuepress build docs",
27+
"docs:build:api": "yarn build && api-documenter markdown --input-folder temp --output-folder docs-api",
28+
"docs:deploy": "bash ./docs/deploy.sh",
29+
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
30+
"release": "node scripts/release.js"
31+
},
32+
"repository": {
33+
"type": "git",
34+
"url": "git+https://github.com/vuex-orm/plugin-apollo.git"
35+
},
36+
"keywords": [
37+
"vue",
38+
"vuex",
39+
"vuex-plugin",
40+
"vuex-orm",
41+
"vuex-orm-plugin",
42+
"apollo"
43+
],
44+
"author": "Kia Ishii",
45+
"license": "MIT",
46+
"bugs": {
47+
"url": "https://github.com/vuex-orm/plugin-apollo/issues"
48+
},
49+
"peerDependencies": {
50+
"@vuex-orm/core": ">=1.0.0-draft.4",
51+
"vuex": ">=3.1.0"
52+
},
53+
"dependencies": {
54+
"apollo-client": "^2.6.10",
55+
"vue-apollo": "^3.0.3"
56+
},
57+
"devDependencies": {
58+
"@microsoft/api-documenter": "^7.8.13",
59+
"@microsoft/api-extractor": "^7.8.12",
60+
"@rollup/plugin-commonjs": "^13.0.0",
61+
"@rollup/plugin-node-resolve": "^8.0.1",
62+
"@rollup/plugin-replace": "^2.3.3",
63+
"@types/jest": "^26.0.0",
64+
"@vuex-orm/core": "1.0.0-draft.4",
65+
"apollo-cache-inmemory": "^1.6.6",
66+
"apollo-link": "^1.2.14",
67+
"apollo-link-http": "^1.5.17",
68+
"brotli": "^1.3.2",
69+
"chalk": "^4.1.0",
70+
"codecov": "^3.7.0",
71+
"conventional-changelog-cli": "^2.0.34",
72+
"enquirer": "^2.3.4",
73+
"execa": "^4.0.2",
74+
"graphql": "^15.1.0",
75+
"graphql-tag": "^2.10.3",
76+
"jest": "^26.0.1",
77+
"prettier": "1.19.1",
78+
"rollup": "^2.16.1",
79+
"rollup-plugin-terser": "^6.1.0",
80+
"rollup-plugin-typescript2": "^0.27.1",
81+
"semver": "^7.1.3",
82+
"ts-jest": "^26.1.0",
83+
"typescript": "^3.9.5",
84+
"unfetch": "^4.1.0",
85+
"vue": "^2.6.11",
86+
"vue-server-renderer": "^2.6.11",
87+
"vuepress": "^1.5.2",
88+
"vuepress-theme-vue": "^1.1.0",
89+
"vuex": "^3.4.0"
90+
}
91+
}

Diff for: rollup.config.js

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import path from 'path'
2+
import replace from '@rollup/plugin-replace'
3+
import resolve from '@rollup/plugin-node-resolve'
4+
import commonjs from '@rollup/plugin-commonjs'
5+
import ts from 'rollup-plugin-typescript2'
6+
import { terser } from 'rollup-plugin-terser'
7+
8+
const configs = [
9+
{ input: 'src/index.ts', file: 'dist/vuex-orm-apollo.esm-browser.js', format: 'es', browser: true, env: 'development' },
10+
{ input: 'src/index.ts', file: 'dist/vuex-orm-apollo.esm-browser.prod.js', format: 'es', browser: true, env: 'production' },
11+
{ input: 'src/index.ts', file: 'dist/vuex-orm-apollo.esm-bundler.js', format: 'es', env: 'development' },
12+
{ input: 'src/index.cjs.ts', file: 'dist/vuex-orm-apollo.global.js', format: 'iife', env: 'development' },
13+
{ input: 'src/index.cjs.ts', file: 'dist/vuex-orm-apollo.global.prod.js', format: 'iife', minify: true, env: 'production' },
14+
{ input: 'src/index.cjs.ts', file: 'dist/vuex-orm-apollo.cjs.js', format: 'cjs', env: 'development' }
15+
]
16+
17+
function createEntries() {
18+
return configs.map((c) => createEntry(c))
19+
}
20+
21+
function createEntry(config) {
22+
const c = {
23+
input: config.input,
24+
plugins: [],
25+
output: {
26+
file: config.file,
27+
format: config.format,
28+
globals: {
29+
vue: 'Vue'
30+
}
31+
},
32+
onwarn: (msg, warn) => {
33+
if (!/Circular/.test(msg)) {
34+
warn(msg)
35+
}
36+
}
37+
}
38+
39+
if (config.format === 'iife') {
40+
c.output.name = 'VuexORMAxios'
41+
}
42+
43+
c.plugins.push(replace({
44+
__DEV__: config.format === 'es' && !config.browser
45+
? `(process.env.NODE_ENV !== 'production')`
46+
: config.env !== 'production'
47+
}))
48+
49+
c.plugins.push(resolve())
50+
c.plugins.push(commonjs())
51+
52+
c.plugins.push(ts({
53+
check: config.format === 'es' && config.browser && config.env === 'development',
54+
tsconfig: path.resolve(__dirname, 'tsconfig.json'),
55+
cacheRoot: path.resolve(__dirname, 'node_modules/.rts2_cache'),
56+
tsconfigOverride: {
57+
compilerOptions: {
58+
declaration: config.format === 'es' && config.browser && config.env === 'development',
59+
target: config.format === 'iife' || config.format === 'cjs' ? 'es5' : 'es2018'
60+
},
61+
exclude: ['test']
62+
}
63+
}))
64+
65+
if (config.minify) {
66+
c.plugins.push(terser({ module: config.format === 'es' }))
67+
}
68+
69+
return c
70+
}
71+
72+
export default createEntries()

0 commit comments

Comments
 (0)