├── .babelrc
├── .editorconfig
├── .eslintrc
├── .github
└── workflows
│ ├── bump.yml
│ ├── deploy.yml
│ └── verify.yml
├── .gitignore
├── .npmignore
├── .nvmrc
├── .vscode
└── settings.json
├── LICENSE
├── README.md
├── examples
└── vue-jss-example
│ ├── .babelrc
│ ├── .browserslistrc
│ ├── .eslintrc
│ ├── .gitignore
│ ├── LICENCE
│ ├── README.md
│ ├── package.json
│ ├── public
│ ├── favicon.ico
│ └── index.html
│ ├── src
│ ├── App.vue
│ ├── assets
│ │ └── logo.png
│ ├── components
│ │ ├── Button.vue
│ │ └── HelloWorld.vue
│ └── main.js
│ └── webpack.config.js
├── logo.svg
├── package-lock.json
├── package.json
├── package.md
├── src
├── index.js
├── index.test.js
└── utils
│ ├── create-vue-model-projection.js
│ └── create-vue-model-projection.test.js
└── webpack.config.js
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": [
3 | "@babel/plugin-proposal-class-properties",
4 | "@babel/plugin-proposal-object-rest-spread"
5 | ],
6 | "presets": [
7 | "@babel/preset-env"
8 | ],
9 | "env": {
10 | "test": {
11 | "presets": [["@babel/preset-env", { "targets": { "node": "current" } }]]
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | indent_style = space
5 | indent_size = 2
6 | charset = utf-8
7 | trim_trailing_whitespace = false
8 | insert_final_newline = false
9 |
--------------------------------------------------------------------------------
/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "root": true,
3 | "env": {
4 | "node": true
5 | },
6 | "extends": [
7 | "google"
8 | ],
9 | "parserOptions": {
10 | "parser": "babel-eslint",
11 | "ecmaVersion": 2018,
12 | "sourceType": "module"
13 | },
14 | "ignorePatterns": ["build/", "examples/"],
15 | "rules": {
16 | "max-len": "off",
17 | "linebreak-style": "off"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/.github/workflows/bump.yml:
--------------------------------------------------------------------------------
1 | name: Bump version
2 |
3 | on:
4 | push:
5 | branches:
6 | - master
7 |
8 | jobs:
9 | bump:
10 | name: Bump project version
11 | runs-on: ubuntu-latest
12 | env:
13 | SKIP_CI_FLAG: skip CI
14 | PRE_RELEASE_ID: next
15 | if: "!contains(github.event.head_commit.message, '[skip CI]')"
16 | steps:
17 | - name: Checkout to current repository branch
18 | uses: actions/checkout@v1
19 |
20 | - name: Setup GitHub Actions local user
21 | run: |
22 | git config --local user.email "actions@github.com"
23 | git config --local user.name "GitHub Actions"
24 |
25 | - name: Read Node.js® version from .nvmrc file
26 | id: nvmrc
27 | run: echo ::set-output name=NVMRC::$(cat .nvmrc)
28 |
29 | - name: Setup locked Node.js® version
30 | uses: actions/setup-node@v1
31 | with:
32 | node-version: "${{ steps.nvmrc.outputs.NVMRC }}"
33 |
34 | - id: version
35 | name: Bump project version
36 | run: |
37 | if ${{ github.event.ref == 'refs/heads/master' }}; then
38 | echo ::set-output name=NEW_VERSION::$(npm version prerelease --preid=$PRE_RELEASE_ID --no-git-tag-version)
39 | elif ${{ contains(github.event.ref, 'refs/heads/release') }}; then
40 | echo ::set-output name=NEW_VERSION::$(npm version patch --no-git-tag-version)
41 | fi
42 |
43 | - name: Commit and push new version
44 | run: |
45 | git add package.json
46 | git add package-lock.json
47 | git commit -m "[skip CI] ⚙️ Set version to ${{ steps.version.outputs.NEW_VERSION }}"
48 |
49 | - name: Push changes
50 | uses: ad-m/github-push-action@master
51 | with:
52 | github_token: "${{ secrets.GITHUB_TOKEN }}"
53 |
54 | skip:
55 | name: Skip CI
56 | runs-on: ubuntu-latest
57 | if: "contains(github.event.head_commit.message, '[skip CI]')"
58 | steps:
59 | - name: Skip CI log
60 | run: echo "Skip CI for a '${{github.event.head_commit.message}}' commit"
61 |
--------------------------------------------------------------------------------
/.github/workflows/deploy.yml:
--------------------------------------------------------------------------------
1 | name: Deploy
2 |
3 | on:
4 | release:
5 | types: [created]
6 |
7 | jobs:
8 | verify:
9 | name: Verify production bundle
10 | runs-on: ubuntu-latest
11 | steps:
12 | - name: Checkout to current repository branch
13 | uses: actions/checkout@v1
14 |
15 | - name: Read Node.js® version from .nvmrc file
16 | id: nvmrc
17 | run: echo ::set-output name=NVMRC::$(cat .nvmrc)
18 |
19 | - name: Setup locked Node.js® version
20 | uses: actions/setup-node@v1
21 | with:
22 | node-version: "${{ steps.nvmrc.outputs.NVMRC }}"
23 |
24 | - name: Cache Node.js® packages
25 | uses: actions/cache@v1
26 | with:
27 | path: ~/.npm
28 | key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
29 | restore-keys: |
30 | ${{ runner.os }}-npm-
31 |
32 | - name: Install npm dependencies
33 | run: npm ci
34 |
35 | - name: Check linting
36 | run: npm run lint
37 |
38 | - name: Run unit tests
39 | run: npm run test
40 |
41 | - name: Build plugin
42 | run: npm run build
43 |
44 | publish:
45 | needs: [verify]
46 | name: Publish artifact on npmjs.org registry
47 | runs-on: ubuntu-latest
48 | steps:
49 | - name: Checkout to current repository branch
50 | uses: actions/checkout@v1
51 |
52 | - name: Read Node.js® version from .nvmrc file
53 | id: nvmrc
54 | run: echo ::set-output name=NVMRC::$(cat .nvmrc)
55 |
56 | - name: Setup locked Node.js® version
57 | uses: actions/setup-node@v1
58 | with:
59 | node-version: "${{ steps.nvmrc.outputs.NVMRC }}"
60 | registry-url: https://registry.npmjs.org/
61 |
62 | - name: Cache Node.js® packages
63 | uses: actions/cache@v1
64 | with:
65 | path: ~/.npm
66 | key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
67 | restore-keys: |
68 | ${{ runner.os }}-npm-
69 |
70 | - name: Install npm dependencies
71 | run: npm ci
72 |
73 | - name: Build plugin
74 | run: npm run build
75 |
76 | - name: Replace README.md with package.md which more suitable for npmjs.org registry
77 | run: |
78 | rm README.md
79 | mv package.md README.md
80 |
81 | - name: Update logo image source link in README.md file
82 | env:
83 | GITHUB_RAW_PATH: https://github.com/${{ github.repository }}/raw/${{ github.sha }}
84 | run: sed -i "s|./logo.svg|$GITHUB_RAW_PATH/logo.svg?sanitize=true|g" README.md
85 |
86 | - name: Read current package.json version
87 | id: version
88 | run: echo ::set-output name=PACKAGE_VERSION::$(grep -Po '"'"version"'"\s*:\s*"\K([^"]*)' package.json)
89 |
90 | - name: Publish package at npmjs.org registry
91 | # TODO - Get release tag by $(echo ${{ steps.version.outputs.PACKAGE_VERSION }} | grep -oP "\d+\.\d+\.\d+\-\K([^\.]*)")
92 | run: |
93 | if ${{ contains(steps.version.outputs.PACKAGE_VERSION, 'next') }}; then
94 | npm publish --tag next
95 | else
96 | npm publish
97 | fi
98 | env:
99 | NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
100 |
--------------------------------------------------------------------------------
/.github/workflows/verify.yml:
--------------------------------------------------------------------------------
1 | name: Verify build
2 |
3 | on:
4 | push:
5 | paths-ignore:
6 | - ".github/**"
7 | - ".vscode/**"
8 | - "examples/**"
9 |
10 | jobs:
11 | verify:
12 | name: Verify current commit
13 | runs-on: ubuntu-latest
14 | steps:
15 | - name: Checkout to current repository branch
16 | uses: actions/checkout@v1
17 |
18 | - name: Read Node.js® version from .nvmrc file
19 | id: nvmrc
20 | run: echo ::set-output name=NVMRC::$(cat .nvmrc)
21 |
22 | - name: Setup locked Node.js® version
23 | uses: actions/setup-node@v1
24 | with:
25 | node-version: "${{ steps.nvmrc.outputs.NVMRC }}"
26 |
27 | - name: Cache Node.js® packages
28 | uses: actions/cache@v1
29 | with:
30 | path: ~/.npm
31 | key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
32 | restore-keys: |
33 | ${{ runner.os }}-npm-
34 |
35 | - name: Install npm dependencies
36 | run: npm ci
37 |
38 | - name: Check linting
39 | run: npm run lint
40 |
41 | - name: Run unit tests
42 | run: npm run test
43 |
44 | - name: Build plugin
45 | run: npm run build
46 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Misc
2 | .DS_Store
3 | node_modules
4 |
5 | # Build files
6 | /build
7 | *.tgz
8 |
9 | # Log files
10 | npm-debug.log*
11 | yarn-debug.log*
12 | yarn-error.log*
13 |
14 | # Editor directories and files
15 | .idea
16 | .vscode
17 | *.suo
18 | *.ntvs*
19 | *.njsproj
20 | *.sln
21 | *.sw?
22 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | # Misc
2 | .DS_Store
3 |
4 | # Editor directories and files
5 | .idea
6 | .vscode
7 | *.suo
8 | *.ntvs*
9 | *.njsproj
10 | *.sln
11 | *.sw?
12 |
13 | # CI and development stuff
14 | .github
15 | /examples
16 |
17 | # Configuration files
18 | .babelrc
19 | .editorconfig
20 | .eslintrc
21 | .nvmrc
22 | webpack.config.js
23 |
24 | # Test suites
25 | *.test.js
26 |
27 | # Log files
28 | yarn-debug.log*
29 | yarn-error.log*
30 |
--------------------------------------------------------------------------------
/.nvmrc:
--------------------------------------------------------------------------------
1 | 12.14
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "eslint.enable": true,
3 | "eslint.validate": [
4 | "javascript",
5 | "vue"
6 | ],
7 | "cSpell.words": [
8 | "unmanage"
9 | ],
10 | }
11 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright © 2019-2020 Arkadiusz S. Krauzowicz | cube11
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 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
14 | The Vue JSS plugin implements one of the most flexible CSS-in-JS framework in Vue.js components. About JSS you can read more in the 📖 JSS documentation. 15 |
16 | 17 | ### Table of content 18 | 19 | - [Usage](#usage) 20 | - [Installation](#installation) 21 | - [Development](#development) 22 | - [Examples](#examples) 23 | - [Test](#test) 24 | - [Production](#production) 25 | - [License](#license) 26 | 27 | ## Usage 28 | 29 | The plugin usage section was moved to separate file that is published as README file on npm registry. Check README page for your plugin version on npmjs.org [plugin page](https://www.npmjs.com/package/vue-jss-plugin), or go to the latest draft of [package README](./package.md) file and check [Usage section](./package.md#usage) 30 | 31 | ## Installation 32 | 33 | ### Environment 34 | 35 | Project was initially designed to be run over **Node.js®** 12.14.0 LTS, and that version is locked in `.nvmrc` file. There shouldn't be much troubles to run it on other version, but if there will be any please use [nvm](https://github.com/nvm-sh/nvm) to switch to declared version of **Node.js®**. 36 | 37 | ```sh 38 | $ nvm install 39 | $ nvm use 40 | ``` 41 | 42 | ### Dependencies 43 | 44 | The project uses **npm** as a package manager, so use only **npm** to install all project dependencies. 45 | 46 | ```sh 47 | $ npm install 48 | ``` 49 | 50 | ## Development 51 | 52 | ```sh 53 | $ npm run start 54 | ``` 55 | 56 | ## Examples 57 | 58 | // TODO 59 | 60 | ## Tests 61 | 62 | The project contains configured eslint setup and test cases driven by jest. Before build should be run to make sure that every feature works well. 63 | 64 | ```sh 65 | $ npm run lint 66 | $ npm run test 67 | ``` 68 | 69 | ## Production 70 | 71 | ```sh 72 | $ npm run build 73 | ``` 74 | 75 | ## License 76 | 77 | Released under the MIT [License](./LICENSE). Copyright © 2019-2020 Arkadiusz S. Krauzowicz 78 | -------------------------------------------------------------------------------- /examples/vue-jss-example/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "@babel/plugin-proposal-class-properties", 4 | "@babel/plugin-proposal-object-rest-spread" 5 | ], 6 | "presets": [ 7 | "@babel/preset-env" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /examples/vue-jss-example/.browserslistrc: -------------------------------------------------------------------------------- 1 | last 5 version 2 | > 5% 3 | not dead 4 | IE 11 5 | -------------------------------------------------------------------------------- /examples/vue-jss-example/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "env": { 4 | "browser": true, 5 | "es6": true 6 | }, 7 | "extends": [ 8 | "google", 9 | "plugin:vue/recommended" 10 | ], 11 | "parserOptions": { 12 | "parser": "babel-eslint", 13 | "ecmaVersion": 2018, 14 | "sourceType": "module" 15 | }, 16 | "plugins": [ 17 | "vue", 18 | "html" 19 | ], 20 | "rules": { 21 | "max-len": "off", 22 | "linebreak-style": "off" 23 | } 24 | } -------------------------------------------------------------------------------- /examples/vue-jss-example/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /build 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | -------------------------------------------------------------------------------- /examples/vue-jss-example/LICENCE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2019 Arkadiusz S. Krauzowicz | cube11 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. 22 | -------------------------------------------------------------------------------- /examples/vue-jss-example/README.md: -------------------------------------------------------------------------------- 1 | # Vue JSS Example 2 | [](https://travis-ci.org/arktosk/vue-jss-project) 3 | 4 | ## Project setup 5 | ``` 6 | npm install 7 | ``` 8 | 9 | ### Compiles and hot-reloads for development 10 | ``` 11 | npm run serve 12 | ``` 13 | 14 | ### Compiles and minifies for production 15 | ``` 16 | npm run build 17 | ``` 18 | 19 | ### Run your tests 20 | ``` 21 | npm run test 22 | ``` 23 | 24 | ### Lints and fixes files 25 | ``` 26 | npm run lint 27 | ``` 28 | -------------------------------------------------------------------------------- /examples/vue-jss-example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-jss-example", 3 | "description": "Vue JSS Plugin implementation example", 4 | "version": "1.1.1", 5 | "private": true, 6 | "scripts": { 7 | "start": "webpack-dev-server --config=webpack.config.js --env.NODE_ENV=development --watch", 8 | "build": "rimraf build && webpack --config=webpack.config.js --env.NODE_ENV=production", 9 | "lint": "eslint {public,src}/**/*.{html,js,vue}", 10 | "test": "exit 0;" 11 | }, 12 | "dependencies": { 13 | "color": "^3.1.2", 14 | "vue": "^2.6.10", 15 | "vue-jss-plugin": "^1.1.1" 16 | }, 17 | "devDependencies": { 18 | "@babel/core": "^7.6.0", 19 | "@babel/plugin-proposal-class-properties": "^7.5.5", 20 | "@babel/plugin-proposal-object-rest-spread": "^7.5.5", 21 | "@babel/plugin-syntax-dynamic-import": "^7.2.0", 22 | "@babel/preset-env": "^7.6.0", 23 | "babel-eslint": "^10.0.3", 24 | "babel-loader": "^8.0.6", 25 | "eslint": "^6.4.0", 26 | "eslint-config-google": "^0.14.0", 27 | "eslint-plugin-html": "^6.0.0", 28 | "eslint-plugin-vue": "^5.2.3", 29 | "file-loader": "^4.2.0", 30 | "html-loader": "^0.5.5", 31 | "html-webpack-plugin": "^3.2.0", 32 | "rimraf": "^3.0.0", 33 | "terser-webpack-plugin": "^2.0.1", 34 | "url-loader": "^2.1.0", 35 | "vue-loader": "^15.7.1", 36 | "vue-template-compiler": "^2.6.10", 37 | "webpack": "^4.40.2", 38 | "webpack-cli": "^3.3.8", 39 | "webpack-dev-server": "^3.8.0" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /examples/vue-jss-example/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arktosk/vue-jss-plugin/fe74d4f40d002b96494313f97e1ed499578f4f49/examples/vue-jss-example/public/favicon.ico -------------------------------------------------------------------------------- /examples/vue-jss-example/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
5 | For a guide and recipes on how to configure / customize this project,
6 | check out the
7 | vue-cli documentation.
13 |
3 |
4 |