Skip to content
This repository has been archived by the owner on Feb 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #69 from JoeKarow/JoeKarow/47-initial-steps
Browse files Browse the repository at this point in the history
JoeKarow/47 initial steps
  • Loading branch information
JoeKarow authored Jun 28, 2022
2 parents fdddd6d + b7f7c90 commit 41759a5
Show file tree
Hide file tree
Showing 87 changed files with 2,418 additions and 810 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/issues-from-TODO-comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
importAll:
default: 'false'
default: false
required: false
type: boolean
description: Enable, if you want to import all TODOs. Runs on checked out branch! Only use if you're sure what you are doing.
Expand All @@ -27,6 +27,6 @@ jobs:
- name: Run Issue Bot
uses: derjuulsn/todo-issue@main
with:
excludePattern: '^(node_modules/)'
excludePattern: "^(node_modules/)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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: Release
on:
push:
branches:
- main
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- uses: pnpm/action-setup@v2.0.1
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
run: pnpx semantic-release
76 changes: 50 additions & 26 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,65 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Next.js: debug server-side",
"name": "Next.js: app:web",
"type": "node-terminal",
"request": "launch",
"command": "pnpm dev"
"command": "pnpx turbo run dev",
// "cwd": "${workspaceFolder:✨ @joekarow/netwerkr}",
"sourceMaps": true,
},
{
"name": "Next.js: debug client-side",
"name": "Attach to Process",
"type": "node",
"request": "attach",
"processId": "${command:PickProcess}"
}
{
"type": "firefox",
"request": "launch",
"type": "chrome",
"runtimeExecutable": "/Applications/Brave Browser.app/Contents/MacOS/Brave Browser",
// "runtimeArgs": ["--remote-debugging-port=9222"],
"port": 9222,
"reAttach": true,
"name": "Launch Firefox Dev",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}",
"outFiles": [
"${workspaceFolder}/**/*.js",
"!**/node_modules/**"
"webRoot": "${workspaceFolder:🚀 @joekarow/netwerkr-web}/",
"enableCRAWorkaround": true,
"skipFiles": [
"**/node_modules/**",
"<node_internals>/**/*.js"
],
"showConsoleCallLocation": true,
"suggestPathMappingWizard": true,
"pathMappings": [
{
"url": "webpack://_n_e/packages",
"path": "${workspaceFolder}/packages"
}
]
},
// {
// "name": "Next.js: debug web",
// "request": "launch",
// "type": "chrome",
// "runtimeExecutable": "/Applications/Brave Browser.app/Contents/MacOS/Brave Browser",
// "port": 9222,
// "url": "http://localhost:3000",
// "cwd": "${workspaceFolder:🚀 @joekarow/netwerkr-web}",
// "webRoot": "${workspaceFolder:🚀 @joekarow/netwerkr-web}/",
// "sourceMaps": true,
// "resolveSourceMapLocations": [
// "${webRoot}",
// "${workspaceFolder}",
// "!node_modules"
// ]
// },
],
"compounds": [
{
"name": "Next.js: debug full stack",
"type": "node-terminal",
"request": "launch",
"command": "pnpm run dev",
"outputCapture": "std",
// "console": "integratedTerminal",
"serverReadyAction": {
"pattern": "started server on .+, url: (https?://.+)",
"action": "startDebugging",
"name": "Next.js: debug client-side",
}
"name": "Debug netwerkr w/ Firefox Dev",
"configurations": [
"Next.js: app:web",
"Launch Firefox Dev"
],
"stopAll": true
}
]
}
4 changes: 0 additions & 4 deletions apps/docs/.eslintrc.js

This file was deleted.

10 changes: 0 additions & 10 deletions apps/docs/.lintstagedrc.js

This file was deleted.

30 changes: 0 additions & 30 deletions apps/docs/README.md

This file was deleted.

5 changes: 0 additions & 5 deletions apps/docs/next-env.d.ts

This file was deleted.

5 changes: 0 additions & 5 deletions apps/docs/next.config.js

This file was deleted.

29 changes: 0 additions & 29 deletions apps/docs/package.json

This file was deleted.

10 changes: 0 additions & 10 deletions apps/docs/pages/index.tsx

This file was deleted.

11 changes: 0 additions & 11 deletions apps/docs/tsconfig.json

This file was deleted.

31 changes: 31 additions & 0 deletions apps/web/db/convertDateTime.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { DateTime as dt } from 'luxon'

const convertDateTime = ( data, [ ...keysToReplace ] ) => {
try {
// keys.forEach( key => {
// data[ key ] = data[ key ].toString()
// } )

const seeker = ( obj ) => {
Object.keys( obj ).forEach( key => {
if ( keysToReplace.includes( key ) ) {
if ( obj[ key ] ) {
// obj[ key ] = obj[ key ].toString()
obj[ key ] = dt.fromJSDate( obj[ key ] ).toUTC().toISO()
}
}
if ( typeof obj[ key ] === 'object' && obj[ key ] !== null ) {
seeker( obj[ key ] )
}
} )
}
seeker( data )

} catch ( err ) {
throw new Error( err )
}
// console.log( data )
return data
}

export { convertDateTime }
30 changes: 30 additions & 0 deletions apps/web/db/getContact.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import prisma from '../prisma'
import { convertDateTime } from './'


const getContact = async ( uid ) => {
const data = await prisma.Contact.findUnique( {
where: {
id: uid
},
include: {
email: true,
phone: true,
interactions: {
include: {
conversationId: true,
sourceSocial: {
select: { name: true }
}


}
}
}
} )

// console.log( typeof data.createdAt )
return convertDateTime( data, [ 'createdAt', 'updatedAt', 'time' ] )
}

export { getContact }
18 changes: 18 additions & 0 deletions apps/web/db/getProfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import prisma from '../prisma'
import { convertDateTime } from '.'


const getProfile = async ( uid ) => {
const data = await prisma.user.findUnique( {
where: {
id: uid
},
include: {
profileId: true,
}
} )
console.log( data )

}

export { getProfile }
4 changes: 4 additions & 0 deletions apps/web/db/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// @index('./**/*.{js*,(ts* && !d.*)}', f => `export * from '${f.path}'`)
export * from './convertDateTime'
export * from './getContact'
export * from './getProfile'
Loading

0 comments on commit 41759a5

Please sign in to comment.