Skip to content

Commit

Permalink
chore: init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
DanSnow committed Mar 13, 2023
0 parents commit 6112dba
Show file tree
Hide file tree
Showing 35 changed files with 5,384 additions and 0 deletions.
132 changes: 132 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
### Node
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# vue-advertising

## Usage

### How to set advertising

1. Create a `GPT` config

```
const gptConfig = {
slots: [
{
id: 'banner-ad',
path: '/6355419/Travel/Europe/France/Paris',
sizes: [[300, 250]],
},
],
usePrebid: false,
useAPS: false,
customEvents: {
blueBackground: {
eventMessagePrefix: 'BlueBackground:',
},
},
}
```

2. Wrap the entire area that you want to display ad with `AdvertisingProvider` to provide the config

```
<template>
<AdvertisingProvider :config="gptConfig">
...
</AdvertisingProvider>
</template>
```

3. Place `AdvertisingSlot` to the position that you want to insert ad inside `AdvertisingProvider`

```html
<AdvertisingSlot id="banner-ad" :is-sticky="true" />
```

4. You will see advertise appear


### Preload the advertising

Use `GlobalAdvertisingProvider` and `GlobalAdvertisingSlot`, ads can be loaded as fast as possible (need to use `@vueuse/head` or `@unhead/vue` to preload the script)

## Credits

- @KijijiCA - original [react-advertising](https://github.com/KijijiCA/react-advertising)
- @ches4117 - rewrite react-advertising to vue-advertising
6 changes: 6 additions & 0 deletions build.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { defineBuildConfig } from 'unbuild'

export default defineBuildConfig({
entries: [{ input: 'src/', outDir: 'dist/' }],
declaration: true,
})
48 changes: 48 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"name": "@storipress/vue-advertising",
"version": "1.0.2",
"repository": "git@github.com:storipress/framework-scaffolding.git",
"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
"type": "module",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs"
}
},
"scripts": {
"build": "unbuild",
"test": "vitest",
"prepack": "yarn build"
},
"files": [
"dist/**/*",
"!dist/**/*.test.d.ts",
"!dist/**/*.test.mjs",
"!dist/**/__snapshots__/**"
],
"publishConfig": {
"access": "restricted"
},
"dependencies": {
"@guanghechen/fast-deep-equal": "^2.2.4",
"@vueuse/core": "^9.13.0",
"vue3-lazy-hydration": "^1.2.1"
},
"peerDependencies": {
"vue": "^3.0.0"
},
"packageManager": "yarn@3.2.4",
"devDependencies": {
"@unhead/vue": "^1.1.22",
"happy-dom": "^8.9.0",
"sass": "^1.59.2",
"typescript": "^4.9.5",
"unbuild": "^1.1.2",
"vite": "^4.1.4",
"vitest": "^0.29.2",
"vue": "^3.2.47"
}
}
2 changes: 2 additions & 0 deletions src/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.test.js
__snapshots__
Loading

0 comments on commit 6112dba

Please sign in to comment.