Skip to content

Commit

Permalink
DAW#87 Restructuring (see App.tsx)
Browse files Browse the repository at this point in the history
  • Loading branch information
artiphishle committed Nov 1, 2023
1 parent 34e54c9 commit 9119832
Show file tree
Hide file tree
Showing 71 changed files with 1,111 additions and 989 deletions.
4 changes: 4 additions & 0 deletions .env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

#*** @Stripe *#
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_51LBfSOLjx992qWAYRekYCPRpgZ3xa6POoteqC7Tp9555GXDGEcm67xHgOQt20N9vTrXaerlfKQdTcxZreijcvwI300GL0SnTOR
STRIPE_SECRET=sk_test_51LBfSOLjx992qWAYx8s062kh2dqbNsjbH6Po0xL93bZjeOKZyFCtxNzQ0gyFNCSOWYLSi45miRAZS6olA3epsayv00C9LKNqPB
File renamed without changes.
4 changes: 1 addition & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"overrides": [
{
"files": ["**/*.test.ts", "**/*.test.tsx"],
"env": {
"jest": true
}
"env": {}
}
],
"rules": {
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ node_modules/

# Next.js
.*.env
.*.env.local
.next/
.swc/
.vercel
Expand Down
29 changes: 14 additions & 15 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,46 +1,45 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: { serverActions: true },
async headers() {
return [
{
source: "/(.*)", // Apply these headers to all routes
source: '/(.*)', // Apply these headers to all routes
headers: [
/* {
key: "Content-Security-Policy",
value: "default-src 'self'; script-src 'self'; style-src 'self'",
}, */
{
key: "X-Content-Type-Options",
value: "nosniff",
key: 'X-Content-Type-Options',
value: 'nosniff',
},
{
key: "X-Frame-Options",
value: "DENY",
key: 'X-Frame-Options',
value: 'DENY',
},
{
key: "X-XSS-Protection",
value: "1; mode=block",
key: 'X-XSS-Protection',
value: '1; mode=block',
},
{
key: "Strict-Transport-Security",
value: "max-age=31536000; includeSubDomains; preload",
key: 'Strict-Transport-Security',
value: 'max-age=31536000; includeSubDomains; preload',
},
{
key: "Referrer-Policy",
value: "no-referrer",
key: 'Referrer-Policy',
value: 'no-referrer',
},
{
key: "Feature-Policy",
key: 'Feature-Policy',
value: "geolocation 'none'; camera 'none'; microphone 'none'",
},
/* {
key: "Access-Control-Allow-Origin",
value: "https://trusted-domain.com",
}, */
{
key: "X-Content-Type-Options",
value: "nosniff",
key: 'X-Content-Type-Options',
value: 'nosniff',
},
/* {
key: "Expect-CT",
Expand Down
39 changes: 39 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"@nextui-org/react": "^2.1.13",
"@react-hook/window-size": "^3.1.1",
"@spotify/basic-pitch": "^1.0.1",
"@stripe/stripe-js": "^2.1.10",
"@tensorflow/tfjs": "^4.12.0",
"@types/node": "^20.8.9",
"@types/react": "18.2.33",
Expand All @@ -49,6 +50,8 @@
"react-dom": "^18.2.0",
"react-useportal": "^1.0.18",
"reactflow": "^11.9.4",
"server-only": "^0.0.1",
"stripe": "^14.2.0",
"swr": "^2.2.4",
"tailwindcss": "3.3.5",
"tonal": "^5.0.0",
Expand Down
27 changes: 0 additions & 27 deletions src/app/(routes)/layout.tsx

This file was deleted.

41 changes: 0 additions & 41 deletions src/app/(routes)/page.tsx

This file was deleted.

16 changes: 4 additions & 12 deletions src/app/_common/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { ETrackType, type ITrack } from 'app/_common/types/track.types';
import type { IChannel } from './types/channel.types';
import { EInstrument } from './types/instrument.types';
import { Note } from 'tone/build/esm/core/type/NoteUnits';
import { Subdivision } from 'tone/build/esm/core/type/Units';

// ---------- General
/*** @constants */
Expand Down Expand Up @@ -43,30 +44,21 @@ export const PROGRESSION = [
// Montgomery Ward bridge
'I IV ii V',
];
export const ROMAN_NUMS = ['i', 'ii', 'iii', 'iv', 'v', 'vi', 'vii'];

// ---------- Utils
/*** @utils */
export const getMaxNotes = (notes: Note[][]) =>
Math.max(notes.reduce((a, b) => (a > b.length ? a : b.length), 0));
export const getMeasureTime = (n: number) => Tone.Time(`${n}m`);
export const getMeasureSeconds = (n: number) => getMeasureTime(n).toSeconds();
export const getNotationTime = (n: number) => Tone.Time(`${n}n`);
export const getNotationSeconds = (n: number) => getNotationTime(n).toSeconds();
export const isRomanNum = (s: string) => ROMAN_NUMS.includes(_.toLower(s));

// ---------- Project
const DEFAULT_ACTIVE_TRACK_ID = 'track-bd';
const DEFAULT_ACTIVE_TRACK_ID = 'audio-halloween';
const DEFAULT_BPM = 120;
const DEFAULT_CLEF = 'D';
const DEFAULT_SCALE = 'minor';
const DEFAULT_MEASURE_COUNT = 2;
const DEFAULT_NAME = t('untitled');
const DEFAULT_OFFSET_LEFT = 184;
const DEFAULT_OFFSET_LEFT = 179;
const DEFAULT_POSITION = '0:0:0';
const DEFAULT_QUANTIZATION = 16;
const DEFAULT_SWING = 0;
const DEFAULT_SWING_SUBDIVISION = '8n';
const DEFAULT_SWING_SUBDIVISION: Subdivision = '8n';
const DEFAULT_STATES = {
tabTopActive: 0,
tabBtmActive: 0,
Expand Down
Loading

0 comments on commit 9119832

Please sign in to comment.