From 1f88ccae3742da4d889001dcd34ea4e06c2eb03a Mon Sep 17 00:00:00 2001 From: Liam Bigelow <40188355+bglw@users.noreply.github.com> Date: Fri, 22 Sep 2023 06:51:15 +1200 Subject: [PATCH] Spec out flatlake package --- .backstage/create_package.cjs | 8 +++--- .backstage/version.cjs | 6 ++-- .backstage/version_main_package.cjs | 2 +- .cloudcannon/prebuild | 6 ++-- .github/dependabot.yml | 2 +- .github/workflows/release.yml | 34 +++++++++++------------ .github/workflows/test.yml | 8 +++--- CHANGELOG.md | 32 +-------------------- Cargo.toml | 2 +- LICENSE | 2 +- README.md | 6 ++-- docs/config.toml | 2 +- docs/content/_index.md | 4 +-- docs/content/docs/_index.md | 2 +- docs/data/meta.yml | 6 ++-- docs/go.mod | 2 +- docs/package.json | 2 +- {inane => flatlake}/Cargo.toml | 4 +-- {inane => flatlake}/features/base.feature | 2 +- flatlake/src/lib.rs | 11 ++++++++ flatlake/src/main.rs | 6 ++++ flatlake/test.sh | 8 ++++++ inane/src/lib.rs | 14 ---------- inane/src/main.rs | 6 ---- inane/test.sh | 8 ------ wrappers/node/LICENSE/LICENSE | 2 +- wrappers/node/README.md | 4 +-- wrappers/node/lib/index.js | 2 +- wrappers/node/package.json | 26 +++++++++-------- 29 files changed, 94 insertions(+), 125 deletions(-) rename {inane => flatlake}/Cargo.toml (68%) rename {inane => flatlake}/features/base.feature (57%) create mode 100644 flatlake/src/lib.rs create mode 100644 flatlake/src/main.rs create mode 100755 flatlake/test.sh delete mode 100644 inane/src/lib.rs delete mode 100644 inane/src/main.rs delete mode 100755 inane/test.sh diff --git a/.backstage/create_package.cjs b/.backstage/create_package.cjs index 668116d..06aa5f0 100644 --- a/.backstage/create_package.cjs +++ b/.backstage/create_package.cjs @@ -13,18 +13,18 @@ if (!os || !cpu) { fs.writeFileSync(path.join(cwd, "package.json"), JSON.stringify({ name: package_name, version: "0.0.0", - description: `The platform-specific binary for inane on ${os}/${cpu}`, + description: `The platform-specific binary for flatlake on ${os}/${cpu}`, license: "MIT", repository: { type: "git", - url: "git+https://github.com/cloudcannon/inane.git" + url: "git+https://github.com/cloudcannon/flatlake.git" }, author: "CloudCannon", os: [ os ], cpu: [ cpu ], })); -fs.writeFileSync(path.join(cwd, "README.md"), `# Inane +fs.writeFileSync(path.join(cwd, "README.md"), `# Flatlake -The platform-specific binary for inane on ${os}/${cpu} +The platform-specific binary for flatlake on ${os}/${cpu} `); \ No newline at end of file diff --git a/.backstage/version.cjs b/.backstage/version.cjs index 923bcdd..d1c1cba 100644 --- a/.backstage/version.cjs +++ b/.backstage/version.cjs @@ -19,6 +19,6 @@ const file = (localPath) => { return { path: localPath, contents }; } -let inaneCfg = file("../inane/Cargo.toml"); -inaneCfg.contents = inaneCfg.contents.replace(version_re, `version = "${version}"`); -fs.writeFileSync(inaneCfg.path, inaneCfg.contents); +let flatlakeCfg = file("../flatlake/Cargo.toml"); +flatlakeCfg.contents = flatlakeCfg.contents.replace(version_re, `version = "${version}"`); +fs.writeFileSync(flatlakeCfg.path, flatlakeCfg.contents); diff --git a/.backstage/version_main_package.cjs b/.backstage/version_main_package.cjs index 1c2b7f6..9cfceb8 100644 --- a/.backstage/version_main_package.cjs +++ b/.backstage/version_main_package.cjs @@ -10,7 +10,7 @@ if (!version) { const pkg = path.join(__dirname, "../wrappers/node/package.json"); const pkg_contents = JSON.parse(fs.readFileSync(pkg, { encoding: "utf-8" })); -for (const dep of Object.keys(pkg_contents.optionalDependencies).filter(dep => dep.startsWith("inane"))) { +for (const dep of Object.keys(pkg_contents.optionalDependencies).filter(dep => dep.startsWith("flatlake"))) { pkg_contents.optionalDependencies[dep] = version; } diff --git a/.cloudcannon/prebuild b/.cloudcannon/prebuild index 0552c57..dc1f35e 100755 --- a/.cloudcannon/prebuild +++ b/.cloudcannon/prebuild @@ -1,5 +1,5 @@ -if [ -z "$HUGO_INANE_DOCS_VERSION" ]; then - export HUGO_INANE_DOCS_VERSION=$(node ./.backstage/get_version.cjs) +if [ -z "$HUGO_FLATLAKE_DOCS_VERSION" ]; then + export HUGO_FLATLAKE_DOCS_VERSION=$(node ./.backstage/get_version.cjs) fi -echo "Building documentation for $HUGO_INANE_DOCS_VERSION" +echo "Building documentation for $HUGO_FLATLAKE_DOCS_VERSION" cd docs && npm i \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0a74107..73d53fd 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,7 +6,7 @@ version: 2 updates: - package-ecosystem: "cargo" - directory: "/inane" + directory: "/flatlake" open-pull-requests-limit: 1 schedule: interval: "daily" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ebd8606..08bf8c5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,14 +50,14 @@ jobs: run: | # Update cargo version, node ./.backstage/version.cjs - git add ./inane/Cargo.toml + git add ./flatlake/Cargo.toml # Commit changes so cargo doesn't complain about dirty repo git commit -m "Deploy changes." - name: Build run: cargo build --release --verbose - name: Publish - working-directory: ./inane + working-directory: ./flatlake run: cargo publish --allow-dirty env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} @@ -101,23 +101,23 @@ jobs: matrix: include: - target: x86_64-pc-windows-msvc - package: inane-windows-x64 + package: flatlake-windows-x64 os: win32 cpu: x64 - target: x86_64-unknown-linux-musl - package: inane-linux-x64 + package: flatlake-linux-x64 os: linux cpu: x64 - target: aarch64-unknown-linux-musl - package: inane-linux-arm64 + package: flatlake-linux-arm64 os: linux cpu: arm64 - target: x86_64-apple-darwin - package: inane-darwin-x64 + package: flatlake-darwin-x64 os: darwin cpu: x64 - target: aarch64-apple-darwin - package: inane-darwin-arm64 + package: flatlake-darwin-arm64 os: darwin cpu: arm64 steps: @@ -143,7 +143,7 @@ jobs: - name: Extract Binary working-directory: build-artifacts run: | - tar xzf inane-v$GIT_VERSION-${{ matrix.target }}.tar.gz + tar xzf flatlake-v$GIT_VERSION-${{ matrix.target }}.tar.gz rm *.tar.gz mv * ../${{ matrix.package }}/bin/ @@ -210,7 +210,7 @@ jobs: with: route: PUT /repos/{owner}/{repo}/contents/CHANGELOG.md owner: cloudcannon - repo: inane + repo: flatlake branch: main message: Changelog for ${{ env.GIT_VERSION }} sha: ${{ env.SHA }} @@ -224,7 +224,7 @@ jobs: with: route: POST /repos/{owner}/{repo}/merges owner: cloudcannon - repo: inane + repo: flatlake base: production-docs head: main commit_message: Release documentation for ${{ env.GIT_VERSION }} @@ -350,32 +350,32 @@ jobs: run: | # Update cargo version, node ./.backstage/version.cjs - git add ./inane/Cargo.toml + git add ./flatlake/Cargo.toml # Commit changes so cargo doesn't complain about dirty repo git commit -m "Deploy changes." - name: Build - working-directory: ./inane + working-directory: ./flatlake run: cargo build --release --target ${{ matrix.target }} - name: Test Lib if: matrix.run_tests == true - working-directory: ./inane + working-directory: ./flatlake run: cargo test --release --target ${{ matrix.target }} - name: Test CLI if: matrix.run_tests == true - working-directory: ./inane - run: TEST_BINARY=../target/${{ matrix.target }}/release/inane humane + working-directory: ./flatlake + run: TEST_BINARY=../target/${{ matrix.target }}/release/flatlake humane - name: Create Release Assets run: | - EXEC_NAME="inane" + EXEC_NAME="flatlake" ASSET_PATH="$EXEC_NAME-v$GIT_VERSION-${{ matrix.target }}.tar.gz" CHECKSUM_PATH="$ASSET_PATH.sha256" if [ "$RUNNER_OS" == "Windows" ]; then - EXEC_NAME="inane.exe" + EXEC_NAME="flatlake.exe" fi if command -v gtar &> /dev/null; then diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b24dc16..35bfde1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -64,13 +64,13 @@ jobs: version: ${{env.HUMANE_VERSION}} - name: Build Testing Binary - working-directory: ./inane + working-directory: ./flatlake run: cargo build --release - name: Test Lib - working-directory: ./inane + working-directory: ./flatlake run: cargo test --release --lib - name: Test CLI - working-directory: ./inane - run: TEST_BINARY=../target/release/inane humane + working-directory: ./flatlake + run: TEST_BINARY=../target/release/flatlake humane diff --git a/CHANGELOG.md b/CHANGELOG.md index f5666d2..2dc8b8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,34 +9,4 @@ ## Unreleased -## v1.0.20 (March 10, 2023) - -## v1.0.19 (March 10, 2023) - -## v1.0.18 (March 10, 2023) - -## v1.0.17 (March 10, 2023) - -## v1.0.16 (March 10, 2023) - -## v1.0.15 (March 10, 2023) - -## v1.0.13 (March 10, 2023) - -## v1.0.12 (December 2, 2022) - -## v1.0.11 (November 24, 2022) - -## v1.0.10 (November 24, 2022) - -## v1.0.9 (November 24, 2022) - -## v1.0.8 (November 24, 2022) - -## v1.0.6 (November 17, 2022) - -## v1.0.5 (November 17, 2022) - -## v1.0.0 (November 17, 2022) - -* Literally nothing of use. +* Testing releases. diff --git a/Cargo.toml b/Cargo.toml index 807ce3e..ab9cee5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,3 @@ [workspace] -members = ["inane"] +members = ["flatlake"] diff --git a/LICENSE b/LICENSE index 51d359c..52fe580 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2022 CloudCannon +Copyright 2023 CloudCannon Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/README.md b/README.md index a5f4fea..d73ac3a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,4 @@ -# Inane +# Flatlake -An intentionally useless package used to iterate on open source tooling/publishing. - -`npx inane` +`npx flatlake` diff --git a/docs/config.toml b/docs/config.toml index 8a8c8e4..aa0d045 100644 --- a/docs/config.toml +++ b/docs/config.toml @@ -1,6 +1,6 @@ baseURL = '/' languageCode = 'en-us' -title = 'Inane Documentation' +title = 'Flatlake Documentation' summaryLength = 30 disableKinds = ["taxonomyTerm"] diff --git a/docs/content/_index.md b/docs/content/_index.md index c82998c..b7efcb3 100644 --- a/docs/content/_index.md +++ b/docs/content/_index.md @@ -1,7 +1,7 @@ --- -title: Inane +title: Flatlake nav_title: Home weight: 1 --- -Inane documentation. +Flatlake documentation. diff --git a/docs/content/docs/_index.md b/docs/content/docs/_index.md index c8f3559..89e3be8 100644 --- a/docs/content/docs/_index.md +++ b/docs/content/docs/_index.md @@ -5,4 +5,4 @@ nav_section: Root weight: 2 --- -There is nothing to do. +Getting started with Flatlake. diff --git a/docs/data/meta.yml b/docs/data/meta.yml index 543601a..87d3f44 100644 --- a/docs/data/meta.yml +++ b/docs/data/meta.yml @@ -1,6 +1,6 @@ -project_name: Inane +project_name: Flatlake default_og_image: /og.png logo_image: /logo.svg side_nav_title: Docs -github_url: https://github.com/cloudcannon/inane -version_env_var: HUGO_INANE_DOCS_VERSION +github_url: https://github.com/cloudcannon/flatlake +version_env_var: HUGO_FLATLAKE_DOCS_VERSION diff --git a/docs/go.mod b/docs/go.mod index e542abc..75e3e42 100644 --- a/docs/go.mod +++ b/docs/go.mod @@ -1,4 +1,4 @@ -module github.com/cloudcannon/inane/docs +module github.com/cloudcannon/flatlake/docs go 1.18 diff --git a/docs/package.json b/docs/package.json index ca1d2f3..584b73d 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,5 +1,5 @@ { - "name": "inane-docs", + "name": "flatlake-docs", "private": true, "dependencies": { "alpinejs": "^3.10.3" diff --git a/inane/Cargo.toml b/flatlake/Cargo.toml similarity index 68% rename from inane/Cargo.toml rename to flatlake/Cargo.toml index 85022a5..b0d240d 100644 --- a/inane/Cargo.toml +++ b/flatlake/Cargo.toml @@ -1,9 +1,9 @@ [package] -name = "inane" +name = "flatlake" version = "0.0.0" edition = "2021" include = ["/src", "/features", "/tests"] -description = "Intentionally useless." +description = "In the works." license = "MIT" [dependencies] diff --git a/inane/features/base.feature b/flatlake/features/base.feature similarity index 57% rename from inane/features/base.feature rename to flatlake/features/base.feature index 3f0fcc7..eaf53fa 100644 --- a/inane/features/base.feature +++ b/flatlake/features/base.feature @@ -2,4 +2,4 @@ Feature: Base Tests Scenario: Default message When I run my program - Then I should see "There is nothing to do" in stdout + Then I should see "flatlake running" in stdout diff --git a/flatlake/src/lib.rs b/flatlake/src/lib.rs new file mode 100644 index 0000000..97602ee --- /dev/null +++ b/flatlake/src/lib.rs @@ -0,0 +1,11 @@ +pub struct Watershed {} + +impl Watershed { + pub fn new() -> Self { + Self {} + } + + pub fn run(&mut self) { + println!("flatlake running as {}", env!("CARGO_PKG_VERSION")) + } +} diff --git a/flatlake/src/main.rs b/flatlake/src/main.rs new file mode 100644 index 0000000..5e7111f --- /dev/null +++ b/flatlake/src/main.rs @@ -0,0 +1,6 @@ +use flatlake::Watershed; + +fn main() { + let mut state = Watershed::new(); + state.run(); +} diff --git a/flatlake/test.sh b/flatlake/test.sh new file mode 100755 index 0000000..26f99a3 --- /dev/null +++ b/flatlake/test.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +cargo build --release +if [ -z "$1" ]; then + TEST_BINARY=../target/release/flatlake npx -y humane@latest +else + TEST_BINARY=../target/release/flatlake npx -y humane@latest --name "$1" +fi diff --git a/inane/src/lib.rs b/inane/src/lib.rs deleted file mode 100644 index 3f1c95e..0000000 --- a/inane/src/lib.rs +++ /dev/null @@ -1,14 +0,0 @@ -pub struct InaneState {} - -impl InaneState { - pub fn new() -> Self { - Self {} - } - - pub fn run(&mut self) { - println!( - "Inane v{}\n\n🤷\n\nThere is nothing to do.", - env!("CARGO_PKG_VERSION") - ) - } -} diff --git a/inane/src/main.rs b/inane/src/main.rs deleted file mode 100644 index 630c640..0000000 --- a/inane/src/main.rs +++ /dev/null @@ -1,6 +0,0 @@ -use inane::InaneState; - -fn main() { - let mut state = InaneState::new(); - state.run(); -} diff --git a/inane/test.sh b/inane/test.sh deleted file mode 100755 index 2e6214c..0000000 --- a/inane/test.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -cargo build --release -if [ -z "$1" ]; then - TEST_BINARY=../target/release/inane npx -y humane@latest -else - TEST_BINARY=../target/release/inane npx -y humane@latest --name "$1" -fi diff --git a/wrappers/node/LICENSE/LICENSE b/wrappers/node/LICENSE/LICENSE index 2cc7a3c..344bdb4 100644 --- a/wrappers/node/LICENSE/LICENSE +++ b/wrappers/node/LICENSE/LICENSE @@ -1,4 +1,4 @@ -inane +flatlake Copyright (c) CloudCannon diff --git a/wrappers/node/README.md b/wrappers/node/README.md index 682afdf..f6e7c14 100644 --- a/wrappers/node/README.md +++ b/wrappers/node/README.md @@ -1,3 +1,3 @@ -# Inane +# Flatlake -The CLI for Inane. +The CLI for Flatlake. diff --git a/wrappers/node/lib/index.js b/wrappers/node/lib/index.js index a63a103..8ec0b39 100755 --- a/wrappers/node/lib/index.js +++ b/wrappers/node/lib/index.js @@ -2,7 +2,7 @@ const os = require('os'); const { spawnSync } = require('child_process'); -const execname = 'inane'; +const execname = 'flatlake'; function resolveBinaryPath() { const cpu = process.env.npm_config_arch || os.arch(); diff --git a/wrappers/node/package.json b/wrappers/node/package.json index 17af701..352ffed 100644 --- a/wrappers/node/package.json +++ b/wrappers/node/package.json @@ -1,26 +1,30 @@ { - "name": "inane", + "name": "flatlake", "version": "0.0.0", - "description": "Intentionally useless.", + "description": "In the works", "bin": "lib/index.js", "repository": { "type": "git", - "url": "https://github.com/CloudCannon/inane" + "url": "https://github.com/CloudCannon/flatlake" }, "author": "CloudCannon", "license": "MIT", "optionalDependencies": { - "inane-linux-x64": "0.0.0", - "inane-linux-arm64": "0.0.0", - "inane-darwin-x64": "0.0.0", - "inane-darwin-arm64": "0.0.0", - "inane-windows-x64": "0.0.0" + "flatlake-linux-x64": "0.0.0", + "flatlake-linux-arm64": "0.0.0", + "flatlake-darwin-x64": "0.0.0", + "flatlake-darwin-arm64": "0.0.0", + "flatlake-windows-x64": "0.0.0" }, "keywords": [ - "useless" + "flat", + "git", + "data lake", + "static", + "api" ], "bugs": { - "url": "https://github.com/CloudCannon/inane/issues" + "url": "https://github.com/CloudCannon/flatlake/issues" }, - "homepage": "https://github.com/CloudCannon/inane#readme" + "homepage": "https://github.com/CloudCannon/flatlake#readme" } \ No newline at end of file