Skip to content

Commit e9b02cb

Browse files
authored
feat(nx-dev): Migrate careers from nx.app (nrwl#27020)
1 parent f953ab8 commit e9b02cb

23 files changed

+474
-1
lines changed

nx-dev/data-access-careers/.babelrc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"presets": [
3+
[
4+
"@nx/react/babel",
5+
{
6+
"runtime": "automatic",
7+
"useBuiltIns": "usage"
8+
}
9+
]
10+
],
11+
"plugins": []
12+
}
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7+
"rules": {}
8+
},
9+
{
10+
"files": ["*.ts", "*.tsx"],
11+
"rules": {}
12+
},
13+
{
14+
"files": ["*.js", "*.jsx"],
15+
"rules": {}
16+
}
17+
]
18+
}

nx-dev/data-access-careers/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# data-access-careers
2+
3+
This library was generated with [Nx](https://nx.dev).
4+
5+
## Running unit tests
6+
7+
Run `nx test data-access-careers` to execute the unit tests via [Jest](https://jestjs.io).
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "data-access-careers",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"sourceRoot": "nx-dev/data-access-careers/src",
5+
"projectType": "library",
6+
"tags": ["scope:nx-dev", "type:data-access"],
7+
"// targets": "to see all targets run: nx show project data-access-careers --web",
8+
"targets": {}
9+
}
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Job, LeverJob } from './models';
2+
3+
export async function fetchJobsList(): Promise<Job[]> {
4+
const apiUrl = 'https://api.lever.co/v0/postings/nrwl?mode=json';
5+
6+
const res = await fetch(apiUrl);
7+
8+
if (res.ok) {
9+
const data = (await res.json()) as LeverJob[];
10+
return data.map((job: LeverJob) => ({
11+
title: job.text,
12+
location: job.categories.location,
13+
team: job.categories.team,
14+
url: job.hostedUrl,
15+
}));
16+
} else {
17+
return [];
18+
}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
export interface LeverJob {
2+
additional: string;
3+
additionalPlain: string;
4+
applyUrl: string;
5+
categories: {
6+
commitment: string;
7+
location: string;
8+
team: string;
9+
};
10+
createdAt: number;
11+
description: string;
12+
descriptionPlain: string;
13+
hostedUrl: string;
14+
id: string;
15+
lists: { text: string; content: string }[];
16+
text: string;
17+
}
18+
19+
export interface Job {
20+
location: string;
21+
team: string;
22+
title: string;
23+
url: string;
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './lib/api';
2+
export * from './lib/models';
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"compilerOptions": {
3+
"jsx": "react-jsx",
4+
"allowJs": false,
5+
"esModuleInterop": false,
6+
"allowSyntheticDefaultImports": true,
7+
"strict": true
8+
},
9+
"files": [],
10+
"include": [],
11+
"references": [
12+
{
13+
"path": "./tsconfig.lib.json"
14+
}
15+
],
16+
"extends": "../../tsconfig.base.json"
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../../dist/out-tsc",
5+
"types": [
6+
"node",
7+
8+
"@nx/react/typings/cssmodule.d.ts",
9+
"@nx/react/typings/image.d.ts"
10+
]
11+
},
12+
"exclude": [
13+
"jest.config.ts",
14+
"src/**/*.spec.ts",
15+
"src/**/*.test.ts",
16+
"src/**/*.spec.tsx",
17+
"src/**/*.test.tsx",
18+
"src/**/*.spec.js",
19+
"src/**/*.test.js",
20+
"src/**/*.spec.jsx",
21+
"src/**/*.test.jsx"
22+
],
23+
"include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"]
24+
}

nx-dev/nx-dev/app/careers/page.tsx

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import {
2+
MakeADifference,
3+
WhyJoinNx,
4+
CurrentOpenings,
5+
WhatWeOffer,
6+
} from '@nx/nx-dev/ui-careers';
7+
import { DefaultLayout } from '@nx/nx-dev/ui-common';
8+
9+
import { fetchJobsList } from '@nx/nx-dev/data-access-careers/node-only';
10+
11+
async function getData() {
12+
return await fetchJobsList();
13+
}
14+
15+
export default async function CareersPage() {
16+
const jobs = await getData();
17+
return (
18+
<DefaultLayout>
19+
<MakeADifference />
20+
<div className="mt-32 lg:mt-56">
21+
<WhyJoinNx />
22+
</div>
23+
<div className="mt-32 lg:mt-56">
24+
<CurrentOpenings jobs={jobs} />
25+
</div>
26+
<div className="mt-32 lg:mt-56">
27+
<WhatWeOffer />
28+
</div>
29+
</DefaultLayout>
30+
);
31+
}

nx-dev/nx-dev/app/layout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Metadata, Viewport } from 'next';
2-
import { Header, Footer, AnnouncementBanner } from '@nx/nx-dev/ui-common';
2+
import { AnnouncementBanner } from '@nx/nx-dev/ui-common';
33
import AppRouterAnalytics from './app-router-analytics';
44
import GlobalScripts from './global-scripts';
55

nx-dev/ui-careers/.babelrc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"presets": [
3+
[
4+
"@nx/react/babel",
5+
{
6+
"runtime": "automatic",
7+
"useBuiltIns": "usage"
8+
}
9+
]
10+
],
11+
"plugins": []
12+
}

nx-dev/ui-careers/.eslintrc.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7+
"rules": {}
8+
},
9+
{
10+
"files": ["*.ts", "*.tsx"],
11+
"rules": {}
12+
},
13+
{
14+
"files": ["*.js", "*.jsx"],
15+
"rules": {}
16+
}
17+
]
18+
}

nx-dev/ui-careers/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# ui-careers
2+
3+
This library was generated with [Nx](https://nx.dev).
4+
5+
## Running unit tests
6+
7+
Run `nx test ui-careers` to execute the unit tests via [Jest](https://jestjs.io).

nx-dev/ui-careers/project.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "ui-careers",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"sourceRoot": "nx-dev/ui-careers/src",
5+
"projectType": "library",
6+
"tags": [],
7+
"// targets": "to see all targets run: nx show project ui-careers --web",
8+
"targets": {}
9+
}

nx-dev/ui-careers/src/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export * from './lib/current-openings';
2+
export * from './lib/make-a-difference';
3+
export * from './lib/what-we-offer';
4+
export * from './lib/why-join-nx';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import { SectionHeading } from '@nx/nx-dev/ui-common';
2+
import { Job } from '@nx/nx-dev/data-access-careers/node-only';
3+
4+
interface CurrentOpeningsProps {
5+
jobs: Job[];
6+
}
7+
8+
export async function CurrentOpenings({ jobs }: CurrentOpeningsProps) {
9+
return (
10+
<section
11+
id="current-openings"
12+
className="border-b border-t border-slate-100 bg-slate-50/40 dark:border-slate-800 dark:bg-slate-800/60"
13+
>
14+
<div className="mx-auto max-w-7xl px-4 py-16 sm:px-6 lg:px-8 lg:py-24">
15+
<div className="relative mx-auto max-w-lg divide-y divide-slate-100 lg:max-w-7xl dark:divide-slate-700">
16+
<header className="max-w-prose">
17+
<SectionHeading as="h2" variant="title" className="mt-4">
18+
Current Openings
19+
</SectionHeading>
20+
</header>
21+
22+
<div className="mt-6 grid gap-16 pt-10 lg:grid-cols-2 lg:gap-x-5 lg:gap-y-12">
23+
{jobs.map((post) => (
24+
<div
25+
key={post.title}
26+
className="relative mt-2 block rounded-lg border border-transparent p-4 transition hover:border-slate-100 hover:shadow-sm dark:hover:border-slate-700"
27+
>
28+
<p className="text-lg font-semibold leading-8 tracking-tight text-slate-800 dark:text-slate-200">
29+
{post.title}
30+
</p>
31+
<p className="mt-3 text-base">
32+
{post.location} / {post.team}
33+
</p>
34+
<a
35+
href={post.url}
36+
target="_blank"
37+
rel="nofollow noreferrer"
38+
className="absolute inset-0"
39+
title="Apply for this position"
40+
>
41+
<span className="sr-only">Apply</span>
42+
</a>
43+
</div>
44+
))}
45+
{!jobs.length ? (
46+
<div className="mt-2 block">
47+
<p className="text-lg font-semibold leading-8 tracking-tight text-slate-800 dark:text-slate-200">
48+
There are no job openings at this time.
49+
</p>
50+
</div>
51+
) : null}
52+
</div>
53+
</div>
54+
</div>
55+
</section>
56+
);
57+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { SectionHeading } from '@nx/nx-dev/ui-common';
2+
3+
export function MakeADifference() {
4+
return (
5+
<div
6+
id="careers"
7+
className="mx-auto max-w-3xl px-4 text-center sm:px-6 lg:px-8"
8+
>
9+
<SectionHeading as="h2" variant="display">
10+
Make a difference
11+
</SectionHeading>
12+
<SectionHeading as="p" variant="subtitle" className="mt-6">
13+
We build tools helping companies scale and modernize their development
14+
practices.
15+
</SectionHeading>
16+
</div>
17+
);
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import { CheckIcon } from '@heroicons/react/24/outline';
2+
import { SectionHeading } from '@nx/nx-dev/ui-common';
3+
4+
const features = [
5+
{
6+
name: 'Vacation and Sick Days',
7+
description:
8+
'Four weeks of paid vacation + unlimited sick days. Paid regional holidays. Spend more time with your family and friends.',
9+
},
10+
{
11+
name: 'Remote Work',
12+
description:
13+
'Office space paid for by the company in Phoenix. Or work from home, work from anywhere you want.',
14+
},
15+
{
16+
name: 'Competitive Salaries',
17+
description:
18+
'We pay really well because we want you to live comfortably. Salaried employment with benefits - not hourly contracts.',
19+
},
20+
{
21+
name: 'Flexibility at Work',
22+
description:
23+
'You control your work hours. Run an errand or walk your dog during the day if you need to.',
24+
},
25+
{
26+
name: 'Health, Dental, & Vision Insurance',
27+
description:
28+
'We offer plans for all employees. Canadian employees also get an HSA account.',
29+
},
30+
{
31+
name: 'No Red Tape Attitude Towards Expenses',
32+
description:
33+
'Get the best hardware, software, supplies & books. No pre-approval for small purchases. Phone and internet reimbursement.',
34+
},
35+
{
36+
name: 'Exceptional Career Development',
37+
description:
38+
'Expenses and time off provided for conference attendance and speaking. Write blog posts and books. Meet exceptional folks leading software communities and build your reputation.',
39+
},
40+
];
41+
42+
export function WhatWeOffer(): JSX.Element {
43+
return (
44+
<article className="mx-auto max-w-7xl px-6 lg:grid lg:grid-cols-3 lg:gap-x-12 lg:px-8">
45+
<header>
46+
<SectionHeading as="h2" variant="title">
47+
What we offer
48+
</SectionHeading>
49+
<SectionHeading as="p" variant="subtitle" className="mt-6">
50+
Work/life, balanced
51+
</SectionHeading>
52+
</header>
53+
54+
<div className="mt-20 lg:col-span-2 lg:mt-0">
55+
<dl className="grid grid-cols-1 gap-12 sm:grid-flow-col sm:grid-cols-2 sm:grid-rows-4">
56+
{features.map((feature) => (
57+
<div key={feature.name} className="relative">
58+
<dt>
59+
<CheckIcon
60+
className="absolute mt-1 h-6 w-6 text-blue-500 dark:text-sky-500"
61+
aria-hidden="true"
62+
/>
63+
<p className="ml-10 text-lg font-semibold leading-8 tracking-tight text-slate-800 dark:text-slate-200">
64+
{feature.name}
65+
</p>
66+
</dt>
67+
<dd className="ml-10 mt-2 text-base leading-7">
68+
{feature.description}
69+
</dd>
70+
</div>
71+
))}
72+
</dl>
73+
</div>
74+
</article>
75+
);
76+
}

0 commit comments

Comments
 (0)