Skip to content

Commit 45855c0

Browse files
committed
move from github.com/bcms/utils
0 parents  commit 45855c0

36 files changed

Lines changed: 28552 additions & 0 deletions

.editorconfig

Lines changed: 12 additions & 0 deletions
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

.github/workflows/ci.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: 20
21+
22+
- run: npm i -g --force corepack@latest && corepack enable
23+
24+
- name: Install dependencies
25+
run: npx nypm@latest i
26+
27+
- name: Lint
28+
run: npm run lint
29+
30+
test:
31+
runs-on: ubuntu-latest
32+
33+
steps:
34+
- uses: actions/checkout@v4
35+
36+
- uses: actions/setup-node@v4
37+
with:
38+
node-version: 20
39+
40+
- run: npm i -g --force corepack@latest && corepack enable
41+
42+
- name: Install dependencies
43+
run: npx nypm@latest i
44+
45+
- name: Playground prepare
46+
run: npm run dev:prepare
47+
48+
- name: Test
49+
run: npm run test

.gitignore

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Dependencies
2+
node_modules
3+
4+
# BCMS
5+
/bcms
6+
7+
# Logs
8+
*.log*
9+
10+
# Temp directories
11+
.temp
12+
.tmp
13+
.cache
14+
15+
# Yarn
16+
**/.yarn/cache
17+
**/.yarn/*state*
18+
19+
# Generated dirs
20+
dist
21+
22+
# Nuxt
23+
.nuxt
24+
.output
25+
.data
26+
.vercel_build_output
27+
.build-*
28+
.netlify
29+
30+
# Env
31+
.env
32+
33+
# Testing
34+
reports
35+
coverage
36+
*.lcov
37+
.nyc_output
38+
39+
# VSCode
40+
.vscode/*
41+
!.vscode/settings.json
42+
!.vscode/tasks.json
43+
!.vscode/launch.json
44+
!.vscode/extensions.json
45+
!.vscode/*.code-snippets
46+
47+
# Intellij idea
48+
*.iml
49+
.idea
50+
51+
# OSX
52+
.DS_Store
53+
.AppleDouble
54+
.LSOverride
55+
.AppleDB
56+
.AppleDesktop
57+
Network Trash Folder
58+
Temporary Items
59+
.apdisk

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
shamefully-hoist=true
2+
strict-peer-dependencies=false

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"printWidth": 80,
5+
"trailingComma": "all"
6+
}

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"eslint.experimental.useFlatConfig": true
3+
}

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Changelog
2+
3+
4+
## v1.0.1
5+
6+
7+
### 🩹 Fixes
8+
9+
- Import Buffer ([a9dcdd5](https://github.com/your-org/my-module/commit/a9dcdd5))
10+
- Package name ([c9ddb7e](https://github.com/your-org/my-module/commit/c9ddb7e))
11+
- NodeParser JSX return ([2b1b27a](https://github.com/your-org/my-module/commit/2b1b27a))
12+
- NodeParser value check ([1c4d34d](https://github.com/your-org/my-module/commit/1c4d34d))
13+
- Instance check for pulling data ([3b2d21f](https://github.com/your-org/my-module/commit/3b2d21f))
14+
- Config import path ([4a546da](https://github.com/your-org/my-module/commit/4a546da))
15+
- Import path on win32 ([a0e6a16](https://github.com/your-org/my-module/commit/a0e6a16))
16+
17+
### ❤️ Contributors
18+
19+
- Bbanez <banezprod@gmail.com>
20+

README.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Nuxt BCMS
2+
3+
[![npm version][npm-version-src]][npm-version-href]
4+
[![npm downloads][npm-downloads-src]][npm-downloads-href]
5+
[![License][license-src]][license-href]
6+
[![Nuxt][nuxt-src]][nuxt-href]
7+
8+
[BCMS](https://thebcms.com) integration for [Nuxt](https://nuxt.com).
9+
10+
- [&nbsp;Release Notes](CHANGELOG.md)
11+
- [📖 &nbsp;Documentation](https://thebcms.com/docs/integrations/nuxt-js)
12+
13+
## Features
14+
15+
- Seamless integration with BCMS
16+
- Out of the box components for rendering BCMS Images and content
17+
- Automatic TypeScript types generation from your BCMS
18+
- Easy access to BCMS Client API on server and client side
19+
- Support for Private and Public API Keys
20+
21+
## Quick Setup
22+
23+
Install the module to your Nuxt application with one command:
24+
25+
```bash
26+
npx nuxi module add bcms
27+
```
28+
29+
Then in your `nuxt.config.ts` file, add BCMS configuration. You can find
30+
configuration information on BCMS dashboard in the `API Keys` section.
31+
32+
```ts
33+
export default defineNuxtConfig({
34+
modules: ['@nuxtjs/bcms'],
35+
// ...
36+
bcms: {
37+
orgId: process.env.BCMS_ORG_ID,
38+
instanceId: process.env.BCMS_INSTANCE_ID,
39+
privateClientOptions: {
40+
key: {
41+
id: process.env.BCMS_PRIVATE_KEY_ID,
42+
secret: process.env.BCMS_PRIVATE_KEY_SECRET,
43+
},
44+
options: {
45+
injectSvg: true,
46+
},
47+
},
48+
publicClientOptions: {
49+
key: {
50+
id: process.env.BCMS_PUBLIC_KEY_ID,
51+
secret: process.env.BCMS_PUBLIC_KEY_SECRET,
52+
},
53+
options: {
54+
injectSvg: true,
55+
},
56+
},
57+
},
58+
});
59+
```
60+
61+
That's it! You can now use BCMS in your Nuxt app ✨
62+
63+
For more information on how to use BCMS with Nuxt, check out the
64+
[documentation](https://thebcms.com/docs/integrations/nuxt-js).
65+
66+
## Contribution
67+
68+
<details>
69+
<summary>Local development</summary>
70+
71+
```bash
72+
# Install dependencies
73+
npm install
74+
75+
# Generate type stubs
76+
77+
npm run dev:prepare
78+
79+
# Develop with the playground
80+
81+
npm run dev
82+
83+
# Build the playground
84+
85+
npm run dev:build
86+
87+
# Run ESLint
88+
89+
npm run lint
90+
91+
# Run Vitest
92+
93+
npm run test
94+
npm run test:watch
95+
96+
# Release new version
97+
98+
npm run release
99+
100+
```
101+
102+
</details>
103+
104+
<!-- Badges -->
105+
106+
[npm-version-src]: https://img.shields.io/npm/v/@nuxtjs/bcms/latest.svg?style=flat&colorA=020420&colorB=00DC82
107+
[npm-version-href]: https://npmjs.com/package/@nuxtjs/bcms
108+
[npm-downloads-src]: https://img.shields.io/npm/dm/@nuxtjs/bcms.svg?style=flat&colorA=020420&colorB=00DC82
109+
[npm-downloads-href]: https://npm.chart.dev/@nuxtjs/bcms
110+
[license-src]: https://img.shields.io/npm/l/@nuxtjs/bcms.svg?style=flat&colorA=020420&colorB=00DC82
111+
[license-href]: https://npmjs.com/package/@nuxtjs/bcms
112+
[nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt.js
113+
[nuxt-href]: https://nuxt.com
114+
```

eslint.config.mjs

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import { createConfigForNuxt } from '@nuxt/eslint-config/flat';
2+
3+
// Run `npx @eslint/config-inspector` to inspect the resolved config interactively
4+
export default createConfigForNuxt({
5+
features: {
6+
// Rules for module authors
7+
tooling: true,
8+
// Rules for formatting
9+
stylistic: true,
10+
},
11+
dirs: {
12+
src: ['./playground'],
13+
},
14+
}).append(
15+
// your custom flat config here...
16+
{
17+
rules: {
18+
// '@typescript-eslint/explicit-module-boundary-types': 'off',
19+
'no-shadow': 'error',
20+
'no-unused-labels': 'warn',
21+
'no-unused-expressions': 'warn',
22+
'no-duplicate-imports': 'off',
23+
'no-console': 'off',
24+
// 'no-console': ['error', { allow: ['warn', 'error', 'debug'] }],
25+
'no-debugger': 'warn',
26+
'@stylistic/indent': ['off', 4],
27+
'@stylistic/semi': ['warn', 'always'],
28+
'@stylistic/operator-linebreak': ['off'],
29+
'@stylistic/jsx-one-expression-per-line': ['off'],
30+
'@stylistic/member-delimiter-style': [
31+
'warn',
32+
{ multiline: { delimiter: 'semi' } },
33+
],
34+
'@stylistic/brace-style': ['warn', '1tbs'],
35+
'@stylistic/quote-props': ['off'],
36+
'@typescript-eslint/no-shadow': 'error',
37+
'@typescript-eslint/no-explicit-any': 'off',
38+
// '@typescript-eslint/consistent-type-imports': 'error',
39+
// '@typescript-eslint/no-unused-vars': [
40+
// 2,
41+
// {
42+
// args: 'all',
43+
// argsIgnorePattern: '^_',
44+
// varsIgnorePattern: '^_',
45+
// caughtErrors: 'none',
46+
// caughtErrorsIgnorePattern: '^_',
47+
// },
48+
// ],
49+
},
50+
},
51+
);

nuxt.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// https://nuxt.com/docs/api/configuration/nuxt-config
2+
export default defineNuxtConfig({
3+
modules: ['@nuxt/eslint', '@nuxt/test-utils'],
4+
});

0 commit comments

Comments
 (0)