Skip to content

Commit

Permalink
chore: Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielmpinto committed Sep 13, 2024
0 parents commit d69cbae
Show file tree
Hide file tree
Showing 26 changed files with 5,107 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- **I'm submitting a ...**
[ ] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project

- **Summary**

- **Other information** (e.g. detailed explanation, stack traces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)
39 changes: 39 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## Why?

Clear and short explanation here.

## How?

- Done A (replace with a breakdown of the steps)
- Done B
- Done C

## Tickets?

- [Ticket 1](the-ticket-url-here)
- [Ticket 2](the-ticket-url-here)
- [Ticket 3](the-ticket-url-here)

## Contribution checklist?

- [ ] The commit messages are detailed
- [ ] The `build` command runs locally
- [ ] Assets or static content are linked and stored in the project
- [ ] Document filename is named after the slug
- [ ] You've reviewed spelling using a grammar checker
- [ ] For documentation, guides or references, you've tested the commands and steps
- [ ] You've done enough research before writing

## Security checklist?

- [ ] Sensitive data has been identified and is being protected properly
- [ ] Injection has been prevented (parameterized queries, no eval or system calls)
- [ ] The Components are escaping output (to prevent XSS)

## References?

Optionally, provide references such as links

## Preview?

Optionally, provide the preview url here
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

on: [push, pull_request]

jobs:
build:
name: CI
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v4

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

- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Install dependencies
run: pnpm i --frozen-lockfile

- name: Run linter
run: pnpm lint

- name: Run formatter
run: pnpm format:check

- name: Build package
run: pnpm build
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish to npm

on:
push:
tags:
- 'v*'

jobs:
release:
name: Release
runs-on: ubuntu-latest
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

steps:
- name: Check out code
uses: actions/checkout@v4

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

- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Install dependencies
run: pnpm i --frozen-lockfile

- name: Build package
run: pnpm build

- name: Set NPM profile for publishing packages
uses: franzbischoff/replace_envs@v1
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
with:
from_file: '.npmrc.template'
to_file: '.npmrc'
commit: 'false'

- name: Publish package
run: pnpm publish --access=public --no-git-checks
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dist
node_modules
test
src/**.js
coverage
*.log
.DS_Store
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no-install commitlint --edit "$1"
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpx lint-staged
8 changes: 8 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
src/
tsconfig.json
jest.config.js
eslint.config.js
commintlint.config.js
.prettierrc
.prettierignore
.husky/
2 changes: 2 additions & 0 deletions .npmrc.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
registry=https://registry.npmjs.org/
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
dist
.husky/
pnpm-lock.yaml
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": true,
"singleQuote": true,
"printWidth": 120,
"trailingComma": "all"
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Fleek

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Fleek Functions ESBuild Config

This package provides a custom ESBuild configuration for Fleek Functions, optimized for building projects for Fleek Functions. It extends the default ESBuild configuration to support Fleek Functions' specific requirements.

## Installation

You can install this package using npm or yarn:

```bash
npm install @fleek-platform/functions-esbuild-config
```

or

```bash
yarn add @fleek-platform/functions-esbuild-config
```

or

```bash
pnpm add @fleek-platform/functions-esbuild-config
```

## Usage

TODO: Add usage example
1 change: 1 addition & 0 deletions commitlint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default { extends: ['@commitlint/config-conventional'] };
6 changes: 6 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// @ts-check

import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default tseslint.config(eslint.configs.recommended, ...tseslint.configs.recommended);
7 changes: 7 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default {
preset: 'ts-jest',
collectCoverage: true,
coverageDirectory: 'coverage',
coverageProvider: 'v8',
testMatch: ['**/*.spec.ts'],
};
51 changes: 51 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "@fleek-platform/functions-esbuild-config",
"version": "1.0.0",
"description": "",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsc",
"lint": "eslint 'src/**/*.{js,ts}'",
"format": "prettier . --write",
"format:check": "prettier . --check",
"test": "jest",
"prepare": "husky"
},
"keywords": [
"fleek",
"esbuild",
"config",
"typescript",
"serverless",
"lambda",
"fleek-functions",
"edge"
],
"author": "",
"license": "MIT",
"engines": {
"node": ">=18"
},
"type": "module",
"dependencies": {
"esbuild": "^0.23.1"
},
"devDependencies": {
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@eslint/js": "^9.2.0",
"@types/jest": "^29.5.12",
"@types/node": "^20.12.11",
"@types/semver": "^7.5.8",
"eslint": "^9.2.0",
"husky": "^9.0.11",
"jest": "^29.7.0",
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"ts-jest": "^29.1.2",
"typescript": "^5.4.5",
"typescript-eslint": "8.5.0"
}
}
Loading

0 comments on commit d69cbae

Please sign in to comment.