Repository navigation
best way to share custom components #90
Description
Activity
yes, writing a codedoc plugin for easy consumption of the component, and publishing it on NPM. I guess we should also add a page to the docs somewhere for community plugins now, so would appreciate if you would mention the final plugin here as well.
- addedenhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requestedand removedenhancementNew feature or requestNew feature or request
on Dec 17, 2020 I managed to merge the code of the component with that of the plugin into the p5-plugin, i.e., I just added the plugin
export function p5Plugin(): ConfigOverrideto the index.tsx component file. It works as expected by:- Copy the
p5-plugindir contents into.codedoc. - Import the plugin into
config.ts:import { p5Plugin } from './p5-plugin/index'; export const config = configuration({ //... plugins: [p5Plugin], });
Since this is my first node package I have several questions:
- Should I use a scoped package? If so, should it go inside
@codedoc/or@connectv/? - Will
import { p5Plugin } from './p5-plugin/index';still be the line to import the plugin intoconfig.tsonce the package is created, published and installed? Or how should it be imported? - Is there any naming convention to be followed for the plugins, e.g., p5-codedoc-plugin?
- Copy the
- Should I use a scoped package? If so, should it go inside @codedoc/ or @connectv/?
no. scoped packages are for organizational packages. since you are the primary maintainer of this package and not
@codedocor@connectvorganizations, I suspect a better naming scheme would becodedoc-p5-pluginor something.- Will
import { p5Plugin } from './p5-plugin/index';still be the line to import the plugin into config.ts once the package is created, published and installed? Or how should it be imported?
nope, it will be something like
import { p5Plugin } from 'codedoc-p5-plugin';.p.s. publishing a typescript-based package can have some nuances, so I would also recommend taking a look at this plugin, specifically
package.jsonandconf/typescriptfolders if you run into issues for proper exports (this is the template that I use for all typescript packages I publish).- locked and limited conversation to collaborators
on Jan 26, 2021
Since I finished my p5.js component I was wondering if there's a standard way to share it?