@launch77-shared/app-template-webapp 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.ci +6 -0
- package/.env.example +9 -0
- package/.eslintrc.json +6 -0
- package/.gitignore +26 -0
- package/README.md.hbs +80 -0
- package/app/about/page.tsx.hbs +41 -0
- package/app/dashboard/page.tsx.hbs +51 -0
- package/app/globals.css +31 -0
- package/app/layout.tsx.hbs +26 -0
- package/app/page.tsx.hbs +30 -0
- package/launch77-shared-app-template-webapp-1.0.0.tgz +0 -0
- package/next.config.js +99 -0
- package/package.json +37 -0
- package/package.json.hbs +30 -0
- package/postcss.config.js +6 -0
- package/src/modules/release/README.md +164 -0
- package/tailwind.config.ts +20 -0
- package/tsconfig.json +29 -0
- package/vercel.json.hbs +7 -0
package/.env.ci
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# CI/CD Build Environment Variables
|
|
2
|
+
# These values allow Next.js to build and prerender static pages in CI
|
|
3
|
+
# Real production values are set in deployment platform (Vercel)
|
|
4
|
+
NEXT_PUBLIC_SITE_URL=http://localhost:3000
|
|
5
|
+
NEXT_PUBLIC_API_URL=http://localhost:4000/graphql
|
|
6
|
+
NEXT_PUBLIC_GTM_ID=
|
package/.env.example
ADDED
package/.eslintrc.json
ADDED
package/.gitignore
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules/
|
|
3
|
+
|
|
4
|
+
# Next.js
|
|
5
|
+
.next/
|
|
6
|
+
out/
|
|
7
|
+
build/
|
|
8
|
+
|
|
9
|
+
# Environment
|
|
10
|
+
.env
|
|
11
|
+
.env.local
|
|
12
|
+
.env.*.local
|
|
13
|
+
|
|
14
|
+
# Logs
|
|
15
|
+
*.log
|
|
16
|
+
npm-debug.log*
|
|
17
|
+
|
|
18
|
+
# Testing
|
|
19
|
+
coverage/
|
|
20
|
+
|
|
21
|
+
# OS
|
|
22
|
+
.DS_Store
|
|
23
|
+
Thumbs.db
|
|
24
|
+
|
|
25
|
+
# Vercel
|
|
26
|
+
.vercel
|
package/README.md.hbs
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# {{appName}}
|
|
2
|
+
|
|
3
|
+
{{#if startupName}}Part of the {{startupName}} startup{{/if}}
|
|
4
|
+
|
|
5
|
+
A web application built with the Launch77 Platform.
|
|
6
|
+
|
|
7
|
+
## Getting Started
|
|
8
|
+
|
|
9
|
+
1. Install dependencies (from monorepo root):
|
|
10
|
+
```bash
|
|
11
|
+
npm install
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
2. Set up environment variables:
|
|
15
|
+
```bash
|
|
16
|
+
cp .env.example .env.local
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
3. Run the development server:
|
|
20
|
+
```bash
|
|
21
|
+
npm run dev
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Open [http://localhost:{{port}}](http://localhost:{{port}}) in your browser.
|
|
25
|
+
|
|
26
|
+
## Available Scripts
|
|
27
|
+
|
|
28
|
+
- `npm run dev` - Start development server
|
|
29
|
+
- `npm run build` - Build for production
|
|
30
|
+
- `npm run start` - Start production server
|
|
31
|
+
- `npm run lint` - Run ESLint
|
|
32
|
+
- `npm run typecheck` - Run TypeScript type checking
|
|
33
|
+
|
|
34
|
+
## Launch77 Packages
|
|
35
|
+
|
|
36
|
+
This app uses the following Launch77 platform packages:
|
|
37
|
+
|
|
38
|
+
- **@launch77/ui** - Shared component library
|
|
39
|
+
- **@launch77/theme** - Tailwind preset and design tokens
|
|
40
|
+
|
|
41
|
+
## Project Structure
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
app/
|
|
45
|
+
├── layout.tsx # Root layout
|
|
46
|
+
├── page.tsx # Homepage
|
|
47
|
+
├── dashboard/ # Example dashboard page
|
|
48
|
+
├── about/ # About page
|
|
49
|
+
└── globals.css # Global styles (imports @launch77/theme)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Next Steps
|
|
53
|
+
|
|
54
|
+
1. **Add Authentication**: Implement login/register pages and protect routes
|
|
55
|
+
2. **Connect to API**: Set up API client to connect to your backend
|
|
56
|
+
3. **Add Features**: Build out your application features
|
|
57
|
+
|
|
58
|
+
## Using UI Components
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
import { Button, Card, Input } from '@launch77/ui'
|
|
62
|
+
|
|
63
|
+
export default function MyPage() {
|
|
64
|
+
return (
|
|
65
|
+
<Card>
|
|
66
|
+
<Input placeholder="Enter text" />
|
|
67
|
+
<Button>Submit</Button>
|
|
68
|
+
</Card>
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Customizing Theme
|
|
74
|
+
|
|
75
|
+
Extend `tailwind.config.ts` for theme customization.
|
|
76
|
+
|
|
77
|
+
## Learn More
|
|
78
|
+
|
|
79
|
+
- [Next.js Documentation](https://nextjs.org/docs)
|
|
80
|
+
- [Launch77 Platform Docs](../../README.md)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import Link from 'next/link'
|
|
2
|
+
|
|
3
|
+
export default function AboutPage() {
|
|
4
|
+
return (
|
|
5
|
+
<div className="min-h-screen bg-gray-50">
|
|
6
|
+
<nav className="border-b border-gray-200">
|
|
7
|
+
<div className="max-w-7xl mx-auto px-4 py-4">
|
|
8
|
+
<div className="flex items-center justify-between">
|
|
9
|
+
<h1 className="text-xl font-bold text-gray-900">{{appName}}</h1>
|
|
10
|
+
<Link
|
|
11
|
+
href="/"
|
|
12
|
+
className="px-4 py-2 text-sm font-medium text-gray-700 hover:text-gray-900 hover:bg-gray-100 rounded-md transition-colors"
|
|
13
|
+
>
|
|
14
|
+
Home
|
|
15
|
+
</Link>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</nav>
|
|
19
|
+
|
|
20
|
+
<main className="max-w-3xl mx-auto px-4 py-16">
|
|
21
|
+
<h1 className="text-4xl font-bold text-gray-900 mb-4">
|
|
22
|
+
About {{appName}}
|
|
23
|
+
</h1>
|
|
24
|
+
<div className="prose prose-slate">
|
|
25
|
+
<p className="text-lg text-gray-600 mb-4">
|
|
26
|
+
This is a web application built with the Launch77 Platform.
|
|
27
|
+
</p>
|
|
28
|
+
<p className="text-gray-600 mb-4">
|
|
29
|
+
Launch77 provides a modern development environment with:
|
|
30
|
+
</p>
|
|
31
|
+
<ul className="list-disc list-inside text-gray-600 mb-4 space-y-2">
|
|
32
|
+
<li>Next.js for server-side rendering and routing</li>
|
|
33
|
+
<li>Tailwind CSS for styling</li>
|
|
34
|
+
<li>TypeScript for type safety</li>
|
|
35
|
+
<li>Plugin-based architecture for adding capabilities</li>
|
|
36
|
+
</ul>
|
|
37
|
+
</div>
|
|
38
|
+
</main>
|
|
39
|
+
</div>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import Link from 'next/link'
|
|
2
|
+
|
|
3
|
+
export default function DashboardPage() {
|
|
4
|
+
return (
|
|
5
|
+
<div className="min-h-screen bg-gray-50">
|
|
6
|
+
<nav className="border-b border-gray-200">
|
|
7
|
+
<div className="max-w-7xl mx-auto px-4 py-4">
|
|
8
|
+
<div className="flex items-center justify-between">
|
|
9
|
+
<h1 className="text-xl font-bold text-gray-900">{{appName}}</h1>
|
|
10
|
+
<Link
|
|
11
|
+
href="/"
|
|
12
|
+
className="px-4 py-2 text-sm font-medium text-gray-700 hover:text-gray-900 hover:bg-gray-100 rounded-md transition-colors"
|
|
13
|
+
>
|
|
14
|
+
Home
|
|
15
|
+
</Link>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</nav>
|
|
19
|
+
|
|
20
|
+
<main className="max-w-7xl mx-auto px-4 py-8">
|
|
21
|
+
<div className="mb-8">
|
|
22
|
+
<h2 className="text-3xl font-bold text-gray-900 mb-2">Dashboard</h2>
|
|
23
|
+
<p className="text-gray-600">
|
|
24
|
+
This is a protected page example. Add your authentication logic here.
|
|
25
|
+
</p>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
|
|
29
|
+
<div className="rounded-lg border border-gray-200 bg-white p-6">
|
|
30
|
+
<h3 className="font-semibold text-gray-900 mb-2">Card 1</h3>
|
|
31
|
+
<p className="text-sm text-gray-600">
|
|
32
|
+
Example content for your dashboard
|
|
33
|
+
</p>
|
|
34
|
+
</div>
|
|
35
|
+
<div className="rounded-lg border border-gray-200 bg-white p-6">
|
|
36
|
+
<h3 className="font-semibold text-gray-900 mb-2">Card 2</h3>
|
|
37
|
+
<p className="text-sm text-gray-600">
|
|
38
|
+
Example content for your dashboard
|
|
39
|
+
</p>
|
|
40
|
+
</div>
|
|
41
|
+
<div className="rounded-lg border border-gray-200 bg-white p-6">
|
|
42
|
+
<h3 className="font-semibold text-gray-900 mb-2">Card 3</h3>
|
|
43
|
+
<p className="text-sm text-gray-600">
|
|
44
|
+
Example content for your dashboard
|
|
45
|
+
</p>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</main>
|
|
49
|
+
</div>
|
|
50
|
+
)
|
|
51
|
+
}
|
package/app/globals.css
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
@tailwind base;
|
|
2
|
+
@tailwind components;
|
|
3
|
+
@tailwind utilities;
|
|
4
|
+
|
|
5
|
+
/* Base resets and accessibility styles */
|
|
6
|
+
@layer base {
|
|
7
|
+
html {
|
|
8
|
+
scroll-behavior: smooth;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
body {
|
|
12
|
+
@apply antialiased;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/* Focus styles for accessibility */
|
|
16
|
+
:focus-visible {
|
|
17
|
+
@apply outline-none ring-2 ring-blue-500 ring-offset-2;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* Reduced motion support */
|
|
21
|
+
@media (prefers-reduced-motion: reduce) {
|
|
22
|
+
*,
|
|
23
|
+
*::before,
|
|
24
|
+
*::after {
|
|
25
|
+
animation-duration: 0.01ms !important;
|
|
26
|
+
animation-iteration-count: 1 !important;
|
|
27
|
+
transition-duration: 0.01ms !important;
|
|
28
|
+
scroll-behavior: auto !important;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Metadata } from 'next'
|
|
2
|
+
import { Inter } from 'next/font/google'
|
|
3
|
+
|
|
4
|
+
import './globals.css'
|
|
5
|
+
|
|
6
|
+
const inter = Inter({ subsets: ['latin'] })
|
|
7
|
+
|
|
8
|
+
export const metadata: Metadata = {
|
|
9
|
+
title: '{{appName}}',
|
|
10
|
+
description: '{{appName}} - Built with Launch77 Platform',
|
|
11
|
+
icons: {
|
|
12
|
+
icon: '/favicon.ico',
|
|
13
|
+
},
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default function RootLayout({
|
|
17
|
+
children,
|
|
18
|
+
}: {
|
|
19
|
+
children: React.ReactNode
|
|
20
|
+
}) {
|
|
21
|
+
return (
|
|
22
|
+
<html lang="en" className={`${inter.className} scroll-smooth`}>
|
|
23
|
+
<body>{children}</body>
|
|
24
|
+
</html>
|
|
25
|
+
)
|
|
26
|
+
}
|
package/app/page.tsx.hbs
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import Link from 'next/link'
|
|
2
|
+
|
|
3
|
+
export default function HomePage() {
|
|
4
|
+
return (
|
|
5
|
+
<main className="min-h-screen flex items-center justify-center bg-gray-50">
|
|
6
|
+
<div className="max-w-2xl mx-auto px-4 py-16 text-center">
|
|
7
|
+
<h1 className="text-4xl font-bold text-gray-900 mb-4">
|
|
8
|
+
Welcome to {{appName}}
|
|
9
|
+
</h1>
|
|
10
|
+
<p className="text-lg text-gray-600 mb-8">
|
|
11
|
+
Built with the Launch77 Platform
|
|
12
|
+
</p>
|
|
13
|
+
<div className="flex gap-4 justify-center">
|
|
14
|
+
<Link
|
|
15
|
+
href="/dashboard"
|
|
16
|
+
className="inline-flex items-center justify-center px-6 py-3 text-base font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-lg transition-colors"
|
|
17
|
+
>
|
|
18
|
+
Go to Dashboard
|
|
19
|
+
</Link>
|
|
20
|
+
<Link
|
|
21
|
+
href="/about"
|
|
22
|
+
className="inline-flex items-center justify-center px-6 py-3 text-base font-medium text-gray-700 bg-white hover:bg-gray-50 border border-gray-300 rounded-lg transition-colors"
|
|
23
|
+
>
|
|
24
|
+
Learn More
|
|
25
|
+
</Link>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</main>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
Binary file
|
package/next.config.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// Load .env.ci in CI environments for build-time placeholder variables
|
|
2
|
+
// This allows static page generation to succeed without real env values
|
|
3
|
+
// Real values come from deployment platform (Vercel/Railway)
|
|
4
|
+
if (process.env.CI === 'true') {
|
|
5
|
+
const path = require('path')
|
|
6
|
+
require('dotenv').config({ path: path.join(__dirname, '.env.ci') })
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** @type {import('next').NextConfig} */
|
|
10
|
+
const nextConfig = {
|
|
11
|
+
reactStrictMode: true,
|
|
12
|
+
images: {
|
|
13
|
+
formats: ['image/avif', 'image/webp'],
|
|
14
|
+
deviceSizes: [640, 750, 1080, 1200, 1920],
|
|
15
|
+
imageSizes: [16, 32, 48, 64, 96, 128, 256],
|
|
16
|
+
minimumCacheTTL: 60 * 60 * 24 * 365, // 1 year
|
|
17
|
+
},
|
|
18
|
+
compress: true,
|
|
19
|
+
poweredByHeader: false,
|
|
20
|
+
swcMinify: true,
|
|
21
|
+
compiler: {
|
|
22
|
+
removeConsole: process.env.NODE_ENV === 'production',
|
|
23
|
+
},
|
|
24
|
+
headers: async () => [
|
|
25
|
+
{
|
|
26
|
+
source: '/:path*',
|
|
27
|
+
headers: [
|
|
28
|
+
{
|
|
29
|
+
key: 'X-DNS-Prefetch-Control',
|
|
30
|
+
value: 'on',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
key: 'X-Content-Type-Options',
|
|
34
|
+
value: 'nosniff',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
key: 'X-Frame-Options',
|
|
38
|
+
value: 'SAMEORIGIN',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
key: 'X-XSS-Protection',
|
|
42
|
+
value: '1; mode=block',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
key: 'Referrer-Policy',
|
|
46
|
+
value: 'origin-when-cross-origin',
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
// Cache static assets aggressively
|
|
51
|
+
{
|
|
52
|
+
source: '/(.*).jpg',
|
|
53
|
+
headers: [
|
|
54
|
+
{
|
|
55
|
+
key: 'Cache-Control',
|
|
56
|
+
value: 'public, max-age=31536000, immutable',
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
source: '/(.*).png',
|
|
62
|
+
headers: [
|
|
63
|
+
{
|
|
64
|
+
key: 'Cache-Control',
|
|
65
|
+
value: 'public, max-age=31536000, immutable',
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
source: '/(.*).svg',
|
|
71
|
+
headers: [
|
|
72
|
+
{
|
|
73
|
+
key: 'Cache-Control',
|
|
74
|
+
value: 'public, max-age=31536000, immutable',
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
source: '/(.*).webp',
|
|
80
|
+
headers: [
|
|
81
|
+
{
|
|
82
|
+
key: 'Cache-Control',
|
|
83
|
+
value: 'public, max-age=31536000, immutable',
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
source: '/_next/static/(.*)',
|
|
89
|
+
headers: [
|
|
90
|
+
{
|
|
91
|
+
key: 'Cache-Control',
|
|
92
|
+
value: 'public, max-age=31536000, immutable',
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
module.exports = nextConfig
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@launch77-shared/app-template-webapp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Launch77 webapp app template",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"files": [
|
|
8
|
+
"**/*",
|
|
9
|
+
"!node_modules",
|
|
10
|
+
"!dist"
|
|
11
|
+
],
|
|
12
|
+
"keywords": [
|
|
13
|
+
"launch77",
|
|
14
|
+
"template",
|
|
15
|
+
"webapp",
|
|
16
|
+
"nextjs"
|
|
17
|
+
],
|
|
18
|
+
"author": "Launch77",
|
|
19
|
+
"license": "UNLICENSED",
|
|
20
|
+
"scripts": {
|
|
21
|
+
"release:connect": "launch77-release-connect",
|
|
22
|
+
"release:verify": "launch77-release-verify"
|
|
23
|
+
},
|
|
24
|
+
"launch77": {
|
|
25
|
+
"installedPlugins": {
|
|
26
|
+
"release": {
|
|
27
|
+
"package": "release",
|
|
28
|
+
"version": "1.0.0",
|
|
29
|
+
"installedAt": "2026-01-08T02:52:53.166Z",
|
|
30
|
+
"source": "local"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
}
|
|
37
|
+
}
|
package/package.json.hbs
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{#if startupName}}@{{startupName}}/{{appName}}{{else}}{{appName}}{{/if}}",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "{{appName}}{{#if startupName}} ({{startupName}}){{/if}} - Built with Launch77 Platform",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "next dev{{#if port}} -p {{port}}{{/if}}",
|
|
8
|
+
"build": "next build",
|
|
9
|
+
"start": "next start{{#if port}} -p {{port}}{{/if}}",
|
|
10
|
+
"test": "echo \"No tests configured\" && exit 0",
|
|
11
|
+
"lint": "next lint",
|
|
12
|
+
"typecheck": "tsc --noEmit"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"next": "^14.2.0",
|
|
16
|
+
"react": "^18.3.1",
|
|
17
|
+
"react-dom": "^18.3.1"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@types/node": "^20.0.0",
|
|
21
|
+
"@types/react": "^18.2.79",
|
|
22
|
+
"@types/react-dom": "^18.2.25",
|
|
23
|
+
"autoprefixer": "^10.4.21",
|
|
24
|
+
"eslint": "^8.56.0",
|
|
25
|
+
"eslint-config-next": "^14.2.0",
|
|
26
|
+
"postcss": "^8.5.6",
|
|
27
|
+
"tailwindcss": "^3.4.17",
|
|
28
|
+
"typescript": "^5.3.0"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# Release Module
|
|
2
|
+
|
|
3
|
+
This module provides tools to set up and verify npm package publishing with Trusted Publishers.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The release module automates the setup process for publishing packages to npm using GitHub Actions with Trusted Publishers (OIDC). This eliminates the need for NPM_TOKEN secrets and provides a more secure publishing workflow.
|
|
8
|
+
|
|
9
|
+
**Important:** All packages start as `"private": true` by default. This prevents changesets from attempting to publish unprepared packages. Running `release:connect` removes the private flag and configures the package for publishing.
|
|
10
|
+
|
|
11
|
+
## Available Scripts
|
|
12
|
+
|
|
13
|
+
### `npm run release:connect`
|
|
14
|
+
|
|
15
|
+
Interactive script that guides you through the initial npm publishing setup:
|
|
16
|
+
|
|
17
|
+
1. **Validates package.json** - Checks that license and publishConfig are correct
|
|
18
|
+
2. **Builds the package** - Runs `npm run build` to ensure it compiles
|
|
19
|
+
3. **Creates test tarball** - Runs `npm pack` to create a .tgz file
|
|
20
|
+
4. **Prepares for publishing** - Removes `"private": true` and sets `"publishConfig.access": "public"`
|
|
21
|
+
5. **Publishes to npm** - Performs the initial `npm publish` (required for Trusted Publishers)
|
|
22
|
+
6. **Guides Trusted Publisher setup** - Provides step-by-step instructions
|
|
23
|
+
|
|
24
|
+
**When to run:** Once per package, before setting up automated releases.
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm run release:connect
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### `npm run release:verify`
|
|
31
|
+
|
|
32
|
+
Verification script that checks if your package is properly configured:
|
|
33
|
+
|
|
34
|
+
- ✓ Checks package is not private
|
|
35
|
+
- ✓ Checks package.json configuration
|
|
36
|
+
- ✓ Verifies package is published to npm
|
|
37
|
+
- ✓ Validates build succeeds
|
|
38
|
+
- ✓ Shows action items if anything is missing
|
|
39
|
+
|
|
40
|
+
**When to run:** Anytime you want to verify your package is ready for publishing.
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm run release:verify
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Setup Process
|
|
47
|
+
|
|
48
|
+
### Prerequisites
|
|
49
|
+
|
|
50
|
+
Before running `release:connect`, ensure:
|
|
51
|
+
|
|
52
|
+
1. **npm organization exists** - Create at https://www.npmjs.com/org/create
|
|
53
|
+
2. **Workspace is connected to GitHub** - Run `launch77 git:connect`
|
|
54
|
+
3. **Release workflow initialized** - Run `launch77 release:init`
|
|
55
|
+
4. **You're logged into npm** - Run `npm login`
|
|
56
|
+
|
|
57
|
+
### Initial Setup
|
|
58
|
+
|
|
59
|
+
1. Navigate to your package directory:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
cd apps/my-app
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
2. Run the connect script:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npm run release:connect
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
3. Follow the interactive prompts:
|
|
72
|
+
- Confirm package.json settings
|
|
73
|
+
- Build the package
|
|
74
|
+
- Publish to npm
|
|
75
|
+
- Configure Trusted Publisher on npm website
|
|
76
|
+
|
|
77
|
+
4. Verify setup:
|
|
78
|
+
```bash
|
|
79
|
+
npm run release:verify
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Trusted Publishers Setup
|
|
83
|
+
|
|
84
|
+
After running `release:connect`, you need to configure Trusted Publishers on the npm website:
|
|
85
|
+
|
|
86
|
+
1. Visit your package access page:
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
https://www.npmjs.com/package/<your-package-name>/access
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
2. Scroll to "Publishing Access" section
|
|
93
|
+
|
|
94
|
+
3. Click "Configure Trusted Publishers"
|
|
95
|
+
|
|
96
|
+
4. Add GitHub Actions as a trusted publisher:
|
|
97
|
+
- **Provider:** GitHub Actions
|
|
98
|
+
- **Repository owner:** your-github-org
|
|
99
|
+
- **Repository name:** your-repo-name
|
|
100
|
+
- **Workflow:** .github/workflows/ci.yml
|
|
101
|
+
- **Environment:** (leave empty for any)
|
|
102
|
+
|
|
103
|
+
5. Save the configuration
|
|
104
|
+
|
|
105
|
+
Full documentation: https://docs.npmjs.com/trusted-publishers
|
|
106
|
+
|
|
107
|
+
## Publishing Workflow
|
|
108
|
+
|
|
109
|
+
Once setup is complete, use changesets for version management:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Create a changeset (describe what changed)
|
|
113
|
+
npm run changeset
|
|
114
|
+
|
|
115
|
+
# Commit and push to main
|
|
116
|
+
git add .
|
|
117
|
+
git commit -m "Add changeset"
|
|
118
|
+
git push
|
|
119
|
+
|
|
120
|
+
# CI will automatically:
|
|
121
|
+
# 1. Create a "Version Packages" PR
|
|
122
|
+
# 2. When merged, publish to npm via Trusted Publishers
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Troubleshooting
|
|
126
|
+
|
|
127
|
+
### Build Fails
|
|
128
|
+
|
|
129
|
+
If `npm run build` fails:
|
|
130
|
+
|
|
131
|
+
- Fix TypeScript/build errors
|
|
132
|
+
- Ensure all dependencies are installed
|
|
133
|
+
- Check tsconfig.json configuration
|
|
134
|
+
|
|
135
|
+
### Publish Fails (Organization Not Found)
|
|
136
|
+
|
|
137
|
+
If `npm publish` fails with "organization not found":
|
|
138
|
+
|
|
139
|
+
- Create the npm organization first: https://www.npmjs.com/org/create
|
|
140
|
+
- Make sure you're logged in: `npm login`
|
|
141
|
+
- Verify your npm account has access to the organization
|
|
142
|
+
|
|
143
|
+
### Trusted Publisher Not Working
|
|
144
|
+
|
|
145
|
+
If GitHub Actions can't publish after Trusted Publisher setup:
|
|
146
|
+
|
|
147
|
+
- Verify repository owner/name match exactly
|
|
148
|
+
- Check workflow path is correct (.github/workflows/ci.yml)
|
|
149
|
+
- Ensure workflow has `id-token: write` permission
|
|
150
|
+
- Wait a few minutes for npm to propagate changes
|
|
151
|
+
|
|
152
|
+
### Package.json Validation Fails
|
|
153
|
+
|
|
154
|
+
Common fixes:
|
|
155
|
+
|
|
156
|
+
- Set `"license": "UNLICENSED"` for proprietary packages
|
|
157
|
+
- Add `"publishConfig": { "access": "public" }` for scoped packages
|
|
158
|
+
- Ensure `"main"` field points to built output (e.g., "dist/index.js")
|
|
159
|
+
|
|
160
|
+
## Additional Resources
|
|
161
|
+
|
|
162
|
+
- [npm Trusted Publishers Documentation](https://docs.npmjs.com/trusted-publishers)
|
|
163
|
+
- [Changesets Documentation](https://github.com/changesets/changesets)
|
|
164
|
+
- [GitHub Actions OIDC](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Config } from 'tailwindcss'
|
|
2
|
+
|
|
3
|
+
const config: Config = {
|
|
4
|
+
content: ['./app/**/*.{js,ts,jsx,tsx,mdx}', './components/**/*.{js,ts,jsx,tsx,mdx}', './lib/**/*.{js,ts,jsx,tsx,mdx}'],
|
|
5
|
+
theme: {
|
|
6
|
+
extend: {
|
|
7
|
+
// Add your custom theme extensions here
|
|
8
|
+
// Example:
|
|
9
|
+
// colors: {
|
|
10
|
+
// brand: {
|
|
11
|
+
// 500: '#FF5816',
|
|
12
|
+
// 600: '#F03D00',
|
|
13
|
+
// },
|
|
14
|
+
// },
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
plugins: [],
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default config
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"target": "ES2020",
|
|
5
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
6
|
+
"allowJs": true,
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"strict": true,
|
|
9
|
+
"noEmit": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"module": "esnext",
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"resolveJsonModule": true,
|
|
14
|
+
"isolatedModules": true,
|
|
15
|
+
"jsx": "preserve",
|
|
16
|
+
"incremental": true,
|
|
17
|
+
"plugins": [
|
|
18
|
+
{
|
|
19
|
+
"name": "next"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"paths": {
|
|
23
|
+
"@/*": ["./*"]
|
|
24
|
+
},
|
|
25
|
+
"baseUrl": "."
|
|
26
|
+
},
|
|
27
|
+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
|
28
|
+
"exclude": ["node_modules"]
|
|
29
|
+
}
|