├── .babelrc
├── .editorconfig
├── .github
├── pull_request_template.md
└── workflows
│ ├── node.js.yml
│ └── npm-publish.yml
├── .gitignore
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── README.md
├── circle.yml
├── dangerfile.ts
├── example
├── App.vue
└── index.js
├── package-lock.json
├── package.json
├── src
├── components
│ ├── VueGist.vue
│ └── VueGistCore.vue
└── index.js
└── test
├── VueGist.test.js
├── VueGistCore.test.js
├── __mocks__
└── jsonp.js
└── index.test.js
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | "poi"
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | indent_style = space
5 | indent_size = 2
6 | end_of_line = lf
7 | charset = utf-8
8 | trim_trailing_whitespace = true
9 | insert_final_newline = true
10 |
11 | [*.md]
12 | trim_trailing_whitespace = false
13 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 | ### What is in this PR:
2 |
3 | What is this PR all about, you can list down all the things that will help a reviewer understand this better. Pro tip: It is helpful to link a PR to an issue. Follow this [guide](https://docs.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue)
4 |
5 | - Point
6 |
7 | ### How to test this PR:
8 |
9 | Provide step by step instructions about how to test this feature
10 |
11 | ### Related PR:
12 |
13 | Any related or already existing pull requests?
14 |
15 | ### Screenshot and preview:
16 |
17 | A picture is worth a thousand words
18 |
--------------------------------------------------------------------------------
/.github/workflows/node.js.yml:
--------------------------------------------------------------------------------
1 | # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3 |
4 | name: Build and Test
5 |
6 | on:
7 | workflow_dispatch:
8 | push:
9 | branches: [ master ]
10 | pull_request_target:
11 | branches: [ master ]
12 |
13 | jobs:
14 | build:
15 |
16 | runs-on: ubuntu-latest
17 |
18 | steps:
19 | - uses: actions/checkout@v2
20 | - name: Use Node.js 12.x
21 | uses: actions/setup-node@v1
22 | with:
23 | node-version: 12.x
24 | - name: Cache Node.js modules
25 | uses: actions/cache@v2
26 | with:
27 | # npm cache files are stored in `~/.npm` on Linux/macOS
28 | path: ~/.npm
29 | key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
30 | restore-keys: |
31 | ${{ runner.OS }}-node-
32 | ${{ runner.OS }}-
33 | - name: Install dependencies
34 | run: npm ci
35 | - name: Build project
36 | run: npm run build --if-present
37 | - name: Run tests
38 | run: npm test
39 | - name: Run Danger
40 | run: npx danger ci
41 | env:
42 | DANGER_GITHUB_API_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }}
43 |
--------------------------------------------------------------------------------
/.github/workflows/npm-publish.yml:
--------------------------------------------------------------------------------
1 | # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3 |
4 | name: Publish
5 |
6 | on:
7 | push:
8 | tags:
9 | - v[0-9].[0-9]+.[0-9]+
10 |
11 | jobs:
12 | build:
13 | runs-on: ubuntu-latest
14 | steps:
15 | - uses: actions/checkout@v2
16 | - uses: actions/setup-node@v1
17 | with:
18 | node-version: 12
19 | - run: npm ci
20 | - run: npm test
21 |
22 | publish-npm:
23 | needs: build
24 | runs-on: ubuntu-latest
25 | steps:
26 | - uses: actions/checkout@v2
27 | - uses: actions/setup-node@v1
28 | with:
29 | node-version: 12
30 | registry-url: https://registry.npmjs.org/
31 | - run: npm ci
32 | - run: npm publish
33 | env:
34 | NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
35 | - run: npm run build:example
36 | - name: deploy example
37 | uses: peaceiris/actions-gh-pages@v3
38 | with:
39 | github_token: ${{ secrets.GITHUB_TOKEN }}
40 | publish_dir: ./example/dist
41 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | dist
3 | .DS_Store
4 | coverage
5 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 |
2 | # Contributor Covenant Code of Conduct
3 |
4 | ## Our Pledge
5 |
6 | We as members, contributors, and leaders pledge to make participation in our
7 | community a harassment-free experience for everyone, regardless of age, body
8 | size, visible or invisible disability, ethnicity, sex characteristics, gender
9 | identity and expression, level of experience, education, socio-economic status,
10 | nationality, personal appearance, race, religion, or sexual identity
11 | and orientation.
12 |
13 | We pledge to act and interact in ways that contribute to an open, welcoming,
14 | diverse, inclusive, and healthy community.
15 |
16 | ## Our Standards
17 |
18 | Examples of behavior that contributes to a positive environment for our
19 | community include:
20 |
21 | * Demonstrating empathy and kindness toward other people
22 | * Being respectful of differing opinions, viewpoints, and experiences
23 | * Giving and gracefully accepting constructive feedback
24 | * Accepting responsibility and apologizing to those affected by our mistakes,
25 | and learning from the experience
26 | * Focusing on what is best not just for us as individuals, but for the
27 | overall community
28 |
29 | Examples of unacceptable behavior include:
30 |
31 | * The use of sexualized language or imagery, and sexual attention or
32 | advances of any kind
33 | * Trolling, insulting or derogatory comments, and personal or political attacks
34 | * Public or private harassment
35 | * Publishing others' private information, such as a physical or email
36 | address, without their explicit permission
37 | * Other conduct which could reasonably be considered inappropriate in a
38 | professional setting
39 |
40 | ## Enforcement Responsibilities
41 |
42 | Community leaders are responsible for clarifying and enforcing our standards of
43 | acceptable behavior and will take appropriate and fair corrective action in
44 | response to any behavior that they deem inappropriate, threatening, offensive,
45 | or harmful.
46 |
47 | Community leaders have the right and responsibility to remove, edit, or reject
48 | comments, commits, code, wiki edits, issues, and other contributions that are
49 | not aligned to this Code of Conduct, and will communicate reasons for moderation
50 | decisions when appropriate.
51 |
52 | ## Scope
53 |
54 | This Code of Conduct applies within all community spaces, and also applies when
55 | an individual is officially representing the community in public spaces.
56 | Examples of representing our community include using an official e-mail address,
57 | posting via an official social media account, or acting as an appointed
58 | representative at an online or offline event.
59 |
60 | ## Enforcement
61 |
62 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
63 | reported to the community leaders responsible for enforcement at
64 | sudhanshu.15@gmail.com.
65 | All complaints will be reviewed and investigated promptly and fairly.
66 |
67 | All community leaders are obligated to respect the privacy and security of the
68 | reporter of any incident.
69 |
70 | ## Enforcement Guidelines
71 |
72 | Community leaders will follow these Community Impact Guidelines in determining
73 | the consequences for any action they deem in violation of this Code of Conduct:
74 |
75 | ### 1. Correction
76 |
77 | **Community Impact**: Use of inappropriate language or other behavior deemed
78 | unprofessional or unwelcome in the community.
79 |
80 | **Consequence**: A private, written warning from community leaders, providing
81 | clarity around the nature of the violation and an explanation of why the
82 | behavior was inappropriate. A public apology may be requested.
83 |
84 | ### 2. Warning
85 |
86 | **Community Impact**: A violation through a single incident or series
87 | of actions.
88 |
89 | **Consequence**: A warning with consequences for continued behavior. No
90 | interaction with the people involved, including unsolicited interaction with
91 | those enforcing the Code of Conduct, for a specified period of time. This
92 | includes avoiding interactions in community spaces as well as external channels
93 | like social media. Violating these terms may lead to a temporary or
94 | permanent ban.
95 |
96 | ### 3. Temporary Ban
97 |
98 | **Community Impact**: A serious violation of community standards, including
99 | sustained inappropriate behavior.
100 |
101 | **Consequence**: A temporary ban from any sort of interaction or public
102 | communication with the community for a specified period of time. No public or
103 | private interaction with the people involved, including unsolicited interaction
104 | with those enforcing the Code of Conduct, is allowed during this period.
105 | Violating these terms may lead to a permanent ban.
106 |
107 | ### 4. Permanent Ban
108 |
109 | **Community Impact**: Demonstrating a pattern of violation of community
110 | standards, including sustained inappropriate behavior, harassment of an
111 | individual, or aggression toward or disparagement of classes of individuals.
112 |
113 | **Consequence**: A permanent ban from any sort of public interaction within
114 | the community.
115 |
116 | ## Attribution
117 |
118 | This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119 | version 2.0, available at
120 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
121 |
122 | Community Impact Guidelines were inspired by [Mozilla's code of conduct
123 | enforcement ladder](https://github.com/mozilla/diversity).
124 |
125 | [homepage]: https://www.contributor-covenant.org
126 |
127 | For answers to common questions about this code of conduct, see the FAQ at
128 | https://www.contributor-covenant.org/faq. Translations are available at
129 | https://www.contributor-covenant.org/translations.
130 |
131 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | ## How to contribute
2 |
3 | First of all, thank you so much for using this plugin in your project secondly, I really appreciate you taking the initiative to consider contributing to this project. One of the fundamental goals of this project was to promote learning and if this is your first time contributing you are very welcome here and I hope it fun and exciting for you.
4 |
5 | Some general technical overview to get you started and help understand the project better.
6 | PS: This is also for me to refer later 🙈
7 |
8 | This project uses:
9 | - [bili](https://bili.egoist.sh/#/) for bundling the library. It is simple and easy to use.
10 | - ESlint for linting
11 | - Jest for testing
12 | - All source code resides in `src/`
13 | - To validate your changes run `npm run prepublishOnly`. This will run the test suite and also try to build the project. 😉 it might be wise to update the test cases in `test/`.
14 | - There is a test app in `example/` which uses this library and can be used for testing.
15 | - The test app uses [poi](https://poi.js.org/) and is fairly simple to use.
16 | - To test run `npm run example` and you should be good.
17 | - The project uses [CircleCI](https://circleci.com/) as the CI solution, so any PR will be run on CI before it can be approved.
18 |
19 | ## Creating a pull request
20 |
21 | Your new shiny feature is ready or you have tackled some nasty bug, what next? Nothing much just create a [Github Pull Request](https://github.com/sudhanshu-15/vue-embed-gist/pull/new/master). To make this smoother fill-in the details in the PR template.
22 | Some best practices to consider while creating a pull request:
23 | - Always good to refer an issue if it exists.
24 | - Providing meaningful comments are good.
25 | - Branches could be follow this naming `bug/issue-#-someDescription` or `feature/issue-#-someDescription`. eg: `feature/issue-7-addContributionGuides`
26 | - Even if you don't follow this convention it is fine, your contributions are always welcome. 🤗
27 |
28 | ## [Code of conduct](CODE_OF_CONDUCT.md)
29 |
30 | Thank you again and happy contributing.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # vue-embed-gist
2 |
3 | [](https://npmjs.com/package/vue-embed-gist) [](https://npmjs.com/package/vue-embed-gist) [](https://circleci.com/gh/sudhanshu-15/vue-embed-gist/tree/master)
4 | [](code_of_conduct.md)
5 |
6 | Vue component to embed Github Gists, inspired by Blair Vanderhoof's gist-embed. (https://github.com/blairvanderhoof/gist-embed)
7 |
8 | ## Demo
9 |
10 | [Demo of vue-embed-gist](https://sudhanshu-15.github.io/vue-embed-gist)
11 |
12 | ## Install
13 |
14 | ```bash
15 | yarn add vue-embed-gist
16 | ```
17 |
18 | or
19 |
20 | ```bash
21 | npm install --save vue-embed-gist
22 | ```
23 |
24 |
25 |
26 | ## Usage
27 |
28 | ```vue
29 |
30 | vue-embed-gist usage
6 |
7 | Install vue-embed-gist using npm
8 |
12 | Usage
13 |
17 | vue-embed-gist example
18 |
19 | With gistId
20 |
23 | With gistId and file
24 |
28 | Change the gist id dynamically
29 |
33 |
36 | Error Component
37 |
10 |
11 |
12 |