diff --git a/.changeset/apache-license.md b/.changeset/apache-license.md new file mode 100644 index 0000000..18ac131 --- /dev/null +++ b/.changeset/apache-license.md @@ -0,0 +1,5 @@ +--- +"playground-cli": patch +--- + +License the CLI under Apache-2.0. Adds the canonical `LICENSE` text, declares `"license": "Apache-2.0"` in `package.json`, and applies the standard Parity SPDX + copyright header to every tracked source file. CI now runs `scripts/check-license-headers.sh` on every PR (`License Headers` workflow); contributors can run `pnpm lint:license` locally and `./scripts/check-license-headers.sh --fix` to add the header to new files. diff --git a/.github/workflows/license.yml b/.github/workflows/license.yml new file mode 100644 index 0000000..1547d07 --- /dev/null +++ b/.github/workflows/license.yml @@ -0,0 +1,22 @@ +name: License Headers + +on: + pull_request: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: license-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + check: + name: Check + runs-on: ${{ github.repository_owner == 'paritytech' && 'parity-default' || 'ubuntu-latest' }} + steps: + - uses: actions/checkout@v4 + - run: ./scripts/check-license-headers.sh diff --git a/AGENTS.md b/AGENTS.md index d67f586..1addee8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -15,8 +15,21 @@ Read `CLAUDE.md` alongside this file when you need the full rationale for repo-s - Type check: `npx tsc --noEmit` - Format: `pnpm format` - Check formatting: `pnpm format:check` +- Check license headers: `pnpm lint:license` - Install local binary: `pnpm cli:install` +## Verification before committing + +Run all of these before claiming work is done, opening a PR, or merging. The first two are enforced by CI; the third catches regressions a typecheck would not. + +```bash +pnpm format:check +pnpm lint:license +pnpm test +``` + +`pnpm build` is the canonical type signal (no separate `tsc` step). If `lint:license` fails on a file you wrote, run `./scripts/check-license-headers.sh --fix` to prepend the header — every tracked `.ts` / `.tsx` / `.rs` file must carry the full Parity-style Apache-2.0 block (SPDX line + Parity copyright line both required). + ## Repository Conventions - Tests live next to the source as `*.test.ts`. `vitest.config.ts` only picks up `.test.ts`; update it before adding `.tsx` tests. diff --git a/CLAUDE.md b/CLAUDE.md index b4d5c06..cea66f8 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -2,6 +2,18 @@ Refer to the **Contributing** and **Architecture Highlights** sections of [README.md](./README.md) for development workflows, release process, and repo conventions. +## Verification before committing + +Before claiming a task complete, opening a PR, or merging, run these three checks. The first two are enforced by CI; the third catches regressions: + +```bash +pnpm format:check +pnpm lint:license +pnpm test +``` + +`pnpm build` is the canonical type signal — there is no separate `tsc` step. If `lint:license` flags a file you authored, run `./scripts/check-license-headers.sh --fix` to prepend the standard Parity Apache-2.0 header. Every tracked `.ts` / `.tsx` / `.rs` file must carry both the `SPDX-License-Identifier: Apache-2.0` line and the `Copyright (C) Parity Technologies (UK) Ltd.` line — a bare SPDX line alone is rejected, and the `License Headers` workflow fails closed on missing headers. The check script handles shebanged scripts (`#!/usr/bin/env node|bun`) by keeping the shebang on line 1 and placing the header below it. + ## Non-obvious invariants These are things that aren't self-evident from reading the code and have bitten us before: diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ + + 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 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. diff --git a/README.md b/README.md index 975abf4..d383eb3 100644 --- a/README.md +++ b/README.md @@ -192,6 +192,27 @@ pnpm format # fix pnpm format:check # check only ``` +### License Headers + +Every tracked `.ts` / `.tsx` / `.rs` file must carry the Parity-style Apache-2.0 SPDX header. CI's `License Headers` workflow runs `scripts/check-license-headers.sh` on every PR. + +```bash +pnpm lint:license # check +./scripts/check-license-headers.sh --fix # prepend the header to any missing files +``` + +### Verification before committing + +Run all of these locally before opening a PR (and before declaring work complete from an AI agent session): + +```bash +pnpm format:check +pnpm lint:license +pnpm test +``` + +The first two are also enforced in CI; running them locally catches the failure before the PR turns red. `pnpm build` is the canonical type signal — there is no separate `tsc` step. + ## Dependency Notes - `@parity/product-sdk-*` packages use caret ranges (`^0.x.y`) so upstream patch and minor releases auto-resolve on a fresh `pnpm install`. With pre-1.0 versions, `^` only widens patches within the current 0.x line — a 0.x → 0.(x+1) bump still requires an intentional `package.json` change. CI's `Format` job runs a grep guard that fails the build on any direct `@polkadot-apps/*` import in `src/`, `e2e/`, `scripts/`, or `tools/`. diff --git a/e2e/cli/build.test.ts b/e2e/cli/build.test.ts index 391382c..ef66b5c 100644 --- a/e2e/cli/build.test.ts +++ b/e2e/cli/build.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, test, expect, afterEach } from "vitest"; import { cpSync, existsSync, mkdtempSync, rmSync } from "node:fs"; import { join, resolve } from "node:path"; diff --git a/e2e/cli/chaos.test.ts b/e2e/cli/chaos.test.ts index 629b4e3..4c09333 100644 --- a/e2e/cli/chaos.test.ts +++ b/e2e/cli/chaos.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Chaos tests for `dot deploy` — verifies that the process-guard cleanup * + SIGINT handling work end-to-end. diff --git a/e2e/cli/deploy.test.ts b/e2e/cli/deploy.test.ts index b509f23..7ec2828 100644 --- a/e2e/cli/deploy.test.ts +++ b/e2e/cli/deploy.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * E2E tests for `dot deploy`. * diff --git a/e2e/cli/diagnostic.test.ts b/e2e/cli/diagnostic.test.ts index c9f05e6..decc759 100644 --- a/e2e/cli/diagnostic.test.ts +++ b/e2e/cli/diagnostic.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * E2E tests for diagnostic/verbose modes. * diff --git a/e2e/cli/fixtures/accounts.ts b/e2e/cli/fixtures/accounts.ts index 7f78b51..adf53b7 100644 --- a/e2e/cli/fixtures/accounts.ts +++ b/e2e/cli/fixtures/accounts.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Test account helpers for E2E tests. * diff --git a/e2e/cli/fixtures/projects/hardhat/hardhat.config.ts b/e2e/cli/fixtures/projects/hardhat/hardhat.config.ts index 248bddb..0cbe7dc 100644 --- a/e2e/cli/fixtures/projects/hardhat/hardhat.config.ts +++ b/e2e/cli/fixtures/projects/hardhat/hardhat.config.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + export default { solidity: "0.8.24", }; diff --git a/e2e/cli/fixtures/projects/rust-cdm/contracts/counter-reader/lib.rs b/e2e/cli/fixtures/projects/rust-cdm/contracts/counter-reader/lib.rs index 9844b28..e44480e 100644 --- a/e2e/cli/fixtures/projects/rust-cdm/contracts/counter-reader/lib.rs +++ b/e2e/cli/fixtures/projects/rust-cdm/contracts/counter-reader/lib.rs @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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_main] #![no_std] diff --git a/e2e/cli/fixtures/projects/rust-cdm/contracts/counter-writer/lib.rs b/e2e/cli/fixtures/projects/rust-cdm/contracts/counter-writer/lib.rs index 377c0d0..7ddae7c 100644 --- a/e2e/cli/fixtures/projects/rust-cdm/contracts/counter-writer/lib.rs +++ b/e2e/cli/fixtures/projects/rust-cdm/contracts/counter-writer/lib.rs @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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_main] #![no_std] diff --git a/e2e/cli/fixtures/projects/rust-cdm/contracts/counter/lib.rs b/e2e/cli/fixtures/projects/rust-cdm/contracts/counter/lib.rs index dae28ad..eaf5faa 100644 --- a/e2e/cli/fixtures/projects/rust-cdm/contracts/counter/lib.rs +++ b/e2e/cli/fixtures/projects/rust-cdm/contracts/counter/lib.rs @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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_main] #![no_std] diff --git a/e2e/cli/fixtures/registry.ts b/e2e/cli/fixtures/registry.ts index b137b0d..3858abb 100644 --- a/e2e/cli/fixtures/registry.ts +++ b/e2e/cli/fixtures/registry.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Registry contract query helpers for E2E tests. * diff --git a/e2e/cli/fixtures/templates.ts b/e2e/cli/fixtures/templates.ts index bdcc099..9a41346 100644 --- a/e2e/cli/fixtures/templates.ts +++ b/e2e/cli/fixtures/templates.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Test template app setup and fixture project paths. */ diff --git a/e2e/cli/helpers/chain.ts b/e2e/cli/helpers/chain.ts index 98cc001..ab688c9 100644 --- a/e2e/cli/helpers/chain.ts +++ b/e2e/cli/helpers/chain.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Chain query helpers for E2E tests. * diff --git a/e2e/cli/helpers/dot.ts b/e2e/cli/helpers/dot.ts index d1f15e4..28d1148 100644 --- a/e2e/cli/helpers/dot.ts +++ b/e2e/cli/helpers/dot.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Typed execa wrapper for spawning `dot` CLI commands in E2E tests. * diff --git a/e2e/cli/helpers/published-binary.ts b/e2e/cli/helpers/published-binary.ts index 4e33a14..2b2528a 100644 --- a/e2e/cli/helpers/published-binary.ts +++ b/e2e/cli/helpers/published-binary.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Resolves the path to the `dot` binary for E2E tests against a published * artefact. When `DOT_E2E_BINARY` is set, return that path (tests run against diff --git a/e2e/cli/init.test.ts b/e2e/cli/init.test.ts index ec184d8..e9b70da 100644 --- a/e2e/cli/init.test.ts +++ b/e2e/cli/init.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * E2E tests for `dot init` — session detection and allowance checks. * diff --git a/e2e/cli/install.test.ts b/e2e/cli/install.test.ts index 57b3f99..205398e 100644 --- a/e2e/cli/install.test.ts +++ b/e2e/cli/install.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, test, expect } from "vitest"; import { dot } from "./helpers/dot.js"; diff --git a/e2e/cli/mod.test.ts b/e2e/cli/mod.test.ts index 4f4944d..1487ae1 100644 --- a/e2e/cli/mod.test.ts +++ b/e2e/cli/mod.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * E2E tests for `dot mod`. * diff --git a/e2e/cli/published.test.ts b/e2e/cli/published.test.ts index 4d49330..87a6bfd 100644 --- a/e2e/cli/published.test.ts +++ b/e2e/cli/published.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Smoke tests for the published SEA binary. Skipped when DOT_E2E_BINARY is * unset (i.e. on PR / dev runs). Exercised by the e2e-release.yml workflow diff --git a/e2e/cli/session.test.ts b/e2e/cli/session.test.ts index 1a7ab1d..a275b0e 100644 --- a/e2e/cli/session.test.ts +++ b/e2e/cli/session.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * E2E tests for session management. * diff --git a/e2e/cli/setup/fund.ts b/e2e/cli/setup/fund.ts index 855d780..db37bfc 100644 --- a/e2e/cli/setup/fund.ts +++ b/e2e/cli/setup/fund.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Top up the E2E deployer account before tests run. * diff --git a/e2e/cli/setup/global.ts b/e2e/cli/setup/global.ts index d1eafc4..591361b 100644 --- a/e2e/cli/setup/global.ts +++ b/e2e/cli/setup/global.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Vitest globalSetup — runs once before all E2E tests. * diff --git a/e2e/vitest.config.ts b/e2e/vitest.config.ts index a2ef34b..7c23d88 100644 --- a/e2e/vitest.config.ts +++ b/e2e/vitest.config.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { defineConfig } from "vitest/config"; const isCI = process.env.CI === "true"; diff --git a/package.json b/package.json index f202a31..9c154a6 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "description": "CLI for Polkadot Playground", "version": "0.20.1", "private": true, + "license": "Apache-2.0", "type": "module", "packageManager": "pnpm@10.32.1", "bin": { @@ -12,6 +13,7 @@ "postinstall": "bash node_modules/@parity/product-sdk-terminal/scripts/patch-wasm.sh", "format": "biome format --write .", "format:check": "biome format .", + "lint:license": "./scripts/check-license-headers.sh", "build": "bun build --compile src/index.ts --outfile ./dist/dot", "cli:install": "bun build --compile src/index.ts --outfile ~/.polkadot/bin/dot", "test": "vitest run", diff --git a/scripts/check-funder-balance.ts b/scripts/check-funder-balance.ts index ea85dff..a1277ca 100644 --- a/scripts/check-funder-balance.ts +++ b/scripts/check-funder-balance.ts @@ -1,4 +1,20 @@ #!/usr/bin/env bun + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * CI probe for the dedicated funder's PAS balance on Paseo Asset Hub. * diff --git a/scripts/check-license-headers.sh b/scripts/check-license-headers.sh new file mode 100755 index 0000000..4eb3506 --- /dev/null +++ b/scripts/check-license-headers.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash +# Verify (or add) the Apache-2.0 SPDX header on every tracked source file. +# +# Usage: +# scripts/check-license-headers.sh # check (CI). Exits non-zero if any file is missing the header. +# scripts/check-license-headers.sh --fix # prepend the header to any source file missing it. + +set -euo pipefail + +cd "$(git rev-parse --show-toplevel)" + +HEADER='// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. +' + +# git ls-files honors .gitignore, so dist/, node_modules/, target/ are skipped. +mode="${1:-check}" +missing=() +total=0 + +while IFS= read -r f; do + total=$((total + 1)) + # Require BOTH the SPDX line and the Parity copyright line. A bare SPDX line + # alone is not enough — we want the full Parity-style block, not just the + # machine-readable identifier. + if ! grep -q 'SPDX-License-Identifier: Apache-2.0' "$f" \ + || ! grep -q 'Copyright (C) Parity Technologies' "$f"; then + missing+=("$f") + fi +done < <(git ls-files '*.ts' '*.tsx' '*.rs') + +if [[ ${#missing[@]} -eq 0 ]]; then + echo "All ${total} source files have the Apache-2.0 SPDX header." + exit 0 +fi + +if [[ "$mode" == "--fix" ]]; then + for f in "${missing[@]}"; do + first=$(head -n1 "$f") + if [[ "$first" == "#!"* ]]; then + # Preserve the shebang on line 1 — node/bun rely on it being first. + { printf '%s\n\n' "$first"; printf '%s\n' "$HEADER"; tail -n +2 "$f"; } > "$f.tmp" + else + { printf '%s\n' "$HEADER"; cat "$f"; } > "$f.tmp" + fi + mv "$f.tmp" "$f" + echo "fixed: $f" + done + exit 0 +fi + +echo "Missing Apache-2.0 SPDX header in ${#missing[@]} file(s):" +printf ' %s\n' "${missing[@]}" +echo +echo "Run 'scripts/check-license-headers.sh --fix' to add the header automatically." +exit 1 diff --git a/src/bootstrap.test.ts b/src/bootstrap.test.ts index 0856fa1..469ac6e 100644 --- a/src/bootstrap.test.ts +++ b/src/bootstrap.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { readFileSync } from "node:fs"; import { mkdtempSync } from "node:fs"; import { tmpdir } from "node:os"; diff --git a/src/bootstrap.ts b/src/bootstrap.ts index 2328731..e400fa3 100644 --- a/src/bootstrap.ts +++ b/src/bootstrap.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + // Env-var wiring that MUST be applied before any `bulletin-deploy` module // evaluates. ES-module top-level evaluation is dependency-first + ordered // across siblings of the same parent, so importing this module as the very diff --git a/src/cli-runtime.test.ts b/src/cli-runtime.test.ts index 9d871c1..22779cd 100644 --- a/src/cli-runtime.test.ts +++ b/src/cli-runtime.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, it, expect, vi, beforeEach } from "vitest"; const { stopWatchdog, startMemoryWatchdog, scheduleHardExit, onProcessShutdown } = vi.hoisted( diff --git a/src/cli-runtime.ts b/src/cli-runtime.ts index 6191837..2f6411c 100644 --- a/src/cli-runtime.ts +++ b/src/cli-runtime.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { withCommandTelemetry } from "./telemetry.js"; import type { CliCommandName } from "./telemetry-config.js"; import { onProcessShutdown, scheduleHardExit, startMemoryWatchdog } from "./utils/process-guard.js"; diff --git a/src/commands/build.ts b/src/commands/build.ts index a20c670..5586566 100644 --- a/src/commands/build.ts +++ b/src/commands/build.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { Command } from "commander"; import { withSpan, errorMessage } from "../telemetry.js"; import { runCliCommand } from "../cli-runtime.js"; diff --git a/src/commands/deploy/DeployScreen.test.ts b/src/commands/deploy/DeployScreen.test.ts index 12feb4b..16cbf6e 100644 --- a/src/commands/deploy/DeployScreen.test.ts +++ b/src/commands/deploy/DeployScreen.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, expect, it } from "vitest"; import { pickNextStage } from "./DeployScreen.js"; diff --git a/src/commands/deploy/DeployScreen.tsx b/src/commands/deploy/DeployScreen.tsx index 791fc95..c140745 100644 --- a/src/commands/deploy/DeployScreen.tsx +++ b/src/commands/deploy/DeployScreen.tsx @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { useEffect, useMemo, useRef, useState } from "react"; import { Box, Text, useInput } from "ink"; import { diff --git a/src/commands/deploy/index.test.ts b/src/commands/deploy/index.test.ts index 6bd0bd5..57d494f 100644 --- a/src/commands/deploy/index.test.ts +++ b/src/commands/deploy/index.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, it, expect, vi, beforeEach, afterEach } from "vitest"; import { mkdtempSync, rmSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; diff --git a/src/commands/deploy/index.ts b/src/commands/deploy/index.ts index 6d96221..a008bac 100644 --- a/src/commands/deploy/index.ts +++ b/src/commands/deploy/index.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import React from "react"; import { resolve } from "node:path"; import { Command, Option } from "commander"; diff --git a/src/commands/deploy/runningState.test.ts b/src/commands/deploy/runningState.test.ts index 49cc07e..973f7a5 100644 --- a/src/commands/deploy/runningState.test.ts +++ b/src/commands/deploy/runningState.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, it, expect } from "vitest"; import { initialRunningState, runningReducer, type RunningState } from "./runningState.js"; import type { DeployEvent } from "../../utils/deploy/index.js"; diff --git a/src/commands/deploy/runningState.ts b/src/commands/deploy/runningState.ts index 73e8426..4d7aae7 100644 --- a/src/commands/deploy/runningState.ts +++ b/src/commands/deploy/runningState.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Pure reducer + initial-state builder for the running-deploy TUI. Must stay * free of React/Ink so it can be unit-tested. Log-line updates are throttled diff --git a/src/commands/deploy/summary.test.ts b/src/commands/deploy/summary.test.ts index b055398..814fa21 100644 --- a/src/commands/deploy/summary.test.ts +++ b/src/commands/deploy/summary.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, it, expect } from "vitest"; import { buildSummaryView, renderSummaryText } from "./summary.js"; diff --git a/src/commands/deploy/summary.ts b/src/commands/deploy/summary.ts index 823dcd1..8c3d2c8 100644 --- a/src/commands/deploy/summary.ts +++ b/src/commands/deploy/summary.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Pure helpers that compute the human-readable summary the TUI shows after * the user answers every prompt. Kept separate from the Ink component so diff --git a/src/commands/init/AccountSetup.format.test.ts b/src/commands/init/AccountSetup.format.test.ts index eba8566..3fa5ead 100644 --- a/src/commands/init/AccountSetup.format.test.ts +++ b/src/commands/init/AccountSetup.format.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Covers the bigint-safe display formatters used by AccountSetup. * diff --git a/src/commands/init/AccountSetup.tsx b/src/commands/init/AccountSetup.tsx index 4f6e256..988a74a 100644 --- a/src/commands/init/AccountSetup.tsx +++ b/src/commands/init/AccountSetup.tsx @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { useState, useEffect } from "react"; import { Row, Section, type MarkKind } from "../../utils/ui/theme/index.js"; import { getConnection } from "../../utils/connection.js"; diff --git a/src/commands/init/DependencyList.tsx b/src/commands/init/DependencyList.tsx index d5e4ae1..8857704 100644 --- a/src/commands/init/DependencyList.tsx +++ b/src/commands/init/DependencyList.tsx @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { useState, useEffect } from "react"; import { Box } from "ink"; import { Row, LogTail, Section, type MarkKind } from "../../utils/ui/theme/index.js"; diff --git a/src/commands/init/InitScreen.tsx b/src/commands/init/InitScreen.tsx index d694efe..8c85599 100644 --- a/src/commands/init/InitScreen.tsx +++ b/src/commands/init/InitScreen.tsx @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { useState, useEffect } from "react"; import { Box } from "ink"; import { Header, Row, Section } from "../../utils/ui/theme/index.js"; diff --git a/src/commands/init/QrLogin.tsx b/src/commands/init/QrLogin.tsx index b970e9e..ea209b0 100644 --- a/src/commands/init/QrLogin.tsx +++ b/src/commands/init/QrLogin.tsx @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { useState, useEffect } from "react"; import { Row } from "../../utils/ui/theme/index.js"; import { waitForLogin, type LoginStatus, type LoginHandle } from "../../utils/auth.js"; diff --git a/src/commands/init/completion.test.ts b/src/commands/init/completion.test.ts index 3e8d61a..45f2a52 100644 --- a/src/commands/init/completion.test.ts +++ b/src/commands/init/completion.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Tests for the init-completion predicate. * diff --git a/src/commands/init/completion.ts b/src/commands/init/completion.ts index 0acaa8b..f5f5b6e 100644 --- a/src/commands/init/completion.ts +++ b/src/commands/init/completion.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Pure predicate over the three parallel init streams (deps / auth / account * setup). Lives in its own file so tests can import it without dragging React diff --git a/src/commands/init/index.ts b/src/commands/init/index.ts index c77f4fc..53daf27 100644 --- a/src/commands/init/index.ts +++ b/src/commands/init/index.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import React from "react"; import { Command } from "commander"; import { render } from "ink"; diff --git a/src/commands/logout/LogoutScreen.tsx b/src/commands/logout/LogoutScreen.tsx index 6734e9d..f4f041d 100644 --- a/src/commands/logout/LogoutScreen.tsx +++ b/src/commands/logout/LogoutScreen.tsx @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { useEffect, useState } from "react"; import { Box } from "ink"; import { Header, Section } from "../../utils/ui/theme/index.js"; diff --git a/src/commands/logout/LogoutStatus.tsx b/src/commands/logout/LogoutStatus.tsx index cfaf64b..46ba885 100644 --- a/src/commands/logout/LogoutStatus.tsx +++ b/src/commands/logout/LogoutStatus.tsx @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { Row } from "../../utils/ui/theme/index.js"; import { statusToRow } from "./status.js"; import type { LogoutStatus as LogoutStatusType } from "../../utils/auth.js"; diff --git a/src/commands/logout/index.ts b/src/commands/logout/index.ts index 9a8b1b9..ca19bbd 100644 --- a/src/commands/logout/index.ts +++ b/src/commands/logout/index.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import React from "react"; import { Command } from "commander"; import { render } from "ink"; diff --git a/src/commands/logout/status.test.ts b/src/commands/logout/status.test.ts index ed97002..d118304 100644 --- a/src/commands/logout/status.test.ts +++ b/src/commands/logout/status.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, it, expect } from "vitest"; import { isTerminal, statusToRow } from "./status.js"; import type { LogoutStatus } from "../../utils/auth.js"; diff --git a/src/commands/logout/status.ts b/src/commands/logout/status.ts index 944d88f..9756d71 100644 --- a/src/commands/logout/status.ts +++ b/src/commands/logout/status.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Pure mapping from a `LogoutStatus` to the props the primitive needs. * diff --git a/src/commands/mod/AppBrowser.tsx b/src/commands/mod/AppBrowser.tsx index 164ba2c..d7bc74c 100644 --- a/src/commands/mod/AppBrowser.tsx +++ b/src/commands/mod/AppBrowser.tsx @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { useState, useEffect, useRef, useCallback } from "react"; import { Box, Text, useInput, useStdout } from "ink"; import { Mark, Hint, COLOR } from "../../utils/ui/theme/index.js"; diff --git a/src/commands/mod/SetupScreen.tsx b/src/commands/mod/SetupScreen.tsx index 4687273..087bb1a 100644 --- a/src/commands/mod/SetupScreen.tsx +++ b/src/commands/mod/SetupScreen.tsx @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { useRef, useState } from "react"; import { Box } from "ink"; import { existsSync, readFileSync, writeFileSync, appendFileSync } from "node:fs"; diff --git a/src/commands/mod/browserFilter.test.ts b/src/commands/mod/browserFilter.test.ts index d16bc1c..abbd6df 100644 --- a/src/commands/mod/browserFilter.test.ts +++ b/src/commands/mod/browserFilter.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, it, expect } from "vitest"; import { filterModdable, type AppEntry } from "./browserFilter.js"; diff --git a/src/commands/mod/browserFilter.ts b/src/commands/mod/browserFilter.ts index 709024f..efcdd13 100644 --- a/src/commands/mod/browserFilter.ts +++ b/src/commands/mod/browserFilter.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + export interface AppEntry { domain: string; name: string | null; diff --git a/src/commands/mod/index.ts b/src/commands/mod/index.ts index cdc2068..cf9d580 100644 --- a/src/commands/mod/index.ts +++ b/src/commands/mod/index.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import React from "react"; import { render } from "ink"; import { Command } from "commander"; diff --git a/src/commands/update.test.ts b/src/commands/update.test.ts index 156de73..253f534 100644 --- a/src/commands/update.test.ts +++ b/src/commands/update.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, it, expect, vi } from "vitest"; import { existsSync, mkdtempSync, readFileSync, rmSync, statSync } from "node:fs"; import { tmpdir } from "node:os"; diff --git a/src/commands/update.ts b/src/commands/update.ts index bd23b96..0ad0b26 100644 --- a/src/commands/update.ts +++ b/src/commands/update.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { Command } from "commander"; import { chmodSync, diff --git a/src/config.ts b/src/config.ts index ca0889c..103205e 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Single source of truth for environment-dependent values: RPC endpoints, * contract addresses, dapp identifiers, and feature defaults. diff --git a/src/dotns-cli-dispatch.ts b/src/dotns-cli-dispatch.ts index e7a994d..0273f2e 100644 --- a/src/dotns-cli-dispatch.ts +++ b/src/dotns-cli-dispatch.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { pathToFileURL } from "node:url"; // @ts-expect-error Bun's file import attribute embeds the bundled DotNS CLI file. import dotnsCliPath from "../node_modules/@parity/dotns-cli/dist/cli.js" with { type: "file" }; diff --git a/src/index.test.ts b/src/index.test.ts index 9f317b4..24107f4 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { test, expect } from "vitest"; import { readFileSync } from "node:fs"; diff --git a/src/index.ts b/src/index.ts index 1a81502..c023a45 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,20 @@ #!/usr/bin/env node +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + // MUST be the first import — sets env vars that gate bulletin-deploy's // ambient Sentry handoff before its modules evaluate. See // `src/bootstrap.ts` for the rationale. diff --git a/src/telemetry-config.test.ts b/src/telemetry-config.test.ts index 5733bde..345a542 100644 --- a/src/telemetry-config.test.ts +++ b/src/telemetry-config.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, expect, it } from "vitest"; import { configureBulletinTelemetryEnv, diff --git a/src/telemetry-config.ts b/src/telemetry-config.ts index 9629b85..94b08f8 100644 --- a/src/telemetry-config.ts +++ b/src/telemetry-config.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { execFileSync } from "node:child_process"; import { createHash } from "node:crypto"; import pkg from "../package.json" with { type: "json" }; diff --git a/src/telemetry.test.ts b/src/telemetry.test.ts index c1c8209..54cb1bb 100644 --- a/src/telemetry.test.ts +++ b/src/telemetry.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { readFileSync } from "node:fs"; import { beforeEach, describe, expect, it, vi } from "vitest"; diff --git a/src/telemetry.ts b/src/telemetry.ts index 2338dea..3d69ef2 100644 --- a/src/telemetry.ts +++ b/src/telemetry.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import type * as SentryNode from "@sentry/node"; import { PLAYGROUND_SENTRY_DSN, diff --git a/src/utils/account/allowance.test.ts b/src/utils/account/allowance.test.ts index c0501db..aa2a2b3 100644 --- a/src/utils/account/allowance.test.ts +++ b/src/utils/account/allowance.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Tests for bulletin allowance checks and Alice-based granting. * diff --git a/src/utils/account/allowance.ts b/src/utils/account/allowance.ts index 7ffba2d..968a186 100644 --- a/src/utils/account/allowance.ts +++ b/src/utils/account/allowance.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Bulletin storage allowance — check and grant authorization. * diff --git a/src/utils/account/attestation.test.ts b/src/utils/account/attestation.test.ts index 507228d..755de69 100644 --- a/src/utils/account/attestation.test.ts +++ b/src/utils/account/attestation.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, it, expect, vi } from "vitest"; import { formatAttestation, diff --git a/src/utils/account/attestation.ts b/src/utils/account/attestation.ts index bb02e6e..8036741 100644 --- a/src/utils/account/attestation.ts +++ b/src/utils/account/attestation.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Bulletin attestation — read current authorization, format for the TUI. * diff --git a/src/utils/account/authorizationExtent.test.ts b/src/utils/account/authorizationExtent.test.ts index ae9f75d..d08871d 100644 --- a/src/utils/account/authorizationExtent.test.ts +++ b/src/utils/account/authorizationExtent.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, it, expect } from "vitest"; import { remainingAuthorizationExtent } from "./authorizationExtent.js"; diff --git a/src/utils/account/authorizationExtent.ts b/src/utils/account/authorizationExtent.ts index 9ad6e95..0c0e2c4 100644 --- a/src/utils/account/authorizationExtent.ts +++ b/src/utils/account/authorizationExtent.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Current Bulletin authorization extents expose used counters plus granted * allowance totals. The CLI only needs remaining quota for preflight decisions diff --git a/src/utils/account/errors.ts b/src/utils/account/errors.ts index 90900d0..e97b2f3 100644 --- a/src/utils/account/errors.ts +++ b/src/utils/account/errors.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Typed errors raised by the account-setup subsystem so callers (TUI, deploy * orchestrator) can render specific guidance instead of a raw message. diff --git a/src/utils/account/funder.ts b/src/utils/account/funder.ts index 706013d..14b60b4 100644 --- a/src/utils/account/funder.ts +++ b/src/utils/account/funder.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Testnet funder accounts used to top up users and session keys on Paseo * Asset Hub. We try Alice first (public dev account — free tokens while she diff --git a/src/utils/account/funding.test.ts b/src/utils/account/funding.test.ts index cc43f1c..e915c38 100644 --- a/src/utils/account/funding.test.ts +++ b/src/utils/account/funding.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Tests for balance checks and funder-chain selection. * diff --git a/src/utils/account/funding.ts b/src/utils/account/funding.ts index 6fccd52..b688e3b 100644 --- a/src/utils/account/funding.ts +++ b/src/utils/account/funding.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Account funding — check balance and fund the user from a testnet funder * chain on Paseo Asset Hub. diff --git a/src/utils/account/index.ts b/src/utils/account/index.ts index bdfa5b8..d6deb44 100644 --- a/src/utils/account/index.ts +++ b/src/utils/account/index.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + export { checkBalance, ensureFunded, diff --git a/src/utils/account/mapping.test.ts b/src/utils/account/mapping.test.ts index eb48659..3159936 100644 --- a/src/utils/account/mapping.test.ts +++ b/src/utils/account/mapping.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Tests for the Revive-mapping wrapper. * diff --git a/src/utils/account/mapping.ts b/src/utils/account/mapping.ts index bc0990f..26ee3cb 100644 --- a/src/utils/account/mapping.ts +++ b/src/utils/account/mapping.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Revive account mapping — check and map SS58 to H160. * diff --git a/src/utils/auth.test.ts b/src/utils/auth.test.ts index 79433f1..6776691 100644 --- a/src/utils/auth.test.ts +++ b/src/utils/auth.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Tests for auth.ts edge cases — specifically the subscribe-before-assignment bug. * diff --git a/src/utils/auth.ts b/src/utils/auth.ts index b5d2d3b..7e52c1a 100644 --- a/src/utils/auth.ts +++ b/src/utils/auth.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * QR login flow — pure business logic, no UI. * diff --git a/src/utils/build/detect.test.ts b/src/utils/build/detect.test.ts index cb9b955..a68c0c9 100644 --- a/src/utils/build/detect.test.ts +++ b/src/utils/build/detect.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, it, expect } from "vitest"; import { detectBuildConfig, diff --git a/src/utils/build/detect.ts b/src/utils/build/detect.ts index 2db0563..c39a519 100644 --- a/src/utils/build/detect.ts +++ b/src/utils/build/detect.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Pure build-config detection — given a project tree snapshot, decide which * command to run and where the output will land. No I/O here so unit tests diff --git a/src/utils/build/index.ts b/src/utils/build/index.ts index ceab901..fc62556 100644 --- a/src/utils/build/index.ts +++ b/src/utils/build/index.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Public surface for build detection + execution. * diff --git a/src/utils/build/runner.ts b/src/utils/build/runner.ts index f459d09..ce1aed4 100644 --- a/src/utils/build/runner.ts +++ b/src/utils/build/runner.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Filesystem + child-process I/O for `dot build`. Kept in its own module so * `detect.ts` can stay pure and unit-testable. diff --git a/src/utils/bulletinGateway.test.ts b/src/utils/bulletinGateway.test.ts index 7973efa..006f2e6 100644 --- a/src/utils/bulletinGateway.test.ts +++ b/src/utils/bulletinGateway.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, it, expect, vi, afterEach } from "vitest"; import { bulletinGatewayUrl, diff --git a/src/utils/bulletinGateway.ts b/src/utils/bulletinGateway.ts index ca4a3d1..244f5e2 100644 --- a/src/utils/bulletinGateway.ts +++ b/src/utils/bulletinGateway.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { getChainConfig, type Env } from "../config.js"; const DEFAULT_FETCH_TIMEOUT_MS = 30_000; diff --git a/src/utils/connection.test.ts b/src/utils/connection.test.ts index c463ce9..522a8d9 100644 --- a/src/utils/connection.test.ts +++ b/src/utils/connection.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, it, expect, vi, beforeEach } from "vitest"; const mockCreateClient = vi.fn(); diff --git a/src/utils/connection.ts b/src/utils/connection.ts index 688dc80..4fc8e2f 100644 --- a/src/utils/connection.ts +++ b/src/utils/connection.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { createClient, type ChainDefinition, diff --git a/src/utils/contractManifest.test.ts b/src/utils/contractManifest.test.ts index 7bab0bb..c66b1c8 100644 --- a/src/utils/contractManifest.test.ts +++ b/src/utils/contractManifest.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, expect, it, beforeEach, vi } from "vitest"; import type { CdmJson } from "@parity/product-sdk-contracts"; import { CDM_REGISTRY_ADDRESS } from "../config.js"; diff --git a/src/utils/contractManifest.ts b/src/utils/contractManifest.ts index e2d1da1..a3bdd17 100644 --- a/src/utils/contractManifest.ts +++ b/src/utils/contractManifest.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { createContractFromClient, type AbiEntry, diff --git a/src/utils/deploy/availability.test.ts b/src/utils/deploy/availability.test.ts index 324d792..c1f3016 100644 --- a/src/utils/deploy/availability.test.ts +++ b/src/utils/deploy/availability.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, it, expect, vi, beforeEach } from "vitest"; // Mock bulletin-deploy's DotNS class. As of 0.7.6, label classification is diff --git a/src/utils/deploy/availability.ts b/src/utils/deploy/availability.ts index 9883d04..de114c0 100644 --- a/src/utils/deploy/availability.ts +++ b/src/utils/deploy/availability.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Preflight domain availability check. * diff --git a/src/utils/deploy/contracts.test.ts b/src/utils/deploy/contracts.test.ts index c7b13c2..c87c2cc 100644 --- a/src/utils/deploy/contracts.test.ts +++ b/src/utils/deploy/contracts.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { mkdirSync, mkdtempSync, writeFileSync } from "node:fs"; import { join } from "node:path"; import { tmpdir } from "node:os"; diff --git a/src/utils/deploy/contracts.ts b/src/utils/deploy/contracts.ts index 489819d..d351530 100644 --- a/src/utils/deploy/contracts.ts +++ b/src/utils/deploy/contracts.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Compile + deploy contracts for the `dot deploy` flow. * diff --git a/src/utils/deploy/dotns-cli-dependency.test.ts b/src/utils/deploy/dotns-cli-dependency.test.ts index 0a99e59..c3c9bf5 100644 --- a/src/utils/deploy/dotns-cli-dependency.test.ts +++ b/src/utils/deploy/dotns-cli-dependency.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { createRequire } from "node:module"; import { readFileSync } from "node:fs"; import { describe, expect, it } from "vitest"; diff --git a/src/utils/deploy/index.ts b/src/utils/deploy/index.ts index 95350b2..59e714e 100644 --- a/src/utils/deploy/index.ts +++ b/src/utils/deploy/index.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Public surface for programmatic deploy usage (RevX, automation, etc.). * diff --git a/src/utils/deploy/moddable.test.ts b/src/utils/deploy/moddable.test.ts index 457fe7e..da5e6e1 100644 --- a/src/utils/deploy/moddable.test.ts +++ b/src/utils/deploy/moddable.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, it, expect, afterEach } from "vitest"; import { execFileSync } from "node:child_process"; import { mkdtempSync, rmSync } from "node:fs"; diff --git a/src/utils/deploy/moddable.ts b/src/utils/deploy/moddable.ts index 938bf53..3275387 100644 --- a/src/utils/deploy/moddable.ts +++ b/src/utils/deploy/moddable.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * `dot deploy --moddable` preflight: resolves the public GitHub URL we'll * record in the Bulletin metadata. diff --git a/src/utils/deploy/phase.test.ts b/src/utils/deploy/phase.test.ts index d00805e..ba967e8 100644 --- a/src/utils/deploy/phase.test.ts +++ b/src/utils/deploy/phase.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, it, expect, vi } from "vitest"; vi.mock("../../telemetry.js", () => ({ diff --git a/src/utils/deploy/phase.ts b/src/utils/deploy/phase.ts index 2a82eb5..2344f8d 100644 --- a/src/utils/deploy/phase.ts +++ b/src/utils/deploy/phase.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { withSpan, errorMessage } from "../../telemetry.js"; import type { TelemetryAttribute } from "../../telemetry-config.js"; import type { DeployEvent, DeployPhase } from "./run.js"; diff --git a/src/utils/deploy/playground.test.ts b/src/utils/deploy/playground.test.ts index 441660d..fa5bf19 100644 --- a/src/utils/deploy/playground.test.ts +++ b/src/utils/deploy/playground.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, it, expect, vi, beforeEach } from "vitest"; import { mkdtempSync, rmSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; diff --git a/src/utils/deploy/playground.ts b/src/utils/deploy/playground.ts index c1952dc..4d989b4 100644 --- a/src/utils/deploy/playground.ts +++ b/src/utils/deploy/playground.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Own playground-registry publish flow. * diff --git a/src/utils/deploy/progress.test.ts b/src/utils/deploy/progress.test.ts index 1a40fe0..0f47683 100644 --- a/src/utils/deploy/progress.test.ts +++ b/src/utils/deploy/progress.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, it, expect } from "vitest"; import { DeployLogParser, type DeployLogEvent } from "./progress.js"; diff --git a/src/utils/deploy/progress.ts b/src/utils/deploy/progress.ts index 79559ac..26aa7e5 100644 --- a/src/utils/deploy/progress.ts +++ b/src/utils/deploy/progress.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Line-level parser that turns bulletin-deploy's banner/prose output into a * typed event stream the TUI can render. Best-effort — we use it only for diff --git a/src/utils/deploy/run.test.ts b/src/utils/deploy/run.test.ts index f08a07c..577988d 100644 --- a/src/utils/deploy/run.test.ts +++ b/src/utils/deploy/run.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, it, expect, vi, beforeEach } from "vitest"; // Mocks for the heavy underlying pieces. Orchestrator tests only care about diff --git a/src/utils/deploy/run.ts b/src/utils/deploy/run.ts index 8b81973..c2763a0 100644 --- a/src/utils/deploy/run.ts +++ b/src/utils/deploy/run.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Orchestrator for the full `dot deploy` flow. * diff --git a/src/utils/deploy/session-account.test.ts b/src/utils/deploy/session-account.test.ts index 795898e..0c728ed 100644 --- a/src/utils/deploy/session-account.test.ts +++ b/src/utils/deploy/session-account.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, it, expect, beforeEach, afterEach } from "vitest"; import { existsSync, mkdtempSync, readFileSync, rmSync } from "node:fs"; import { tmpdir } from "node:os"; diff --git a/src/utils/deploy/session-account.ts b/src/utils/deploy/session-account.ts index 2c148fc..768a445 100644 --- a/src/utils/deploy/session-account.ts +++ b/src/utils/deploy/session-account.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * On-disk session key used to sign contracts-phase extrinsics. * Persisted at `$POLKADOT_ROOT/accounts.json` (default `~/.polkadot/accounts.json`) diff --git a/src/utils/deploy/signerMode.test.ts b/src/utils/deploy/signerMode.test.ts index f14c83d..d714620 100644 --- a/src/utils/deploy/signerMode.test.ts +++ b/src/utils/deploy/signerMode.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, it, expect } from "vitest"; import { resolveSignerSetup } from "./signerMode.js"; import type { ResolvedSigner } from "../signer.js"; diff --git a/src/utils/deploy/signerMode.ts b/src/utils/deploy/signerMode.ts index 97f8091..29d10da 100644 --- a/src/utils/deploy/signerMode.ts +++ b/src/utils/deploy/signerMode.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Resolves *which* signer is used for each on-chain step of a deploy. This * is the only module that knows the full matrix; everywhere else receives diff --git a/src/utils/deploy/signingProxy.test.ts b/src/utils/deploy/signingProxy.test.ts index a2996ce..8ee1313 100644 --- a/src/utils/deploy/signingProxy.test.ts +++ b/src/utils/deploy/signingProxy.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, it, expect } from "vitest"; import { createSigningCounter } from "./signingProxy.js"; diff --git a/src/utils/deploy/signingProxy.ts b/src/utils/deploy/signingProxy.ts index 0f3cca1..c9778ad 100644 --- a/src/utils/deploy/signingProxy.ts +++ b/src/utils/deploy/signingProxy.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Wraps a `PolkadotSigner` so the TUI can render a "check your phone" panel * around each signing call. We cannot infer this from bulletin-deploy's diff --git a/src/utils/deploy/storage.ts b/src/utils/deploy/storage.ts index 30aa224..f91f4d2 100644 --- a/src/utils/deploy/storage.ts +++ b/src/utils/deploy/storage.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Wrapper around `bulletin-deploy`'s `deploy()` that: * - intercepts bulletin-deploy's `console.log` stream and turns it into diff --git a/src/utils/git.test.ts b/src/utils/git.test.ts index 9fc5c0c..c13e20f 100644 --- a/src/utils/git.test.ts +++ b/src/utils/git.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Tests for git.ts — focused on sanitize() since it handles tricky * ANSI/cursor output from child processes (pnpm, cdm, Ink programs), diff --git a/src/utils/git.ts b/src/utils/git.ts index 8562e6e..389d913 100644 --- a/src/utils/git.ts +++ b/src/utils/git.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Git utilities. */ diff --git a/src/utils/git/repoName.test.ts b/src/utils/git/repoName.test.ts index a1a7ce4..ada0857 100644 --- a/src/utils/git/repoName.test.ts +++ b/src/utils/git/repoName.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, it, expect } from "vitest"; import { defaultRepoName } from "./repoName.js"; diff --git a/src/utils/git/repoName.ts b/src/utils/git/repoName.ts index 0ea7e83..9834e5b 100644 --- a/src/utils/git/repoName.ts +++ b/src/utils/git/repoName.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { randomBytes } from "node:crypto"; /** diff --git a/src/utils/mod/git-baseline.test.ts b/src/utils/mod/git-baseline.test.ts index bbbb687..82b3eed 100644 --- a/src/utils/mod/git-baseline.test.ts +++ b/src/utils/mod/git-baseline.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { execFileSync } from "node:child_process"; import { existsSync, mkdtempSync, rmSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; diff --git a/src/utils/mod/git-baseline.ts b/src/utils/mod/git-baseline.ts index 3fb3986..90bdfd0 100644 --- a/src/utils/mod/git-baseline.ts +++ b/src/utils/mod/git-baseline.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { runCommand } from "../git.js"; import { commandExists } from "../toolchain.js"; diff --git a/src/utils/mod/source.test.ts b/src/utils/mod/source.test.ts index c27b8d7..c543721 100644 --- a/src/utils/mod/source.test.ts +++ b/src/utils/mod/source.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, it, expect, beforeEach, afterEach } from "vitest"; import { mkdtempSync, rmSync, readFileSync, existsSync, mkdirSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; diff --git a/src/utils/mod/source.ts b/src/utils/mod/source.ts index a1535c4..9fa6a35 100644 --- a/src/utils/mod/source.ts +++ b/src/utils/mod/source.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * GitHub-only source acquisition for `dot mod`. * diff --git a/src/utils/process-guard.test.ts b/src/utils/process-guard.test.ts index ba5d476..2d266d7 100644 --- a/src/utils/process-guard.test.ts +++ b/src/utils/process-guard.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, expect, it } from "vitest"; import { isBenignUnsubscriptionError, setProcessGuardWarningHandler } from "./process-guard.js"; diff --git a/src/utils/process-guard.ts b/src/utils/process-guard.ts index 688d91e..d4b7f5f 100644 --- a/src/utils/process-guard.ts +++ b/src/utils/process-guard.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Defense-in-depth against runaway memory / zombie processes. * diff --git a/src/utils/process.test.ts b/src/utils/process.test.ts index c807124..cb27d3e 100644 --- a/src/utils/process.test.ts +++ b/src/utils/process.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, it, expect } from "vitest"; import { runStreamed, runShell } from "./process.js"; diff --git a/src/utils/process.ts b/src/utils/process.ts index 91cc559..a7c0f86 100644 --- a/src/utils/process.ts +++ b/src/utils/process.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Streamed child-process helper. Consolidates the copies that used to live * in `build/runner.ts`, `deploy/contracts.ts`, and `toolchain.ts`. diff --git a/src/utils/registry.test.ts b/src/utils/registry.test.ts index 500e059..5f72482 100644 --- a/src/utils/registry.test.ts +++ b/src/utils/registry.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, expect, it, beforeEach, vi } from "vitest"; import type { ResolvedSigner } from "./signer.js"; import cdmJson from "../../cdm.json"; diff --git a/src/utils/registry.ts b/src/utils/registry.ts index 58eb7dd..4b7233f 100644 --- a/src/utils/registry.ts +++ b/src/utils/registry.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Playground registry contract access. */ diff --git a/src/utils/signer.test.ts b/src/utils/signer.test.ts index c4795d8..07ec2f2 100644 --- a/src/utils/signer.test.ts +++ b/src/utils/signer.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Tests for unified signer resolution. * diff --git a/src/utils/signer.ts b/src/utils/signer.ts index e562d2d..69744a8 100644 --- a/src/utils/signer.ts +++ b/src/utils/signer.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Unified signer resolution — "give me a PolkadotSigner, I don't care how." * diff --git a/src/utils/toolchain.test.ts b/src/utils/toolchain.test.ts index e885be8..444e9a7 100644 --- a/src/utils/toolchain.test.ts +++ b/src/utils/toolchain.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { afterEach, beforeEach, describe, expect, it } from "vitest"; import { prependPath } from "./toolchain.js"; diff --git a/src/utils/toolchain.ts b/src/utils/toolchain.ts index 483622b..f92a612 100644 --- a/src/utils/toolchain.ts +++ b/src/utils/toolchain.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { exec } from "node:child_process"; import { existsSync } from "node:fs"; import { resolve } from "node:path"; diff --git a/src/utils/ui/components/StepRunner.tsx b/src/utils/ui/components/StepRunner.tsx index e7610e3..92b9e62 100644 --- a/src/utils/ui/components/StepRunner.tsx +++ b/src/utils/ui/components/StepRunner.tsx @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Reusable step runner — displays a list of sequential steps with status * marks and a fixed-height log tail for step output. diff --git a/src/utils/ui/index.ts b/src/utils/ui/index.ts index fe54c11..7c894f3 100644 --- a/src/utils/ui/index.ts +++ b/src/utils/ui/index.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Public TUI surface: re-exports the theme plug (the visual system) and * the shared StepRunner (the sequential-steps runner built on top of it). diff --git a/src/utils/ui/theme/Callout.tsx b/src/utils/ui/theme/Callout.tsx index 4085ec2..52f78db 100644 --- a/src/utils/ui/theme/Callout.tsx +++ b/src/utils/ui/theme/Callout.tsx @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { Box, Text } from "ink"; import { COLOR, LAYOUT } from "./tokens.js"; diff --git a/src/utils/ui/theme/Header.tsx b/src/utils/ui/theme/Header.tsx index 7f47302..1e29cfc 100644 --- a/src/utils/ui/theme/Header.tsx +++ b/src/utils/ui/theme/Header.tsx @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import React, { useEffect } from "react"; import { Box, Text, useStdout } from "ink"; import { LAYOUT } from "./tokens.js"; diff --git a/src/utils/ui/theme/Hint.tsx b/src/utils/ui/theme/Hint.tsx index 99c4f38..a91e65e 100644 --- a/src/utils/ui/theme/Hint.tsx +++ b/src/utils/ui/theme/Hint.tsx @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { Box, Text } from "ink"; import { LAYOUT } from "./tokens.js"; diff --git a/src/utils/ui/theme/Input.tsx b/src/utils/ui/theme/Input.tsx index 74e8c47..dc0d5c2 100644 --- a/src/utils/ui/theme/Input.tsx +++ b/src/utils/ui/theme/Input.tsx @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { useState } from "react"; import { Box, Text, useInput } from "ink"; import { COLOR, GLYPH, LAYOUT } from "./tokens.js"; diff --git a/src/utils/ui/theme/LogTail.tsx b/src/utils/ui/theme/LogTail.tsx index 2d72b30..b4dc8e1 100644 --- a/src/utils/ui/theme/LogTail.tsx +++ b/src/utils/ui/theme/LogTail.tsx @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { Box, Text } from "ink"; import { LAYOUT } from "./tokens.js"; diff --git a/src/utils/ui/theme/Mark.tsx b/src/utils/ui/theme/Mark.tsx index 1ac4578..1db0737 100644 --- a/src/utils/ui/theme/Mark.tsx +++ b/src/utils/ui/theme/Mark.tsx @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { useState, useEffect } from "react"; import { Text } from "ink"; import { COLOR, GLYPH, TIMING } from "./tokens.js"; diff --git a/src/utils/ui/theme/Row.tsx b/src/utils/ui/theme/Row.tsx index 401ab1f..2c461e6 100644 --- a/src/utils/ui/theme/Row.tsx +++ b/src/utils/ui/theme/Row.tsx @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { Box, Text } from "ink"; import { COLOR, LAYOUT } from "./tokens.js"; import { Mark, type MarkKind } from "./Mark.js"; diff --git a/src/utils/ui/theme/Rule.tsx b/src/utils/ui/theme/Rule.tsx index 1fe9d5c..c394d27 100644 --- a/src/utils/ui/theme/Rule.tsx +++ b/src/utils/ui/theme/Rule.tsx @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { Box, Text, useStdout } from "ink"; import { GLYPH, LAYOUT } from "./tokens.js"; diff --git a/src/utils/ui/theme/Section.tsx b/src/utils/ui/theme/Section.tsx index 164dfa4..f22d6c6 100644 --- a/src/utils/ui/theme/Section.tsx +++ b/src/utils/ui/theme/Section.tsx @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { Box, Text } from "ink"; import { LAYOUT } from "./tokens.js"; diff --git a/src/utils/ui/theme/Select.tsx b/src/utils/ui/theme/Select.tsx index 4f081f1..ad4cb33 100644 --- a/src/utils/ui/theme/Select.tsx +++ b/src/utils/ui/theme/Select.tsx @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { useState } from "react"; import { Box, Text, useInput } from "ink"; import { COLOR, GLYPH, LAYOUT } from "./tokens.js"; diff --git a/src/utils/ui/theme/Sparkline.tsx b/src/utils/ui/theme/Sparkline.tsx index e4e3c50..088b951 100644 --- a/src/utils/ui/theme/Sparkline.tsx +++ b/src/utils/ui/theme/Sparkline.tsx @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { Text } from "ink"; import { GLYPH } from "./tokens.js"; diff --git a/src/utils/ui/theme/index.tsx b/src/utils/ui/theme/index.tsx index a8d069d..5826f80 100644 --- a/src/utils/ui/theme/index.tsx +++ b/src/utils/ui/theme/index.tsx @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Theme plug — the complete public surface for the CLI's visual identity. * diff --git a/src/utils/ui/theme/tokens.ts b/src/utils/ui/theme/tokens.ts index 5d479d6..c806903 100644 --- a/src/utils/ui/theme/tokens.ts +++ b/src/utils/ui/theme/tokens.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Design tokens — the entire identity of the CLI's TUI in one file. * diff --git a/src/utils/ui/theme/window-title.ts b/src/utils/ui/theme/window-title.ts index e0c1968..1a78c5b 100644 --- a/src/utils/ui/theme/window-title.ts +++ b/src/utils/ui/theme/window-title.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Terminal tab/window title integration via OSC 0. * diff --git a/src/utils/version-check.test.ts b/src/utils/version-check.test.ts index 601b15c..2cd7a34 100644 --- a/src/utils/version-check.test.ts +++ b/src/utils/version-check.test.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { describe, it, expect } from "vitest"; import { formatBanner, diff --git a/src/utils/version-check.ts b/src/utils/version-check.ts index 9d94f5e..cbaa02f 100644 --- a/src/utils/version-check.ts +++ b/src/utils/version-check.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * "Update available" banner shown at the bottom of every `dot` invocation. * diff --git a/src/utils/version.ts b/src/utils/version.ts index fbf1af7..9dd6516 100644 --- a/src/utils/version.ts +++ b/src/utils/version.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import pkg from "../../package.json" with { type: "json" }; /** "v0.6.9" — used by the theme Header's right-aligned breadcrumb. */ diff --git a/tools/list-registry-apps.ts b/tools/list-registry-apps.ts index 851f880..a9e8ac5 100644 --- a/tools/list-registry-apps.ts +++ b/tools/list-registry-apps.ts @@ -1,4 +1,20 @@ #!/usr/bin/env bun + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Enumerate apps on the live playground-registry contract on Paseo Asset Hub, * and check whether each one's `metadata.repository` is reachable as a public diff --git a/tools/probe-registry-resolution.ts b/tools/probe-registry-resolution.ts index a772fa4..7f77fb2 100644 --- a/tools/probe-registry-resolution.ts +++ b/tools/probe-registry-resolution.ts @@ -1,4 +1,20 @@ #!/usr/bin/env bun + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Diagnostic probe for issue paritytech/playground-cli#74. * diff --git a/tools/register-e2e-fixtures.ts b/tools/register-e2e-fixtures.ts index 882c88b..0390be5 100644 --- a/tools/register-e2e-fixtures.ts +++ b/tools/register-e2e-fixtures.ts @@ -1,4 +1,20 @@ #!/usr/bin/env bun + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + /** * Register all permanent E2E fixture domains on the live playground-registry * contract, signed by the dedicated E2E deployer (SIGNER from diff --git a/vitest.config.ts b/vitest.config.ts index c12de09..62a8487 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -1,3 +1,18 @@ +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// 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. + import { defineConfig } from "vitest/config"; export default defineConfig({