javierlopezdeancos / cuoore-elements

Native custom elements independently deployable ready to browser consume

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cuoore Elements

cuoore logo

Native custom elements independently deployable ready to browser consume

License: GPL v3 Issues Stage - Alpha maintained - yes

Elements

Add a new cuoore element

Create a new folder inside packages folder to your new cuoore component called cuoore-element-{your-element-name} with this structure:

packages/
   ├── cuoore-element-{your-element-name}/
         ├── index.ts
         ├── package.json

package.json

Fill your package json as follow in this template:

{
  "name": "cuoore-element-{your-element-name}",
  "version": "0.1.0",
  "main": "dist/index.js",
  "scripts": {
    "build": "tsc index.ts --outDir dist"
  },
  "devDependencies": {}
}

Build cuoore elements

npm run build

Local Linking of Packages

Linking packages locally in a package-based monorepo style is done with NPM workspaces. In this specific setup we use NPM workspaces (see the workspaces property of the package.json file at the root of your workspace).

Set the dependency that you have in your package from another one in its package json:

{
 "name": "cuoore-element-{your-element-name}",
  "version": "0.1.0",
  "main": "dist/index.js",
  "scripts": {
    "build": "tsc index.ts --outDir dist"
  },
 "dependencies": {
    "cuoore-element-{your-dependency-element-name}": "*"
  }
}

At the root of your workspace run:

npm install

Understand this workspace

Run npm run graph to see a diagram of the dependencies of the projects.

About

Native custom elements independently deployable ready to browser consume

License:GNU General Public License v3.0


Languages

Language:TypeScript 76.6%Language:HTML 23.4%