Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into use-jfrog-header-instead-o…
Browse files Browse the repository at this point in the history
…f-basic-auth
  • Loading branch information
kihehs committed Sep 14, 2023
2 parents 2841346 + b4f8ea3 commit 115c692
Show file tree
Hide file tree
Showing 157 changed files with 21,500 additions and 44 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
*.tgz filter=lfs diff=lfs merge=lfs -text
*.js linguist-vendored
*.jsx linguist-vendored
*.ts linguist-vendored
*.tsx linguist-vendored
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "buffrs"
version = "0.5.0"
edition = "2021"
description = "An opinionated protobuf package manager"
description = "Modern protobuf package management"
authors = ["Mara Schulke <mara.schulke@helsing.ai>"]
repository = "https://github.com/helsing-ai/buffrs"
documentation = "https://docs.rs/buffrs"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Buffrs

**An opinionated protobuf package manager**
**Modern protobuf package management**

[![Helsing](https://img.shields.io/badge/helsing-open%20source-black.svg)](https://helsing.ai)
[![Buffrs Crate](https://img.shields.io/crates/v/buffrs.svg)](https://crates.io/crates/buffrs)
Expand Down Expand Up @@ -34,7 +34,7 @@ Useful resources:
## Synopsis

```text,ignore
An opinionated protobuf package manager
Modern protobuf package management
Usage: buffrs <COMMAND>
Expand Down
6 changes: 3 additions & 3 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
* [Creating a Package](guide/creating-a-new-package.md)
* [Consuming Packages](guide/consuming-packages.md)
* [Project Layout](guide/project-layout.md)
* [Proto.toml vs Proto.lock](guide/proto-toml-vs-proto-lock.md)
* [Continuous Integration](guide/continuous-integration.md)
* [Buffrs Home](guide/buffrs-home.md)
* [Proto.toml vs Proto.lock]()
* [Continuous Integration]()
* [Buffrs Home]()

* [Buffrs Integrations](integrations/index.md)
* [Cargo](integrations/cargo.md)
Expand Down
4 changes: 2 additions & 2 deletions docs/src/guide/project-layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ uses. The `proto` directory, which is the source directory for all your protocol
buffer definitions and the `proto/vendor` directory, which contains external
protocol buffers.

**Important:** The vendor directory is managed by buffrs, all manual changes
will be overridden / cam cause not reproducible behavior.
**Important:** The vendor directory is managed by Buffrs, all manual changes
will be overridden / can cause unreproducible behavior.
10 changes: 10 additions & 0 deletions registry/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "buffrs-registry"
version = "0.1.0"
edition = "2021"

[dependencies]
buffrs = { path = "../" }

[build-dependencies]
buffrs = { path = "../" }
4 changes: 4 additions & 0 deletions registry/Proto.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[package]
type = "api"
name = "buffrs-registry"
version = "0.0.1"
5 changes: 5 additions & 0 deletions registry/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// (c) Copyright 2023 Helsing GmbH. All rights reserved.

fn main() {
buffrs::build(buffrs::Language::Rust).expect("failed to compile protos");
}
1 change: 1 addition & 0 deletions registry/migrations/20230828111733_users.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE users;
13 changes: 13 additions & 0 deletions registry/migrations/20230828111733_users.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CREATE TABLE users (
id SERIAL PRIMARY KEY,
-- metadata
name TEXT,
email TEXT,
avatar TEXT,
-- static user token here
token TEXT NOT NULL UNIQUE,
-- timestamps
created_at TIMESTAMPTZ NOT NULL,
updated_at TIMESTAMPTZ NOT NULL,
deleted_at TIMESTAMPTZ
);
3 changes: 3 additions & 0 deletions registry/migrations/20230828111844_packages.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DROP TABLE package_owners;
DROP TABLE packages;
DROP TYPE package_type;
22 changes: 22 additions & 0 deletions registry/migrations/20230828111844_packages.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
CREATE TYPE package_type AS ENUM('library', 'api');

CREATE TABLE packages (
id SERIAL PRIMARY KEY,
-- metadata
name TEXT NOT NULL,
type package_type NOT NULL,
-- timestamps
created_at TIMESTAMPTZ NOT NULL,
updated_at TIMESTAMPTZ NOT NULL,
);

CREATE TABLE package_owners (
id SERIAL PRIMARY KEY,
-- references
user_id INTEGER NOT NULL FOREIGN KEY ON(users) ON DELETE RESTRICT,
package_id INTEGER NOT NULL FOREIGN KEY ON(packages) ON DELETE RESTRICT,
created_by INTEGER FOREIGN KEY ON(users) ON DELETE RESTRICT,
-- timestamps
created_at TIMESTAMPTZ NOT NULL,
deleted_at TIMESTAMPTZ
);
3 changes: 3 additions & 0 deletions registry/migrations/20230828111923_versions.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DROP TABLE version_dependencies;
DROP TABLE versions;
DROP TABLE categories;
37 changes: 37 additions & 0 deletions registry/migrations/20230828111923_versions.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
CREATE TABLE versions (
id SERIAL PRIMARY KEY,
package_id INTEGER NOT NULL FOREIGN KEY on(packages) ON DELETE RESTRICT,
version TEXT NOT NULL,

checksum TEXT NOT NULL, -- sha3 256bit

-- metadata
authors TEXT[] NOT NULL,
description TEXT NOT NULL,
keywords TEXT[] NOT NULL,
documentation TEXT,
homepage TEXT,
license TEXT,
repository TEXT,
-- timestamps
created_at TIMESTAMPTZ NOT NULL,
yanked_at TIMESTAMPTZ,

CONSTRAINT unique_version UNIQUE (package_id, version)

);


CREATE TABLE version_dependencies (
id SERIAL PRIMARY KEY,
version_id INTEGER NOT NULL,
package_id INTEGER NOT NULL,
requirement TEXT NOT NULL,
);

CREATE TABLE categories (
id SERIAL PRIMARY KEY,
label TEXT NOT NULL UNIQUE,
slug TEXT NOT NULL UNIQUE,
created_at TIMESTAMPTZ NOT NULL
);
10 changes: 10 additions & 0 deletions registry/proto/dependency.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// (c) Copyright 2023 Helsing GmbH. All rights reserved.

syntax = "proto3";

package buffrs.dependency;

message Dependency {
string name = 1;
string version = 2;
}
17 changes: 17 additions & 0 deletions registry/proto/manifest.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// (c) Copyright 2023 Helsing GmbH. All rights reserved.

syntax = "proto3";

import "package.proto";
import "dependency.proto";

package buffrs.manifest;

message Manifest {
buffrs.package.Package package = 1;
repeated buffrs.dependency.Dependency dependencies = 2;
}

message LockFile {
// tbd
}
21 changes: 21 additions & 0 deletions registry/proto/package.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// (c) Copyright 2023 Helsing GmbH. All rights reserved.

syntax = "proto3";

package buffrs.package;

enum Type {
Library = 0;
Api = 1;
}

message Package {
buffrs.package.Type type = 1;
string name = 2;
string version = 3;
}

message Compressed {
Package metadata = 1;
bytes tgz = 2;
}
31 changes: 31 additions & 0 deletions registry/proto/registry.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// (c) Copyright 2023 Helsing GmbH. All rights reserved.

syntax = "proto3";

import "package.proto";

package buffrs.registry;

service Registry {
// Publish a package
rpc Publish(PublishRequest)
returns (PublishResponse);

// Download a package
rpc Download(DownloadRequest)
returns (DownloadResponse);
}

message PublishRequest {
buffrs.package.Compressed package = 1;
}

message PublishResponse {}

message DownloadRequest {
buffrs.package.Package package = 1;
}

message DownloadResponse {
buffrs.package.Compressed package = 1;
}
22 changes: 22 additions & 0 deletions registry/proto/resolver.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// (c) Copyright 2023 Helsing GmbH. All rights reserved.

syntax = "proto3";

import "package.proto";
import "dependency.proto";

package buffrs.resolver;

service Resolver {
// Resolve a set of dependencies to packages
rpc Resolve(ResolveRequest)
returns (ResolveResponse);
}

message ResolveRequest {
repeated buffrs.dependency.Dependency dependencies = 1;
}

message ResolveResponse {
repeated buffrs.package.Package packages = 1;
}
1 change: 1 addition & 0 deletions registry/src/config.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// (c) Copyright 2023 Helsing GmbH. All rights reserved.
1 change: 1 addition & 0 deletions registry/src/context.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// (c) Copyright 2023 Helsing GmbH. All rights reserved.
1 change: 1 addition & 0 deletions registry/src/db/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// (c) Copyright 2023 Helsing GmbH. All rights reserved.
8 changes: 8 additions & 0 deletions registry/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// (c) Copyright 2023 Helsing GmbH. All rights reserved.

pub mod config;
pub mod context;
pub mod db;
pub mod proto;
pub mod schema;
pub mod storage;
5 changes: 5 additions & 0 deletions registry/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// (c) Copyright 2023 Helsing GmbH. All rights reserved.

fn main() {
println!("Hello, world!");
}
3 changes: 3 additions & 0 deletions registry/src/proto.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// (c) Copyright 2023 Helsing GmbH. All rights reserved.

buffrs::include!();
1 change: 1 addition & 0 deletions registry/src/schema.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// (c) Copyright 2023 Helsing GmbH. All rights reserved.
1 change: 1 addition & 0 deletions registry/src/storage/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// (c) Copyright 2023 Helsing GmbH. All rights reserved.
3 changes: 3 additions & 0 deletions registry/ui/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
35 changes: 35 additions & 0 deletions registry/ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
17 changes: 17 additions & 0 deletions registry/ui/app/categories/[category]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const categories = ["aerospace", "finance", "computer-vision", "science"];

export async function generateStaticParams() {
return categories.map((category) => ({ category }))
}

const Category = ({ params }: { params: { category: string } }): React.Element => {
return (
<>
<div className="py-8">
<h1 className="font-bold text-4xl">{params.category}</h1>
</div>
</>
)
}

export default Category;
14 changes: 14 additions & 0 deletions registry/ui/app/categories/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Hero } from '@/components/hero/Hero'
import { Categories as Cards } from '@/components/Categories'

const Categories = (): React.Element => {
return (
<>
<Hero title="Categories" />

<Cards />
</>
)
}

export default Categories;
Binary file added registry/ui/app/favicon.ico
Binary file not shown.
Empty file.
Loading

0 comments on commit 115c692

Please sign in to comment.