UNPKG

1.12 kBJavaScriptView Raw
1"use strict";
2var __importDefault = (this && this.__importDefault) || function (mod) {
3 return (mod && mod.__esModule) ? mod : { "default": mod };
4};
5Object.defineProperty(exports, "__esModule", { value: true });
6const Doer_1 = __importDefault(require("./Doer"));
7/**
8 * A base class for language parsers
9 *
10 * A language `Parser` generates a JSON-LD `SoftwarePackage` instance based on the
11 * contents of a directory. It is responsible for determining which packages the application
12 * needs, resolving the dependencies of those packages (both system and language packages) and
13 * turning those into a JSON-LD `SoftwarePackage` instance.
14 *
15 * If the `Parser` finds a corresponding requirements file for the language (e.g. `requirements.txt` for Python),
16 * then it uses that to determine the language packages to install. If no requirements file is found,
17 * it scans for source code files for package import statements (e.g. `library(package)` in `.R` files),
18 * generates a package list from those statements and creates a requirements file.
19 */
20class Parser extends Doer_1.default {
21}
22exports.default = Parser;