Skip to content
Julien edited this page Mar 2, 2023 · 9 revisions

You wish to contribute to vue-sections

  1. Please fork the project
  2. npm install to install node modules (⚠️ if you are using npm v7, run npm i --legacy-peer-deps to avoid loading peer deps)
  3. npm run build to build the library using rollup
  4. npm pack to generate a tarball similar to what gets uploaded to npmjs

Setting up a new host project to include the library in dev

To test the library you should create a new vue project and set it up:

  1. vue.config.js:
    module.exports = {
        devServer: {
            host: 'url of your project on sections.geeks.solutions/login',
            https: true
        },
        chainWebpack: config => config.resolve.symlinks(false)
    };
    
  2. package.json
    dependencies:{
        "vue-sections": "file://{local_path_of_your_vue_section_tarball_generated_on_step_4_above}"
    }
    
    Note: Make sure to run the following command after this adjustment npm install
  3. Library setup
    Follow the setup instruction on Readme.
    Then make sure to have the library point to Sections' test URL.
    You do that by supplying the following option to the Vue.use instruction: environment: testing (note: the type of the string is important, some dev reported that providing it as "testing" didn't work and they had to load it from an env. variable, i.e app.$env.YOUR_VAR_NAME in a nuxt project)
  4. config
    If you want to make adjustments on how project specific components are handled by the library, following the setup to configure the config folder and put components there

Updating the library and testing your changes

Then as you are editing the codebase of the library, you have to repeat the following steps:

On the library

  1. npm run build
  2. npm pack on the library to generate a new tarball

On the host project

  1. rm -rf @geeks-solutions/vue-sections at the root of the host project, to remove the unpacked library
  2. Delete the entry for @geeks-solutions/vue-sections in the package-lock.json
  3. npm install to download the new tarball and install it afresh

Then you can test your changes in the host project

Publish a new version of the library

If you are working on the publication of the library on npm, keep in mind to always run run build before publishing

npm run build
npm publish