-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
10,998 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-env" | ||
], | ||
"plugins": [ | ||
["@babel/plugin-transform-runtime", | ||
{ | ||
"regenerator": true | ||
} | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
version: 2 | ||
|
||
defaults: &defaults | ||
working_directory: ~/repo | ||
docker: | ||
- image: circleci/node:8.9.1 | ||
|
||
jobs: | ||
test: | ||
<<: *defaults | ||
steps: | ||
- checkout | ||
|
||
- run: | ||
name: Install Codecov | ||
command: npm install codecov | ||
|
||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ checksum "package.json" }} | ||
# fallback to using the latest cache if no exact match is found. | ||
- v1-dependencies- | ||
|
||
- run: npm install | ||
- run: | ||
name: Build component | ||
command: npm run build | ||
- run: | ||
name: Run tests | ||
command: npm test | ||
|
||
- run: | ||
name: Upload coverage report | ||
command: npx codecov | ||
|
||
- save_cache: | ||
paths: | ||
- node_modules | ||
key: v1-dependencies-{{ checksum "package.json" }} | ||
|
||
- persist_to_workspace: | ||
root: ~/repo | ||
paths: | ||
- . | ||
|
||
deploy: | ||
<<: *defaults | ||
steps: | ||
- attach_workspace: | ||
at: ~/repo | ||
|
||
- run: | ||
name: Authenticate with registry | ||
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc | ||
|
||
- run: | ||
name: Publish package | ||
command: npm publish | ||
|
||
workflows: | ||
version: 2 | ||
|
||
test_deploy: | ||
jobs: | ||
- test | ||
- deploy: | ||
requires: | ||
- test | ||
filters: | ||
branches: | ||
only: master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
extends: [ | ||
'plugin:vue/recommended' | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
coverage | ||
dist | ||
node_modules | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# \<druxt-search /> | ||
|
||
[](https://circleci.com/gh/Realityloop/druxt-search) | ||
[](https://snyk.io/test/github/Realityloop/druxt-search?targetFile=package.json) | ||
[](https://codecov.io/gh/Realityloop/druxt-search) | ||
|
||
Provides JSON API Search integration for a Druxt (DRUpal nuXT) project. | ||
|
||
## Install | ||
|
||
`$ npm install druxt-search` | ||
|
||
## Usage | ||
|
||
Add module to `nuxt.config.js` | ||
|
||
```js | ||
module.exports = { | ||
modules: [ | ||
... | ||
'druxt-router', | ||
'druxt-search' | ||
], | ||
|
||
druxt: { | ||
baseUrl: 'https://example.com' | ||
} | ||
} | ||
``` | ||
|
||
## Options | ||
|
||
### Base Druxt options | ||
|
||
These options are available to all Druxt modules. | ||
|
||
| Option | Type | Required | Default | Description | | ||
| --- | --- | --- | --- | --- | | ||
| `axios` | `object` | No | `{}` | [Axios instance settings](https://github.com/axios/axios#axioscreateconfig). | | ||
| `baseUrl` | `string` | Yes | `null` | Base URL for the Drupal installation. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { DruxtSearch } from 'druxt-search' | ||
|
||
export default (context, inject) => { | ||
const baseUrl = '<%= options.baseUrl %>' | ||
const options = {} | ||
|
||
<% if (options.endpoint) { %> | ||
options.endpoint = '<%= options.endpoint %>' | ||
<% } %> | ||
|
||
const druxtSearch = new DruxtSearch(baseUrl, options) | ||
inject('druxtSearch', druxtSearch) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { DruxtSearchStore } from 'druxt-search' | ||
|
||
export default DruxtSearchStore |
Oops, something went wrong.