Giter Club home page Giter Club logo

pjamas's Introduction

pjamas

Pascal to Javascript Package Management Software.

This is a simple non-official package manager focused on Pas2JS, the Pascal-to-JavaScript transpiler. It just downloads the dependencies you want and turn them into a series of -Fu flags for the Pas2JS compiler.

This is a work in progress.

How to use

The idea is to copy the single pjamas.pas file to your project, build it with:

fpc pjamas.pas

And now use the pjamas resulting binary to manage your packages.

Let's say we have a simple program that wants to use this code: https://github.com/glhrmfrts/wetween.

program myprogram;
uses WeTween;
var
  mgr: TWeManager;
begin
  mgr := TWeManager.Create(nil);
  // go bananas
end.

We can just use the get command inside our project root:

pjamas get github.com/glhrmfrts/wetween --create

And to compile:

pas2js -Jc -Jirtl.js `pjamas units` myprogram.pas

Use -h or --help for more commands.

pjamas.json

In the above example, this file will be created in the current directory as pjamas.json:

{
  "Compiler": "Pas2JS",
  "PackagesPath": "pjamas-packages",
  "UnitPath": [
  ],
  "Dependencies": {
    "github.com/glhrmfrts/wetween": "master"
  }
}

You can add other dependencies using pjamas get or by adding in the Dependencies JSON field.

Use pjamas help-json for an extended documentation of each field in the JSON.

This file should be commited to version control.

pjamas-packages

When you download packages, pjamas will download and install them to a directory named pjamas-packages in your package directory. Dependencies that depends on other packages will also install them in this directory, and so on and so forth.

This directory should be ignored by version control.

How to build

The only requirement is a standard installation of FPC, the versions used in the development are:

  • Free Pascal Compiler version 3.2.2

Then build using Lazarus or use the command-line:

fpc pjamas.pas

Which will produce a pjamas binary.

TODO

The scope of this project shall remain small, and help is needed:

  • Documentation
  • Cache the output to a file (to use pjamas as a one-time-use tool)
  • Handle other type of dependencies than github repositories
  • Handle private repositories
  • Have an index of known packages (Name + URL + Description)

LICENSE

MIT

pjamas's People

Contributors

glhrmfrts avatar

Stargazers

Andrew Chou avatar

Watchers

 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.