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

Feature: OCI Package Composability #1469

Merged
merged 223 commits into from
May 17, 2023
Merged
Show file tree
Hide file tree
Changes from 221 commits
Commits
Show all changes
223 commits
Select commit Hold shift + click to select a range
7f3813a
init skeleton package creation
Noxsios Mar 23, 2023
ababd4e
warn on importing local pkgs is unsupported
Noxsios Mar 23, 2023
a19b0de
handle charts.localPath
Noxsios Mar 23, 2023
45451f6
Merge branch 'main' into oci-package-compose
Racer159 Mar 27, 2023
6c04ee7
make git able to handle relative + home paths
Noxsios Mar 27, 2023
6f15bc2
wip creating mega import example + bad example
Noxsios Mar 30, 2023
fe499a8
wip improving the docs for components
Noxsios Mar 30, 2023
5fe6e60
showcase magic comments
Noxsios Mar 30, 2023
048fddb
Merge branch 'main' into oci-package-compose
Noxsios Mar 30, 2023
1ca0fc6
fix bad package.json
Noxsios Mar 30, 2023
424f9a4
change code theme to shades of purple
Noxsios Mar 30, 2023
21cda03
remove @mdx-js/react docusarus uses its own internally
Noxsios Mar 31, 2023
0967fbe
remove js-yaml
Noxsios Mar 31, 2023
cdffc28
Merge branch 'main' into oci-package-compose
Noxsios Mar 31, 2023
170672f
publish skeleton, wip on composing
Noxsios Apr 1, 2023
4ae9e94
docs and scheme
Noxsios Apr 1, 2023
a867ad4
Merge branch 'main' into oci-package-compose
Noxsios Apr 1, 2023
c4dc7cd
docs and scheme
Noxsios Apr 1, 2023
bbf4ec1
include signing + checksums in skeleton publish
Noxsios Apr 1, 2023
c07888a
create loadSkeleton fn
Noxsios Apr 1, 2023
eabafd2
tarball up the right stuff
Noxsios Apr 1, 2023
4b8b870
docs and scheme
Noxsios Apr 3, 2023
5d59c63
update examples
Noxsios Apr 4, 2023
6ce26f6
create initial test for publishing/composing skeleton packages, this …
Noxsios Apr 4, 2023
503d5cd
restore helm-local-chart
Noxsios Apr 4, 2023
a8affb7
first crack at composition
Noxsios Apr 4, 2023
01803fc
create cache
Noxsios Apr 4, 2023
ec6f87a
Merge branch 'main' into oci-package-compose
Noxsios Apr 4, 2023
e1bb082
fix bad logic fork
Noxsios Apr 4, 2023
0c03b51
mv
Noxsios Apr 4, 2023
0a5beb6
update test
Noxsios Apr 4, 2023
22c9527
Merge branch 'main' into oci-package-compose
Noxsios Apr 4, 2023
b27b044
remove composable-packages target
Noxsios Apr 4, 2023
8b1f8e9
update test w/ version
Noxsios Apr 5, 2023
366d9bf
mutate package path accordingly
Noxsios Apr 5, 2023
51ff7a5
whoops
Noxsios Apr 5, 2023
f140c04
working?
Noxsios Apr 5, 2023
6886047
Merge branch 'main' into oci-package-compose
Noxsios Apr 5, 2023
a489d4d
ok maybe now
Noxsios Apr 5, 2023
2abb0fd
testing nonsense
Noxsios Apr 5, 2023
4092b79
test
Noxsios Apr 5, 2023
51102ab
test
Noxsios Apr 5, 2023
9a107f9
Merge branch 'main' into oci-package-compose
Noxsios Apr 5, 2023
b59c602
update examples
Noxsios Apr 5, 2023
3a29369
test
Noxsios Apr 5, 2023
0cb4183
Merge branch 'main' into oci-package-compose
Noxsios Apr 5, 2023
c837216
getting closer
Noxsios Apr 5, 2023
84456e3
testing
Noxsios Apr 5, 2023
24e2cc5
fix port
Noxsios Apr 6, 2023
ee1f14c
Merge branch 'main' into oci-package-compose
Noxsios Apr 6, 2023
41a0fcd
o boi, try to tackle nested imports
Noxsios Apr 6, 2023
9de3540
pull url into constant
Noxsios Apr 12, 2023
40b255b
update config
Noxsios Apr 12, 2023
868ffbb
Update src/internal/packager/git/pull.go
Noxsios Apr 12, 2023
157babf
lint
Noxsios Apr 12, 2023
5cc9304
Update src/internal/packager/git/pull.go
Noxsios Apr 12, 2023
a573583
move import-everything
Noxsios Apr 13, 2023
9fc603b
fix typo
Noxsios Apr 13, 2023
a094f3f
testing
Noxsios Apr 13, 2023
d143759
merge main
Noxsios Apr 13, 2023
2107428
update image ref
Noxsios Apr 13, 2023
5a7d37f
testing
Noxsios Apr 13, 2023
324d4c8
why is this not working?
Noxsios Apr 13, 2023
5c10f4d
make sure dir exists
Noxsios Apr 13, 2023
d5493ac
more waits
Noxsios Apr 14, 2023
8176fcc
update data injections test
Noxsios Apr 14, 2023
74395cb
testing
Noxsios Apr 14, 2023
d9a3f31
Merge branch 'main' into oci-package-compose
Noxsios Apr 14, 2023
f1ad94f
test
Noxsios Apr 17, 2023
2a6e861
test
Noxsios Apr 17, 2023
df9f6ae
restore working on m1
Noxsios Apr 17, 2023
6b01a19
fail faster
Noxsios Apr 17, 2023
dd0e5ad
fail faster
Noxsios Apr 17, 2023
31a447a
Merge branch 'main' into oci-package-compose
Noxsios Apr 18, 2023
7435b12
fix package removal of non k8s
Noxsios Apr 18, 2023
ae7bb73
restore some deleted files
Noxsios Apr 18, 2023
ba72e9e
working?
Noxsios Apr 18, 2023
686dacd
it might work this time, idk
Noxsios Apr 18, 2023
da55ccd
handle abs paths in imported components during composition
Noxsios Apr 18, 2023
26d6018
Merge branch 'main' into oci-package-compose
Noxsios Apr 18, 2023
ada6d90
fix testing typos
Noxsios Apr 18, 2023
6fdf44e
more typos
Noxsios Apr 18, 2023
90214c0
only grab one component at a time
Noxsios Apr 18, 2023
4aca021
Merge branch 'main' into oci-package-compose
Noxsios Apr 19, 2023
304c7d9
release the 🐙
Noxsios Apr 19, 2023
35dc571
Merge branch 'oci-package-compose' of github.com:defenseunicorns/zarf…
Noxsios Apr 19, 2023
e273b4b
Merge branch 'main' into oci-package-compose
Noxsios Apr 19, 2023
f049998
get partial pulls working
Noxsios Apr 19, 2023
c9fbf41
download values files
Noxsios Apr 19, 2023
07290f3
revert temp changes to allow remote chart
Noxsios Apr 21, 2023
e43e013
derp
Noxsios Apr 21, 2023
178f5dd
unblock while waiting for ORAS to update ErrSkipDesc
Noxsios Apr 21, 2023
b6d1383
Merge branch 'main' into oci-package-compose
Noxsios Apr 21, 2023
d0263a4
inspect the published pkg to view the path mutations
Noxsios Apr 21, 2023
7c7faff
more clarity on testing
Noxsios Apr 21, 2023
702a1a3
Merge branch 'main' into oci-package-compose
Noxsios Apr 21, 2023
9afbbb6
docs and scheme
Noxsios Apr 21, 2023
0e76ef3
use relative path during oci import
Noxsios Apr 21, 2023
2871ad0
Merge branch 'main' into oci-package-compose
Noxsios Apr 21, 2023
26cffb4
yaml validation
Noxsios Apr 21, 2023
342e48d
relative pathing import
Noxsios Apr 21, 2023
0f3a3b1
revert relative pathing funkiness
Noxsios Apr 22, 2023
716b4ba
Merge branch 'main' into oci-package-compose
Noxsios Apr 22, 2023
706ac10
re-add gitea during 51
Noxsios Apr 22, 2023
f194dab
typo
Noxsios Apr 22, 2023
eeca14f
remove support for file:// and absolute paths
Noxsios May 2, 2023
6c83b41
docs and schema
Noxsios May 2, 2023
c546c98
Merge branch 'main' into oci-package-compose
Noxsios May 2, 2023
6fea162
remove more abs paths in tests
Noxsios May 2, 2023
7b06a92
merge main
Noxsios May 2, 2023
68929e7
fix merge from main
Noxsios May 2, 2023
dc9ee6b
use relative paths on importing oci from cache
Noxsios May 2, 2023
2457655
cleanup
Noxsios May 2, 2023
9975d74
tldr; this does quite a few things
Noxsios May 3, 2023
033b6d1
handle older packages
Noxsios May 3, 2023
079e774
handle older packages
Noxsios May 3, 2023
75c5096
linting
Noxsios May 3, 2023
c83a52b
fix tests
Noxsios May 3, 2023
752442e
remove localpaths in favor of per-resource type unique naming
Noxsios May 4, 2023
af55fe5
mkdir --> mkdirall
Noxsios May 4, 2023
e3d48b1
Merge branch 'main' into oci-package-compose
Noxsios May 4, 2023
1763839
fix leftover usage of crcPath
Noxsios May 4, 2023
12f05a9
package compose path checks
Noxsios May 4, 2023
c78303b
change recursive nature to use pathAncestry more
Noxsios May 4, 2023
21226e4
Merge branch 'main' into oci-package-compose
Noxsios May 4, 2023
a162d89
stashing docs changes
Noxsios May 5, 2023
ac89741
cleanup examples metadata.name
Noxsios May 8, 2023
bc53b0a
cleanup examples metadata.name
Noxsios May 8, 2023
46656d8
cleanup
Noxsios May 8, 2023
04a531e
cleanup
Noxsios May 8, 2023
2a2dee0
refactor publish to utilize p.addComponent
Noxsios May 8, 2023
a6eceb4
Apply suggestions from code review
Noxsios May 8, 2023
a7378fc
cleanup
Noxsios May 8, 2023
f67a260
only grab a single component when importing via oci
Noxsios May 8, 2023
a2502cd
fix tests
Noxsios May 8, 2023
eb4ca22
fix tests
Noxsios May 8, 2023
fb2022d
Merge branch 'main' into oci-package-compose
Noxsios May 9, 2023
484bce1
remove blank line in go mod
Noxsios May 9, 2023
fde015c
fix tests
Noxsios May 9, 2023
6b227fe
support remote kustomizations during compose
Noxsios May 9, 2023
2d75869
support remote kustomizations during compose
Noxsios May 9, 2023
010bd57
more cleanup
Noxsios May 9, 2023
dca67b8
more cleanup
Noxsios May 9, 2023
e054a55
docs and schema
Noxsios May 9, 2023
0bd1900
fix import validation logic
Noxsios May 9, 2023
0c44f46
docs
Noxsios May 9, 2023
41900b5
fix publish skeleton oci
Noxsios May 9, 2023
e4611c9
more docs
Noxsios May 9, 2023
3b08979
update examples
Noxsios May 9, 2023
5d3cb4d
docs
Noxsios May 9, 2023
6591b3e
docs and schema
Noxsios May 9, 2023
4a619ea
merge main
Noxsios May 9, 2023
62c966e
docs
Noxsios May 9, 2023
91eb66b
Apply suggestions from code review
Noxsios May 10, 2023
5af49bc
feedback
Noxsios May 10, 2023
b0b8b10
feeedback
Noxsios May 10, 2023
b04a592
handle cosign keypath on skeleton publishes, cleaner check for isSkel…
Noxsios May 11, 2023
87e5ed2
more changes from feedback
Noxsios May 11, 2023
b45757a
simplify code logic a bit and add a few comments
YrrepNoj May 11, 2023
ba21518
add prereq to composable-packages example README
YrrepNoj May 11, 2023
ebae326
set referenceSuffix on publish after we read the zarf yaml
YrrepNoj May 11, 2023
ceb6da1
remove support for oci artifact.manifest
Noxsios May 12, 2023
25dcc49
update compose test
Noxsios May 12, 2023
04c517c
Merge branch 'main' into oci-package-compose
Noxsios May 12, 2023
75f3f15
fix tests
Noxsios May 12, 2023
b87454b
Update src/internal/packager/validate/validate.go
Noxsios May 13, 2023
9b4958d
feedback on docs
Noxsios May 13, 2023
ee5b171
feedback on compose + network
Noxsios May 13, 2023
37967ee
p.archiveComponent()
Noxsios May 13, 2023
569c141
oci:// and sget:// as const
Noxsios May 13, 2023
4d3874b
start transitioning test to be much cleaner
Noxsios May 13, 2023
b274924
merge main
Noxsios May 13, 2023
febb968
fix bad code
Noxsios May 13, 2023
3ff03da
fix archive/unarchive components
Noxsios May 14, 2023
1b25eb8
decompress-all --> unarchive-all
Noxsios May 14, 2023
747a69a
docs and schema
Noxsios May 15, 2023
f34205d
progress on better test
Noxsios May 15, 2023
d43b29c
fix componetPaths base
Noxsios May 15, 2023
de8398a
skip if component has no paths to check
Noxsios May 15, 2023
0bf3d42
tests
Noxsios May 15, 2023
178ed3b
merge main
Noxsios May 15, 2023
ac938ec
Merge branch 'main' into oci-package-compose
Noxsios May 15, 2023
e9adf74
tests
Noxsios May 15, 2023
fb4a1b8
tests
Noxsios May 15, 2023
4ac5f06
Merge branch 'main' into oci-package-compose
Noxsios May 15, 2023
66d40a1
tests
Noxsios May 15, 2023
20a160f
lets see what this does
Noxsios May 16, 2023
95e66e3
revert some changes to archiving/unarchiving components
Noxsios May 16, 2023
2c698ab
some nonsense
Noxsios May 16, 2023
d03da47
docs and schema
Noxsios May 16, 2023
78bb283
revert
Noxsios May 16, 2023
37c4e3f
fix archiver
Noxsios May 16, 2023
3c87a40
fix compose
Noxsios May 16, 2023
82d9083
fix bad test
Noxsios May 16, 2023
2700848
Merge branch 'main' into oci-package-compose
Noxsios May 16, 2023
fe4fd97
Compose action dirs relative to the child (#1720)
Racer159 May 17, 2023
e42b254
Merge branch 'main' into oci-package-compose
Racer159 May 17, 2023
45ed7de
update imporception
Noxsios May 17, 2023
46c0066
Update .gitignore
Noxsios May 17, 2023
3c088e3
Update docs-website/src/components/ExampleYAML.js
Noxsios May 17, 2023
35f9a4f
Update docs/3-create-a-zarf-package/2-zarf-components.md
Noxsios May 17, 2023
88c1194
Update examples/composable-packages/README.md
Noxsios May 17, 2023
8b693ae
Update src/cmd/package.go
Noxsios May 17, 2023
955f85c
Update src/pkg/packager/create.go
Noxsios May 17, 2023
bf49207
Update src/cmd/tools/archiver.go
Noxsios May 17, 2023
b60ddd6
Update src/test/e2e/51_oci_compose_test.go
Noxsios May 17, 2023
e8a5186
Update src/test/e2e/51_oci_compose_test.go
Noxsios May 17, 2023
87e9c5f
Merge branch 'main' into oci-package-compose
Noxsios May 17, 2023
44b67d6
Update src/pkg/packager/create.go
Noxsios May 17, 2023
bdd97d9
Update src/pkg/packager/compose.go
Noxsios May 17, 2023
beeeaeb
Update src/pkg/packager/compose.go
Noxsios May 17, 2023
43097b6
alias unarchive-all <--> decompress-all
Noxsios May 17, 2023
33d83b6
update wordpress readme
Noxsios May 17, 2023
f1a6551
resolve nit
Noxsios May 17, 2023
016c1ee
linting
Noxsios May 17, 2023
c3ffe63
test will properly cleanup after failure, no need to ignore
Noxsios May 17, 2023
3c0bd72
fix bad viper var
Noxsios May 17, 2023
7a1f754
fix bad viper var
Noxsios May 17, 2023
6fa03cc
use sketon suffix
YrrepNoj May 17, 2023
98e510a
update docs and schema
YrrepNoj May 17, 2023
9bbf736
docs and schema
Noxsios May 17, 2023
c68ad85
fix broken link
Noxsios May 17, 2023
4a4cb63
Update decompress flag hiding behavior
Racer159 May 17, 2023
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ zarf-sbom/
*.part*
test-*.txt
__debug_bin
docs-website/static/zarf.schema.json
14 changes: 6 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,17 @@ build-examples: ## Build all of the example packages

@test -s ./build/zarf-package-variables-$(ARCH).tar.zst || $(ZARF_BIN) package create examples/variables --set NGINX_VERSION=1.23.3 -o build -a $(ARCH) --confirm

@test -s ./build/zarf-package-data-injection-demo-$(ARCH).tar || $(ZARF_BIN) package create examples/data-injection -o build -a $(ARCH) --confirm
@test -s ./build/zarf-package-data-injection-$(ARCH).tar || $(ZARF_BIN) package create examples/data-injection -o build -a $(ARCH) --confirm

@test -s ./build/zarf-package-git-data-$(ARCH)-v1.0.0.tar.zst || $(ZARF_BIN) package create examples/git-data -o build -a $(ARCH) --confirm

@test -s ./build/zarf-package-test-helm-releasename-$(ARCH).tar.zst || $(ZARF_BIN) package create examples/helm-alt-release-name -o build -a $(ARCH) --confirm
@test -s ./build/zarf-package-helm-alt-release-name-$(ARCH).tar.zst || $(ZARF_BIN) package create examples/helm-alt-release-name -o build -a $(ARCH) --confirm

@test -s ./build/zarf-package-test-helm-local-chart-$(ARCH).tar.zst || $(ZARF_BIN) package create examples/helm-local-chart -o build -a $(ARCH) --confirm
@test -s ./build/zarf-package-helm-local-chart-$(ARCH)-0.0.1.tar.zst || $(ZARF_BIN) package create examples/helm-local-chart -o build -a $(ARCH) --confirm

@test -s ./build/zarf-package-compose-example-$(ARCH).tar.zst || $(ZARF_BIN) package create examples/composable-packages -o build -a $(ARCH) --confirm
@test -s ./build/zarf-package-podinfo-flux-$(ARCH).tar.zst || $(ZARF_BIN) package create examples/podinfo-flux -o build -a $(ARCH) --confirm

@test -s ./build/zarf-package-flux-test-$(ARCH).tar.zst || $(ZARF_BIN) package create examples/flux-test -o build -a $(ARCH) --confirm

@test -s ./build/zarf-package-test-helm-wait-$(ARCH).tar.zst || $(ZARF_BIN) package create examples/helm-no-wait -o build -a $(ARCH) --confirm
@test -s ./build/zarf-package-helm-no-wait-$(ARCH).tar.zst || $(ZARF_BIN) package create examples/helm-no-wait -o build -a $(ARCH) --confirm

@test -s ./build/zarf-package-helm-oci-chart-$(ARCH)-0.0.1.tar.zst || $(ZARF_BIN) package create examples/helm-oci-chart -o build -a $(ARCH) --confirm

Expand All @@ -159,7 +157,7 @@ test-e2e: build-examples ## Run all of the core Zarf CLI E2E tests (builds any d
test-external: ## Run the Zarf CLI E2E tests for an external registry and cluster
@test -s $(ZARF_BIN) || $(MAKE) build-cli
@test -s ./build/zarf-init-$(ARCH)-$(CLI_VERSION).tar.zst || $(MAKE) init-package
@test -s ./build/zarf-package-flux-test-$(ARCH).tar.zst || $(ZARF_BIN) package create examples/flux-test -o build -a $(ARCH) --confirm
@test -s ./build/zarf-package-podinfo-flux-$(ARCH).tar.zst || $(ZARF_BIN) package create examples/podinfo-flux -o build -a $(ARCH) --confirm
cd src/test/external-test && go test -failfast -v -timeout 30m

## NOTE: Requires an existing cluster and
Expand Down
134 changes: 68 additions & 66 deletions docs-website/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,77 +1,79 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

const darkCodeTheme = require('prism-react-renderer/themes/dracula')
const { SocialsBox } = require('./static-components/SocialsBox/SocialsBox')
const darkCodeTheme = require("prism-react-renderer/themes/shadesOfPurple");
const { SocialsBox } = require("./static-components/SocialsBox/SocialsBox");

/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'Zarf Documentation',
tagline: 'Airgap is hard. Zarf makes it easy.',
url: 'https://zarf.dev',
baseUrl: '/',
onBrokenLinks: 'warn',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.svg',
organizationName: 'Defense Unicorns', // Usually your GitHub org/user name.
projectName: 'Zarf', // Usually your repo name.
title: "Zarf Documentation",
tagline: "Airgap is hard. Zarf makes it easy.",
url: "https://zarf.dev",
baseUrl: "/",
onBrokenLinks: "warn",
onBrokenMarkdownLinks: "throw",
favicon: "img/favicon.svg",
organizationName: "Defense Unicorns", // Usually your GitHub org/user name.
projectName: "Zarf", // Usually your repo name.
markdown: {
mermaid: true,
},
themes: [
[require.resolve('@easyops-cn/docusaurus-search-local'), { hashed: true }],
[require.resolve('@docusaurus/theme-mermaid'), { hashed: true }],
[require.resolve("@easyops-cn/docusaurus-search-local"), { hashed: true }],
[require.resolve("@docusaurus/theme-mermaid"), { hashed: true }],
],
staticDirectories: ["static", "../examples", "../packages"],
presets: [
[
'classic',
"classic",
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
path: '..',
path: "..",
include: [
'CONTRIBUTING.md',
'adr/**/*.{md,mdx}',
'docs/**/*.{md,mdx}',
'examples/**/*.{md,mdx}',
'packages/**/*.{md,mdx}',
"CONTRIBUTING.md",
"adr/**/*.{md,mdx}",
"docs/**/*.{md,mdx}",
"examples/**/*.{md,mdx}",
"packages/**/*.{md,mdx}",
],
sidebarPath: require.resolve('./src/sidebars.js'),
// The '/x/' at the end if the editUrl is patching a defect in the plugin URL rendering. Removing it will break the base path for editing the docs.
editUrl: 'https://github.com/defenseunicorns/zarf/tree/main/x/',
routeBasePath: '/',
async sidebarItemsGenerator({
defaultSidebarItemsGenerator,
...args
}) {
const sidebarItems = await defaultSidebarItemsGenerator(args)
if (args.item.dirName === 'docs') {
showLastUpdateTime: true,
showLastUpdateAuthor: true,
sidebarPath: require.resolve("./src/sidebars.js"),
editUrl: ({ docPath }) => {
// TODO: (@RAZZLE) once examples have been fixed, change this url to edit: `https://github.com/defenseunicorns/zarf/edit/main/${docPath}`
return `https://github.com/defenseunicorns/zarf/tree/main/${docPath}`; // <-- to view
},
routeBasePath: "/",
async sidebarItemsGenerator({ defaultSidebarItemsGenerator, ...args }) {
const sidebarItems = await defaultSidebarItemsGenerator(args);
if (args.item.dirName === "docs") {
// This hack places the examples tree at the 7th position in the sidebar
sidebarItems.splice(6, 0, {
type: 'category',
label: 'Package Examples',
link: {
type: 'doc',
id: 'examples/README',
type: "doc",
id: "examples/README",
},
items: [
{
type: 'autogenerated',
dirName: 'examples',
type: "autogenerated",
dirName: "examples",
},
],
})
});
}
if (args.item.dirName === 'examples') {
if (args.item.dirName === "examples") {
// This hack removes the "Overview" page from the sidebar on the examples page
return sidebarItems.slice(1)
return sidebarItems.slice(1);
}
return sidebarItems
return sidebarItems;
},
},
blog: false,
theme: {
customCss: [require.resolve('./src/css/custom.css')],
customCss: [require.resolve("./src/css/custom.css")],
},
}),
],
Expand All @@ -81,51 +83,51 @@ const config = {
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
colorMode: {
defaultMode: 'dark',
defaultMode: "dark",
disableSwitch: true,
},
navbar: {
logo: {
alt: 'Zarf',
src: 'img/zarf-logo-light.svg',
srcDark: 'img/zarf-logo-dark.svg',
href: 'https://zarf.dev/',
target: '_self',
alt: "Zarf",
src: "img/zarf-logo-light.svg",
srcDark: "img/zarf-logo-dark.svg",
href: "https://zarf.dev/",
target: "_self",
},
items: [
{
type: 'search',
position: 'right',
type: "search",
position: "right",
},
{
type: 'doc',
docId: 'docs/zarf-overview',
position: 'left',
label: 'Docs',
type: "doc",
docId: "docs/zarf-overview",
position: "left",
label: "Docs",
},
{
position: 'left',
label: 'Product',
to: 'https://zarf.dev',
target: '_self',
position: "left",
label: "Product",
to: "https://zarf.dev",
target: "_self",
},
{
type: 'html',
position: 'right',
className: 'navbar__item--socials-box',
type: "html",
position: "right",
className: "navbar__item--socials-box",
value: SocialsBox({
linkClass: 'menu__link',
linkClass: "menu__link",
}),
},
],
},
footer: {
style: 'dark',
style: "dark",
logo: {
alt: 'Zarf',
src: 'img/zarf-logo-light.svg',
srcDark: 'img/zarf-logo-dark.svg',
href: 'https://zarf.dev/',
alt: "Zarf",
src: "img/zarf-logo-light.svg",
srcDark: "img/zarf-logo-dark.svg",
href: "https://zarf.dev/",
},
copyright: `<p class="p-copy">Copyright © ${new Date().getFullYear()} Zarf Project, All rights reserved.</p>`,
links: [
Expand All @@ -139,6 +141,6 @@ const config = {
darkTheme: darkCodeTheme,
},
}),
}
};

module.exports = config
module.exports = config;
2 changes: 2 additions & 0 deletions docs-website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"prestart": "cp ../zarf.schema.json ./static/zarf.schema.json",
"start": "docusaurus start",
"prebuild": "cp ../zarf.schema.json ./static/zarf.schema.json",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
Expand Down
46 changes: 46 additions & 0 deletions docs-website/src/components/ExampleYAML.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import React from "react";
import { useEffect, useState } from "react";
import CodeBlock from "@theme/CodeBlock";

const FetchExampleYAML = ({ example, component, raw, showLink = true, rootFolder = "examples" }) => {
const [content, setContent] = useState(null);
const url = `/${example}/zarf.yaml`;

useEffect(() => {
fetch(url)
.then((res) => res.text())
.then(async (text) => {
if (component) {
const lines = text.split("\n");
const start = lines.indexOf(` - name: ${component}`);
const end = lines.findIndex((line, index) => index > start && line.startsWith(" - name: "));
setContent(lines.slice(start, end).join("\n"));
} else {
setContent(text);
}
});
}, []);

if (!content) {
console.log(`Unable to fetch example YAML ${url}`)
return <></>
}
if (raw) {
return <>{content}</>;
}
return (
<>
{showLink && (
<p>
This example's full <code>zarf.yaml</code> can be viewed at{" "}
<a href={`/${rootFolder}/${example}/#zarf.yaml`}>{rootFolder}/{example}</a>
</p>
)}
<CodeBlock copy={false} language="yaml">
{content}
</CodeBlock>
</>
);
};

export default FetchExampleYAML;
65 changes: 65 additions & 0 deletions docs-website/src/components/SchemaItemProperties.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import React from "react";
import { useEffect, useState } from "react";

const SchemaItemProperties = ({ item, include, invert }) => {
const [itemSchema, setItemSchema] = useState(null);

useEffect(async () => {
const json = await import("@site/static/zarf.schema.json");
setItemSchema(json.definitions[item]);
}, []);

if (!itemSchema) {
return null;
}

return (
<>
<table>
<thead>
<tr>
<th>Field</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
{itemSchema &&
Object.keys(itemSchema.properties)
Noxsios marked this conversation as resolved.
Show resolved Hide resolved
.filter((key) => {
if (!include) {
return true;
} else if (invert) {
return !include.includes(key);
} else {
return include.includes(key);
}
})
.sort()
.sort((key) => (itemSchema.required.includes(key) ? -1 : 1))
.map((key) => {
return (
<tr key={key}>
<td>
<code>{key}</code>
{itemSchema.required.includes(key) && <em>*</em>}
</td>
<td>
<em>{itemSchema.properties[key].type ?? "object"}</em>
</td>
<td>{itemSchema.properties[key].description}</td>
</tr>
);
})}
</tbody>
</table>
{itemSchema && itemSchema.required && itemSchema.required.some((ele) => include.includes(ele)) && (
<small>
<em>* Required field</em>
</small>
)}
</>
);
};

export default SchemaItemProperties;
27 changes: 11 additions & 16 deletions docs-website/src/theme/Footer/Layout/index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
import React from "react";
import clsx from "clsx";
import React from 'react';

// Reorder and remove default styling from copyright, logo, and links.
export default function FooterLayout({ style, links, logo, copyright }) {
return (
<footer
className={clsx("footer", {
"footer--dark": style === "dark",
})}
>
<div className="container container-fluid">
{logo}
{copyright}
{links}
</div>
</footer>
);
export default function FooterLayout({ links, logo, copyright }) {
return (
<footer className="footer footer--dark">
<div className="container container-fluid">
{logo}
{copyright}
{links}
</div>
</footer>
);
}
Loading