Skip to content

Commit

Permalink
Hadi/extract projects (#4)
Browse files Browse the repository at this point in the history
* fix: ens route

* fix

* feat

* feat

* feat

* feat

* feat

* feat

* feat

* feat

* feat

* feat

* feat

* feat

* feat

* Feat

* feat

* feat

* feat

* feat
  • Loading branch information
HadiKhai authored Mar 23, 2024
1 parent dd3eb7e commit 100d4c9
Show file tree
Hide file tree
Showing 136 changed files with 31,469 additions and 4,366 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI
on:
push:
branches:
- '*'
- '*/*'
- '**'
- '!main'
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.OS }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-yarn-
- uses: nrwl/nx-set-shas@v3
- run: yarn install
- run: npx nx run-many --target=install --all -parallel
- run: npx nx affected -t lint
- run: npx nx affected -t test --configuration=ci --passWithNoTests --exclude=justaname-mono-sdk
- run: npx nx affected -t build
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Release
on:
push:
branches:
- 'main'
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: nrwl/nx-set-shas@v3
- run: yarn workspaces foreach --all --parallel install --immutable
- run: npx nx affected -t lint
- run: npx nx affected -t test --configuration=ci
- run: npx nx affected -t build
- run: npx nx affected -t release:package --parallel=1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Binary file modified .yarn/install-state.gz
Binary file not shown.
132 changes: 132 additions & 0 deletions examples/backend/express/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
### Node template
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

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

# 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.*

16 changes: 16 additions & 0 deletions examples/backend/express/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint',
'import', // Add this line
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended', // Add this line
],
rules: {
// Add any additional rules or overrides here
}
};
27 changes: 0 additions & 27 deletions examples/backend/express/.eslintrc.json

This file was deleted.

11 changes: 0 additions & 11 deletions examples/backend/express/jest.config.ts

This file was deleted.

22 changes: 19 additions & 3 deletions examples/backend/express/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
{
"name": "justaname-express-example",
"scripts": {
"build": "tsc",
"build:watch": "tsc -w",
"start": "nodemon dist/main.js",
"serve": "concurrently \"yarn build:watch\" \"yarn start\"",
"lint": "eslint . --ext .ts"
},
"dependencies": {
"@justaname.id/sdk": "0.0.6",
"@nx/webpack": "18.0.8",
"@justaname.id/sdk": "^0.0.7",
"express": "^4.18.1"
},
"devDependencies": {
"@types/eslint": "^8",
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@typescript-eslint/parser": "^7.3.1",
"concurrently": "^8.2.2",
"dotenv": "^16.4.5",
"eslint": "^8.57.0",
"eslint-plugin-import": "^2.29.1",
"nodemon": "^3.1.0"
}
}
}
40 changes: 20 additions & 20 deletions examples/backend/express/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,32 @@
"sourceRoot": "examples/backend/express/src",
"projectType": "application",
"targets": {
"build": {
"executor": "nx:run-commands",
"options": {
"command": "yarn build",
"cwd": "examples/backend/express"
}
},
"serve": {
"executor": "@nx/js:node",
"defaultConfiguration": "development",
"outputs": ["{workspaceRoot}/examples/backend/express/dist"],
"executor": "nx:run-commands",
"options": {
"buildTarget": "justaname-express:build",
"port": 3000
},
"configurations": {
"development": {
"buildTarget": "justaname-express:build:development"
},
"production": {
"buildTarget": "justaname-express:production"
}
"command": "yarn serve",
"cwd": "examples/backend/express"
}
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"executor": "nx:run-commands",
"options": {
"command": "yarn lint",
"cwd": "examples/backend/express"
}
},
"install": {
"executor": "nx:run-commands",
"options": {
"fix": true,
"lintFilePatterns": [
"examples/backend/express/src/*.{ts,tsx,js,jsx}",
"examples/backend/express/package.json"
]
"command": "yarn",
"cwd": "examples/backend/express"
}
}
},
Expand Down
2 changes: 2 additions & 0 deletions examples/backend/express/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import express, { Request } from 'express';
import cors from 'cors';
import { JustaName } from '@justaname.id/sdk';
import dotenv from 'dotenv'

dotenv.config();
const app = express();

app.use(cors());
Expand Down
13 changes: 0 additions & 13 deletions examples/backend/express/tsconfig.app.json

This file was deleted.

28 changes: 13 additions & 15 deletions examples/backend/express/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
{
"extends": "../../../tsconfig.base.json",
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.app.json"
},
{
"path": "./tsconfig.spec.json"
}
],
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"paths": {
"@justaname.id/sdk": ["packages/@justaname.id/sdk/dist"],
}
}
"outDir": "./dist",
"rootDir": "./src",
"skipLibCheck": true
},
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules"
]
}
Loading

0 comments on commit 100d4c9

Please sign in to comment.