From ff2ee54abddec472265371cd68e83975bdc724ba Mon Sep 17 00:00:00 2001 From: Pascal Klesse Date: Mon, 15 May 2023 18:10:40 +0200 Subject: [PATCH] rename module --- README.md | 44 ++++++++++++++++++++++---------------------- package-lock.json | 8 ++++---- package.json | 4 ++-- src/module.ts | 24 ++++++++++++------------ 4 files changed, 40 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index e3eb5ca..1ebce91 100644 --- a/README.md +++ b/README.md @@ -2,57 +2,57 @@ Get your module up and running quickly. Find and replace all on all files (CMD+SHIFT+F): -- Name: My Module -- Package name: @lenne.tech/lenne-nuxt-gql +- Name: nuxt-zeus +- Package name: nuxt-zeus - Description: My new Nuxt module --> -# @lenne.tech/lenne-nuxt-gql +# nuxt-zeus [![npm version][npm-version-src]][npm-version-href] [![npm downloads][npm-downloads-src]][npm-downloads-href] [![License][license-src]][license-href] [![Nuxt][nuxt-src]][nuxt-href] -My new Nuxt module for doing amazing things. - - [✨  Release Notes](/CHANGELOG.md) - + +Nuxt 3 module for https://github.com/graphql-editor/graphql-zeus 🚀 + ## Features -- ⛰  Foo -- 🚠  Bar -- 🌲  Baz +- 🚀  Use zeus in nuxt app +- 🚀  Some helper functions for better usage +- 🚀  Completely typed ## Quick Setup -1. Add `@lenne.tech/lenne-nuxt-gql` dependency to your project +1. Add `nuxt-zeus` dependency to your project ```bash # Using pnpm -pnpm add -D @lenne.tech/lenne-nuxt-gql +pnpm add -D nuxt-zeus # Using yarn -yarn add --dev @lenne.tech/lenne-nuxt-gql +yarn add --dev nuxt-zeus # Using npm -npm install --save-dev @lenne.tech/lenne-nuxt-gql +npm install --save-dev nuxt-zeus ``` -2. Add `@lenne.tech/lenne-nuxt-gql` to the `modules` section of `nuxt.config.ts` +2. Add `nuxt-zeus` to the `modules` section of `nuxt.config.ts` ```js export default defineNuxtConfig({ modules: [ - '@lenne.tech/lenne-nuxt-gql' + 'nuxt-zeus' ] }) ``` -That's it! You can now use My Module in your Nuxt app ✨ +That's it! You can now use nuxt-zeus in your Nuxt app ✨ ## Development @@ -81,14 +81,14 @@ npm run release ``` -[npm-version-src]: https://img.shields.io/npm/v/@lenne.tech/lenne-nuxt-gql/latest.svg?style=flat&colorA=18181B&colorB=28CF8D -[npm-version-href]: https://npmjs.com/package/@lenne.tech/lenne-nuxt-gql +[npm-version-src]: https://img.shields.io/npm/v/nuxt-zeus/latest.svg?style=flat&colorA=18181B&colorB=28CF8D +[npm-version-href]: https://npmjs.com/package/nuxt-zeus -[npm-downloads-src]: https://img.shields.io/npm/dm/@lenne.tech/lenne-nuxt-gql.svg?style=flat&colorA=18181B&colorB=28CF8D -[npm-downloads-href]: https://npmjs.com/package/@lenne.tech/lenne-nuxt-gql +[npm-downloads-src]: https://img.shields.io/npm/dm/nuxt-zeus.svg?style=flat&colorA=18181B&colorB=28CF8D +[npm-downloads-href]: https://npmjs.com/package/nuxt-zeus -[license-src]: https://img.shields.io/npm/l/@lenne.tech/lenne-nuxt-gql.svg?style=flat&colorA=18181B&colorB=28CF8D -[license-href]: https://npmjs.com/package/@lenne.tech/lenne-nuxt-gql +[license-src]: https://img.shields.io/npm/l/nuxt-zeus.svg?style=flat&colorA=18181B&colorB=28CF8D +[license-href]: https://npmjs.com/package/nuxt-zeus [nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt.js [nuxt-href]: https://nuxt.com diff --git a/package-lock.json b/package-lock.json index f3ba7a5..53ea1c6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { - "name": "@lenne.tech/lenne-nuxt-gql", - "version": "1.0.3", + "name": "nuxt-zeus", + "version": "1.0.4", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "@lenne.tech/lenne-nuxt-gql", - "version": "1.0.3", + "name": "nuxt-zeus", + "version": "1.0.4", "license": "MIT", "dependencies": { "@nuxt/kit": "^3.4.3", diff --git a/package.json b/package.json index 7ea48c0..689b826 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "@lenne.tech/lenne-nuxt-gql", - "version": "1.0.3", + "name": "nuxt-zeus", + "version": "1.0.4", "description": "Nuxt graphql module of @lenne.tech", "repository": "https://github.com/lenneTech/lenne-nuxt-gql", "license": "MIT", diff --git a/src/module.ts b/src/module.ts index 76bef30..c254b6a 100644 --- a/src/module.ts +++ b/src/module.ts @@ -1,11 +1,11 @@ -import { defineNuxtModule, createResolver, addImportsDir, addTemplate, useLogger } from '@nuxt/kit' -import { TreeToTS } from 'graphql-zeus-core'; +import { addImportsDir, addTemplate, createResolver, defineNuxtModule, useLogger } from '@nuxt/kit'; +import { defu } from 'defu'; import { Parser } from 'graphql-js-tree'; -import { readFileSync } from 'node:fs' -import { defu } from 'defu' +import { TreeToTS } from 'graphql-zeus-core'; +import { readFileSync } from 'node:fs'; // TODO: replace when es-module error is fixed -import { Utils } from './zeus_utils' -const logger = useLogger("[@lenne.tech/zeus] "); +import { Utils } from './zeus_utils'; +const logger = useLogger("[nuxt-zeus] "); export interface ModuleOptions { /** @@ -26,7 +26,7 @@ export interface ModuleOptions { export default defineNuxtModule({ meta: { - name: '@lenne.tech/lenne-nuxt-gql', + name: 'nuxt-zeus', configKey: 'zeus' }, // Default configuration options of the Nuxt module @@ -38,7 +38,7 @@ export default defineNuxtModule({ const { resolve } = createResolver(import.meta.url) if (!options.host) { - throw new Error('[@lenne.tech/zeus]: Host must be provided, in module config!') + throw new Error('[nuxt-zeus]: Host must be provided, in module config!') } nuxt.options.runtimeConfig.public.zeus = defu(nuxt.options.runtimeConfig.public.zeus, { @@ -55,14 +55,14 @@ export default defineNuxtModule({ if (options.pathToSchema) { if (options.pathToSchema && options.pathToSchema.startsWith('http')) { - logger.success("[@lenne.tech/zeus] custom remote schema path will be used"); + logger.success("[nuxt-zeus] custom remote schema path will be used"); schemaFileContents = await Utils.getFromUrl(options.pathToSchema) } else { - logger.success("[@lenne.tech/zeus] local schema will be used"); + logger.success("[nuxt-zeus] local schema will be used"); schemaFileContents = readFileSync(resolve(options.pathToSchema), 'utf8') } } else { - logger.success("[@lenne.tech/zeus] host will be used as schema path"); + logger.success("[nuxt-zeus] host will be used as schema path"); schemaFileContents = await Utils.getFromUrl(options.host) } @@ -74,7 +74,7 @@ export default defineNuxtModule({ ), }); - logger.success("[@lenne.tech/zeus] Generated zeus/index.ts"); + logger.success("[nuxt-zeus] Generated zeus/index.ts"); nuxt.options.alias['#zeus'] = resolve(nuxt.options.buildDir, 'zeus') nuxt.options.alias['#zeus/*'] = resolve(nuxt.options.buildDir, 'zeus', '*')