Skip to content

A monorepo of useful tools for committee to help with common tasks & make our lives a bit easier

Notifications You must be signed in to change notification settings

icdocsoc/docsoc-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DoCSocTools

This Nx-based monorepo contains a series of tools made by Kishan Sambhi (kss22) for DoCSoc at Imperial College London for the committee of academic year 2024-2025. They are designed to help the committee manage their responsibilities and make their lives easier, by providing tools to automate and simplify common tasks.

Strcuture of the repo

The repo is structured as an Nx monorepo (I recommend you look at the Nx documentation for more information on how to use it). You can also have a look at the Nx readme at the bottom of this document.

Tools

  • clickup/calendar-sync: A rust tool that syncs the DoCSoc ClickUp calendar with the DoCSoc Google Calendar. It is designed to be run as a cron job on a server.
  • common/util: A set of common utilities used by other tools written in TypeScript
  • email/mailmerge: A TypeScript library that can be used to generate emails from templates and send them. It is designed to be used in conjunction with the email/mailmerge-cli tool, but can be used by itself
  • email/mailmerge-cli: A TypeScript CLI tool that can be used to generate emails from templates, regenerate them after modifying the results, upload them to Outlook drafts and send them.

Each tool's directory has a README with more information on how to use it.

Building

Build for development

npx nx run-many -t build build-local

build builds all tools (TypeScript and Rust) to /dist/, build-local builds the typescript tools to dist/ folders in each tool's directory.

You should use build-local when working on just the TypeScript code

Building for production

npx nx run-many -t build

Documentation

You can get API documentation for everything in the repo by running:

npm run docs

This will output the documentation to ./docs/ in the repo root.

Linting

npx nx run-many -t lint

Testing

npx nx run-many -t test

Nx Mono repo info

The plugin @monodon/rust has been added to Nx to allow for Rust projects to be built and run in the monorepo. This is used by the calendar-sync tool. The plugin has create a Cargo workspace in the root of the monorepo as such, and all builds for all packages are done in the root of the monorepo and sent to dist in the repo root.

Original Nx README

This workspace has been generated by Nx, Smart Monorepos · Fast CI.

Integrate with editors

Enhance your Nx experience by installing Nx Console for your favorite editor. Nx Console provides an interactive UI to view your projects, run tasks, generate code, and more! Available for VSCode, IntelliJ and comes with a LSP for Vim users.

Nx plugins and code generators

Add Nx plugins to leverage their code generators and automated, inferred tasks.

# Add plugin
npx nx add @nx/react

# Use code generator
npx nx generate @nx/react:app demo

# Run development server
npx nx serve demo

# View project details
npx nx show project demo --web

Run npx nx list to get a list of available plugins and whether they have generators. Then run npx nx list <plugin-name> to see what generators are available.

Learn more about code generators and inferred tasks in the docs.

Running tasks

To execute tasks with Nx use the following syntax:

npx nx <target> <project> <...options>

You can also run multiple targets:

npx nx run-many -t <target1> <target2>

..or add -p to filter specific projects

npx nx run-many -t <target1> <target2> -p <proj1> <proj2>

Targets can be defined in the package.json or projects.json. Learn more in the docs.

Set up CI!

Nx comes with local caching already built-in (check your nx.json). On CI you might want to go a step further.

Explore the project graph

Run npx nx graph to show the graph of the workspace. It will show tasks that you can run with Nx.

Connect with us!