1.1.1 • Published 1 year ago

@netcentric/eddys-video v1.1.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 year ago

Netcentric Block Collection

Version Build Status CodeQL Analysis semver: semantic-release License

Custom and extendable block collection

Installation

In the Edge delivery project folder run

npm i @netcentric/eddys-block-collection //TODO change name to the correct package/repo

it will download it as a dependency and create a /libs folder with all th e blocks to reference.

Usage

in your /blocks folder create a new block with a css and a js file (the name can be the same or different that the block you want to use)

JS file: There Are 2 ways to use a block from the Block Collection

Option 1

Use an already existing block with no possibility to extend the js or use a custom block developed using a js class Not extending the js class

You need to import the defaultDecorate function form the libs/blocks block you want to use. And export the async function decorate to get your code executed when the block is in place.

import defaultDecorate from '/libs/blocks/<original-block-name>/<original-block-name>.js';

export default async function decorate(block) {
    // Custom decoration can be done here
  await defaultDecorate(block);
}

Option 2

Use a custom block developed using a js class extending the js class

You need to import the defaultDecorate and the OriginalBlockName (the class with the block functionality) form the libs/blocks block you want to use. And export the async function decorate to get your code executed when the block is in place. If we are extending the class we need to pass the extended class as a param in the defaultDecorate function

import { defaultDecorate, OriginalBlockName } from '/libs/blocks/<original-block-name>/<original-block-name>.js';

class BlockName extends OriginalBlockName {
  constructor(block) {
    super(block);
  }
    // Code here
}

export default async function decorate(block) {
  // Custom decoration can be done here
  await defaultDecorate(block, BlockName); // Note that you need to pass the extended class to the defaultDeaorate
}

CSS file:

You need to import the CSS file form the libs/blocks block you want to use. And then you can add as much extra CSS you want.

@import "/libs/blocks/<original-block-name>/<original-block-name>.css";

/* you can add custom css here */ 

Issue template

  • .github/ISSUE_TEMPLATE.md

PR template

  • .github/PULL_REQUEST_TEMPLATE.md --> automatically closes connected issue

Workflows

  • CI --> npm ci, test and build
  • CodeQL --> Perform CodeQL Analysis (Security, etc.)
  • Release --> semantic-release:
    • Creates release notes
    • Updates CHANGELOG
    • Updates package.json version
    • Creates Git tag/release
    • Publish package to NPM
  • Manual Release --> same as Release, but can be triggered manually in Actions tab

Release

Commit message Convention

<type>(<scope>): <short summary>
│       │             │
│       │             └─⫸ Summary in present tense. Not capitalized. No period at the end.
│       │
│       └─⫸ Commit Scope (optional): project|based|list
│
└─⫸ Commit Type: build|ci|docs|feat|fix|perf|refactor|test
1.1.1

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago