Skip to content

Instantly share code, notes, and snippets.

View aelbore's full-sized avatar

Jay aelbore

View GitHub Profile
@aelbore
aelbore / typescript-web-components.md
Last active December 7, 2023 20:14
Step by Step creating web components in typescript using rollup

Getting Started

  • Install Dependencies
    npm init
    npm install --save-dev ts-node typescript tslib express @types/express
    

Create your web server

  • Create server.ts in root folder of your app.
@aelbore
aelbore / vue-to-js.md
Last active February 1, 2019 03:40
vue file to js file
const ts = require('typescript');
const fs = require('fs');
const path =  require('path');
const prettier = require('prettier');

const { promisify } = require('util');
const { globFiles, clean, mkdirp } = require('aria-fs');

const writeFileAsync = promisify(fs.writeFile);

Getting Started

  • Install Dependencies
    npm init -y
    npm install --save-dev vue @vue/cli http-server
    

Create Web Component

  • Create vue component src/my-component.vue.
    <template>
    
@aelbore
aelbore / angular-elements.md
Last active July 6, 2019 16:17
Step by Step Guide for create Angular Elements

Getting Started

ng new ng-elements --enable-ivy

Create and Build HelloWorldElements

  • Remove all the files in src/app folder
  • Add hello-world.ts file in src/app folder
  • Add Component

Getting Started

ng new ng-elements --enable-ivy

Create and Build HelloWorldElements

  • Remove all the files in src/app folder
  • Create card.ts file in src/app folder
  • Add Component
@aelbore
aelbore / App.vue
Last active July 24, 2019 10:32
Step by Step creating web components in Vue
<template>
<div id="app">
<div style="text-align:center;margin-bottom:20px;">
<h1>Welcome to Vue</h1>
<img width="200" src="https://vuejs.org/images/logo.png" />
</div>
<div class="cards">
<div v-for="(profile, index) in profiles" v-bind:key="index">
<Card :profile="profile" />
</div>

Testing in Vue

Write lots of tests so people will afraid to delete yout code
  - creator of redux
  
Don't just write tests that let you verify unit works with confidence.
Write tests that let you *delete* that unit of confidence.
  - creator of redux
@aelbore
aelbore / getting-started-with-mongo-docker.md
Last active March 16, 2020 05:14
Getting Started with Mongodb Docker
@aelbore
aelbore / vue-vite-headless-testing.md
Last active May 30, 2020 03:26
Vue 3 + Vite headless unit testing

Testing in Vue

Write lots of tests so people will afraid to delete yout code

alt text

Why need test?

@aelbore
aelbore / esm-cjs-modules.md
Last active January 22, 2024 13:57
Publish your npm package as ES Module, and backward compatibility CommonJS

Create your library

  • Initialize project npm init -y
  • Create esm module ./src/esm/my-lib.js
    function addNumber(value, value2) {
      return value + value2;
    }
    
    export { addNumber };