This repository has been archived by the owner on Feb 5, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from JoeKarow/JoeKarow/47-initial-steps
JoeKarow/47 initial steps
- Loading branch information
Showing
87 changed files
with
2,418 additions
and
810 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
Oops, something went wrong.