Skip to content

Commit af66d5d

Browse files
committed
wip: move files
1 parent 005b2ae commit af66d5d

File tree

3,108 files changed

+287605
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,108 files changed

+287605
-0
lines changed

.docker.env

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
REDIS_URL="redis://redis:6379"
2+
CLICKHOUSE_URL="http://clickhouse-server:8123"

.dockerignore

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
node_modules
2+
**/node_modules
3+
**/.env
4+
.env*
5+
6+
.git
7+
.idea
8+
.venv
9+
.vscode
10+
.ref
11+
./ref*
12+
**/.ref
13+
*.md
14+
15+
docker
16+
clickhouse
17+
18+
#docker
19+
docker-compose.yml
20+
docker-compose.*.yml
21+
coverage

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_size = 2
6+
indent_style = space
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.factor/config.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

.factor/config.ts

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/* tslint:disable */
2+
/**
3+
* Automatically generated file, do not modify by hand.
4+
*/
5+
6+
export interface CompiledServiceConfig {
7+
commands: 'bundle' | 'release' | 'render'
8+
vars:
9+
| 'AWS_ACCESS_KEY'
10+
| 'AWS_ACCESS_KEY_SECRET'
11+
| 'COMMAND'
12+
| 'COMMAND_OPTS'
13+
| 'GOOGLE_CLIENT_ID'
14+
| 'GOOGLE_CLIENT_SECRET'
15+
| 'IS_TEST'
16+
| 'NGROK_AUTH_TOKEN'
17+
| 'NODE_ENV'
18+
| 'POSTGRES_URL'
19+
| 'RUNTIME_COMMIT'
20+
| 'RUNTIME_VERSION'
21+
| 'SMTP_HOST'
22+
| 'SMTP_PASSWORD'
23+
| 'SMTP_USER'
24+
| 'TOKEN_SECRET'
25+
| 'UNSPLASH_ACCESS_KEY'
26+
[k: string]: unknown
27+
}

.github/workflows/deploy.yml

+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
workflow_dispatch:
8+
inputs:
9+
cmd:
10+
description: Command
11+
required: true
12+
type: choice
13+
options:
14+
- deploy
15+
- test
16+
17+
tags:
18+
description: Tags
19+
required: false
20+
type: string
21+
22+
# if deploy on release
23+
# release:
24+
# types: [published]
25+
26+
env:
27+
CI: true
28+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
29+
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
30+
AWS_ACCESS_KEY_SECRET: ${{ secrets.AWS_ACCESS_KEY_SECRET }}
31+
STRIPE_SECRET_KEY_TEST: ${{ secrets.STRIPE_SECRET_KEY_TEST }}
32+
TOKEN_SECRET: ${{ secrets.TOKEN_SECRET }}
33+
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
34+
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
35+
SMTP_HOST: ${{ secrets.SMTP_HOST }}
36+
SMTP_USER: ${{ secrets.SMTP_USER }}
37+
SMTP_PASSWORD: ${{ secrets.SMTP_PASSWORD }}
38+
UNSPLASH_ACCESS_KEY: ${{ secrets.UNSPLASH_ACCESS_KEY }}
39+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
40+
jobs:
41+
test:
42+
env:
43+
REDIS_URL: redis://localhost:6379
44+
CLICKHOUSE_URL: http://default:@localhost:8123
45+
POSTGRES_URL: http://test:test@localhost:5432/test
46+
SHOULD_DEPLOY: ${{ contains(github.event.head_commit.message, '-d') }}
47+
name: build and test
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: Get The Code
51+
uses: actions/checkout@v2
52+
53+
- name: Install pnpm
54+
uses: pnpm/[email protected]
55+
with:
56+
version: 8.13.1
57+
58+
- name: Set Node Version
59+
uses: actions/setup-node@v3
60+
with:
61+
node-version: 20
62+
cache: pnpm
63+
64+
- name: Get pnpm store directory
65+
id: pnpm-cache
66+
run: |
67+
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
68+
69+
- name: Install Deps
70+
run: pnpm -v && pnpm i && pnpm rebuild --recursive
71+
72+
- name: Install Playwright Browsers
73+
run: npx playwright install
74+
75+
- name: Run Docker Compose (DB)
76+
run: docker-compose pull && docker-compose up --build -d
77+
78+
- name: Create Tables
79+
run: npm -w @fiction/www exec -- factor run generate
80+
81+
- name: Run Type Check
82+
run: npm run types:ci
83+
84+
- name: BUILD unit tests
85+
env:
86+
NODE_OPTIONS: --max_old_space_size=4096
87+
run: npm exec -- vitest run build -u --no-file-parallelism
88+
89+
- name: DEV unit tests
90+
run: npm exec -- vitest run wip -u
91+
92+
- name: STABLE unit tests
93+
run: npm exec -- vitest run ci -u
94+
95+
- name: E2E/UI unit tests
96+
run: npm exec -- vitest run e2e -u
97+
98+
- name: Install Build Packages
99+
if: env.SHOULD_DEPLOY
100+
run: pnpm add tsup cross-env --global
101+
102+
- name: Build Bundles
103+
if: env.SHOULD_DEPLOY
104+
run: npm exec -- factor run bundle
105+
106+
- name: Render Apps
107+
if: env.SHOULD_DEPLOY
108+
run: npm exec -- factor run render
109+
110+
- name: Install FlyCtl
111+
if: env.SHOULD_DEPLOY
112+
uses: superfly/flyctl-actions/setup-flyctl@master
113+
114+
- name: Deploy Apps
115+
if: env.SHOULD_DEPLOY
116+
run: |
117+
cross-env DOMAIN=fiction APP=www npm run deploy
118+
cross-env DOMAIN=fiction APP=sites npm run deploy
119+
120+
- name: Post Notification
121+
if: always()
122+
id: slack
123+
uses: slackapi/[email protected]
124+
with:
125+
# This data can be any valid JSON from a previous step in the GitHub Action
126+
payload: |
127+
{
128+
"icon_emoji": "${{ job.status == 'success' && ':white_check_mark:' || ':x:' }}",
129+
"username": "supereon",
130+
"channel": "#notify",
131+
"text": "Workflow *${{ github.workflow }}* on *${{ github.ref }}* (commit: ${{ github.sha }}) completed with status: *${{ job.status }}*. <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run>"
132+
}
133+
env:
134+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}

.gitignore

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/xcache
2+
3+
dist
4+
**/dist
5+
**/rendered
6+
7+
.DS_Store
8+
**/node_modules/**
9+
coverage
10+
temp
11+
temp.*
12+
explorations
13+
TODOs.md
14+
15+
.env
16+
.env*
17+
18+
# wireguard/tunnels
19+
wire.*
20+
21+
# debugging
22+
.ts-node
23+
*.log
24+
25+
# Local .terraform directories
26+
**/.terraform
27+
28+
# .tfstate files
29+
*.tfstate
30+
*.tfstate.*
31+
32+
# Ansible/Python
33+
.venv/
34+
.venv*/
35+
*.retry
36+
/___*.yml

.markdownlint.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"MD013": false,
3+
"MD033": false,
4+
"MD041": false
5+
}

.node-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v20.9.0

.nodemon.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"watch": ["packages"],
3+
"ignore": [
4+
"**/dist/*",
5+
"**/rendered/*",
6+
"./temp/*",
7+
"**/temp/*",
8+
"./app/**/*"
9+
],
10+
"ext": "js,ts,less,html",
11+
"events": {
12+
"restart": "",
13+
"start": ""
14+
}
15+
}

.npmignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*.tgz
2+
temp
3+
.env
4+
.env*
5+
.local
6+
*.log

.npmpackagejsonlintrc.json

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"rules": {
3+
"require-main": "error",
4+
"require-publishConfig": "error",
5+
"name-format": "error",
6+
"version-format": "error",
7+
"require-license": "error",
8+
"require-name": "error",
9+
"require-version": "error",
10+
"bin-type": "error",
11+
"config-type": "error",
12+
"description-type": "error",
13+
"devDependencies-type": "error",
14+
"directories-type": "error",
15+
"engines-type": "error",
16+
"files-type": "error",
17+
"homepage-type": "error",
18+
"keywords-type": "error",
19+
"license-type": "error",
20+
"main-type": "error",
21+
"man-type": "error",
22+
"name-type": "error",
23+
"preferGlobal-type": "error",
24+
"private-type": "error",
25+
"repository-type": "error",
26+
"scripts-type": "error",
27+
"version-type": "error",
28+
"valid-values-author": ["error", ["Supereon"]],
29+
30+
"no-restricted-dependencies": ["error", ["gulping-npm-package-json-lint"]],
31+
"no-restricted-pre-release-dependencies": [
32+
"error",
33+
["gulping-npm-package-json-lint"]
34+
],
35+
"no-restricted-devDependencies": [
36+
"error",
37+
["gulping-npm-package-json-lint"]
38+
],
39+
"no-restricted-pre-release-devDependencies": [
40+
"error",
41+
["gulping-npm-package-json-lint"]
42+
]
43+
}
44+
}

.npmrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
shamefully-hoist=true
2+
3+
# https://answers.netlify.com/t/support-guide-using-private-npm-modules-on-netlify/795
4+
# //registry.npmjs.org/:_authToken=${NPM_TOKEN}

.pnpmfile.cjs

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// const fs = require('node:fs')
2+
// const path = require('node:path')
3+
4+
// const exists = fs.existsSync(path.join(process.cwd(), '../factor/package.json'))
5+
// const localInstall = process.env.INSTALL_ENV === 'local'
6+
function rewriteFactorDependency(deps) {
7+
// Object.entries(deps).forEach(([name, version]) => {
8+
// if (name.includes("@factor")) {
9+
// deps[name] =
10+
// exists && localInstall ? `file:~/Projects/factor/${name}` : "latest"
11+
// }
12+
// })
13+
return deps
14+
}
15+
16+
function readPackage(pkg, _context) {
17+
pkg.dependencies = rewriteFactorDependency(pkg.dependencies)
18+
pkg.devDependencies = rewriteFactorDependency(pkg.devDependencies)
19+
20+
return pkg
21+
}
22+
23+
function afterAllResolved(lockfile, _context) {
24+
return lockfile
25+
}
26+
27+
module.exports = {
28+
hooks: {
29+
afterAllResolved,
30+
readPackage,
31+
},
32+
}

.prettierignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
**/.ref/**
2+
**/.ref*/**
3+
**/dist/**
4+
*-lock*
5+
**/.factor/**

.prettierrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"arrowParens": "always",
3+
"semi": false,
4+
"singleQuote": true,
5+
"trailingComma": "all"
6+
}
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"endpoints": [],
3+
"routes": [
4+
{
5+
"key": "engine",
6+
"path": "/:pathMatch(.*)*"
7+
}
8+
]
9+
}

0 commit comments

Comments
 (0)