Skip to content

Commit

Permalink
[COMPLIANCE] Add Copyright and License Headers
Browse files Browse the repository at this point in the history
  • Loading branch information
hashicorp-copywrite[bot] authored Jul 3, 2023
1 parent bdce315 commit 541989c
Show file tree
Hide file tree
Showing 66 changed files with 330 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/basic/app/(app)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

export default function RootLayout({
children,
}: {
Expand Down
5 changes: 5 additions & 0 deletions examples/basic/app/(app)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

export default function Index() {
return <h1>Hello world</h1>
}
5 changes: 5 additions & 0 deletions examples/basic/app/(swingset)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import layout from 'swingset/theme'

export default layout
5 changes: 5 additions & 0 deletions examples/basic/app/(swingset)/swingset/[...path]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { generateStaticParams } from 'swingset/meta'
import { Page } from 'swingset/theme'

Expand Down
5 changes: 5 additions & 0 deletions examples/basic/app/(swingset)/swingset/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import Content from './content.mdx'

export default async function SwingsetRoot() {
Expand Down
5 changes: 5 additions & 0 deletions examples/basic/components/accordion/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { ReactElement } from 'react'

interface AccordionProps {
Expand Down
5 changes: 5 additions & 0 deletions examples/basic/components/button/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { ReactElement } from 'react'

interface ButtonProps {
Expand Down
5 changes: 5 additions & 0 deletions examples/basic/components/card/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

export function Card({ children }) {
return (
<div style={{ border: '1px solid gray', borderRadius: '4px' }}>
Expand Down
5 changes: 5 additions & 0 deletions examples/basic/components/checkbox/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

export function Checkbox(props) {
return <input type="checkbox" {...props} />
}
5 changes: 5 additions & 0 deletions examples/basic/components/nested/title/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

export function Title({ children }) {
return <h1>{children}</h1>
}
5 changes: 5 additions & 0 deletions examples/basic/components/text-input/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

export function TextInput(props) {
return <input {...props} />
}
5 changes: 5 additions & 0 deletions examples/basic/components/text/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

export default function Text({ children }) {
return <span>{children}</span>
}
5 changes: 5 additions & 0 deletions examples/basic/mdx-components.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import themeComponents from 'swingset-theme-hashicorp/components'

export function useMDXComponents(components) {
Expand Down
5 changes: 5 additions & 0 deletions examples/basic/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

/// <reference types="next" />
/// <reference types="next/image-types/global" />

Expand Down
5 changes: 5 additions & 0 deletions examples/basic/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import withSwingset from 'swingset'
import remarkGfm from 'remark-gfm'

Expand Down
5 changes: 5 additions & 0 deletions packages/swingset-theme-hashicorp/postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

module.exports = {
plugins: {
'postcss-import': {},
Expand Down
5 changes: 5 additions & 0 deletions packages/swingset-theme-hashicorp/src/components.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { PropsTable } from './components/props-table'
import { Heading } from './components/heading'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

'use client'
import { SideNavigation } from './side-nav'
import { categories } from 'swingset/meta'
Expand Down
5 changes: 5 additions & 0 deletions packages/swingset-theme-hashicorp/src/components/heading.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { type HTMLAttributes } from 'react'
import { cx, cva } from 'class-variance-authority'

Expand Down
5 changes: 5 additions & 0 deletions packages/swingset-theme-hashicorp/src/components/link.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { type ComponentProps } from 'react'
import NextLink from 'next/link'
import { cx } from 'class-variance-authority'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

'use client'

export function OpenInEditor({ path }: { path: string }) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { ComponentType, ReactNode } from 'react'

interface PropsTableProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { NavigationNode, ComponentNode } from 'swingset/types'
import { LinkItem } from './link-item'
import { cx } from 'class-variance-authority'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { NavigationTree } from 'swingset/types'
import Category from './category'
import { Link } from '../link'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { Link } from "../link"
import { cx } from "class-variance-authority"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { IconChevronLeft24 } from '@hashicorp/flight-icons/svg-react/chevron-left-24'
import { cx } from 'class-variance-authority'

Expand Down
5 changes: 5 additions & 0 deletions packages/swingset-theme-hashicorp/src/css/styles.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

@tailwind base;
@tailwind components;
@tailwind utilities;
5 changes: 5 additions & 0 deletions packages/swingset-theme-hashicorp/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

// NOTE: global css import needs to be at the top so component-specific CSS is loaded after the theme reset (component-specific CSS is loaded as a result of the swingset/meta import below)
import '../style.css'
import React from 'react'
Expand Down
5 changes: 5 additions & 0 deletions packages/swingset-theme-hashicorp/src/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { ComponentEntity, EvaluatedEntity } from 'swingset/types'
import { Heading } from './components/heading'
import { OpenInEditor } from './components/open-in-editor'
Expand Down
5 changes: 5 additions & 0 deletions packages/swingset-theme-hashicorp/tailwind.config.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

/** @type {import('tailwindcss').Config} */
module.exports = {
prefix: 'ss-',
Expand Down
5 changes: 5 additions & 0 deletions packages/swingset-theme-hashicorp/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { Buffer } from 'node:buffer'
import { defineConfig } from 'tsup'

Expand Down
5 changes: 5 additions & 0 deletions packages/swingset/__tests__/get-navigation-tree.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { describe, it } from 'vitest'
import { getNavigationTree } from '../src/get-navigation-tree'
import { ComponentEntity, NavigationTree } from '../src/types'
Expand Down
5 changes: 5 additions & 0 deletions packages/swingset/__tests__/parse-component-path.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { describe, it } from 'vitest'
import { parseComponentPath } from '../src/parse-component-path'

Expand Down
5 changes: 5 additions & 0 deletions packages/swingset/loader.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

/**
* @typedef {import('webpack').LoaderContext<unknown>} LoaderContext
*
Expand Down
5 changes: 5 additions & 0 deletions packages/swingset/postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

module.exports = {
plugins: {
'postcss-import': {},
Expand Down
5 changes: 5 additions & 0 deletions packages/swingset/src/cli/commands/bootstrap.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import fs from 'fs'
import { Logs, codeText } from '../utils/logs'
import childProcess from 'child_process'
Expand Down
5 changes: 5 additions & 0 deletions packages/swingset/src/cli/commands/default.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { Logs } from '../utils/logs'

export const defaultCMD = {
Expand Down
5 changes: 5 additions & 0 deletions packages/swingset/src/cli/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/usr/bin/env node
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import yargs from 'yargs'
import { bootstrap } from './commands/bootstrap'
import { defaultCMD } from './commands/default'
Expand Down
5 changes: 5 additions & 0 deletions packages/swingset/src/cli/utils/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import fs from 'fs'

const usingSrc = fs.existsSync('./src')
Expand Down
5 changes: 5 additions & 0 deletions packages/swingset/src/cli/utils/get-pkg-install-cmd.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { detect, PM } from 'detect-package-manager'
import { error, Logs } from './logs'

Expand Down
5 changes: 5 additions & 0 deletions packages/swingset/src/cli/utils/logs.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { FILES } from './constants'
const redTxt = '\x1b[31m'
const endTxt = '\x1b[0m'
Expand Down
5 changes: 5 additions & 0 deletions packages/swingset/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import { CompileOptions } from '@mdx-js/mdx'

const DEFAULT_CONFIG = {
Expand Down
5 changes: 5 additions & 0 deletions packages/swingset/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

export const MARKDOWN_EXTENSION_REGEX = /\.mdx?$/
export const COMPONENT_DOCS_FILENAME = 'docs.mdx'

Expand Down
5 changes: 5 additions & 0 deletions packages/swingset/src/create-page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/

import React from 'react'
// note: this uses swingset/meta as the import statement, instead of a relative path, so the application build step can pick this up
import { getEntity } from 'swingset/meta'
Expand Down
Loading

0 comments on commit 541989c

Please sign in to comment.