-
Notifications
You must be signed in to change notification settings - Fork 40
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
1 parent
7ac3e06
commit bedcd7d
Showing
12 changed files
with
237 additions
and
1 deletion.
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,29 @@ | ||
version: 2 | ||
jobs: | ||
build: | ||
working_directory: /usr/src/app | ||
docker: | ||
- image: banian/node | ||
steps: | ||
# Checkout repository | ||
- checkout | ||
|
||
# Restore cache | ||
- restore_cache: | ||
key: yarn-{{ checksum "yarn.lock" }} | ||
|
||
# Install dependencies | ||
- run: | ||
name: Install Dependencies | ||
command: NODE_ENV=dev yarn | ||
|
||
# Keep cache | ||
- save_cache: | ||
key: yarn-{{ checksum "yarn.lock" }} | ||
paths: | ||
- "node_modules" | ||
|
||
# Test | ||
- run: | ||
name: Tests | ||
command: yarn test && yarn codecov |
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 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_size = 2 | ||
indent_style = space | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
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,30 @@ | ||
module.exports = { | ||
root: true, | ||
parserOptions: { | ||
sourceType: 'module' | ||
}, | ||
env: { | ||
browser: true, | ||
node: true, | ||
jest: true | ||
}, | ||
extends: 'standard', | ||
plugins: [ | ||
'jest', | ||
'vue' | ||
], | ||
rules: { | ||
// Allow paren-less arrow functions | ||
'arrow-parens': 0, | ||
// Allow async-await | ||
'generator-star-spacing': 0, | ||
// Allow debugger during development | ||
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, | ||
// Do not allow console.logs etc... | ||
'no-console': 2 | ||
}, | ||
globals: { | ||
'jest/globals': true, | ||
jasmine: 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,9 @@ | ||
node_modules | ||
*.iml | ||
.idea | ||
*.log* | ||
.nuxt | ||
.vscode | ||
.DS_STORE | ||
coverage | ||
dist |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
MIT License | ||
|
||
Copyright (c) 2017 William DA SILVA | ||
Copyright (c) WilliamDASILVA <[email protected]> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
|
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,41 @@ | ||
# nuxt-facebook-pixel-module | ||
[![npm (scoped with tag)](https://img.shields.io/npm/v/nuxt-facebook-pixel-module/latest.svg?style=flat-square)](https://npmjs.com/package/nuxt-facebook-pixel-module) | ||
[![npm](https://img.shields.io/npm/dt/nuxt-facebook-pixel-module.svg?style=flat-square)](https://npmjs.com/package/nuxt-facebook-pixel-module) | ||
[![CircleCI](https://img.shields.io/circleci/project/github/.svg?style=flat-square)](https://circleci.com/gh/) | ||
[![Codecov](https://img.shields.io/codecov/c/github/.svg?style=flat-square)](https://codecov.io/gh/) | ||
[![Dependencies](https://david-dm.org//status.svg?style=flat-square)](https://david-dm.org/) | ||
[![js-standard-style](https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square)](http://standardjs.com) | ||
|
||
> | ||
[📖 **Release Notes**](./CHANGELOG.md) | ||
|
||
## Features | ||
|
||
The module features | ||
|
||
## Setup | ||
- Add `nuxt-facebook-pixel-module` dependency using yarn or npm to your project | ||
- Add `nuxt-facebook-pixel-module` to `modules` section of `nuxt.config.js` | ||
|
||
```js | ||
{ | ||
modules: [ | ||
// Simple usage | ||
'nuxt-facebook-pixel-module', | ||
|
||
// With options | ||
['nuxt-facebook-pixel-module', { /* module options */ }], | ||
] | ||
} | ||
``` | ||
|
||
## Usage | ||
|
||
Module Description | ||
|
||
## License | ||
|
||
[MIT License](./LICENSE) | ||
|
||
Copyright (c) WilliamDASILVA <[email protected]> |
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,11 @@ | ||
// const { resolve } = require('path') | ||
|
||
module.exports = async function module (moduleOptions) { | ||
// const options = Object.assign({}, moduleOptions) | ||
|
||
// this.addPlugin({ | ||
// src: resolve(__dirname, '../templates/plugin.js'), | ||
// fileName: 'nuxt-facebook-pixel-module.js', | ||
// options | ||
// }) | ||
} |
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 @@ | ||
export default async function ({ router, store }) { | ||
|
||
|
||
} |
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,42 @@ | ||
{ | ||
"name": "nuxt-facebook-pixel-module", | ||
"version": "0.0.0", | ||
"description": "", | ||
"license": "MIT", | ||
"contributors": [ | ||
{ | ||
"name": "WilliamDASILVA <[email protected]>" | ||
} | ||
], | ||
"main": "lib/module.js", | ||
"repository": "https://github.com/", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
"lint": "eslint lib test", | ||
"test": "npm run lint && jest", | ||
"release": "standard-version && git push --follow-tags && npm publish" | ||
}, | ||
"eslintIgnore": [ | ||
"lib/templates/*.*" | ||
], | ||
"files": [ | ||
"lib" | ||
], | ||
"jest": { | ||
"testEnvironment": "node", | ||
"coverageDirectory": "./coverage/", | ||
"collectCoverage": true, | ||
"collectCoverageFrom": [ | ||
"lib", | ||
"test" | ||
] | ||
}, | ||
"dependencies": { | ||
|
||
}, | ||
"devDependencies": { | ||
"nuxt-module-builder": "latest" | ||
} | ||
} |
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,10 @@ | ||
module.exports = { | ||
srcDir: __dirname, | ||
dev: false, | ||
render: { | ||
resourceHints: false | ||
}, | ||
modules: [ | ||
['@@', { /* Module options */ }] | ||
] | ||
} |
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,11 @@ | ||
<template> | ||
<div> | ||
Works! | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
} | ||
</script> |
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,36 @@ | ||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 20000 | ||
process.env.PORT = process.env.PORT || 5060 | ||
process.env.NODE_ENV = 'production' | ||
|
||
const { Nuxt, Builder } = require('nuxt') | ||
const request = require('request-promise-native') | ||
|
||
const config = require('./fixture/nuxt.config') | ||
|
||
const url = path => `http://localhost:${process.env.PORT}${path}` | ||
const get = path => request(url(path)) | ||
|
||
describe('Module', () => { | ||
let nuxt | ||
|
||
beforeAll(async () => { | ||
config.modules.unshift(function () { | ||
// Add test specific test only hooks on nuxt life cycle | ||
}) | ||
|
||
// Build a fresh nuxt | ||
nuxt = new Nuxt(config) | ||
await new Builder(nuxt).build() | ||
await nuxt.listen(process.env.PORT) | ||
}) | ||
|
||
afterAll(async () => { | ||
// Close all opened resources | ||
await nuxt.close() | ||
}) | ||
|
||
test('render', async () => { | ||
let html = await get('/') | ||
expect(html).toContain('Works!') | ||
}) | ||
}) |