Git Product home page Git Product logo

module-template's Introduction


↪️ Deprecated: Please migrate to new Starter Template using Module Builder


Module Template for Nuxt.js

Nuxt.js module template

Features

  • ESLint
  • Ready tests using Jest
  • Code coverage
  • Github Actions
  • Standard Version

Create a Nuxt Module

This is a template for vue-cli. Make sure to use a version of vue-cli >= 2.1 (vue -V) is installed. If you don't already have it, just install it.

npx @vue/cli init nuxt-community/module-template <module-name>
cd <module-name>
yarn install # or npm install

Then, just head to Modules Guide for more help.

Development

For easier development you can use yarn link or npm link to link to your project.

Then start build using npm run dev.

Publishing

npm run release

Getting known

Don't forget to:

  1. Add nuxt-module Github topic
  2. Submit a PR in awesome-nuxt when your module was ready ;)
  3. Mention us when you have your first release on our Twitter (@nuxt_js)

Licenses

module-template's People

Contributors

ahalimkara avatar atinux avatar bingtimren avatar clarkdo avatar devcrossnet avatar pi0 avatar renovate[bot] avatar ricardogobbosouza avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

module-template's Issues

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper integration’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

This question is available on Nuxt.js community (#c1)

Improved Template

We are working on a new template

  • Remove requirement of using vue-cli to scaffold first version
  • Use github template system to simply fork
  • Use typescript and build system
  • Add docs template
    • This needs rework to render on https://modules.nuxtjs.org since deployment of one website per module is not a scalable solution and currently requires manual steps to generate banner meanwhile we shall fallback to readme
  • Update example to work with typescript with yarn dev (siroc needs alias support)
  • Use nuxt/test-utils
    • test/fixture
  • Use nuxt/kit (module utils) (postponed)
  • New starter guide (requirements, places to update after fork or a simple script to do)
  • types/ for runtime types
  • Lintable/Typed runtime
  • Update/Fix actions

Postponed:

  • Using nuxt/kit for meta and config
  • Docs compatible with modules.nuxtjs.org
  • Scaffold with nuxt module create (new nuxt-cli)
  • Announcing to update existing nuxt-community modules to adopt new structure

Requirements

Could someone also add the following requirements for the vue/cli to work:

yarn global add @vue/cli @vue/cli-init

Template doesn't compile

Tried to use template. Doesn't run when using without any changes after

npx vue-cli init nuxt-community/module-template test-module
cd test-module
npm i
npm run dev

Output is:

  ╭─────────────────────────────────────────╮
   │                                         │
   │   Nuxt.js @ v2.14.0-26582020.6ab65fbf   │
   │                                         │
   │   ▸ Environment: development            │
   │   ▸ Rendering:   server-side            │
   │   ▸ Target:      server                 │
   │                                         │
   │   Listening: http://localhost:3000/     │
   │                                         │
   ╰─────────────────────────────────────────╯

ℹ Preparing project for development                                                                                                      15:01:06
ℹ Initial build may take a while                                                                                                         15:01:06
✔ Builder initialized                                                                                                                    15:01:06
✔ Nuxt files generated                                                                                                                   15:01:06

✖ Client
  Compiled with some errors in 4.64s

✔ Server
  Compiled successfully in 3.87s


 ERROR  Failed to compile with 40 errors                                                                                 friendly-errors 15:01:12

These dependencies were not found:                                                                                       friendly-errors 15:01:12
                                                                                                                         friendly-errors 15:01:12
* core-js/modules/es6.array.find in ./example/.nuxt/client.js                                                            friendly-errors 15:01:12
* core-js/modules/es6.array.from in ./example/.nuxt/client.js, ./example/.nuxt/components/nuxt-link.client.js            friendly-errors 15:01:12
* core-js/modules/es6.array.iterator in ./example/.nuxt/client.js                                                        friendly-errors 15:01:12
* core-js/modules/es6.date.to-string in ./example/.nuxt/client.js, ./example/.nuxt/components/nuxt-link.client.js        friendly-errors 15:01:12
* core-js/modules/es6.function.name in ./example/.nuxt/client.js, ./example/.nuxt/components/nuxt-link.client.js         friendly-errors 15:01:12
* core-js/modules/es6.object.assign in ./example/.nuxt/client.js                                                         friendly-errors 15:01:12
* core-js/modules/es6.object.keys in ./example/.nuxt/client.js                                                           friendly-errors 15:01:12
* core-js/modules/es6.object.to-string in ./example/.nuxt/client.js, ./example/.nuxt/components/nuxt-link.client.js and 1 other
* core-js/modules/es6.promise in ./example/.nuxt/client.js                                                               friendly-errors 15:01:12
* core-js/modules/es6.regexp.constructor in ./example/.nuxt/utils.js                                                     friendly-errors 15:01:12
* core-js/modules/es6.regexp.match in ./example/.nuxt/client.js                                                          friendly-errors 15:01:12
* core-js/modules/es6.regexp.replace in ./example/.nuxt/utils.js, ./example/.nuxt/components/nuxt.js                     friendly-errors 15:01:12
* core-js/modules/es6.regexp.search in ./example/.nuxt/utils.js                                                          friendly-errors 15:01:12
* core-js/modules/es6.regexp.split in ./example/.nuxt/utils.js, ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./example/.nuxt/components/nuxt-build-indicator.vue?vue&type=script&lang=js&
* core-js/modules/es6.regexp.to-string in ./example/.nuxt/client.js, ./example/.nuxt/components/nuxt-link.client.js      friendly-errors 15:01:12
* core-js/modules/es6.string.ends-with in ./example/.nuxt/utils.js                                                       friendly-errors 15:01:12
* core-js/modules/es6.string.includes in ./example/.nuxt/client.js, ./example/.nuxt/components/nuxt-link.client.js       friendly-errors 15:01:12
* core-js/modules/es6.string.iterator in ./example/.nuxt/client.js, ./example/.nuxt/components/nuxt-link.client.js       friendly-errors 15:01:12
* core-js/modules/es6.string.repeat in ./example/.nuxt/utils.js                                                          friendly-errors 15:01:12
* core-js/modules/es6.string.starts-with in ./example/.nuxt/utils.js                                                     friendly-errors 15:01:12
* core-js/modules/es6.symbol in ./example/.nuxt/client.js, ./example/.nuxt/components/nuxt-link.client.js                friendly-errors 15:01:12
* core-js/modules/es7.array.includes in ./example/.nuxt/client.js, ./example/.nuxt/components/nuxt-link.client.js        friendly-errors 15:01:12
* core-js/modules/es7.object.get-own-property-descriptors in ./example/.nuxt/index.js                                    friendly-errors 15:01:12
* core-js/modules/es7.promise.finally in ./example/.nuxt/client.js                                                       friendly-errors 15:01:12
* core-js/modules/es7.symbol.async-iterator in ./example/.nuxt/client.js, ./example/.nuxt/components/nuxt-link.client.js friendly-errors 15:01:12
* core-js/modules/web.dom.iterable in ./example/.nuxt/client.js, ./example/.nuxt/components/nuxt-link.client.js          friendly-errors 15:01:12
                                                                                                                         friendly-errors 15:01:12
To install them, you can run: npm install --save core-js/modules/es6.array.find core-js/modules/es6.array.from core-js/modules/es6.array.iterator core-js/modules/es6.date.to-string core-js/modules/es6.function.name core-js/modules/es6.object.assign core-js/modules/es6.object.keys core-js/modules/es6.object.to-string core-js/modules/es6.promise core-js/modules/es6.regexp.constructor core-js/modules/es6.regexp.match core-js/modules/es6.regexp.replace core-js/modules/es6.regexp.search core-js/modules/es6.regexp.split core-js/modules/es6.regexp.to-string core-js/modules/es6.string.ends-with core-js/modules/es6.string.includes core-js/modules/es6.string.iterator core-js/modules/es6.string.repeat core-js/modules/es6.string.starts-with core-js/modules/es6.symbol core-js/modules/es7.array.includes core-js/modules/es7.object.get-own-property-descriptors core-js/modules/es7.promise.finally core-js/modules/es7.symbol.async-iterator core-js/modules/web.dom.iterable
ℹ Waiting for file changes                                                                                                               15:01:12
ℹ Memory usage: 213 MB (RSS: 291 MB)                                                                                                     15:01:12
ℹ Listening on: http://localhost:3000/                                                                                                   15:01:12

Dependency Dashboard

This issue provides visibility into Renovate updates and their statuses. Learn more

This repository currently has no open or pending branches.

Detected dependencies

npm
package.json
template/package.json
  • @babel/core latest
  • @babel/preset-env latest
  • @commitlint/cli latest
  • @commitlint/config-conventional latest
  • @nuxtjs/eslint-config latest
  • @nuxtjs/module-test-utils latest
  • babel-eslint latest
  • babel-jest latest
  • eslint latest
  • husky latest
  • jest latest
  • nuxt-edge latest
  • standard-version latest

  • Check this box to trigger a request for Renovate to run again on this repository

Is this project still active?

What is the status of this template? Is still up-to-date, can it be used to start a new module project with current standards?

Question about import a component

Hello,

I'm working in a nuxt-module using this template, on this module I have some components that will be imported on the nuxt-project.

I have added the components using the addTemplate, but once I try to import it, it's returning that the This dependency was not found:

Have someone an example how to do it?

The file is available on .nuxt and also on the node_modules.

image

Installation error

Error installing module template.

Command:
$ vue init nuxt-community/module-template newModule

Console output:
vue-cli · [.github\workflows\ci.yml] Parse error on line 32: ...ix.node }}-deps-${{ hashFiles(format('{0 -----------------------^ Expecting 'ID', 'STRING', 'NUMBER', 'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', got 'INVALID'

How to import a file from root project in nuxt-module?

Hello All,

I'm developing a nuxt-module using this template base, but I'm with a question:

How to import a file for example: file.config.js, that will be in the same folder position as nuxt.config.js.

The main idea is to import components on this file.config.js and be able to use it on as replacements from to the default components on my nuxt-module.

I want to do that because when I import vue components on my nuxt.config.js to send as properties to nuxt-module didn't works (error bellow):

Has someone a hint how to do that?

 FATAL  Unexpected token '<'                                                                                               16:27:12

  <template>
  ^
  
  SyntaxError: Unexpected token '<'
  at wrapSafe (internal/modules/cjs/loader.js:1001:16)
  at Module._compile (internal/modules/cjs/loader.js:1049:27)
  at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
  at Module.load (internal/modules/cjs/loader.js:950:32)
  at Function.Module._load (internal/modules/cjs/loader.js:790:14)
  at Module.require (internal/modules/cjs/loader.js:974:19)
  at require (internal/modules/cjs/helpers.js:92:18)
  at g (node_modules/jiti/dist/jiti.js:1:54280)
  at src/pageeditor/modules/index.js:1:199
  at g (node_modules/jiti/dist/jiti.js:1:55111)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.