Skip to content

Commit 5aa6b06

Browse files
committed
feat: init
0 parents  commit 5aa6b06

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+13205
-0
lines changed

.editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
indent_size = 2
5+
indent_style = space
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

.eslintignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dist
2+
node_modules
3+
coverage
4+
.cache
5+
deprecated

.eslintrc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "@antfu",
3+
"rules": {
4+
"vue/multi-word-component-names": "off",
5+
"vue/component-tags-order": ["error", {
6+
"order": ["template", "script", "style"]
7+
}],
8+
"@typescript-eslint/consistent-type-definitions": ["off"],
9+
"curly": ["error", "all"]
10+
},
11+
"ignorePatterns": ["**/*.md"]
12+
}

.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.DS_Store
2+
.vite-ssg-dist
3+
.vite-ssg-temp
4+
*.local
5+
dist
6+
dist-ssr
7+
node_modules
8+
.idea/
9+
.vscode
10+
*.log
11+
12+
docs

.gitlab-ci.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
stages:
2+
- triggers
3+
4+
library:
5+
stage: triggers
6+
trigger:
7+
include: .gitlab/library.yml
8+
strategy: depend
9+
rules:
10+
- if: $CI_COMMIT_TAG =~ /^v.*$/
11+
12+
nuxt:
13+
stage: triggers
14+
trigger:
15+
include: .gitlab/nuxt.yml
16+
strategy: depend
17+
rules:
18+
- if: $CI_COMMIT_TAG =~ /^nuxt\@.*$/
19+
20+
docs:
21+
stage: triggers
22+
trigger:
23+
include: .gitlab/docs.yml
24+
strategy: depend
25+
rules:
26+
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
27+
changes:
28+
- docs/**/*
29+
- .gitlab/docs.yml

.gitlab/docs.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
workflow:
2+
rules:
3+
- when: always
4+
5+
variables:
6+
ARTIFACT_NAME: ${CI_PROJECT_PATH_SLUG}-docs-${CI_COMMIT_SHORT_SHA}.zip
7+
8+
stages:
9+
- build
10+
- deploy
11+
12+
build_docs:
13+
stage: build
14+
image: node:18-alpine
15+
before_script:
16+
- corepack enable
17+
- corepack prepare pnpm@latest --activate
18+
- pnpm config set store-dir .pnpm-store
19+
- apk add --no-cache zip
20+
script:
21+
- cd docs
22+
- pnpm i --reporter=silent
23+
- pnpm run --reporter=silent generate
24+
- cd .output/public
25+
- zip -r $ARTIFACT_NAME ./*
26+
- mv $ARTIFACT_NAME ../../../
27+
artifacts:
28+
paths:
29+
- $ARTIFACT_NAME
30+
31+
deploy_docs:
32+
stage: deploy
33+
dependencies:
34+
- build_docs
35+
resource_group: deploy_docs
36+
before_script:
37+
- apk add --no-cache aws-cli
38+
script:
39+
- aws s3 cp $ARTIFACT_NAME s3://${AWS_S3_BUCKET}/${ARTIFACT_NAME}
40+
- aws amplify start-deployment --app-id $AWS_AMPLIFY_ID --branch-name $AWS_AMPLIFY_ENV --source-url s3://${AWS_S3_BUCKET}/${ARTIFACT_NAME}

.gitlab/library.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
workflow:
2+
rules:
3+
- when: always
4+
5+
stages:
6+
- publish
7+
8+
publish_library:
9+
stage: publish
10+
image: node:18-alpine
11+
resource_group: publish_library
12+
before_script:
13+
- corepack enable
14+
- corepack prepare pnpm@latest --activate
15+
- pnpm config set store-dir .pnpm-store
16+
script:
17+
- cd packages/vue-notifications
18+
- pnpm i
19+
- pnpm run --reporter=silent build
20+
- echo "@outloud:registry=${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/npm/" >> .npmrc
21+
- echo "//${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=${CI_JOB_TOKEN}" >> .npmrc
22+
- pnpm publish

.gitlab/nuxt.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
workflow:
2+
rules:
3+
- when: always
4+
5+
stages:
6+
- publish
7+
8+
publish_nuxt:
9+
stage: publish
10+
image: node:18-alpine
11+
resource_group: publish_nuxt
12+
before_script:
13+
- corepack enable
14+
- corepack prepare pnpm@latest --activate
15+
- pnpm config set store-dir .pnpm-store
16+
script:
17+
- cd packages/nuxt-notifications
18+
- pnpm i
19+
- echo "@outloud:registry=${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/npm/" >> .npmrc
20+
- echo "//${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=${CI_JOB_TOKEN}" >> .npmrc
21+
- pnpm publish

.npmrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
shamefully-hoist=true
2+
strict-peer-dependencies=false
3+
auto-install-peers=true

.prettierrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"trailingComma": "es5",
3+
"semi": false,
4+
"singleQuote": true,
5+
"useTabs": false,
6+
"quoteProps": "consistent",
7+
"bracketSpacing": true,
8+
"arrowParens": "always",
9+
"printWidth": 100
10+
}

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# @outloud/vue-notifications

package.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"private": true,
3+
"scripts": {
4+
"dev": "concurrently \"pnpm:dev:*\"",
5+
"dev:docs": "pnpm --filter docs dev",
6+
"build:docs": "pnpm --filter docs build",
7+
"generate:docs": "pnpm --filter docs generate",
8+
"dev:library": "pnpm --filter @outloud/vue-notifications dev",
9+
"build:library": "pnpm --filter @outloud/vue-notifications build",
10+
"test:library": "pnpm --filter @outloud/vue-notifications test",
11+
"release:library": "pnpm --filter @outloud/vue-notifications release",
12+
"lint": "eslint . --ext=.ts,.vue --fix",
13+
"typecheck": "pnpm --parallel typecheck",
14+
"prepare:nuxt": "pnpm --filter @outloud/nuxt-notifications dev:prepare && pnpm --filter @outloud/nuxt-notifications prepack",
15+
"postinstall": "pnpm build:library && pnpm prepare:nuxt"
16+
},
17+
"devDependencies": {
18+
"@antfu/eslint-config": "^0.34.1",
19+
"@types/node": "^20.5.1",
20+
"concurrently": "^7.6.0",
21+
"eslint": "^8.32.0",
22+
"prettier": "^3.0.2",
23+
"typescript": "^5.1.6"
24+
}
25+
}
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Dependencies
2+
node_modules
3+
4+
# Logs
5+
*.log*
6+
7+
# Temp directories
8+
.temp
9+
.tmp
10+
.cache
11+
12+
# Yarn
13+
**/.yarn/cache
14+
**/.yarn/*state*
15+
16+
# Generated dirs
17+
dist
18+
19+
# Nuxt
20+
.nuxt
21+
.output
22+
.vercel_build_output
23+
.build-*
24+
.env
25+
.netlify
26+
27+
# Env
28+
.env
29+
30+
# Testing
31+
reports
32+
coverage
33+
*.lcov
34+
.nyc_output
35+
36+
# VSCode
37+
.vscode
38+
39+
# Intellij idea
40+
*.iml
41+
.idea
42+
43+
# OSX
44+
.DS_Store
45+
.AppleDouble
46+
.LSOverride
47+
.AppleDB
48+
.AppleDesktop
49+
Network Trash Folder
50+
Temporary Items
51+
.apdisk

packages/nuxt-notifications/.nuxtrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
imports.autoImport=false
2+
typescript.includeWorkspace=true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"gitlab": {
3+
"release": true,
4+
"releaseName": "nuxt ${version}"
5+
},
6+
"git": {
7+
"tagName": "nuxt@${version}",
8+
"commitMessage": "nuxt@${version}",
9+
"tagAnnotation": "nuxt@${version}",
10+
"requireCleanWorkingDir": false
11+
},
12+
"npm": {
13+
"publish": false
14+
},
15+
"plugins": {
16+
"@release-it/conventional-changelog": {
17+
"preset": "angular",
18+
"infile": "CHANGELOG.md",
19+
"ignoreRecommendedBump": true
20+
}
21+
}
22+
}

packages/nuxt-notifications/CHANGELOG.md

Whitespace-only changes.

packages/nuxt-notifications/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Nuxt Module
2+
3+
## Development
4+
5+
- Run `npm run dev:prepare` to generate type stubs.
6+
- Use `npm run dev` to start [playground](./playground) in development mode.
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "@outloud/nuxt-notifications",
3+
"private": false,
4+
"version": "0.0.1",
5+
"license": "MIT",
6+
"type": "module",
7+
"exports": {
8+
".": {
9+
"import": "./dist/module.mjs",
10+
"require": "./dist/module.cjs"
11+
}
12+
},
13+
"main": "./dist/module.cjs",
14+
"types": "./dist/types.d.ts",
15+
"files": [
16+
"dist"
17+
],
18+
"scripts": {
19+
"prepack": "nuxt-module-build",
20+
"dev": "nuxi dev playground",
21+
"dev:build": "nuxi build playground",
22+
"dev:prepare": "nuxt-module-build --stub && nuxi prepare playground",
23+
"release": "pnpm prepack && release-it"
24+
},
25+
"dependencies": {
26+
"@nuxt/kit": "^3",
27+
"@outloud/vue-notifications": "workspace:*"
28+
},
29+
"devDependencies": {
30+
"@nuxt/module-builder": "^0.2.1",
31+
"@nuxt/schema": "^3",
32+
"@nuxtjs/eslint-config-typescript": "^12.0.0",
33+
"@release-it/conventional-changelog": "^5.1.1",
34+
"nuxt": "^3",
35+
"release-it": "^15.6.0"
36+
}
37+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<template>
2+
<div>
3+
<button type="button" @click="open()">
4+
Open notification
5+
</button>
6+
7+
<ONotificationsContainer />
8+
</div>
9+
</template>
10+
11+
<script setup lang="ts">
12+
import { ONotificationsContainer, useNotifications } from '@outloud/vue-notifications'
13+
14+
const notifications = useNotifications()
15+
16+
function open() {
17+
notifications.open('Test', {
18+
duration: 0,
19+
})
20+
}
21+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { defineNuxtConfig } from 'nuxt/config'
2+
import module from '../src/module'
3+
4+
export default defineNuxtConfig({
5+
modules: [
6+
'nuxt-icon',
7+
[module as any, {
8+
duration: 8000,
9+
}],
10+
],
11+
12+
notifications: {
13+
max: 10,
14+
duration: 6000,
15+
},
16+
17+
})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"private": true,
3+
"name": "my-module-playground",
4+
"type": "module",
5+
"scripts": {
6+
"dev": "nuxi dev",
7+
"build": "nuxi build",
8+
"generate": "nuxi generate"
9+
},
10+
"devDependencies": {
11+
"nuxt": "latest"
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "./.nuxt/tsconfig.json"
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
declare module '@outloud/vue-notifications' {
2+
export interface NotificationManager {
3+
fail: () => void
4+
test: boolean
5+
}
6+
}
7+
8+
export {}

0 commit comments

Comments
 (0)