Skip to content

Commit

Permalink
Spec out flatlake package
Browse files Browse the repository at this point in the history
  • Loading branch information
bglw committed Sep 21, 2023
1 parent 72dfc2b commit 1f88cca
Show file tree
Hide file tree
Showing 29 changed files with 94 additions and 125 deletions.
8 changes: 4 additions & 4 deletions .backstage/create_package.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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}
`);
6 changes: 3 additions & 3 deletions .backstage/version.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
2 changes: 1 addition & 1 deletion .backstage/version_main_package.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
6 changes: 3 additions & 3 deletions .cloudcannon/prebuild
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/inane"
directory: "/flatlake"
open-pull-requests-limit: 1
schedule:
interval: "daily"
Expand Down
34 changes: 17 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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:
Expand All @@ -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/
Expand Down Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
32 changes: 1 addition & 31 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[workspace]

members = ["inane"]
members = ["flatlake"]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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:

Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Inane
# Flatlake

An intentionally useless package used to iterate on open source tooling/publishing.

`npx inane`
`npx flatlake`

2 changes: 1 addition & 1 deletion docs/config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
baseURL = '/'
languageCode = 'en-us'
title = 'Inane Documentation'
title = 'Flatlake Documentation'
summaryLength = 30
disableKinds = ["taxonomyTerm"]

Expand Down
4 changes: 2 additions & 2 deletions docs/content/_index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Inane
title: Flatlake
nav_title: Home
weight: 1
---

Inane documentation.
Flatlake documentation.
2 changes: 1 addition & 1 deletion docs/content/docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ nav_section: Root
weight: 2
---

There is nothing to do.
Getting started with Flatlake.
6 changes: 3 additions & 3 deletions docs/data/meta.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion docs/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/cloudcannon/inane/docs
module github.com/cloudcannon/flatlake/docs

go 1.18

Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "inane-docs",
"name": "flatlake-docs",
"private": true,
"dependencies": {
"alpinejs": "^3.10.3"
Expand Down
4 changes: 2 additions & 2 deletions inane/Cargo.toml → flatlake/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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]
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 11 additions & 0 deletions flatlake/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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"))
}
}
6 changes: 6 additions & 0 deletions flatlake/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
use flatlake::Watershed;

fn main() {
let mut state = Watershed::new();
state.run();
}
8 changes: 8 additions & 0 deletions flatlake/test.sh
Original file line number Diff line number Diff line change
@@ -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
14 changes: 0 additions & 14 deletions inane/src/lib.rs

This file was deleted.

6 changes: 0 additions & 6 deletions inane/src/main.rs

This file was deleted.

8 changes: 0 additions & 8 deletions inane/test.sh

This file was deleted.

2 changes: 1 addition & 1 deletion wrappers/node/LICENSE/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
inane
flatlake

Copyright (c) CloudCannon

Expand Down
4 changes: 2 additions & 2 deletions wrappers/node/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Inane
# Flatlake

The CLI for Inane.
The CLI for Flatlake.
2 changes: 1 addition & 1 deletion wrappers/node/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Loading

0 comments on commit 1f88cca

Please sign in to comment.