From 1061d29aba5dc65023b3a42b4f9c2d3e35e6c8e4 Mon Sep 17 00:00:00 2001 From: David East Date: Mon, 20 Apr 2026 11:17:21 -0400 Subject: [PATCH 1/4] docs: update recommended tokens in spec --- docs/spec.md | 4 ++-- packages/cli/src/linter/spec-config.yaml | 17 ++++++++--------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/docs/spec.md b/docs/spec.md index 0227376..874f300 100644 --- a/docs/spec.md +++ b/docs/spec.md @@ -335,9 +335,9 @@ This section provides practical guidelines and common pitfalls. These act as gua The following names are commonly used across design systems. They are not required but are provided as guidance for consistency. -**Typography:** `headline-display`, `headline-lg`, `headline-md`, `body-lg`, `body-md`, `body-sm`, `label-lg`, `label-md`, `label-sm` +**Colors:** `primary`, `secondary`, `tertiary`, `neutral`, `surface`, `on-surface`, `error` -**Spacing:** `unit`, `gutter`, `margin`, `xs`, `sm`, `md`, `lg`, `xl` +**Typography:** `headline-display`, `headline-lg`, `headline-md`, `body-lg`, `body-md`, `body-sm`, `label-lg`, `label-md`, `label-sm` **Rounded:** `none`, `sm`, `md`, `lg`, `xl`, `full` diff --git a/packages/cli/src/linter/spec-config.yaml b/packages/cli/src/linter/spec-config.yaml index 848013a..97a4ac6 100644 --- a/packages/cli/src/linter/spec-config.yaml +++ b/packages/cli/src/linter/spec-config.yaml @@ -70,6 +70,14 @@ color_roles: - neutral recommended_tokens: + colors: + - primary + - secondary + - tertiary + - neutral + - surface + - on-surface + - error typography: - headline-display - headline-lg @@ -80,15 +88,6 @@ recommended_tokens: - label-lg - label-md - label-sm - spacing: - - unit - - gutter - - margin - - xs - - sm - - md - - lg - - xl rounded: - none - sm From fbb4c20f975ec1cf968955d93ee02524a6c82576 Mon Sep 17 00:00:00 2001 From: David East Date: Tue, 21 Apr 2026 10:16:28 -0400 Subject: [PATCH 2/4] feat: set up OSS boilerplate and license headers --- .github/workflows/test.yml | 14 ++ CONTRIBUTING.md | 33 +++ LICENSE | 201 ++++++++++++++++++ README.md | 7 +- examples/atmospheric-glass/tailwind.config.js | 14 ++ examples/paws-and-paths/tailwind.config.js | 14 ++ examples/totality-festival/tailwind.config.js | 14 ++ packages/cli/scripts/check-package.ts | 14 ++ packages/cli/src/commands/diff.ts | 14 ++ packages/cli/src/commands/export.ts | 14 ++ packages/cli/src/commands/lint.ts | 14 ++ packages/cli/src/commands/spec.test.ts | 14 ++ packages/cli/src/commands/spec.ts | 14 ++ packages/cli/src/index.ts | 14 ++ .../cli/src/linter/dtcg/conformance.test.ts | 14 ++ packages/cli/src/linter/dtcg/handler.test.ts | 14 ++ packages/cli/src/linter/dtcg/handler.ts | 14 ++ packages/cli/src/linter/dtcg/spec.ts | 14 ++ packages/cli/src/linter/fixer/handler.test.ts | 14 ++ packages/cli/src/linter/fixer/handler.ts | 14 ++ packages/cli/src/linter/fixer/spec.ts | 14 ++ packages/cli/src/linter/fixture.test.ts | 14 ++ packages/cli/src/linter/index.test.ts | 14 ++ packages/cli/src/linter/index.ts | 14 ++ packages/cli/src/linter/lint.ts | 14 ++ .../cli/src/linter/linter/handler.test.ts | 14 ++ packages/cli/src/linter/linter/handler.ts | 14 ++ .../linter/linter/rules/broken-ref.test.ts | 14 ++ .../cli/src/linter/linter/rules/broken-ref.ts | 14 ++ .../linter/rules/contrast-ratio.test.ts | 14 ++ .../src/linter/linter/rules/contrast-ratio.ts | 14 ++ packages/cli/src/linter/linter/rules/index.ts | 14 ++ .../linter/rules/missing-primary.test.ts | 14 ++ .../linter/linter/rules/missing-primary.ts | 14 ++ .../linter/rules/missing-sections.test.ts | 14 ++ .../linter/linter/rules/missing-sections.ts | 14 ++ .../linter/rules/missing-typography.test.ts | 14 ++ .../linter/linter/rules/missing-typography.ts | 14 ++ .../linter/rules/orphaned-tokens.test.ts | 14 ++ .../linter/linter/rules/orphaned-tokens.ts | 14 ++ .../linter/linter/rules/section-order.test.ts | 14 ++ .../src/linter/linter/rules/section-order.ts | 14 ++ .../src/linter/linter/rules/test-helpers.ts | 14 ++ .../linter/linter/rules/token-summary.test.ts | 14 ++ .../src/linter/linter/rules/token-summary.ts | 14 ++ .../cli/src/linter/linter/rules/types.test.ts | 14 ++ packages/cli/src/linter/linter/rules/types.ts | 14 ++ packages/cli/src/linter/linter/runner.test.ts | 14 ++ packages/cli/src/linter/linter/runner.ts | 14 ++ packages/cli/src/linter/linter/spec.ts | 14 ++ packages/cli/src/linter/model/handler.test.ts | 14 ++ packages/cli/src/linter/model/handler.ts | 14 ++ packages/cli/src/linter/model/spec.test.ts | 14 ++ packages/cli/src/linter/model/spec.ts | 14 ++ .../cli/src/linter/parser/handler.test.ts | 14 ++ packages/cli/src/linter/parser/handler.ts | 14 ++ packages/cli/src/linter/parser/spec.test.ts | 14 ++ packages/cli/src/linter/parser/spec.ts | 14 ++ packages/cli/src/linter/spec-config.test.ts | 14 ++ packages/cli/src/linter/spec-config.ts | 14 ++ packages/cli/src/linter/spec-config.yaml | 14 ++ .../cli/src/linter/spec-gen/compiler.test.ts | 14 ++ packages/cli/src/linter/spec-gen/compiler.ts | 14 ++ packages/cli/src/linter/spec-gen/generate.ts | 14 ++ packages/cli/src/linter/spec-gen/renderers.ts | 14 ++ .../src/linter/spec-gen/spec-helpers.test.ts | 14 ++ .../cli/src/linter/spec-gen/spec-helpers.ts | 14 ++ .../cli/src/linter/tailwind/handler.test.ts | 14 ++ packages/cli/src/linter/tailwind/handler.ts | 14 ++ packages/cli/src/linter/tailwind/spec.ts | 14 ++ packages/cli/src/utils.ts | 14 ++ 71 files changed, 1192 insertions(+), 1 deletion(-) create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 806e52b..0148a52 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,3 +1,17 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + name: Test on: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..b16bd94 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,33 @@ +# How to contribute + +We'd love to accept your patches and contributions to this project. + +## Before you begin + +### Sign our Contributor License Agreement + +Contributions to this project must be accompanied by a +[Contributor License Agreement](https://cla.developers.google.com/about) (CLA). +You (or your employer) retain the copyright to your contribution; this simply +gives us permission to use and redistribute your contributions as part of the +project. + +If you or your current employer have already signed the Google CLA (even if it +was for a different project), you probably don't need to do it again. + +Visit to see your current agreements or to +sign a new one. + +### Review our community guidelines + +This project follows +[Google's Open Source Community Guidelines](https://opensource.google/conduct/). + +## Contribution process + +### Code reviews + +All submissions, including submissions by project members, require review. We +use GitHub pull requests for this purpose. Consult +[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more +information on using pull requests. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..15e431c --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to the Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/README.md b/README.md index 885e6f5..1b8bf8e 100644 --- a/README.md +++ b/README.md @@ -288,4 +288,9 @@ DESIGN.md tokens are inspired by the [W3C Design Token Format](https://www.desig ## Status -The DESIGN.md format is at version `alpha`. The spec, token schema, and CLI are under active development. Expect changes to the format as it matures. \ No newline at end of file +The DESIGN.md format is at version `alpha`. The spec, token schema, and CLI are under active development. Expect changes to the format as it matures. + +## Disclaimer + +This project is not eligible for the [Google Open Source Software Vulnerability +Rewards Program](https://bughunters.google.com/open-source-security). \ No newline at end of file diff --git a/examples/atmospheric-glass/tailwind.config.js b/examples/atmospheric-glass/tailwind.config.js index 5f29a31..c5cabc2 100644 --- a/examples/atmospheric-glass/tailwind.config.js +++ b/examples/atmospheric-glass/tailwind.config.js @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + /** @type {import('tailwindcss').Config} */ module.exports = { darkMode: "class", diff --git a/examples/paws-and-paths/tailwind.config.js b/examples/paws-and-paths/tailwind.config.js index 1366f7b..5633f63 100644 --- a/examples/paws-and-paths/tailwind.config.js +++ b/examples/paws-and-paths/tailwind.config.js @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + /** @type {import('tailwindcss').Config} */ module.exports = { darkMode: "class", diff --git a/examples/totality-festival/tailwind.config.js b/examples/totality-festival/tailwind.config.js index 6ba7a1e..b15fa3f 100644 --- a/examples/totality-festival/tailwind.config.js +++ b/examples/totality-festival/tailwind.config.js @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + /** @type {import('tailwindcss').Config} */ module.exports = { darkMode: "class", diff --git a/packages/cli/scripts/check-package.ts b/packages/cli/scripts/check-package.ts index ac7eef2..ecda9bf 100644 --- a/packages/cli/scripts/check-package.ts +++ b/packages/cli/scripts/check-package.ts @@ -1,4 +1,18 @@ #!/usr/bin/env bun +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + /** * Package verification script for @google/design.md * diff --git a/packages/cli/src/commands/diff.ts b/packages/cli/src/commands/diff.ts index 9c4ff84..010975d 100644 --- a/packages/cli/src/commands/diff.ts +++ b/packages/cli/src/commands/diff.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { defineCommand } from 'citty'; import { lint } from '../linter/index.js'; import { readInput, formatOutput, diffMaps, serializeDesignSystem } from '../utils.js'; diff --git a/packages/cli/src/commands/export.ts b/packages/cli/src/commands/export.ts index c96aea6..bf14d7c 100644 --- a/packages/cli/src/commands/export.ts +++ b/packages/cli/src/commands/export.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { defineCommand } from 'citty'; import { lint, TailwindEmitterHandler } from '../linter/index.js'; import { DtcgEmitterHandler } from '../linter/dtcg/handler.js'; diff --git a/packages/cli/src/commands/lint.ts b/packages/cli/src/commands/lint.ts index d41dc45..990901d 100644 --- a/packages/cli/src/commands/lint.ts +++ b/packages/cli/src/commands/lint.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { defineCommand } from 'citty'; import { lint } from '../linter/index.js'; import { readInput, formatOutput } from '../utils.js'; diff --git a/packages/cli/src/commands/spec.test.ts b/packages/cli/src/commands/spec.test.ts index e1f5d55..29f4ada 100644 --- a/packages/cli/src/commands/spec.test.ts +++ b/packages/cli/src/commands/spec.test.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { describe, it, expect, beforeEach, afterEach, spyOn } from 'bun:test'; import specCommand from './spec.js'; diff --git a/packages/cli/src/commands/spec.ts b/packages/cli/src/commands/spec.ts index cb7a238..2c583b2 100644 --- a/packages/cli/src/commands/spec.ts +++ b/packages/cli/src/commands/spec.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { defineCommand } from 'citty'; import { getSpecContent, getRulesTable } from '../linter/spec-gen/spec-helpers.js'; import { DEFAULT_RULE_DESCRIPTORS } from '../linter/linter/rules/index.js'; diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index 7621e99..42ed837 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -1,4 +1,18 @@ #!/usr/bin/env node +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { defineCommand, runMain } from 'citty'; import lintCommand from './commands/lint.js'; import diffCommand from './commands/diff.js'; diff --git a/packages/cli/src/linter/dtcg/conformance.test.ts b/packages/cli/src/linter/dtcg/conformance.test.ts index 3d563fd..f4de8ae 100644 --- a/packages/cli/src/linter/dtcg/conformance.test.ts +++ b/packages/cli/src/linter/dtcg/conformance.test.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { describe, test, expect } from 'bun:test'; import { writeFileSync, mkdtempSync, existsSync, readFileSync } from 'fs'; import { join } from 'path'; diff --git a/packages/cli/src/linter/dtcg/handler.test.ts b/packages/cli/src/linter/dtcg/handler.test.ts index 2ce281a..1933852 100644 --- a/packages/cli/src/linter/dtcg/handler.test.ts +++ b/packages/cli/src/linter/dtcg/handler.test.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { describe, test, expect } from 'bun:test'; import { DtcgEmitterHandler } from './handler.js'; import type { DesignSystemState, ResolvedColor, ResolvedDimension, ResolvedTypography } from '../model/spec.js'; diff --git a/packages/cli/src/linter/dtcg/handler.ts b/packages/cli/src/linter/dtcg/handler.ts index 05d668c..f441822 100644 --- a/packages/cli/src/linter/dtcg/handler.ts +++ b/packages/cli/src/linter/dtcg/handler.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import type { DtcgEmitterSpec, DtcgEmitterResult, DtcgTokenFile, DtcgToken, DtcgGroup, DtcgColorValue, DtcgDimensionValue, DtcgTypographyValue } from './spec.js'; import type { DesignSystemState, ResolvedColor, ResolvedDimension, ResolvedTypography } from '../model/spec.js'; diff --git a/packages/cli/src/linter/dtcg/spec.ts b/packages/cli/src/linter/dtcg/spec.ts index 49dccc2..7c6d399 100644 --- a/packages/cli/src/linter/dtcg/spec.ts +++ b/packages/cli/src/linter/dtcg/spec.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { z } from 'zod'; import type { DesignSystemState } from '../model/spec.js'; diff --git a/packages/cli/src/linter/fixer/handler.test.ts b/packages/cli/src/linter/fixer/handler.test.ts index 15439f5..69fb786 100644 --- a/packages/cli/src/linter/fixer/handler.test.ts +++ b/packages/cli/src/linter/fixer/handler.test.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { describe, it, expect } from 'bun:test'; import { fixSectionOrder } from './handler.js'; import type { FixerInput } from './spec.js'; diff --git a/packages/cli/src/linter/fixer/handler.ts b/packages/cli/src/linter/fixer/handler.ts index e9fde3a..c20dc82 100644 --- a/packages/cli/src/linter/fixer/handler.ts +++ b/packages/cli/src/linter/fixer/handler.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import type { FixerInput, FixerResult } from './spec.js'; import { CANONICAL_ORDER, resolveAlias } from '../linter/rules/section-order.js'; diff --git a/packages/cli/src/linter/fixer/spec.ts b/packages/cli/src/linter/fixer/spec.ts index 63dae87..c1b4c04 100644 --- a/packages/cli/src/linter/fixer/spec.ts +++ b/packages/cli/src/linter/fixer/spec.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { z } from 'zod'; export const FixerInputSchema = z.object({ diff --git a/packages/cli/src/linter/fixture.test.ts b/packages/cli/src/linter/fixture.test.ts index c1b4b3e..80f873d 100644 --- a/packages/cli/src/linter/fixture.test.ts +++ b/packages/cli/src/linter/fixture.test.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { describe, it, expect } from 'bun:test'; import { lint } from './index.js'; import { readFileSync } from 'fs'; diff --git a/packages/cli/src/linter/index.test.ts b/packages/cli/src/linter/index.test.ts index fa05050..6b2230a 100644 --- a/packages/cli/src/linter/index.test.ts +++ b/packages/cli/src/linter/index.test.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { describe, it, expect } from 'bun:test'; import { lint } from './index.js'; diff --git a/packages/cli/src/linter/index.ts b/packages/cli/src/linter/index.ts index 0c70cc0..598c9e1 100644 --- a/packages/cli/src/linter/index.ts +++ b/packages/cli/src/linter/index.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + // ── Primary API ──────────────────────────────────────────────────── export { lint } from './lint.js'; export type { LintReport, LintOptions } from './lint.js'; diff --git a/packages/cli/src/linter/lint.ts b/packages/cli/src/linter/lint.ts index 50e74ab..b25dbfd 100644 --- a/packages/cli/src/linter/lint.ts +++ b/packages/cli/src/linter/lint.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { ParserHandler } from './parser/handler.js'; import type { ParsedDesignSystem } from './parser/spec.js'; import { ModelHandler } from './model/handler.js'; diff --git a/packages/cli/src/linter/linter/handler.test.ts b/packages/cli/src/linter/linter/handler.test.ts index defdcb1..f0c9fcb 100644 --- a/packages/cli/src/linter/linter/handler.test.ts +++ b/packages/cli/src/linter/linter/handler.test.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { describe, it, expect } from 'bun:test'; import { LinterHandler } from './handler.js'; import { ModelHandler } from '../model/handler.js'; diff --git a/packages/cli/src/linter/linter/handler.ts b/packages/cli/src/linter/linter/handler.ts index aa5421a..ee7eef6 100644 --- a/packages/cli/src/linter/linter/handler.ts +++ b/packages/cli/src/linter/linter/handler.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import type { LinterSpec, LintResult, diff --git a/packages/cli/src/linter/linter/rules/broken-ref.test.ts b/packages/cli/src/linter/linter/rules/broken-ref.test.ts index 9d9508c..13ac68a 100644 --- a/packages/cli/src/linter/linter/rules/broken-ref.test.ts +++ b/packages/cli/src/linter/linter/rules/broken-ref.test.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { describe, it, expect } from 'bun:test'; import { brokenRef, brokenRefRule } from './broken-ref.js'; import { buildState } from './test-helpers.js'; diff --git a/packages/cli/src/linter/linter/rules/broken-ref.ts b/packages/cli/src/linter/linter/rules/broken-ref.ts index 60d5091..7aadb73 100644 --- a/packages/cli/src/linter/linter/rules/broken-ref.ts +++ b/packages/cli/src/linter/linter/rules/broken-ref.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import type { DesignSystemState } from '../../model/spec.js'; import { VALID_COMPONENT_SUB_TOKENS } from '../../model/spec.js'; import type { RuleDescriptor, RuleFinding } from './types.js'; diff --git a/packages/cli/src/linter/linter/rules/contrast-ratio.test.ts b/packages/cli/src/linter/linter/rules/contrast-ratio.test.ts index 0c94390..e8c911b 100644 --- a/packages/cli/src/linter/linter/rules/contrast-ratio.test.ts +++ b/packages/cli/src/linter/linter/rules/contrast-ratio.test.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { describe, it, expect } from 'bun:test'; import { contrastCheck } from './contrast-ratio.js'; import { buildState } from './test-helpers.js'; diff --git a/packages/cli/src/linter/linter/rules/contrast-ratio.ts b/packages/cli/src/linter/linter/rules/contrast-ratio.ts index 57c60f3..2285649 100644 --- a/packages/cli/src/linter/linter/rules/contrast-ratio.ts +++ b/packages/cli/src/linter/linter/rules/contrast-ratio.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import type { DesignSystemState, ResolvedColor, ResolvedValue } from '../../model/spec.js'; import { contrastRatio } from '../../model/handler.js'; import type { RuleDescriptor, RuleFinding } from './types.js'; diff --git a/packages/cli/src/linter/linter/rules/index.ts b/packages/cli/src/linter/linter/rules/index.ts index eb7dbfe..c3b2d9a 100644 --- a/packages/cli/src/linter/linter/rules/index.ts +++ b/packages/cli/src/linter/linter/rules/index.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import type { LintRule, RuleDescriptor } from './types.js'; import type { DesignSystemState } from '../../model/spec.js'; import type { Finding } from '../spec.js'; diff --git a/packages/cli/src/linter/linter/rules/missing-primary.test.ts b/packages/cli/src/linter/linter/rules/missing-primary.test.ts index dcf43c8..bdd571c 100644 --- a/packages/cli/src/linter/linter/rules/missing-primary.test.ts +++ b/packages/cli/src/linter/linter/rules/missing-primary.test.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { describe, it, expect } from 'bun:test'; import { missingPrimary } from './missing-primary.js'; import { buildState } from './test-helpers.js'; diff --git a/packages/cli/src/linter/linter/rules/missing-primary.ts b/packages/cli/src/linter/linter/rules/missing-primary.ts index e2568d4..ef8b13d 100644 --- a/packages/cli/src/linter/linter/rules/missing-primary.ts +++ b/packages/cli/src/linter/linter/rules/missing-primary.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import type { DesignSystemState } from '../../model/spec.js'; import type { RuleDescriptor, RuleFinding } from './types.js'; diff --git a/packages/cli/src/linter/linter/rules/missing-sections.test.ts b/packages/cli/src/linter/linter/rules/missing-sections.test.ts index 1f950d0..dd3c393 100644 --- a/packages/cli/src/linter/linter/rules/missing-sections.test.ts +++ b/packages/cli/src/linter/linter/rules/missing-sections.test.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { describe, it, expect } from 'bun:test'; import { missingSections } from './missing-sections.js'; import { buildState } from './test-helpers.js'; diff --git a/packages/cli/src/linter/linter/rules/missing-sections.ts b/packages/cli/src/linter/linter/rules/missing-sections.ts index 1db8b75..7fcc205 100644 --- a/packages/cli/src/linter/linter/rules/missing-sections.ts +++ b/packages/cli/src/linter/linter/rules/missing-sections.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import type { DesignSystemState } from '../../model/spec.js'; import type { RuleDescriptor, RuleFinding } from './types.js'; diff --git a/packages/cli/src/linter/linter/rules/missing-typography.test.ts b/packages/cli/src/linter/linter/rules/missing-typography.test.ts index 3a7f949..b76022d 100644 --- a/packages/cli/src/linter/linter/rules/missing-typography.test.ts +++ b/packages/cli/src/linter/linter/rules/missing-typography.test.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { describe, it, expect } from 'bun:test'; import { missingTypography } from './missing-typography.js'; import { buildState } from './test-helpers.js'; diff --git a/packages/cli/src/linter/linter/rules/missing-typography.ts b/packages/cli/src/linter/linter/rules/missing-typography.ts index 0d8378c..03ba9f5 100644 --- a/packages/cli/src/linter/linter/rules/missing-typography.ts +++ b/packages/cli/src/linter/linter/rules/missing-typography.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import type { DesignSystemState } from '../../model/spec.js'; import type { RuleDescriptor, RuleFinding } from './types.js'; diff --git a/packages/cli/src/linter/linter/rules/orphaned-tokens.test.ts b/packages/cli/src/linter/linter/rules/orphaned-tokens.test.ts index 6fe9251..5adca68 100644 --- a/packages/cli/src/linter/linter/rules/orphaned-tokens.test.ts +++ b/packages/cli/src/linter/linter/rules/orphaned-tokens.test.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { describe, it, expect } from 'bun:test'; import { orphanedTokens } from './orphaned-tokens.js'; import { buildState } from './test-helpers.js'; diff --git a/packages/cli/src/linter/linter/rules/orphaned-tokens.ts b/packages/cli/src/linter/linter/rules/orphaned-tokens.ts index 5987e84..bc5c47b 100644 --- a/packages/cli/src/linter/linter/rules/orphaned-tokens.ts +++ b/packages/cli/src/linter/linter/rules/orphaned-tokens.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import type { DesignSystemState } from '../../model/spec.js'; import type { RuleDescriptor, RuleFinding } from './types.js'; diff --git a/packages/cli/src/linter/linter/rules/section-order.test.ts b/packages/cli/src/linter/linter/rules/section-order.test.ts index 3f2911c..4e94ebe 100644 --- a/packages/cli/src/linter/linter/rules/section-order.test.ts +++ b/packages/cli/src/linter/linter/rules/section-order.test.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { describe, it, expect } from 'bun:test'; import { sectionOrder, resolveAlias, SECTION_ALIASES } from './section-order.js'; import type { DesignSystemState } from '../../model/spec.js'; diff --git a/packages/cli/src/linter/linter/rules/section-order.ts b/packages/cli/src/linter/linter/rules/section-order.ts index 3fab775..b425d6d 100644 --- a/packages/cli/src/linter/linter/rules/section-order.ts +++ b/packages/cli/src/linter/linter/rules/section-order.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import type { DesignSystemState } from '../../model/spec.js'; import { CANONICAL_ORDER, diff --git a/packages/cli/src/linter/linter/rules/test-helpers.ts b/packages/cli/src/linter/linter/rules/test-helpers.ts index 8fb5507..c7da5a2 100644 --- a/packages/cli/src/linter/linter/rules/test-helpers.ts +++ b/packages/cli/src/linter/linter/rules/test-helpers.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + /** * Shared test helper for rule unit tests. * Builds a DesignSystemState from parsed overrides, reusing the ModelHandler. diff --git a/packages/cli/src/linter/linter/rules/token-summary.test.ts b/packages/cli/src/linter/linter/rules/token-summary.test.ts index e667ad9..d73bc55 100644 --- a/packages/cli/src/linter/linter/rules/token-summary.test.ts +++ b/packages/cli/src/linter/linter/rules/token-summary.test.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { describe, it, expect } from 'bun:test'; import { tokenSummary } from './token-summary.js'; import { buildState } from './test-helpers.js'; diff --git a/packages/cli/src/linter/linter/rules/token-summary.ts b/packages/cli/src/linter/linter/rules/token-summary.ts index eb11d72..8c096e0 100644 --- a/packages/cli/src/linter/linter/rules/token-summary.ts +++ b/packages/cli/src/linter/linter/rules/token-summary.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import type { DesignSystemState } from '../../model/spec.js'; import type { RuleDescriptor, RuleFinding } from './types.js'; diff --git a/packages/cli/src/linter/linter/rules/types.test.ts b/packages/cli/src/linter/linter/rules/types.test.ts index 634c5ec..5caf460 100644 --- a/packages/cli/src/linter/linter/rules/types.test.ts +++ b/packages/cli/src/linter/linter/rules/types.test.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { describe, it, expect } from 'bun:test'; import type { LintRule, RuleDescriptor } from './types.js'; import { DEFAULT_RULE_DESCRIPTORS } from './index.js'; diff --git a/packages/cli/src/linter/linter/rules/types.ts b/packages/cli/src/linter/linter/rules/types.ts index 95893ba..95aea85 100644 --- a/packages/cli/src/linter/linter/rules/types.ts +++ b/packages/cli/src/linter/linter/rules/types.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import type { DesignSystemState } from '../../model/spec.js'; import type { Finding, Severity } from '../spec.js'; diff --git a/packages/cli/src/linter/linter/runner.test.ts b/packages/cli/src/linter/linter/runner.test.ts index f151843..49c0f56 100644 --- a/packages/cli/src/linter/linter/runner.test.ts +++ b/packages/cli/src/linter/linter/runner.test.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { describe, it, expect } from 'bun:test'; import { runLinter, preEvaluate } from './runner.js'; import { missingPrimaryRule } from './rules/missing-primary.js'; diff --git a/packages/cli/src/linter/linter/runner.ts b/packages/cli/src/linter/linter/runner.ts index c3ec8c3..6c2c9bc 100644 --- a/packages/cli/src/linter/linter/runner.ts +++ b/packages/cli/src/linter/linter/runner.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import type { DesignSystemState } from '../model/spec.js'; import type { LintResult, Finding, GradedTokenEdits, TokenEditEntry } from './spec.js'; import type { LintRule, RuleDescriptor } from './rules/types.js'; diff --git a/packages/cli/src/linter/linter/spec.ts b/packages/cli/src/linter/linter/spec.ts index bdf02cf..3d3f0b3 100644 --- a/packages/cli/src/linter/linter/spec.ts +++ b/packages/cli/src/linter/linter/spec.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import type { DesignSystemState } from '../model/spec.js'; export type { Finding, Severity } from '../model/spec.js'; import type { Finding } from '../model/spec.js'; diff --git a/packages/cli/src/linter/model/handler.test.ts b/packages/cli/src/linter/model/handler.test.ts index a38731f..1b2557b 100644 --- a/packages/cli/src/linter/model/handler.test.ts +++ b/packages/cli/src/linter/model/handler.test.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { describe, it, expect } from 'bun:test'; import { ModelHandler, contrastRatio } from './handler.js'; import type { ParsedDesignSystem } from '../parser/spec.js'; diff --git a/packages/cli/src/linter/model/handler.ts b/packages/cli/src/linter/model/handler.ts index a500bed..2510173 100644 --- a/packages/cli/src/linter/model/handler.ts +++ b/packages/cli/src/linter/model/handler.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import type { ParsedDesignSystem } from '../parser/spec.js'; import type { ModelSpec, diff --git a/packages/cli/src/linter/model/spec.test.ts b/packages/cli/src/linter/model/spec.test.ts index d36d2b2..fe3270c 100644 --- a/packages/cli/src/linter/model/spec.test.ts +++ b/packages/cli/src/linter/model/spec.test.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { describe, it, expect } from 'bun:test'; import { isValidColor, isStandardDimension, isParseableDimension, parseDimensionParts, isTokenReference } from './spec.js'; diff --git a/packages/cli/src/linter/model/spec.ts b/packages/cli/src/linter/model/spec.ts index 814f338..4e844e4 100644 --- a/packages/cli/src/linter/model/spec.ts +++ b/packages/cli/src/linter/model/spec.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { z } from 'zod'; import type { ParsedDesignSystem } from '../parser/spec.js'; import { diff --git a/packages/cli/src/linter/parser/handler.test.ts b/packages/cli/src/linter/parser/handler.test.ts index 1fbd610..96e57ff 100644 --- a/packages/cli/src/linter/parser/handler.test.ts +++ b/packages/cli/src/linter/parser/handler.test.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { describe, it, expect } from 'bun:test'; import { ParserHandler } from './handler.js'; diff --git a/packages/cli/src/linter/parser/handler.ts b/packages/cli/src/linter/parser/handler.ts index ca710bc..5ce47d4 100644 --- a/packages/cli/src/linter/parser/handler.ts +++ b/packages/cli/src/linter/parser/handler.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import YAML from 'yaml'; import type { ParserSpec, ParserInput, ParserResult, ParsedDesignSystem, SourceLocation } from './spec.js'; import { unified } from 'unified'; diff --git a/packages/cli/src/linter/parser/spec.test.ts b/packages/cli/src/linter/parser/spec.test.ts index 67ae2d4..28f6250 100644 --- a/packages/cli/src/linter/parser/spec.test.ts +++ b/packages/cli/src/linter/parser/spec.test.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { describe, it, expect } from 'bun:test'; import { ParserInputSchema } from './spec.js'; diff --git a/packages/cli/src/linter/parser/spec.ts b/packages/cli/src/linter/parser/spec.ts index 541d7cd..76ec876 100644 --- a/packages/cli/src/linter/parser/spec.ts +++ b/packages/cli/src/linter/parser/spec.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { z } from 'zod'; // ── INPUT ────────────────────────────────────────────────────────── diff --git a/packages/cli/src/linter/spec-config.test.ts b/packages/cli/src/linter/spec-config.test.ts index a66857f..c2ca9bb 100644 --- a/packages/cli/src/linter/spec-config.test.ts +++ b/packages/cli/src/linter/spec-config.test.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { describe, it, expect } from 'bun:test'; import { writeFileSync, unlinkSync } from 'node:fs'; import { diff --git a/packages/cli/src/linter/spec-config.ts b/packages/cli/src/linter/spec-config.ts index cb909fd..27d28c9 100644 --- a/packages/cli/src/linter/spec-config.ts +++ b/packages/cli/src/linter/spec-config.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { readFileSync } from 'node:fs'; import { resolve, dirname } from 'node:path'; import { fileURLToPath } from 'node:url'; diff --git a/packages/cli/src/linter/spec-config.yaml b/packages/cli/src/linter/spec-config.yaml index 97a4ac6..d00c233 100644 --- a/packages/cli/src/linter/spec-config.yaml +++ b/packages/cli/src/linter/spec-config.yaml @@ -1,3 +1,17 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # DESIGN.md Spec Configuration # This file is the single source of truth for the DESIGN.md format specification. # Edit this file, then run `bun run spec:gen` to regenerate docs/spec.md. diff --git a/packages/cli/src/linter/spec-gen/compiler.test.ts b/packages/cli/src/linter/spec-gen/compiler.test.ts index 8f6d389..656c796 100644 --- a/packages/cli/src/linter/spec-gen/compiler.test.ts +++ b/packages/cli/src/linter/spec-gen/compiler.test.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { describe, it, expect } from 'bun:test'; import { readFile } from 'node:fs/promises'; import { resolve } from 'node:path'; diff --git a/packages/cli/src/linter/spec-gen/compiler.ts b/packages/cli/src/linter/spec-gen/compiler.ts index bbc4f49..f04b6cd 100644 --- a/packages/cli/src/linter/spec-gen/compiler.ts +++ b/packages/cli/src/linter/spec-gen/compiler.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { unified } from 'unified'; import remarkParse from 'remark-parse'; import remarkMdx from 'remark-mdx'; diff --git a/packages/cli/src/linter/spec-gen/generate.ts b/packages/cli/src/linter/spec-gen/generate.ts index d2e3671..ccd61db 100644 --- a/packages/cli/src/linter/spec-gen/generate.ts +++ b/packages/cli/src/linter/spec-gen/generate.ts @@ -1,4 +1,18 @@ #!/usr/bin/env bun +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + /** * Generate docs/spec.md from docs/spec.mdx + spec-config.ts. * diff --git a/packages/cli/src/linter/spec-gen/renderers.ts b/packages/cli/src/linter/spec-gen/renderers.ts index 1dd369f..c7cfb98 100644 --- a/packages/cli/src/linter/spec-gen/renderers.ts +++ b/packages/cli/src/linter/spec-gen/renderers.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + /** * Spec renderers: pure functions that turn spec-config data into * markdown fragments. Used by the MDX compiler via scope injection. diff --git a/packages/cli/src/linter/spec-gen/spec-helpers.test.ts b/packages/cli/src/linter/spec-gen/spec-helpers.test.ts index d485f13..3aaebb3 100644 --- a/packages/cli/src/linter/spec-gen/spec-helpers.test.ts +++ b/packages/cli/src/linter/spec-gen/spec-helpers.test.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { describe, it, expect } from 'bun:test'; import { getRulesTable, getSpecContent } from './spec-helpers.js'; import type { RuleDescriptor } from '../linter/rules/types.js'; diff --git a/packages/cli/src/linter/spec-gen/spec-helpers.ts b/packages/cli/src/linter/spec-gen/spec-helpers.ts index 41c7a01..c08b2c8 100644 --- a/packages/cli/src/linter/spec-gen/spec-helpers.ts +++ b/packages/cli/src/linter/spec-gen/spec-helpers.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { readFileSync } from 'node:fs'; import { resolve, dirname } from 'node:path'; import { fileURLToPath } from 'node:url'; diff --git a/packages/cli/src/linter/tailwind/handler.test.ts b/packages/cli/src/linter/tailwind/handler.test.ts index a8b3813..b51f8c8 100644 --- a/packages/cli/src/linter/tailwind/handler.test.ts +++ b/packages/cli/src/linter/tailwind/handler.test.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { describe, it, expect } from 'bun:test'; import { TailwindEmitterHandler } from './handler.js'; import { ModelHandler } from '../model/handler.js'; diff --git a/packages/cli/src/linter/tailwind/handler.ts b/packages/cli/src/linter/tailwind/handler.ts index c9b5399..c6b2f20 100644 --- a/packages/cli/src/linter/tailwind/handler.ts +++ b/packages/cli/src/linter/tailwind/handler.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import type { TailwindEmitterSpec, TailwindEmitterResult } from './spec.js'; import type { DesignSystemState, ResolvedDimension } from '../model/spec.js'; diff --git a/packages/cli/src/linter/tailwind/spec.ts b/packages/cli/src/linter/tailwind/spec.ts index 5aa7409..dfffb35 100644 --- a/packages/cli/src/linter/tailwind/spec.ts +++ b/packages/cli/src/linter/tailwind/spec.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { z } from 'zod'; import type { Config } from 'tailwindcss'; import type { DesignSystemState } from '../model/spec.js'; diff --git a/packages/cli/src/utils.ts b/packages/cli/src/utils.ts index 56e3af4..620f079 100644 --- a/packages/cli/src/utils.ts +++ b/packages/cli/src/utils.ts @@ -1,3 +1,17 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + import { readFileSync } from 'node:fs'; /** From f8b7b5a110178bc58767fe0985afdd250549be32 Mon Sep 17 00:00:00 2001 From: David East Date: Tue, 21 Apr 2026 10:19:26 -0400 Subject: [PATCH 3/4] chore: update package.json for npm publish readiness --- packages/cli/package.json | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index c2ed1f8..27bea48 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -7,7 +7,8 @@ ], "repository": { "type": "git", - "url": "git+https://github.com/google-labs-code/design.md.git" + "url": "git+https://github.com/google-labs-code/design.md.git", + "directory": "packages/cli" }, "bugs": { "url": "https://github.com/google-labs-code/design.md/issues" @@ -15,9 +16,14 @@ "main": "./dist/index.js", "types": "./dist/index.d.ts", "files": [ - "dist" + "dist", + "README.md", + "LICENSE" ], - "private": true, + "license": "Apache-2.0", + "publishConfig": { + "access": "public" + }, "type": "module", "bin": { "design.md": "./dist/index.js" From ef9abf58eba567d64b1b8d345e1e75a663e9dff4 Mon Sep 17 00:00:00 2001 From: David East Date: Tue, 21 Apr 2026 10:20:26 -0400 Subject: [PATCH 4/4] chore: update build script and ignore copied files in packages/cli --- packages/cli/.gitignore | 2 ++ packages/cli/package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 packages/cli/.gitignore diff --git a/packages/cli/.gitignore b/packages/cli/.gitignore new file mode 100644 index 0000000..f0f644e --- /dev/null +++ b/packages/cli/.gitignore @@ -0,0 +1,2 @@ +LICENSE +README.md diff --git a/packages/cli/package.json b/packages/cli/package.json index 27bea48..2fdb205 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -39,7 +39,7 @@ } }, "scripts": { - "build": "bun build src/index.ts src/linter/index.ts --outdir dist --target node && npx tsc --project tsconfig.build.json --emitDeclarationOnly --skipLibCheck && cp src/linter/spec-config.yaml dist/linter/ && cp src/linter/spec-config.yaml dist/ && cp ../../docs/spec.md dist/linter/", + "build": "bun build src/index.ts src/linter/index.ts --outdir dist --target node && npx tsc --project tsconfig.build.json --emitDeclarationOnly --skipLibCheck && cp src/linter/spec-config.yaml dist/linter/ && cp src/linter/spec-config.yaml dist/ && cp ../../docs/spec.md dist/linter/ && cp ../../README.md . && cp ../../LICENSE .", "dev": "bun run src/index.ts", "test": "bun test", "check-package": "bun run scripts/check-package.ts"