Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(packages): create env, api, db libraries #75

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
strict-peer-dependencies=false
auto-install-peers=true

# Registries to install packages from based on prefix
@cuhacking:registry=http://localhost:4873/
registry=https://registry.npmjs.org/
28 changes: 28 additions & 0 deletions .verdaccio/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# path to a directory with all packages
storage: ../tmp/local-registry/storage

# a list of other known repositories we can talk to
uplinks:
npmjs:
url: https://registry.npmjs.org/
maxage: 60m

packages:
'**':
# give all users (including non-authenticated users) full access
# because it is a local registry
access: $all
publish: $all
unpublish: $all

# if package is not available locally, proxy requests to npm registry
proxy: npmjs

# log settings
logs:
type: stdout
format: pretty
level: warn

publish:
allow_offline: true # set offline to true to allow publish offline
58 changes: 33 additions & 25 deletions apps/docs-e2e/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,40 @@
const { FlatCompat } = require('@eslint/eslintrc')
const js = require('@eslint/js')
const baseConfigPromise = require('../../eslint.config.js')
// TODO: merge with antfu eslint config
// const { FlatCompat } = require('@eslint/eslintrc');
import baseConfigPromise from '../../eslint.config.js'

module.exports = (async () => {
export default (async () => {
const baseConfig = await baseConfigPromise
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
})

return [
...baseConfig,
...compat.extends('plugin:playwright/recommended'),
{
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
rules: {},
},
{
files: ['**/*.ts', '**/*.tsx'],
rules: {},
},
{
files: ['**/*.js', '**/*.jsx'],
rules: {},
},
{
files: ['src/**/*.{ts,js,tsx,jsx}'],
rules: {},
},
// ...compat.extends("plugin:playwright/recommended"),
// The following configurations are commented out
// ...compat.extends(
// 'plugin:@nx/react-typescript',
// 'next',
// 'next/core-web-vitals'
// ),
// {
// files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
// rules: {
// '@next/next/no-html-link-for-pages': ['error', 'apps/portal/pages'],
// },
// },
// {
// files: ['**/*.ts', '**/*.tsx'],
// rules: {},
// },
// {
// files: ['**/*.js', '**/*.jsx'],
// rules: {},
// },
// ...compat.config({ env: { jest: true } }).map((config) => ({
// ...config,
// files: ['**/*.spec.ts', '**/*.spec.tsx', '**/*.spec.js', '**/*.spec.jsx'],
// rules: {
// ...config.rules,
// },
// })),
// { ignores: ['.next/**/*'] },
]
})()
3 changes: 3 additions & 0 deletions apps/docs-e2e/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
// TODO: Investigate node global process usage
/* eslint-disable node/prefer-global/process */
import { fileURLToPath } from 'node:url'
import { defineConfig, devices } from '@playwright/test'
import { nxE2EPreset } from '@nx/playwright/preset'

import { workspaceRoot } from '@nx/devkit'

const __filename = fileURLToPath(import.meta.url)

// For CI, you may want to set BASE_URL to the deployed application.
const baseURL = process.env.BASE_URL || 'http://127.0.0.1:3000'

Expand Down
5 changes: 1 addition & 4 deletions apps/docs-e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"module": "commonjs",
"allowJs": true,
"outDir": "../../dist/out-tsc",
"sourceMap": false
"outDir": "../../dist/out-tsc"
},
"include": [
"**/*.ts",
Expand Down
5 changes: 3 additions & 2 deletions apps/docs/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// TODO: merge with antfu eslint config
// const { FlatCompat } = require('@eslint/eslintrc');
const baseConfigPromise = require('../../eslint.config.js')
// const baseConfigPromise = require('../../eslint.config.js')
import baseConfigPromise from '../../eslint.config.js'
// const js = require('@eslint/js');

module.exports = (async () => {
export default (async () => {
const baseConfig = await baseConfigPromise

return [
Expand Down
File renamed without changes.
58 changes: 28 additions & 30 deletions apps/docs/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,37 @@
// import type { Config } from 'tailwindcss'
// const { fontFamily } = require('tailwindcss/defaultTheme')
const { join } = require('node:path')
import { join } from 'node:path'

const { createPreset } = require('fumadocs-ui/tailwind-plugin')
import { createPreset } from 'fumadocs-ui/tailwind-plugin'

const { createGlobPatternsForDependencies } = require('@nx/react/tailwind')
import { createGlobPatternsForDependencies } from '@nx/react/tailwind'

/** @type {import('tailwindcss').Config} */
module.exports = {
darkMode: ['class'],
content: [
join(
__dirname,
'{src,pages,components,app}/**/*!(*.stories|*.spec).{ts,tsx,html}',
),
...createGlobPatternsForDependencies(__dirname),
'./mdx-components.tsx',
'../../node_modules/fumadocs-ui/dist/**/*.js',
],
theme: {
extend: {
fontFamily: {
// sans: ['var(--font-geist-sans)', ...fontFamily.sans],
},
export const darkMode = ['class']
export const content = [
join(
__dirname,
'{src,pages,components,app}/**/*!(*.stories|*.spec).{ts,tsx,html}',
),
...createGlobPatternsForDependencies(__dirname),
'./mdx-components.tsx',
'../../node_modules/fumadocs-ui/dist/**/*.js',
]
export const theme = {
extend: {
fontFamily: {
// sans: ['var(--font-geist-sans)', ...fontFamily.sans],
},
},
presets: [
createPreset({
// preset: 'default',
// preset: 'neutral',
// preset: 'dusk',
// preset: 'purple',
// preset: 'ocean',
preset: 'catppuccin',
}),
],
plugins: [],
}
export const presets = [
createPreset({
// preset: 'default',
// preset: 'neutral',
// preset: 'dusk',
// preset: 'purple',
// preset: 'ocean',
preset: 'catppuccin',
}),
]
export const plugins = []
1 change: 0 additions & 1 deletion apps/docs/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// TODO: Delete this file once no longer needed as a reference
import type { Config } from 'tailwindcss'
import { fontFamily } from 'tailwindcss/defaultTheme'
import { createPreset } from 'fumadocs-ui/tailwind-plugin'

export default {
Expand Down
14 changes: 10 additions & 4 deletions apps/docs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"incremental": true,
"jsx": "preserve",
"resolveJsonModule": true,
"types": ["node"],
"types": [
"node"
],
"allowJs": true,
"strict": true,
"noEmit": true,
Expand All @@ -28,8 +30,12 @@
"next-env.d.ts",
".next/types/**/*.ts",
"next.config.mjs",
"postcss.config.js",
"tailwind.config.js"
"postcss.config.cjs",
"tailwind.config.cjs"
],
"exclude": ["node_modules", "**/*.spec.ts", "**/*.test.ts"]
"exclude": [
"node_modules",
"**/*.spec.ts",
"**/*.test.ts"
]
}
58 changes: 33 additions & 25 deletions apps/portal-e2e/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,40 @@
const { FlatCompat } = require('@eslint/eslintrc')
const js = require('@eslint/js')
const baseConfigPromise = require('../../eslint.config.js')
// TODO: merge with antfu eslint config
// const { FlatCompat } = require('@eslint/eslintrc');
import baseConfigPromise from '../../eslint.config.js'

module.exports = (async () => {
export default (async () => {
const baseConfig = await baseConfigPromise
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
})

return [
...baseConfig,
...compat.extends('plugin:playwright/recommended'),
{
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
rules: {},
},
{
files: ['**/*.ts', '**/*.tsx'],
rules: {},
},
{
files: ['**/*.js', '**/*.jsx'],
rules: {},
},
{
files: ['src/**/*.{ts,js,tsx,jsx}'],
rules: {},
},
// ...compat.extends("plugin:playwright/recommended"),
// The following configurations are commented out
// ...compat.extends(
// 'plugin:@nx/react-typescript',
// 'next',
// 'next/core-web-vitals'
// ),
// {
// files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
// rules: {
// '@next/next/no-html-link-for-pages': ['error', 'apps/portal/pages'],
// },
// },
// {
// files: ['**/*.ts', '**/*.tsx'],
// rules: {},
// },
// {
// files: ['**/*.js', '**/*.jsx'],
// rules: {},
// },
// ...compat.config({ env: { jest: true } }).map((config) => ({
// ...config,
// files: ['**/*.spec.ts', '**/*.spec.tsx', '**/*.spec.js', '**/*.spec.jsx'],
// rules: {
// ...config.rules,
// },
// })),
// { ignores: ['.next/**/*'] },
]
})()
3 changes: 3 additions & 0 deletions apps/portal-e2e/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
/* eslint-disable node/prefer-global/process */
import { fileURLToPath } from 'node:url'
import { defineConfig, devices } from '@playwright/test'
import { nxE2EPreset } from '@nx/playwright/preset'

import { workspaceRoot } from '@nx/devkit'

const __filename = fileURLToPath(import.meta.url)

// For CI, you may want to set BASE_URL to the deployed application.
const baseURL = process.env.BASE_URL || 'http://127.0.0.1:3000'

Expand Down
5 changes: 1 addition & 4 deletions apps/portal-e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"module": "commonjs",
"allowJs": true,
"outDir": "../../dist/out-tsc",
"sourceMap": false
"outDir": "../../dist/out-tsc"
},
"include": [
"**/*.ts",
Expand Down
5 changes: 3 additions & 2 deletions apps/portal/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// TODO: merge with antfu eslint config
// const { FlatCompat } = require('@eslint/eslintrc');
const baseConfigPromise = require('../../eslint.config.js')
// const baseConfigPromise = require('../../eslint.config.js')
import baseConfigPromise from '../../eslint.config.js'
// const js = require('@eslint/js');

module.exports = (async () => {
export default (async () => {
const baseConfig = await baseConfigPromise

return [
Expand Down
4 changes: 2 additions & 2 deletions apps/portal/next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { composePlugins, withNx } = require('@nx/next')
import { composePlugins, withNx } from '@nx/next'

/**
* @type {import('@nx/next/plugins/with-nx').WithNxOptions}
Expand All @@ -16,4 +16,4 @@ const plugins = [
withNx,
]

module.exports = composePlugins(...plugins)(nextConfig)
export default composePlugins(...plugins)(nextConfig)
File renamed without changes.
26 changes: 12 additions & 14 deletions apps/portal/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
const { join } = require('node:path')
const { createGlobPatternsForDependencies } = require('@nx/react/tailwind')
import { join } from 'node:path'
import { createGlobPatternsForDependencies } from '@nx/react/tailwind'

/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
join(
__dirname,
'{src,pages,components,app}/**/*!(*.stories|*.spec).{ts,tsx,html}',
),
...createGlobPatternsForDependencies(__dirname),
],
theme: {
extend: {},
},
plugins: [],
export const content = [
join(
__dirname,
'{src,pages,components,app}/**/*!(*.stories|*.spec).{ts,tsx,html}',
),
...createGlobPatternsForDependencies(__dirname),
]
export const theme = {
extend: {},
}
export const plugins = []
Loading
Loading