Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First version of TypeScript sample repo #1

Merged
merged 13 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @edgee-cloud/edgeers
31 changes: 31 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build and Deploy

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'

- name: Install dependencies
run: npm install

- name: Run build
run: npm run build

- name: Run tests
run: npm test
134 changes: 6 additions & 128 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,130 +1,8 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
# Node stuff
/node_modules
/coverage

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
src/index.js

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
# Build artifacts
*.wasm
8 changes: 8 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extensions": ["ts"],
"spec": ["test/**/*.spec.*"],
"node-option": [
"experimental-specifier-resolution=node",
"import=./test/register-loader.js"
]
}
41 changes: 39 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,39 @@
# example-ts-component
Example TypeScript Edgee Component
<div align="center">

<p align="center">
<a href="https://www.edgee.cloud">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://cdn.edgee.cloud/img/favicon-dark.svg">
<img src="https://cdn.edgee.cloud/img/favicon.svg" height="100" alt="Edgee">
</picture>
<h1 align="center">Edgee</h1>
</a>
</p>


**The full-stack edge platform for your edge oriented applications.**

[![Edgee](https://img.shields.io/badge/edgee-open%20source-blueviolet.svg)](https://www.edgee.cloud)
[![Edgee](https://img.shields.io/badge/slack-edgee-blueviolet.svg?logo=slack)](https://www.edgee.cloud/slack)
[![Docs](https://img.shields.io/badge/docs-published-blue)](https://docs.edgee.cloud)

</div>

This is an example of a TypeScript Edgee Component

WARNING: A JavaScript WASM Component embed a full JS engine, resulting in longer startup time for edgee because of the
pre-instantiating (which requires a lot of computing), which can be mitigated using a cache.

## Setup
Requirements:
- [edgee-cli] (https://github.com/edgee-cloud/edgee)
- Node.js / npm / npx

```shell
$ npm install
```
## Building

```shell
$ edgee components build
```
11 changes: 11 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Reporting Security Issues

We truly appreciate efforts to discover and disclose security issues responsibly. If you’d like
to report a security issue found in any of our products or have security concerns regarding Edgee,
please reach out to security@edgee.cloud.

In order for us to best respond to your report, please include:

Steps to reproduce or proof-of-concept,
Any relevant tools used (including versions),
Tool output.
15 changes: 15 additions & 0 deletions edgee-component.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
manifest_version = 1

[package]
name = "example-ts-component"
version = "1.0.0"
category = "data-collection"
subcategory = "analytics"
description = "Example TypeScript component for data collection"
documentation = "https://github.com/edgee-cloud/example-ts-component"
repository = "https://github.com/edgee-cloud/example-ts-component"
wit-world-version = "0.4.0"

[package.build]
command = "npm install && npm run generate && npm run build"
output_path = "./example-ts-component.wasm"
11 changes: 11 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default tseslint.config(
eslint.configs.recommended,
tseslint.configs.strict,
tseslint.configs.stylistic,
{
ignores: ["types/"]
}
);
Loading