nuxt-modern-cropper 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,77 @@
1
+ # Nuxt Modern Cropper
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
+ Power-packed wrapper over cropperjs@next.
9
+
10
+ This package is just a module wrapper over [vue-modern-cropper](https://github.com/NamesMT/vue-modern-cropper), for more information check it's repo.
11
+ <!-- - [📖 &nbsp;Documentation](https://example.com) -->
12
+
13
+ ## Installation
14
+
15
+ Install the package
16
+ ```bash
17
+ pnpm add -D nuxt-modern-cropper
18
+ ```
19
+
20
+ Add `nuxt-modern-cropper` to your Nuxt config file:
21
+
22
+ ```ts
23
+ // nuxt.config.ts
24
+ export default defineNuxtConfig({
25
+ modules: [
26
+ 'nuxt-modern-cropper',
27
+ ],
28
+ })
29
+ ```
30
+
31
+ That's it! You can now use `<ModernCropper />` in your Nuxt app ✨
32
+
33
+
34
+ ## Contribution
35
+
36
+ <details>
37
+ <summary>Local development</summary>
38
+
39
+ ```bash
40
+ # Install dependencies
41
+ npm install
42
+
43
+ # Generate type stubs
44
+ npm run dev:prepare
45
+
46
+ # Develop with the playground
47
+ npm run dev
48
+
49
+ # Build the playground
50
+ npm run dev:build
51
+
52
+ # Run ESLint
53
+ npm run lint
54
+
55
+ # Run Vitest
56
+ npm run test
57
+ npm run test:watch
58
+
59
+ # Release new version
60
+ npm run release
61
+ ```
62
+
63
+ </details>
64
+
65
+
66
+ <!-- Badges -->
67
+ [npm-version-src]: https://img.shields.io/npm/v/nuxt-modern-cropper/latest.svg?style=flat&colorA=020420&colorB=00DC82
68
+ [npm-version-href]: https://npmjs.com/package/nuxt-modern-cropper
69
+
70
+ [npm-downloads-src]: https://img.shields.io/npm/dm/nuxt-modern-cropper.svg?style=flat&colorA=020420&colorB=00DC82
71
+ [npm-downloads-href]: https://npmjs.com/package/nuxt-modern-cropper
72
+
73
+ [license-src]: https://img.shields.io/npm/l/nuxt-modern-cropper.svg?style=flat&colorA=020420&colorB=00DC82
74
+ [license-href]: https://npmjs.com/package/nuxt-modern-cropper
75
+
76
+ [nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt.js
77
+ [nuxt-href]: https://nuxt.com
@@ -0,0 +1,5 @@
1
+ module.exports = function(...args) {
2
+ return import('./module.mjs').then(m => m.default.call(this, ...args))
3
+ }
4
+ const _meta = module.exports.meta = require('./module.json')
5
+ module.exports.getMeta = () => Promise.resolve(_meta)
@@ -0,0 +1,7 @@
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
+
3
+ interface ModuleOptions {
4
+ }
5
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
6
+
7
+ export { type ModuleOptions, _default as default };
@@ -0,0 +1,7 @@
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
+
3
+ interface ModuleOptions {
4
+ }
5
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
6
+
7
+ export { type ModuleOptions, _default as default };
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "nuxt-modern-cropper",
3
+ "configKey": "modernCropper",
4
+ "version": "0.1.1"
5
+ }
@@ -0,0 +1,18 @@
1
+ import { defineNuxtModule, createResolver, addPlugin } from '@nuxt/kit';
2
+
3
+ const module = defineNuxtModule({
4
+ meta: {
5
+ name: "nuxt-modern-cropper",
6
+ configKey: "modernCropper"
7
+ },
8
+ defaults: {},
9
+ setup(options, nuxt) {
10
+ const resolver = createResolver(import.meta.url);
11
+ addPlugin({
12
+ src: resolver.resolve("./runtime/plugin"),
13
+ mode: "client"
14
+ });
15
+ }
16
+ });
17
+
18
+ export { module as default };
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import { defineNuxtPlugin } from "#app";
2
+ import { ModernCropper } from "vue-modern-cropper";
3
+ export default defineNuxtPlugin((nuxtApp) => {
4
+ nuxtApp.vueApp.component("ModernCropper", ModernCropper);
5
+ });
@@ -0,0 +1,16 @@
1
+
2
+ import type { ModuleOptions } from './module.js'
3
+
4
+
5
+ declare module '@nuxt/schema' {
6
+ interface NuxtConfig { ['modernCropper']?: Partial<ModuleOptions> }
7
+ interface NuxtOptions { ['modernCropper']?: ModuleOptions }
8
+ }
9
+
10
+ declare module 'nuxt/schema' {
11
+ interface NuxtConfig { ['modernCropper']?: Partial<ModuleOptions> }
12
+ interface NuxtOptions { ['modernCropper']?: ModuleOptions }
13
+ }
14
+
15
+
16
+ export type { ModuleOptions, default } from './module.js'
@@ -0,0 +1,16 @@
1
+
2
+ import type { ModuleOptions } from './module'
3
+
4
+
5
+ declare module '@nuxt/schema' {
6
+ interface NuxtConfig { ['modernCropper']?: Partial<ModuleOptions> }
7
+ interface NuxtOptions { ['modernCropper']?: ModuleOptions }
8
+ }
9
+
10
+ declare module 'nuxt/schema' {
11
+ interface NuxtConfig { ['modernCropper']?: Partial<ModuleOptions> }
12
+ interface NuxtOptions { ['modernCropper']?: ModuleOptions }
13
+ }
14
+
15
+
16
+ export type { ModuleOptions, default } from './module'
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "nuxt-modern-cropper",
3
+ "version": "0.1.1",
4
+ "description": "Power-packed wrapper over cropperjs@next",
5
+ "repository": "namesmt/nuxt-modern-cropper",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/types.d.ts",
11
+ "import": "./dist/module.mjs",
12
+ "require": "./dist/module.cjs"
13
+ }
14
+ },
15
+ "main": "./dist/module.cjs",
16
+ "types": "./dist/types.d.ts",
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "dependencies": {
21
+ "@nuxt/kit": "^3.11.1",
22
+ "vue-modern-cropper": "0.x"
23
+ },
24
+ "devDependencies": {
25
+ "@nuxt/devtools": "latest",
26
+ "@nuxt/eslint-config": "^0.2.0",
27
+ "@nuxt/module-builder": "^0.5.5",
28
+ "@nuxt/schema": "^3.11.1",
29
+ "@nuxt/test-utils": "^3.12.0",
30
+ "@types/node": "^20.11.29",
31
+ "changelogen": "^0.5.5",
32
+ "eslint": "^8.57.0",
33
+ "nuxt": "^3.11.1",
34
+ "vitest": "^1.4.0"
35
+ },
36
+ "scripts": {
37
+ "dev": "nuxi dev playground",
38
+ "dev:build": "nuxi build playground",
39
+ "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
40
+ "release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
41
+ "lint": "eslint .",
42
+ "test": "vitest run",
43
+ "test:watch": "vitest watch"
44
+ }
45
+ }