GithubHelp home page GithubHelp logo

axodotdev / axoproject Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 658 KB

🍱 project structure detection for axo's toolchain

License: Apache License 2.0

Rust 94.79% HTML 1.88% CSS 1.02% JavaScript 2.09% Makefile 0.16% C 0.07%
nodejs rust workspaces

axoproject's Introduction

⚠️ Project moved ⚠️

This project has been moved into the cargo-dist repository. Further development will occur there.

axoproject

crates.io docs Rust CI

A tool that handles the details of detecting a cargo/npm workspace/project at a given directory, and making sense of the structure. This should be used by cargo-dist and oranda to share that logic.

License

Licensed under either of

at your option.

axoproject's People

Contributors

ashleygwilliams avatar dependabot[bot] avatar gankra avatar mistydemeo avatar shadows-withal avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

axoproject's Issues

project detection should probably be iterative

If you run axo-project tests/projects/npm-init-legacy, instead of detecting the npm project it will detect axo-project's Cargo project, because we exhaustively search for a Rust project before ever searching for an npm project.

Probably we should check for both kinds of project in each directory before walking up the ancestor?

need better diagnostics when failing to find projects

If you're in a malformed Cargo workspace (such that cargo metadata will error out), all we say is "failed to find a workspace" without any additional context. We should endeavor to provide/forward better diagnostics here. This is made more complicated by the fact that we are sniffing for two different kinds of workspace, so one failing is "normal".

We need some way to distinguish "it kinda looks like there's a project but it's messed up" from "it doesn't at all look like there's a project".

More broadly we need some way to properly factor out the separation of concerns for reporting these issues. Right now I just unconditionally warn! from within axoproject which is uhhhh suboptimal. Unfortunately cargo-dist and oranda currently completely disagree on their error/logging systems, so this might necessitate buffering everything up into properly typed structs/enums/vecs..?

Add override for changelog path

Of the 3 autoincludes (readme, license, changelog), changelogs are the only one without any support for a manual path that wins out over auto-includes. As a result, there's no way to disambiguate when you have a CHANGELOG and CHANGELOG-OTHER or whatever. We kinda just... pick one.

axoproject/src/rust.rs

Lines 250 to 256 in af87635

readme_file: package.readme().map(|readme| package_root.join(readme)),
license_files: package
.license_file()
.map(ToOwned::to_owned)
.into_iter()
.collect(),
changelog_file: None,

The annoying thing here is for the other two we're relying on Cargo having a builtin notion for license/readme paths, but it has no such notion for changelogs. As a result we'll need to define our own under metadata.dist, which axoproject isn't "supposed" to read but honestly I expect that separation isn't long for the world, so whatever let's just read out that one field.

remove "announcement" code

currently some code still refers to the cargo-dist concept of announcements- i think ideally this does not exist in axoproject.

we may want to provide a utility function to select/filter portions of the workspace based on version number (which is ultimately what the announcement functionality does) but we should call it "filter" or something like that

include version number in output

esp for cargo-dist, where version number is uniquely load-bearing, this feels like a useful but not super overwhelming piece of data to include in the output, esp given that the toolchain is focused on publishing/releases

expose cargo categories/keywords

The purpose of this is to translate the concept in cargo to the concept in npm. Cargo has both the notion of a "keyword" and a "category" but they're largely the same thing and I think it's fine for us to flatten them into a single "keywords" field (at least for now). You'll need to add a new field to the PackageInfo type.

You will also need to mirror the field in main.rs around here, which will expose it in our json output (for web APIs).

If keen, do the same for npm:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.