Skip to content

Commit 92dc8dc

Browse files
committed
chore: fix link issue; improve env links/assets
1 parent 5c4dde0 commit 92dc8dc

File tree

15 files changed

+16
-169
lines changed

15 files changed

+16
-169
lines changed

.env.example

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ SYNC_LIFECYCLE_DOCS=
22
GITHUB_TOKEN=
33
UI_BRANCH=main
44
CORE_BRANCH=main
5-
LC_DOCS_PUBLISH=
5+
LC_DOCS_PUBLISH=
6+
NEXT_PUBLIC_DEV_ENV=local
7+
DEV_ENV=local

next-env.d.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
/**
2-
* Copyright 2025 GoodRx, Inc.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
171
/// <reference types="next" />
182
/// <reference types="next/image-types/global" />
193

next.config.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
import nextra from "nextra";
1818
import { remarkCodeHike, recmaCodeHike } from "codehike/mdx";
19+
// eslint-disable-next-line no-undef
20+
const isLocal = process.env?.NEXT_PUBLIC_DEV_ENV === 'local';
1921

2022
/** @type {import('codehike/mdx').CodeHikeConfig} */
2123
export const chConfig = {
@@ -45,8 +47,8 @@ const nextConfig = {
4547
output: 'export',
4648
pageExtensions: ["ts", "tsx", "js", "jsx", "md", "mdx", "css"],
4749
reactStrictMode: true,
48-
assetPrefix: '/lifecycle-docs',
49-
basePath: '/lifecycle-docs',
50+
assetPrefix: !isLocal ? '/lifecycle-docs' : '',
51+
basePath: !isLocal ? '/lifecycle-docs' : '',
5052
eslint: {
5153
dirs: ["src"],
5254
ignoreDuringBuilds: true,

scripts/generateJsonSchema.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const octokit = new Octokit({ auth });
3535
export const fetchFileFromRepo = async ({
3636
owner = "goodrxoss",
3737
repo = "lifecycle",
38-
path = "docs/schema/yaml/2.3.0.yaml",
38+
path = "docs/schema/yaml/1.0.0.yaml",
3939
branch = "main",
4040
debug = false,
4141
}: FetchFileOptions): Promise<string> => {
@@ -87,7 +87,7 @@ export const syncYamlFile = async (options: SyncOptions) => {
8787
owner = "goodrxoss",
8888
repo = "lifecycle",
8989
// docs/schema/yaml/2.3.0.yaml
90-
path = "docs/schema/yaml/2.3.0.yaml",
90+
path = "docs/schema/yaml/1.0.0.yaml",
9191
dest = "src/lib/data/lifecycle-schema",
9292
name = "lifecycle",
9393
debug = false,

src/components/home/main/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const Main = () => {
3838
<div className="my-6 flex justify-center md:mb-0 md:justify-end">
3939
<Link
4040
className={`${buttonVariants()} col-span-1 col-end-3`}
41-
href="/docs/getting-started"
41+
href="/docs/getting-started/create-environment"
4242
>
4343
Get Started
4444
</Link>

src/components/image/index.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,12 @@ export const DefinedImage = ({
5151
alt = "",
5252
width = 800,
5353
height = 500,
54-
}: DefinedImageProps) =>
55-
width && height ? (
54+
}: DefinedImageProps) => {
55+
const isLocal = process.env.NEXT_PUBLIC_DEV_ENV === "local";
56+
const currentSrc = !isLocal ? `/lifecycle-docs${src}` : src;
57+
return width && height ? (
5658
<Image
57-
src={`/lifecycle-docs${src}`}
59+
src={currentSrc}
5860
className="absolute inset-0 h-full w-full"
5961
alt={alt}
6062
width={width}
@@ -63,6 +65,7 @@ export const DefinedImage = ({
6365
) : (
6466
<img src={src} className="absolute inset-0 h-full w-full" alt={alt} />
6567
);
68+
};
6669

6770
export default dynamic(() => Promise.resolve(LifecycleDocsImg), {
6871
loading: () => <Loader />,

src/pages/_meta.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
/**
2-
* Copyright 2025 GoodRx, Inc.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
171
export default {
182
"*": {
193
"type": "page"

src/pages/articles/_meta.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
/**
2-
* Copyright 2025 GoodRx, Inc.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
171
export default {
182
"introduction": {
193
"title": "Introducing Lifecycle"

src/pages/docs/_meta.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
/**
2-
* Copyright 2025 GoodRx, Inc.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
171
export default {
182
"what-is-lifecycle": {
193
"title": "What is Lifecycle?"

src/pages/docs/features/_meta.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
/**
2-
* Copyright 2025 GoodRx, Inc.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
171
export default {
182
"auto-deployment": {
193
"title": "Auto Deploy & Labels"

src/pages/docs/getting-started/_meta.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
/**
2-
* Copyright 2025 GoodRx, Inc.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
171
export default {
182
"create-environment": {
193
"title": "Create environment"

src/pages/docs/schema/_meta.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
/**
2-
* Copyright 2025 GoodRx, Inc.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
171
export default {
182
"index": {
193
"title": "Section by section"

src/pages/docs/setup/_meta.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
/**
2-
* Copyright 2025 GoodRx, Inc.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
171
export default {
182
"prerequisites": {
193
"title": "Prerequisites"

src/pages/docs/tips/_meta.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
/**
2-
* Copyright 2025 GoodRx, Inc.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
171
export default {
182
"using-mission-control": {
193
"title": "Mission Control comment"

src/pages/docs/troubleshooting/_meta.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
/**
2-
* Copyright 2025 GoodRx, Inc.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
171
export default {
182
"build-issues": {
193
"title": "Build Issues"

0 commit comments

Comments
 (0)