Git Product home page Git Product logo

actor-monorepo-example's Introduction

Apify Actor monorepo example

This repository shows how to structure a monorepo containing multiple Apify Actors, along with shared packages used in multiple packages.

Structure

The project is structured as a NPM workspace, with the Actors being in the @actors scope and packages in the @packages scope.

The TypeScript Actors and packages are structured in one TypeScript project, with project references ensuring that they are built in the correct topological order based on their interdependencies.

To enable testing the TypeScript Actors locally without having to rebuild them or the TypeScript packages after every code change, ts-node along with the tsconfig-paths loader is used. Since tsconfig-paths does not play well with ESM packages, a custom wrapper for the loader is used, defined in module_loader.js.

The actors folder contains the code of the Actors in this project. There is one JavaScript actor and one TypeScript actor, with their respective Dockerfiles showing how to build them on the Apify Platform correctly, including the shared packages, but excluding the code of other actors.

The packages folder contains simplistic packages that are used in multiple Actors. There is one JavaScript and one TypeScript package, and both are written as ES modules.

The shared folder contains an input schema for both of the Actors, which is referenced from the respective Actor's .actor/actor.json file.

Building monorepo Actors on the Apify platform

To build Actors from a monorepo, you have to specify the path to the correct Actor in the Git URL of the Actor on the Apify Platform.

For example, to build the TypeScript Actor from this monorepo, you would specify this in the Actor's setup:

  • Git URL: https://github.com/apify/actor-monorepo-example
  • Branch: main
  • Folder: actors/typescript-actor

actor-monorepo-example's People

Contributors

fnesveda avatar

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.