From f2259f2cad7e7b522c0ee964257f24ba9d068ccc Mon Sep 17 00:00:00 2001 From: Ruben Nic Date: Mon, 3 Mar 2025 10:59:18 -0500 Subject: [PATCH 1/6] Add copyright source headers --- .copywrite.hcl | 18 ++++++++++++++++++ .../actions/get-vercel-preview-data/action.yml | 3 +++ .../get-vercel-preview-data/dist/index.js | 5 +++++ .../get-vercel-preview-data/src/index.js | 5 +++++ Dockerfile | 3 +++ app/api/all-docs-paths/route.test.ts | 5 +++++ app/api/all-docs-paths/route.ts | 5 +++++ .../[version]/[...assetPath]/route.test.ts | 5 +++++ .../[version]/[...assetPath]/route.ts | 5 +++++ app/api/content-versions/route.test.ts | 5 +++++ app/api/content-versions/route.ts | 5 +++++ .../doc/[version]/[...docsPath]/route.test.ts | 5 +++++ .../doc/[version]/[...docsPath]/route.ts | 5 +++++ .../[version]/[...section]/route.test.ts | 5 +++++ .../nav-data/[version]/[...section]/route.ts | 5 +++++ .../[productSlug]/redirects/route.test.ts | 5 +++++ .../content/[productSlug]/redirects/route.ts | 5 +++++ .../version-metadata/route.test.ts | 5 +++++ .../[productSlug]/version-metadata/route.ts | 5 +++++ app/layout.tsx | 5 +++++ app/page.tsx | 5 +++++ app/utils/allDocsPaths.test.ts | 5 +++++ app/utils/allDocsPaths.ts | 5 +++++ app/utils/contentVersions.ts | 5 +++++ app/utils/file.ts | 5 +++++ app/utils/findDocVersions.ts | 5 +++++ app/utils/productConfig.mjs | 5 +++++ app/utils/result.ts | 5 +++++ app/utils/utils.test.ts | 5 +++++ docker-compose.yaml | 3 +++ eslint.config.mjs | 5 +++++ next.config.js | 5 +++++ scripts/add-version-to-nav-data.mjs | 5 +++++ .../batch-post-records-to-algolia.mjs | 5 +++++ .../batch-post-records-to-algolia.test.mjs | 5 +++++ scripts/algolia/batch-post-records/index.mjs | 5 +++++ scripts/algolia/build-algolia-records.mjs | 5 +++++ scripts/algolia/convert-mdx-to-json/index.mjs | 5 +++++ .../algolia/convert-mdx-to-json/index.test.mjs | 5 +++++ .../collect-code-list-items.mjs | 5 +++++ .../collect-code-list-items.test.mjs | 5 +++++ .../create-records.mjs | 5 +++++ .../headings/collect-headings.mjs | 5 +++++ .../headings/collect-headings.test.mjs | 5 +++++ scripts/gather-all-versions-docs-paths.mjs | 5 +++++ scripts/gather-all-versions-docs-paths.test.ts | 5 +++++ scripts/gather-version-metadata.mjs | 5 +++++ scripts/gather-version-metadata.test.ts | 5 +++++ .../add-version-to-internal-links.mjs | 5 +++++ .../add-version-to-internal-links.test.mjs | 5 +++++ .../build-mdx-transforms-file.mjs | 5 +++++ .../build-mdx-transforms-file.test.mjs | 5 +++++ .../mdx-transforms/build-mdx-transforms.mjs | 5 +++++ .../include-partials/include-partials.mjs | 5 +++++ .../include-partials/include-partials.test.mjs | 5 +++++ .../paragraph-custom-alert.mjs | 5 +++++ .../paragraph-custom-alert.test.mjs | 5 +++++ .../__fixtures__/redirects.js | 5 +++++ .../rewrite-internal-redirects.mjs | 5 +++++ .../rewrite-internal-redirects.test.mjs | 5 +++++ .../strip-terraform-enterprise-content.mjs | 5 +++++ ...strip-terraform-enterprise-content.test.mjs | 5 +++++ scripts/migrate-content/build-target-repos.mjs | 5 +++++ scripts/migrate-content/clear-and-copy.mjs | 5 +++++ scripts/migrate-content/clone-all-repos.mjs | 5 +++++ scripts/migrate-content/clone-repo.mjs | 5 +++++ .../migrate-content/fetch-version-metadata.mjs | 5 +++++ .../get-target-release-refs.mjs | 5 +++++ scripts/migrate-content/migrate-content.mjs | 5 +++++ scripts/prebuild.mjs | 5 +++++ scripts/utils/batch-promises.mjs | 5 +++++ scripts/utils/copy-asset-file.mjs | 5 +++++ scripts/utils/copy-asset-file.test.ts | 5 +++++ scripts/utils/copy-nav-data-file.mjs | 5 +++++ scripts/utils/copy-nav-data-file.test.mjs | 5 +++++ .../utils/file-path/latest-version/index.mjs | 5 +++++ .../file-path/latest-version/index.test.mjs | 5 +++++ .../file-path/product-directory/index.mjs | 5 +++++ .../file-path/product-directory/index.test.mjs | 5 +++++ scripts/utils/file-path/product-slug/index.mjs | 5 +++++ .../file-path/product-slug/index.test.mjs | 5 +++++ scripts/utils/file-path/version/index.mjs | 5 +++++ scripts/utils/file-path/version/index.test.mjs | 5 +++++ scripts/utils/list-files.mjs | 5 +++++ scripts/watch-content.mjs | 5 +++++ vitest.config.mjs | 5 +++++ 86 files changed, 437 insertions(+) create mode 100644 .copywrite.hcl diff --git a/.copywrite.hcl b/.copywrite.hcl new file mode 100644 index 000000000..017169f82 --- /dev/null +++ b/.copywrite.hcl @@ -0,0 +1,18 @@ +schema_version = 1 + +project { + license = "BUSL-1.1" + copyright_year = 2024 + + header_ignore = [ + "public/**", + "content/**", + "docs/**", + "__fixtures__/**", + "__mocks__/**", + "**/*.json", + ".next/**", + ".husky/**", + "next-env.d.ts", + ] +} diff --git a/.github/actions/get-vercel-preview-data/action.yml b/.github/actions/get-vercel-preview-data/action.yml index 6098f24b8..5f3ec8711 100644 --- a/.github/actions/get-vercel-preview-data/action.yml +++ b/.github/actions/get-vercel-preview-data/action.yml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: BUSL-1.1 + name: Get Vercel Preview Data description: Fetches the latest Vercel preview, inspector URL, and created UTC for the specified project's deployment runs: diff --git a/.github/actions/get-vercel-preview-data/dist/index.js b/.github/actions/get-vercel-preview-data/dist/index.js index d3afe54da..770f86222 100644 --- a/.github/actions/get-vercel-preview-data/dist/index.js +++ b/.github/actions/get-vercel-preview-data/dist/index.js @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ diff --git a/.github/actions/get-vercel-preview-data/src/index.js b/.github/actions/get-vercel-preview-data/src/index.js index 50e87b39a..b0f6b824e 100644 --- a/.github/actions/get-vercel-preview-data/src/index.js +++ b/.github/actions/get-vercel-preview-data/src/index.js @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import * as core from '@actions/core' import fetch from 'node-fetch' diff --git a/Dockerfile b/Dockerfile index 9678ec0b8..8dfecddf8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: BUSL-1.1 + FROM node:20 WORKDIR /server diff --git a/app/api/all-docs-paths/route.test.ts b/app/api/all-docs-paths/route.test.ts index c04d80b5f..dc2b8f33a 100644 --- a/app/api/all-docs-paths/route.test.ts +++ b/app/api/all-docs-paths/route.test.ts @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { expect, test, vi, afterEach } from 'vitest' import docsPathsMock from '../../../__fixtures__/docsPathsAllVersionsMock.json' import { GET } from './route' diff --git a/app/api/all-docs-paths/route.ts b/app/api/all-docs-paths/route.ts index 2a48305e8..75110fceb 100644 --- a/app/api/all-docs-paths/route.ts +++ b/app/api/all-docs-paths/route.ts @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { errorResultToString } from '@utils/result' import { getDocsPaths } from '@utils/allDocsPaths' import { PRODUCT_CONFIG } from '@utils/productConfig.mjs' diff --git a/app/api/assets/[productSlug]/[version]/[...assetPath]/route.test.ts b/app/api/assets/[productSlug]/[version]/[...assetPath]/route.test.ts index 90278d78a..583c74897 100644 --- a/app/api/assets/[productSlug]/[version]/[...assetPath]/route.test.ts +++ b/app/api/assets/[productSlug]/[version]/[...assetPath]/route.test.ts @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { expect, test, vi } from 'vitest' import { GET } from './route' import { getAssetData } from '@utils/file' diff --git a/app/api/assets/[productSlug]/[version]/[...assetPath]/route.ts b/app/api/assets/[productSlug]/[version]/[...assetPath]/route.ts index 92c610cc0..789908419 100644 --- a/app/api/assets/[productSlug]/[version]/[...assetPath]/route.ts +++ b/app/api/assets/[productSlug]/[version]/[...assetPath]/route.ts @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { getAssetData } from '@utils/file' import { getProductVersion } from '@utils/contentVersions' import { errorResultToString } from '@utils/result' diff --git a/app/api/content-versions/route.test.ts b/app/api/content-versions/route.test.ts index b74fbfb60..a2781788b 100644 --- a/app/api/content-versions/route.test.ts +++ b/app/api/content-versions/route.test.ts @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { expect, test, vi, beforeEach, afterEach } from 'vitest' import { GET } from './route' diff --git a/app/api/content-versions/route.ts b/app/api/content-versions/route.ts index 96ddffe27..d23c15ba0 100644 --- a/app/api/content-versions/route.ts +++ b/app/api/content-versions/route.ts @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { findDocVersions } from '../../utils/findDocVersions' import { PRODUCT_CONFIG } from '@utils/productConfig.mjs' diff --git a/app/api/content/[productSlug]/doc/[version]/[...docsPath]/route.test.ts b/app/api/content/[productSlug]/doc/[version]/[...docsPath]/route.test.ts index 15d54c9f6..37cf93f45 100644 --- a/app/api/content/[productSlug]/doc/[version]/[...docsPath]/route.test.ts +++ b/app/api/content/[productSlug]/doc/[version]/[...docsPath]/route.test.ts @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { expect, describe, diff --git a/app/api/content/[productSlug]/doc/[version]/[...docsPath]/route.ts b/app/api/content/[productSlug]/doc/[version]/[...docsPath]/route.ts index 66061fd0c..1a9d804f0 100644 --- a/app/api/content/[productSlug]/doc/[version]/[...docsPath]/route.ts +++ b/app/api/content/[productSlug]/doc/[version]/[...docsPath]/route.ts @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { readFile, parseMarkdownFrontMatter } from '@utils/file' import { getProductVersion } from '@utils/contentVersions' import { errorResultToString } from '@utils/result' diff --git a/app/api/content/[productSlug]/nav-data/[version]/[...section]/route.test.ts b/app/api/content/[productSlug]/nav-data/[version]/[...section]/route.test.ts index 68390cd1d..b99ebd9e7 100644 --- a/app/api/content/[productSlug]/nav-data/[version]/[...section]/route.test.ts +++ b/app/api/content/[productSlug]/nav-data/[version]/[...section]/route.test.ts @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { expect, describe, diff --git a/app/api/content/[productSlug]/nav-data/[version]/[...section]/route.ts b/app/api/content/[productSlug]/nav-data/[version]/[...section]/route.ts index bc9d585b1..2ee7253f2 100644 --- a/app/api/content/[productSlug]/nav-data/[version]/[...section]/route.ts +++ b/app/api/content/[productSlug]/nav-data/[version]/[...section]/route.ts @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { readFile, parseJson } from '@utils/file' import { getProductVersion } from '@utils/contentVersions' import { errorResultToString } from '@utils/result' diff --git a/app/api/content/[productSlug]/redirects/route.test.ts b/app/api/content/[productSlug]/redirects/route.test.ts index 69baf53bf..593d6ad0b 100644 --- a/app/api/content/[productSlug]/redirects/route.test.ts +++ b/app/api/content/[productSlug]/redirects/route.test.ts @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { expect, test, vi } from 'vitest' import { GET } from './route' diff --git a/app/api/content/[productSlug]/redirects/route.ts b/app/api/content/[productSlug]/redirects/route.ts index 9796a9e27..90d4c0b58 100644 --- a/app/api/content/[productSlug]/redirects/route.ts +++ b/app/api/content/[productSlug]/redirects/route.ts @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { getProductVersion } from '@utils/contentVersions' import { readFile, parseJsonc } from '@utils/file' import { errorResultToString } from '@utils/result' diff --git a/app/api/content/[productSlug]/version-metadata/route.test.ts b/app/api/content/[productSlug]/version-metadata/route.test.ts index 49f27ea26..905e5f3bd 100644 --- a/app/api/content/[productSlug]/version-metadata/route.test.ts +++ b/app/api/content/[productSlug]/version-metadata/route.test.ts @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { expect, describe, diff --git a/app/api/content/[productSlug]/version-metadata/route.ts b/app/api/content/[productSlug]/version-metadata/route.ts index d7ed4f847..493d30a61 100644 --- a/app/api/content/[productSlug]/version-metadata/route.ts +++ b/app/api/content/[productSlug]/version-metadata/route.ts @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { getProductVersionMetadata } from '@utils/contentVersions' import { errorResultToString } from '@utils/result' diff --git a/app/layout.tsx b/app/layout.tsx index 46fe4b82f..a610d448e 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import React from 'react' // eslint-disable-next-line no-restricted-exports diff --git a/app/page.tsx b/app/page.tsx index c9f35c5bd..b6eeb846c 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + /** Add your relevant code here for the issue to reproduce */ // eslint-disable-next-line no-restricted-exports export default function Home() { diff --git a/app/utils/allDocsPaths.test.ts b/app/utils/allDocsPaths.test.ts index e937e8147..b079bcd24 100644 --- a/app/utils/allDocsPaths.test.ts +++ b/app/utils/allDocsPaths.test.ts @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { expect, test, vi } from 'vitest' import { getDocsPaths } from './allDocsPaths' import docsPathsMock from '../../__fixtures__/docsPathsAllVersionsMock.json' diff --git a/app/utils/allDocsPaths.ts b/app/utils/allDocsPaths.ts index e837a7873..1e52e9ef5 100644 --- a/app/utils/allDocsPaths.ts +++ b/app/utils/allDocsPaths.ts @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { Ok, Err, errorResultToString } from '@utils/result' import docsPathsAllVersions from '@api/docsPathsAllVersions.json' import { getProductVersion } from './contentVersions' diff --git a/app/utils/contentVersions.ts b/app/utils/contentVersions.ts index 34c4596f3..95a7d44b7 100644 --- a/app/utils/contentVersions.ts +++ b/app/utils/contentVersions.ts @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import versionMetadata from '@api/versionMetadata.json' import { Ok, Err } from '@utils/result' diff --git a/app/utils/file.ts b/app/utils/file.ts index 241dcfe5e..6018533cf 100644 --- a/app/utils/file.ts +++ b/app/utils/file.ts @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import grayMatter from 'gray-matter' import { parse as jsoncParse } from 'jsonc-parser' diff --git a/app/utils/findDocVersions.ts b/app/utils/findDocVersions.ts index fe1ac9be5..3be8b07e3 100644 --- a/app/utils/findDocVersions.ts +++ b/app/utils/findDocVersions.ts @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import docsPathsAllVersions from '@api/docsPathsAllVersions.json' /** diff --git a/app/utils/productConfig.mjs b/app/utils/productConfig.mjs index 46a9bc494..9fdb7a667 100644 --- a/app/utils/productConfig.mjs +++ b/app/utils/productConfig.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import semver from 'semver' /** diff --git a/app/utils/result.ts b/app/utils/result.ts index c71267ca6..ded204494 100644 --- a/app/utils/result.ts +++ b/app/utils/result.ts @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + // The result type is used to represent the result of an operation that can fail. It is a common pattern in Rust and other languages. This pattern is useful for handling errors in a more structured way and avoiding exceptions. Because any error state is wrapped in Err and any success state is wrapped in Ok. See "app/utils/file.ts" for an example of how this is used. export type Result = diff --git a/app/utils/utils.test.ts b/app/utils/utils.test.ts index f4717c414..fbd7bcb32 100644 --- a/app/utils/utils.test.ts +++ b/app/utils/utils.test.ts @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { expect, test, vi, afterEach, beforeEach } from 'vitest' import { vol } from 'memfs' import { diff --git a/docker-compose.yaml b/docker-compose.yaml index c623b97eb..0a73c5e1c 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: BUSL-1.1 + services: dev-portal: image: 'hashicorp/dev-portal:latest' diff --git a/eslint.config.mjs b/eslint.config.mjs index 79bd65e98..aeedb4189 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import globals from 'globals' import pluginJs from '@eslint/js' import tseslint from 'typescript-eslint' diff --git a/next.config.js b/next.config.js index 90e2cc0b5..45de98024 100644 --- a/next.config.js +++ b/next.config.js @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + /** @type {import("next").NextConfig} */ const nextConfig = { reactStrictMode: true, diff --git a/scripts/add-version-to-nav-data.mjs b/scripts/add-version-to-nav-data.mjs index 0be7a7dbc..e8fdc86d3 100644 --- a/scripts/add-version-to-nav-data.mjs +++ b/scripts/add-version-to-nav-data.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import fs from 'node:fs/promises' import { PRODUCT_CONFIG } from '../app/utils/productConfig.mjs' import semver from 'semver' diff --git a/scripts/algolia/batch-post-records/batch-post-records-to-algolia.mjs b/scripts/algolia/batch-post-records/batch-post-records-to-algolia.mjs index 5a4c6db76..015b15a41 100644 --- a/scripts/algolia/batch-post-records/batch-post-records-to-algolia.mjs +++ b/scripts/algolia/batch-post-records/batch-post-records-to-algolia.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import fs from 'fs' import algoliasearch from 'algoliasearch' diff --git a/scripts/algolia/batch-post-records/batch-post-records-to-algolia.test.mjs b/scripts/algolia/batch-post-records/batch-post-records-to-algolia.test.mjs index 6426b3273..b8f6f10dd 100644 --- a/scripts/algolia/batch-post-records/batch-post-records-to-algolia.test.mjs +++ b/scripts/algolia/batch-post-records/batch-post-records-to-algolia.test.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { describe, it, expect, vi, afterEach } from 'vitest' import { batchPostRecords } from './batch-post-records-to-algolia.mjs' import algoliasearch from 'algoliasearch' diff --git a/scripts/algolia/batch-post-records/index.mjs b/scripts/algolia/batch-post-records/index.mjs index c5debcd61..9538aad1c 100644 --- a/scripts/algolia/batch-post-records/index.mjs +++ b/scripts/algolia/batch-post-records/index.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { batchPostRecords } from './batch-post-records-to-algolia.mjs' import path from 'path' diff --git a/scripts/algolia/build-algolia-records.mjs b/scripts/algolia/build-algolia-records.mjs index 9ae6a8251..5fa87cfe0 100644 --- a/scripts/algolia/build-algolia-records.mjs +++ b/scripts/algolia/build-algolia-records.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import path from 'path' import grayMatter from 'gray-matter' import { createAlgoliaRecordObject } from './transform-mdx-to-algolia-record/create-records.mjs' diff --git a/scripts/algolia/convert-mdx-to-json/index.mjs b/scripts/algolia/convert-mdx-to-json/index.mjs index 02295650c..11863566f 100644 --- a/scripts/algolia/convert-mdx-to-json/index.mjs +++ b/scripts/algolia/convert-mdx-to-json/index.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import path from 'path' import { readdir } from 'node:fs/promises' import { getLatestVersion } from '../../utils/file-path/latest-version/index.mjs' diff --git a/scripts/algolia/convert-mdx-to-json/index.test.mjs b/scripts/algolia/convert-mdx-to-json/index.test.mjs index f62f0d089..910a5179f 100644 --- a/scripts/algolia/convert-mdx-to-json/index.test.mjs +++ b/scripts/algolia/convert-mdx-to-json/index.test.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { describe, test, expect, vi } from 'vitest' import path from 'path' import { readdir } from 'node:fs/promises' diff --git a/scripts/algolia/transform-mdx-to-algolia-record/code-list-items/collect-code-list-items.mjs b/scripts/algolia/transform-mdx-to-algolia-record/code-list-items/collect-code-list-items.mjs index 42e6feb0a..42beb93cf 100644 --- a/scripts/algolia/transform-mdx-to-algolia-record/code-list-items/collect-code-list-items.mjs +++ b/scripts/algolia/transform-mdx-to-algolia-record/code-list-items/collect-code-list-items.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import remark from 'remark' import visit from 'unist-util-visit' import is from 'unist-util-is' diff --git a/scripts/algolia/transform-mdx-to-algolia-record/code-list-items/collect-code-list-items.test.mjs b/scripts/algolia/transform-mdx-to-algolia-record/code-list-items/collect-code-list-items.test.mjs index 002b4ccb5..79edfe792 100644 --- a/scripts/algolia/transform-mdx-to-algolia-record/code-list-items/collect-code-list-items.test.mjs +++ b/scripts/algolia/transform-mdx-to-algolia-record/code-list-items/collect-code-list-items.test.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { describe, test, expect } from 'vitest' import { collectCodeListItems } from './collect-code-list-items.mjs' diff --git a/scripts/algolia/transform-mdx-to-algolia-record/create-records.mjs b/scripts/algolia/transform-mdx-to-algolia-record/create-records.mjs index a2151bd84..3c72f70a6 100644 --- a/scripts/algolia/transform-mdx-to-algolia-record/create-records.mjs +++ b/scripts/algolia/transform-mdx-to-algolia-record/create-records.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { PRODUCT_CONFIG } from '../../../app/utils/productConfig.mjs' import { collectHeadings } from './headings/collect-headings.mjs' import { collectCodeListItems } from './code-list-items/collect-code-list-items.mjs' diff --git a/scripts/algolia/transform-mdx-to-algolia-record/headings/collect-headings.mjs b/scripts/algolia/transform-mdx-to-algolia-record/headings/collect-headings.mjs index dc213ce44..34cdb3e8f 100644 --- a/scripts/algolia/transform-mdx-to-algolia-record/headings/collect-headings.mjs +++ b/scripts/algolia/transform-mdx-to-algolia-record/headings/collect-headings.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import remark from 'remark' import visit from 'unist-util-visit' diff --git a/scripts/algolia/transform-mdx-to-algolia-record/headings/collect-headings.test.mjs b/scripts/algolia/transform-mdx-to-algolia-record/headings/collect-headings.test.mjs index c8c989503..78f99dc12 100644 --- a/scripts/algolia/transform-mdx-to-algolia-record/headings/collect-headings.test.mjs +++ b/scripts/algolia/transform-mdx-to-algolia-record/headings/collect-headings.test.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { describe, test, expect } from 'vitest' import { collectHeadings } from './collect-headings.mjs' diff --git a/scripts/gather-all-versions-docs-paths.mjs b/scripts/gather-all-versions-docs-paths.mjs index 408547193..da5368ae0 100644 --- a/scripts/gather-all-versions-docs-paths.mjs +++ b/scripts/gather-all-versions-docs-paths.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import fs from 'fs' import path from 'path' import { PRODUCT_CONFIG } from '../app/utils/productConfig.mjs' diff --git a/scripts/gather-all-versions-docs-paths.test.ts b/scripts/gather-all-versions-docs-paths.test.ts index 5c2ad02c1..8f3a5e5f6 100644 --- a/scripts/gather-all-versions-docs-paths.test.ts +++ b/scripts/gather-all-versions-docs-paths.test.ts @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { expect, test, vi, afterEach } from 'vitest' import { gatherAllVersionsDocsPaths } from './gather-all-versions-docs-paths.mjs' import * as repoConfig from '../app/utils/productConfig.mjs' diff --git a/scripts/gather-version-metadata.mjs b/scripts/gather-version-metadata.mjs index 9de8f695f..4bc2da646 100644 --- a/scripts/gather-version-metadata.mjs +++ b/scripts/gather-version-metadata.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import fs from 'fs' import path from 'path' // Third-party diff --git a/scripts/gather-version-metadata.test.ts b/scripts/gather-version-metadata.test.ts index a722dc299..d40e89778 100644 --- a/scripts/gather-version-metadata.test.ts +++ b/scripts/gather-version-metadata.test.ts @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { beforeEach, expect, it, vi } from 'vitest' import { vol } from 'memfs' import { gatherVersionMetadata } from './gather-version-metadata.mjs' diff --git a/scripts/mdx-transforms/add-version-to-internal-links/add-version-to-internal-links.mjs b/scripts/mdx-transforms/add-version-to-internal-links/add-version-to-internal-links.mjs index 1194e4614..4c5f06144 100644 --- a/scripts/mdx-transforms/add-version-to-internal-links/add-version-to-internal-links.mjs +++ b/scripts/mdx-transforms/add-version-to-internal-links/add-version-to-internal-links.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import remark from 'remark' import remarkMdx from 'remark-mdx' import flatMap from 'unist-util-flatmap' diff --git a/scripts/mdx-transforms/add-version-to-internal-links/add-version-to-internal-links.test.mjs b/scripts/mdx-transforms/add-version-to-internal-links/add-version-to-internal-links.test.mjs index 06667eea4..3fbfdb164 100644 --- a/scripts/mdx-transforms/add-version-to-internal-links/add-version-to-internal-links.test.mjs +++ b/scripts/mdx-transforms/add-version-to-internal-links/add-version-to-internal-links.test.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { describe, it, expect, vi } from 'vitest' import { transformRewriteInternalLinks } from './add-version-to-internal-links.mjs' import versionMetadata from '__fixtures__/versionMetadata.json' diff --git a/scripts/mdx-transforms/build-mdx-transforms-file.mjs b/scripts/mdx-transforms/build-mdx-transforms-file.mjs index a9f9ce21b..75cb90713 100644 --- a/scripts/mdx-transforms/build-mdx-transforms-file.mjs +++ b/scripts/mdx-transforms/build-mdx-transforms-file.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import fs from 'fs' import path from 'path' diff --git a/scripts/mdx-transforms/build-mdx-transforms-file.test.mjs b/scripts/mdx-transforms/build-mdx-transforms-file.test.mjs index 0f57b2996..857a8dd41 100644 --- a/scripts/mdx-transforms/build-mdx-transforms-file.test.mjs +++ b/scripts/mdx-transforms/build-mdx-transforms-file.test.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { expect, test, vi, beforeEach } from 'vitest' import { fs, vol } from 'memfs' import { diff --git a/scripts/mdx-transforms/build-mdx-transforms.mjs b/scripts/mdx-transforms/build-mdx-transforms.mjs index 8f7cc35db..0ec880936 100644 --- a/scripts/mdx-transforms/build-mdx-transforms.mjs +++ b/scripts/mdx-transforms/build-mdx-transforms.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import fs from 'fs' import path from 'path' diff --git a/scripts/mdx-transforms/include-partials/include-partials.mjs b/scripts/mdx-transforms/include-partials/include-partials.mjs index f80ccac08..82065d49e 100644 --- a/scripts/mdx-transforms/include-partials/include-partials.mjs +++ b/scripts/mdx-transforms/include-partials/include-partials.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + // Third-party import remark from 'remark' import remarkMdx from 'remark-mdx' diff --git a/scripts/mdx-transforms/include-partials/include-partials.test.mjs b/scripts/mdx-transforms/include-partials/include-partials.test.mjs index 2f6d1c877..a013e15da 100644 --- a/scripts/mdx-transforms/include-partials/include-partials.test.mjs +++ b/scripts/mdx-transforms/include-partials/include-partials.test.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import fs from 'fs' import { describe, expect, test } from 'vitest' diff --git a/scripts/mdx-transforms/paragraph-custom-alert/paragraph-custom-alert.mjs b/scripts/mdx-transforms/paragraph-custom-alert/paragraph-custom-alert.mjs index 3ecbda9ec..7a3890efe 100644 --- a/scripts/mdx-transforms/paragraph-custom-alert/paragraph-custom-alert.mjs +++ b/scripts/mdx-transforms/paragraph-custom-alert/paragraph-custom-alert.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import remark from 'remark' import remarkMdx from 'remark-mdx' import is from 'unist-util-is' diff --git a/scripts/mdx-transforms/paragraph-custom-alert/paragraph-custom-alert.test.mjs b/scripts/mdx-transforms/paragraph-custom-alert/paragraph-custom-alert.test.mjs index fa784ad9e..284816915 100644 --- a/scripts/mdx-transforms/paragraph-custom-alert/paragraph-custom-alert.test.mjs +++ b/scripts/mdx-transforms/paragraph-custom-alert/paragraph-custom-alert.test.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import fs from 'fs' import path from 'path' import { describe, expect, test } from 'vitest' diff --git a/scripts/mdx-transforms/rewrite-internal-redirects/__fixtures__/redirects.js b/scripts/mdx-transforms/rewrite-internal-redirects/__fixtures__/redirects.js index b0790a9a0..9251b0621 100644 --- a/scripts/mdx-transforms/rewrite-internal-redirects/__fixtures__/redirects.js +++ b/scripts/mdx-transforms/rewrite-internal-redirects/__fixtures__/redirects.js @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + module.exports = [ { source: '/before-rewrite', diff --git a/scripts/mdx-transforms/rewrite-internal-redirects/rewrite-internal-redirects.mjs b/scripts/mdx-transforms/rewrite-internal-redirects/rewrite-internal-redirects.mjs index 977bd1981..190d11a3f 100644 --- a/scripts/mdx-transforms/rewrite-internal-redirects/rewrite-internal-redirects.mjs +++ b/scripts/mdx-transforms/rewrite-internal-redirects/rewrite-internal-redirects.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import remark from 'remark' import remarkMdx from 'remark-mdx' import flatMap from 'unist-util-flatmap' diff --git a/scripts/mdx-transforms/rewrite-internal-redirects/rewrite-internal-redirects.test.mjs b/scripts/mdx-transforms/rewrite-internal-redirects/rewrite-internal-redirects.test.mjs index 5683658b5..34f1e315f 100644 --- a/scripts/mdx-transforms/rewrite-internal-redirects/rewrite-internal-redirects.test.mjs +++ b/scripts/mdx-transforms/rewrite-internal-redirects/rewrite-internal-redirects.test.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import fs from 'fs' import path from 'path' import { describe, expect, test } from 'vitest' diff --git a/scripts/mdx-transforms/strip-terraform-enterprise-content/strip-terraform-enterprise-content.mjs b/scripts/mdx-transforms/strip-terraform-enterprise-content/strip-terraform-enterprise-content.mjs index bf6bcb5f0..73a7bfeaf 100644 --- a/scripts/mdx-transforms/strip-terraform-enterprise-content/strip-terraform-enterprise-content.mjs +++ b/scripts/mdx-transforms/strip-terraform-enterprise-content/strip-terraform-enterprise-content.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import visit from 'unist-util-visit' // this is a courtesy wrapper to prepend [strip-terraform-enterprise-content] diff --git a/scripts/mdx-transforms/strip-terraform-enterprise-content/strip-terraform-enterprise-content.test.mjs b/scripts/mdx-transforms/strip-terraform-enterprise-content/strip-terraform-enterprise-content.test.mjs index 99bc8c5f7..bb1b77526 100644 --- a/scripts/mdx-transforms/strip-terraform-enterprise-content/strip-terraform-enterprise-content.test.mjs +++ b/scripts/mdx-transforms/strip-terraform-enterprise-content/strip-terraform-enterprise-content.test.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { describe, it, expect, vi } from 'vitest' import { transformStripTerraformEnterpriseContent } from './strip-terraform-enterprise-content.mjs' import remark from 'remark' diff --git a/scripts/migrate-content/build-target-repos.mjs b/scripts/migrate-content/build-target-repos.mjs index 3bf6eb440..06c7d02b1 100644 --- a/scripts/migrate-content/build-target-repos.mjs +++ b/scripts/migrate-content/build-target-repos.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { PRODUCT_CONFIG } from '../../app/utils/productConfig.mjs' /** diff --git a/scripts/migrate-content/clear-and-copy.mjs b/scripts/migrate-content/clear-and-copy.mjs index 6eaa9ff18..3197eacb4 100644 --- a/scripts/migrate-content/clear-and-copy.mjs +++ b/scripts/migrate-content/clear-and-copy.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import fs from 'fs' import path from 'path' import { execSync } from 'child_process' diff --git a/scripts/migrate-content/clone-all-repos.mjs b/scripts/migrate-content/clone-all-repos.mjs index 1ba80ba16..3f53c416f 100644 --- a/scripts/migrate-content/clone-all-repos.mjs +++ b/scripts/migrate-content/clone-all-repos.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { execSync } from 'child_process' // Local import { cloneRepo } from './clone-repo.mjs' diff --git a/scripts/migrate-content/clone-repo.mjs b/scripts/migrate-content/clone-repo.mjs index ba8cb9bbf..82668bd93 100644 --- a/scripts/migrate-content/clone-repo.mjs +++ b/scripts/migrate-content/clone-repo.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import fs from 'fs' import path from 'path' import { execSync } from 'child_process' diff --git a/scripts/migrate-content/fetch-version-metadata.mjs b/scripts/migrate-content/fetch-version-metadata.mjs index 0affb489b..7c19a56ad 100644 --- a/scripts/migrate-content/fetch-version-metadata.mjs +++ b/scripts/migrate-content/fetch-version-metadata.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + // Define the base URL for the existing content API const CONTENT_API_BASE_URL = 'https://content.hashicorp.com' diff --git a/scripts/migrate-content/get-target-release-refs.mjs b/scripts/migrate-content/get-target-release-refs.mjs index 594cc39d8..f30f9ebb4 100644 --- a/scripts/migrate-content/get-target-release-refs.mjs +++ b/scripts/migrate-content/get-target-release-refs.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + // Third-party import semver from 'semver' // Local diff --git a/scripts/migrate-content/migrate-content.mjs b/scripts/migrate-content/migrate-content.mjs index 09d099612..cc94257df 100644 --- a/scripts/migrate-content/migrate-content.mjs +++ b/scripts/migrate-content/migrate-content.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import fs from 'fs' import path from 'path' import { execSync } from 'child_process' diff --git a/scripts/prebuild.mjs b/scripts/prebuild.mjs index 90dedb974..52779abe4 100644 --- a/scripts/prebuild.mjs +++ b/scripts/prebuild.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import fs from 'fs' import path from 'path' import { buildMdxTransforms } from './mdx-transforms/build-mdx-transforms.mjs' diff --git a/scripts/utils/batch-promises.mjs b/scripts/utils/batch-promises.mjs index 4b98b3b37..7e854aa4b 100644 --- a/scripts/utils/batch-promises.mjs +++ b/scripts/utils/batch-promises.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + /** * Given an array of items, an asynchronous function to apply to each item * as part of a `.map()` call, and a batch size, diff --git a/scripts/utils/copy-asset-file.mjs b/scripts/utils/copy-asset-file.mjs index c4cd1b59d..2670405e7 100644 --- a/scripts/utils/copy-asset-file.mjs +++ b/scripts/utils/copy-asset-file.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import fs from 'fs' import path from 'path' diff --git a/scripts/utils/copy-asset-file.test.ts b/scripts/utils/copy-asset-file.test.ts index e5e75ffff..b9f6a9e89 100644 --- a/scripts/utils/copy-asset-file.test.ts +++ b/scripts/utils/copy-asset-file.test.ts @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest' import { copyAssetFile } from './copy-asset-file.mjs' import fs from 'fs' diff --git a/scripts/utils/copy-nav-data-file.mjs b/scripts/utils/copy-nav-data-file.mjs index 39ab67555..db7e5e599 100644 --- a/scripts/utils/copy-nav-data-file.mjs +++ b/scripts/utils/copy-nav-data-file.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import fs from 'fs' import path from 'path' diff --git a/scripts/utils/copy-nav-data-file.test.mjs b/scripts/utils/copy-nav-data-file.test.mjs index 6458bd24e..3bd90bdc4 100644 --- a/scripts/utils/copy-nav-data-file.test.mjs +++ b/scripts/utils/copy-nav-data-file.test.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { describe, it, expect, vi, beforeEach } from 'vitest' import fs from 'fs' import path from 'path' diff --git a/scripts/utils/file-path/latest-version/index.mjs b/scripts/utils/file-path/latest-version/index.mjs index 882c14b37..aca85d8af 100644 --- a/scripts/utils/file-path/latest-version/index.mjs +++ b/scripts/utils/file-path/latest-version/index.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { getProductDirectoryFromFilePath } from '../product-directory/index.mjs' import { getVersionFromFilePath } from '../version/index.mjs' diff --git a/scripts/utils/file-path/latest-version/index.test.mjs b/scripts/utils/file-path/latest-version/index.test.mjs index 2e4a3a8e4..737bc4df8 100644 --- a/scripts/utils/file-path/latest-version/index.test.mjs +++ b/scripts/utils/file-path/latest-version/index.test.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { describe, test, expect, vi } from 'vitest' import { isLatestVersion, getLatestVersion } from './index.mjs' import { getProductDirectoryFromFilePath } from '../product-directory/index.mjs' diff --git a/scripts/utils/file-path/product-directory/index.mjs b/scripts/utils/file-path/product-directory/index.mjs index 2a27b69ba..25703bc14 100644 --- a/scripts/utils/file-path/product-directory/index.mjs +++ b/scripts/utils/file-path/product-directory/index.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + /** * Extracts the repository name from a given file path. * diff --git a/scripts/utils/file-path/product-directory/index.test.mjs b/scripts/utils/file-path/product-directory/index.test.mjs index a30b9e9af..8bb26b0b1 100644 --- a/scripts/utils/file-path/product-directory/index.test.mjs +++ b/scripts/utils/file-path/product-directory/index.test.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { describe, test, expect } from 'vitest' import { getProductDirectoryFromFilePath } from './index.mjs' diff --git a/scripts/utils/file-path/product-slug/index.mjs b/scripts/utils/file-path/product-slug/index.mjs index 90cb21e51..597d6629b 100644 --- a/scripts/utils/file-path/product-slug/index.mjs +++ b/scripts/utils/file-path/product-slug/index.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { getProductDirectoryFromFilePath } from '../product-directory/index.mjs' /** diff --git a/scripts/utils/file-path/product-slug/index.test.mjs b/scripts/utils/file-path/product-slug/index.test.mjs index 5417e5601..8e42a2909 100644 --- a/scripts/utils/file-path/product-slug/index.test.mjs +++ b/scripts/utils/file-path/product-slug/index.test.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { describe, test, expect, vi } from 'vitest' import { getProductSlugFromFilePath } from './index.mjs' import { getProductDirectoryFromFilePath } from '../product-directory/index.mjs' diff --git a/scripts/utils/file-path/version/index.mjs b/scripts/utils/file-path/version/index.mjs index 357f72d0e..4c7e8aa2e 100644 --- a/scripts/utils/file-path/version/index.mjs +++ b/scripts/utils/file-path/version/index.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import semver from 'semver' /** * Extracts the version from a given file path. diff --git a/scripts/utils/file-path/version/index.test.mjs b/scripts/utils/file-path/version/index.test.mjs index 6844f166b..c6c8270c7 100644 --- a/scripts/utils/file-path/version/index.test.mjs +++ b/scripts/utils/file-path/version/index.test.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { describe, test, expect } from 'vitest' import { getVersionFromFilePath } from '../version/index.mjs' diff --git a/scripts/utils/list-files.mjs b/scripts/utils/list-files.mjs index d790ec8de..59551a0c5 100644 --- a/scripts/utils/list-files.mjs +++ b/scripts/utils/list-files.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import fs from 'fs' import path from 'path' import { promisify } from 'util' diff --git a/scripts/watch-content.mjs b/scripts/watch-content.mjs index 30932855e..67429537e 100644 --- a/scripts/watch-content.mjs +++ b/scripts/watch-content.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import fs from 'fs' import path from 'path' import { buildFileMdxTransforms } from './mdx-transforms/build-mdx-transforms-file.mjs' diff --git a/vitest.config.mjs b/vitest.config.mjs index e1f1fe967..ae46b034f 100644 --- a/vitest.config.mjs +++ b/vitest.config.mjs @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import { configDefaults, defineConfig } from 'vitest/config' import tsconfigPaths from 'vite-tsconfig-paths' From 5d53b26aca43c34e7bee1d565589d53580590e9a Mon Sep 17 00:00:00 2001 From: Ruben Nic Date: Mon, 3 Mar 2025 11:08:54 -0500 Subject: [PATCH 2/6] Add check headers GHA --- .github/workflows/copyright-headers-check.yml | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/copyright-headers-check.yml diff --git a/.github/workflows/copyright-headers-check.yml b/.github/workflows/copyright-headers-check.yml new file mode 100644 index 000000000..542952c5b --- /dev/null +++ b/.github/workflows/copyright-headers-check.yml @@ -0,0 +1,26 @@ +name: 'Check Copyright Headers' + +on: + pull_request: + paths: + - '**.js' + - '**.jsx' + - '**.ts' + - '**.tsx' + - '**.mjs' + push: + branches: ['main'] + +jobs: + check-headers: + name: 'Check Copyright Headers' + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Install copywrite + uses: hashicorp/setup-copywrite@32638da2d4e81d56a0764aa1547882fc4d209636 # v1.1.3 + + - name: Validate Header Compliance + run: copywrite headers --plan From 70a1e47fcee10e04dd7e8a0a5775cbf3f539e532 Mon Sep 17 00:00:00 2001 From: Ruben Nic Date: Mon, 3 Mar 2025 11:11:12 -0500 Subject: [PATCH 3/6] Use a trusted checkout action version --- .github/workflows/copyright-headers-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/copyright-headers-check.yml b/.github/workflows/copyright-headers-check.yml index 542952c5b..db21b5995 100644 --- a/.github/workflows/copyright-headers-check.yml +++ b/.github/workflows/copyright-headers-check.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repo - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Install copywrite uses: hashicorp/setup-copywrite@32638da2d4e81d56a0764aa1547882fc4d209636 # v1.1.3 From f20c601a36de462b616d6cbd12cfaeb1e6174e83 Mon Sep 17 00:00:00 2001 From: Ruben Nic Date: Mon, 3 Mar 2025 11:13:25 -0500 Subject: [PATCH 4/6] test by pushing up a file with no header --- next-copy.config | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 next-copy.config diff --git a/next-copy.config b/next-copy.config new file mode 100644 index 000000000..b39d374e0 --- /dev/null +++ b/next-copy.config @@ -0,0 +1,7 @@ + +/** @type {import("next").NextConfig} */ +const nextConfig = { + reactStrictMode: true, +} + +module.exports = nextConfig From e1e6b5868374b8f5e5e6768736d9fe5747a6d880 Mon Sep 17 00:00:00 2001 From: Ruben Nic Date: Mon, 3 Mar 2025 11:15:19 -0500 Subject: [PATCH 5/6] forgot the .js on the file --- next-copy.config => next-copy.config.js | 1 - 1 file changed, 1 deletion(-) rename next-copy.config => next-copy.config.js (99%) diff --git a/next-copy.config b/next-copy.config.js similarity index 99% rename from next-copy.config rename to next-copy.config.js index b39d374e0..90e2cc0b5 100644 --- a/next-copy.config +++ b/next-copy.config.js @@ -1,4 +1,3 @@ - /** @type {import("next").NextConfig} */ const nextConfig = { reactStrictMode: true, From 4f28b11efdb4e087a6962e03b07a2b989f44bffe Mon Sep 17 00:00:00 2001 From: Ruben Nic Date: Mon, 3 Mar 2025 11:19:15 -0500 Subject: [PATCH 6/6] Remove test file --- next-copy.config.js | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 next-copy.config.js diff --git a/next-copy.config.js b/next-copy.config.js deleted file mode 100644 index 90e2cc0b5..000000000 --- a/next-copy.config.js +++ /dev/null @@ -1,6 +0,0 @@ -/** @type {import("next").NextConfig} */ -const nextConfig = { - reactStrictMode: true, -} - -module.exports = nextConfig