@remrg/cli 0.0.1-rc1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/LICENSE.md +663 -0
  2. package/README.md +21 -0
  3. package/dist/src/app.js +21 -0
  4. package/dist/src/commands/create.js +146 -0
  5. package/dist/src/commands/index.js +5 -0
  6. package/dist/src/env.js +17 -0
  7. package/dist/src/error.js +19 -0
  8. package/dist/src/host/get-host.js +13 -0
  9. package/dist/src/host/host.js +6 -0
  10. package/dist/src/host/hosts/github.js +81 -0
  11. package/dist/src/host/hosts/index.js +17 -0
  12. package/dist/src/host/index.js +20 -0
  13. package/dist/src/host/template-cache.js +31 -0
  14. package/dist/src/index.js +12 -0
  15. package/dist/src/log.js +13 -0
  16. package/dist/src/main.js +19 -0
  17. package/dist/src/options/branch.js +11 -0
  18. package/dist/src/options/index.js +17 -0
  19. package/dist/src/options/license.js +11 -0
  20. package/dist/src/options/name.js +11 -0
  21. package/dist/src/options/open-with.js +11 -0
  22. package/dist/src/options/org.js +11 -0
  23. package/dist/src/options/remote-url.js +11 -0
  24. package/dist/src/options/template.js +11 -0
  25. package/dist/src/options/templatize.js +11 -0
  26. package/dist/src/options/type.js +14 -0
  27. package/dist/src/options/verbose.js +12 -0
  28. package/dist/src/register.js +17 -0
  29. package/dist/src/remrg/index.js +17 -0
  30. package/dist/src/remrg/template-yaml.js +17 -0
  31. package/dist/src/templates/index.js +17 -0
  32. package/dist/src/templates/template.js +2 -0
  33. package/dist/src/utils/git/check-config.js +19 -0
  34. package/dist/src/utils/git/commit.js +14 -0
  35. package/dist/src/utils/git/config-user.js +7 -0
  36. package/dist/src/utils/git/init-project.js +14 -0
  37. package/dist/src/utils/git/is-git-configured.js +16 -0
  38. package/dist/src/utils/git/stage.js +8 -0
  39. package/dist/src/utils/index.js +19 -0
  40. package/dist/src/utils/merge-template.js +52 -0
  41. package/dist/src/utils/npm-install.js +40 -0
  42. package/dist/src/utils/open-with.js +14 -0
  43. package/dist/src/utils/replace-placeholder.js +23 -0
  44. package/dist/src/utils/write-template-yaml.js +15 -0
  45. package/dist/tsconfig.build.tsbuildinfo +1 -0
  46. package/dist/tsconfig.tsbuildinfo +1 -0
  47. package/package.json +58 -17
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.app = exports.App = void 0;
4
+ exports.bootstrap = bootstrap;
5
+ /**
6
+ * This file bootstraps your application by running the register function
7
+ * and setting up error handling.
8
+ */
9
+ const ts_async_bootstrap_1 = require("ts-async-bootstrap");
10
+ const error_1 = require("./error");
11
+ const register_1 = require("./register");
12
+ class App extends ts_async_bootstrap_1.Bootstrap {
13
+ onError = error_1.errorHandler;
14
+ register = register_1.register;
15
+ teardown = register_1.teardown;
16
+ }
17
+ exports.App = App;
18
+ exports.app = new App();
19
+ function bootstrap(run) {
20
+ exports.app.boot(run);
21
+ }
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.CreateCommand = void 0;
40
+ const path_1 = __importDefault(require("path"));
41
+ const ts_script_1 = require("ts-script");
42
+ const ts_tiny_log_1 = require("ts-tiny-log");
43
+ const levels_1 = require("ts-tiny-log/levels");
44
+ const utils = __importStar(require("../utils"));
45
+ const options = __importStar(require("../options"));
46
+ const ts_commands_1 = require("ts-commands");
47
+ const host_1 = require("../host");
48
+ /**
49
+ * Create a new project
50
+ */
51
+ class CreateCommand extends ts_commands_1.Command {
52
+ key = 'create';
53
+ description = 'Create a new project';
54
+ positional = [options.template(), options.name()];
55
+ options = [
56
+ options.remoteUrl(),
57
+ options.verbose(),
58
+ options.templatize(),
59
+ options.org(),
60
+ options.license(),
61
+ ];
62
+ async handle(argv) {
63
+ const log = new ts_tiny_log_1.Log({
64
+ level: argv.verbose ? levels_1.LogLevel.debug : levels_1.LogLevel.info,
65
+ shouldWriteTimestamp: argv.verbose,
66
+ });
67
+ const cmd = new ts_script_1.CommandRunner({
68
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
69
+ log: log,
70
+ verbose: argv.verbose,
71
+ });
72
+ let template;
73
+ const name = argv.name;
74
+ const branch = 'main'; // TODO: Add option for branch
75
+ const remote = argv.remote;
76
+ if (argv.template && argv.template !== 'remote') {
77
+ template = (0, host_1.getCachedTemplate)(argv.template);
78
+ if (!template && !remote) {
79
+ throw new Error(`Template "${argv.template}" not found`);
80
+ }
81
+ }
82
+ else if (remote) {
83
+ template = {
84
+ name: 'remote',
85
+ url: remote,
86
+ branch: branch,
87
+ };
88
+ }
89
+ else {
90
+ throw new Error('Either a template or remote URL must be provided');
91
+ }
92
+ // Ask for input
93
+ while (!argv.templatize && !argv.org) {
94
+ argv.org = await this.ask('Enter organization name: ');
95
+ }
96
+ while (!argv.templatize && !argv.license) {
97
+ argv.license = await this.ask('Enter license name: ');
98
+ }
99
+ // Create project folder
100
+ utils.initProject(cmd, name);
101
+ // "cd" into project
102
+ cmd.dir = path_1.default.join(cmd.dir, name);
103
+ // Check git config
104
+ if (!utils.isGitConfigured(cmd)) {
105
+ let name = null;
106
+ let email = null;
107
+ log.warn('Git user is not configured.');
108
+ while (!name) {
109
+ name = await this.ask('Enter git user.name: ');
110
+ }
111
+ while (!email) {
112
+ email = await this.ask('Enter git user.email: ');
113
+ }
114
+ utils.configUser(cmd, name, email);
115
+ }
116
+ // Merge the template
117
+ utils.mergeTemplate({ runner: cmd, template, branch });
118
+ // Replace placeholders
119
+ if (argv.templatize) {
120
+ let access = await this.ask('Enter template access level (private/public): ');
121
+ if (access !== '' && access !== 'private' && access !== 'public') {
122
+ throw new Error('Invalid access level');
123
+ }
124
+ if (access === '') {
125
+ access = 'private';
126
+ }
127
+ utils.writeTemplateYaml(cmd.dir, {
128
+ projectName: name,
129
+ organization: argv.org ?? '',
130
+ license: argv.license ?? 'MIT',
131
+ access: access,
132
+ roots: [argv.remote ? argv.remote : template.name],
133
+ });
134
+ }
135
+ else {
136
+ utils.replacePlaceholder(cmd, 'project-name', name);
137
+ utils.replacePlaceholder(cmd, 'organization', argv.org ?? '');
138
+ utils.replacePlaceholder(cmd, 'license', argv.license ?? '');
139
+ }
140
+ // Commit changes
141
+ const templateName = template.name && template.name !== 'remote' ? template.name : remote;
142
+ utils.stage(cmd);
143
+ utils.commit(cmd, `Project created using remrg (${templateName})`);
144
+ }
145
+ }
146
+ exports.CreateCommand = CreateCommand;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.commands = void 0;
4
+ const create_1 = require("./create");
5
+ exports.commands = [create_1.CreateCommand];
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.env = exports.Environment = void 0;
4
+ const ts_appconfig_1 = require("ts-appconfig");
5
+ /**
6
+ * Environment Variables Schema
7
+ */
8
+ class Environment extends ts_appconfig_1.AppConfig {
9
+ APP_TITLE = 'remrg-cli';
10
+ REMRG_HOST = 'github';
11
+ REMRG_GITHUB_ORG = 'remrg-templates';
12
+ }
13
+ exports.Environment = Environment;
14
+ /**
15
+ * Load & export environment variables
16
+ */
17
+ exports.env = (0, ts_appconfig_1.configure)(Environment);
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.errorHandler = errorHandler;
4
+ const ts_error_handler_1 = require("ts-error-handler");
5
+ const app_1 = require("./app");
6
+ const log_1 = require("./log");
7
+ /**
8
+ * Global error handler for uncaught exceptions
9
+ *
10
+ * @param e
11
+ */
12
+ function errorHandler(error) {
13
+ log_1.log.fatal(error.toString(), error);
14
+ app_1.app.exit();
15
+ }
16
+ // Setup error handling
17
+ (0, ts_error_handler_1.setupErrorHandling)({
18
+ handler: errorHandler,
19
+ });
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getHost = getHost;
4
+ const env_1 = require("../env");
5
+ async function getHost() {
6
+ const hostName = env_1.env.REMRG_HOST;
7
+ switch (hostName.toLowerCase()) {
8
+ case 'github':
9
+ return import('./hosts/github.js').then((module) => new module.GithubHost());
10
+ default:
11
+ throw new Error(`Unsupported host: ${hostName}`);
12
+ }
13
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Host = void 0;
4
+ class Host {
5
+ }
6
+ exports.Host = Host;
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.GithubHost = void 0;
37
+ const https = __importStar(require("https"));
38
+ const env_1 = require("../../env");
39
+ const host_1 = require("../host");
40
+ class GithubHost extends host_1.Host {
41
+ org = env_1.env.REMRG_GITHUB_ORG;
42
+ async getTemplates() {
43
+ return new Promise((resolve, reject) => {
44
+ https
45
+ .get(`https://api.github.com/orgs/${this.org}/repos`, {
46
+ headers: {
47
+ Accept: 'application/vnd.github+json',
48
+ 'X-GitHub-Api-Version': '2026-03-10',
49
+ 'User-Agent': 'undefined',
50
+ },
51
+ }, (res) => {
52
+ let data = '';
53
+ res.on('data', (chunk) => {
54
+ data += chunk;
55
+ });
56
+ res.on('end', () => {
57
+ if (res.statusCode && res.statusCode >= 400) {
58
+ reject(new Error(`Error ${res.statusCode}`));
59
+ return;
60
+ }
61
+ try {
62
+ const json = JSON.parse(data);
63
+ const mapped = json.map((repo) => ({
64
+ name: repo.name,
65
+ url: repo.html_url,
66
+ branch: repo.default_branch,
67
+ }));
68
+ resolve(mapped);
69
+ }
70
+ catch (error) {
71
+ reject(error);
72
+ }
73
+ });
74
+ })
75
+ .on('error', (err) => {
76
+ reject(err);
77
+ });
78
+ });
79
+ }
80
+ }
81
+ exports.GithubHost = GithubHost;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./github"), exports);
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./hosts"), exports);
18
+ __exportStar(require("./get-host"), exports);
19
+ __exportStar(require("./host"), exports);
20
+ __exportStar(require("./template-cache"), exports);
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.initializeCache = initializeCache;
4
+ exports.getCachedTemplateNames = getCachedTemplateNames;
5
+ exports.getCachedTemplates = getCachedTemplates;
6
+ exports.getCachedTemplate = getCachedTemplate;
7
+ exports.cacheTemplates = cacheTemplates;
8
+ const get_host_1 = require("./get-host");
9
+ const cache = {};
10
+ async function initializeCache() {
11
+ const host = await (0, get_host_1.getHost)();
12
+ const templates = await host.getTemplates();
13
+ cacheTemplates(templates);
14
+ }
15
+ function getCachedTemplateNames() {
16
+ return Object.keys(cache);
17
+ }
18
+ function getCachedTemplates() {
19
+ return Object.values(cache);
20
+ }
21
+ function getCachedTemplate(name) {
22
+ return cache[name];
23
+ }
24
+ /**
25
+ * @private
26
+ */
27
+ function cacheTemplates(templates) {
28
+ for (const template of templates) {
29
+ cache[template.name] = template;
30
+ }
31
+ }
@@ -0,0 +1,12 @@
1
+ #! /usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ /**
5
+ * This file is the main entrypoint for your application.
6
+ */
7
+ const app_1 = require("./app");
8
+ const main_1 = require("./main");
9
+ /**
10
+ * Bootstrap the application
11
+ */
12
+ (0, app_1.bootstrap)(main_1.main);
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.log = void 0;
4
+ const ts_tiny_log_1 = require("ts-tiny-log");
5
+ /**
6
+ * You can replace or extend the log, but it should implement LogInterface
7
+ * from ts-tiny-log
8
+ */
9
+ exports.log = new ts_tiny_log_1.Log({
10
+ shouldWriteLogLevel: false,
11
+ shouldWriteThreadId: false,
12
+ shouldWriteTimestamp: false,
13
+ });
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.main = main;
4
+ const log_1 = require("./log");
5
+ const ts_commands_1 = require("ts-commands");
6
+ const template_cache_1 = require("./host/template-cache");
7
+ const commands_1 = require("./commands");
8
+ /**
9
+ * Start your application in the main() function
10
+ */
11
+ async function main() {
12
+ log_1.log.info('remrg-cli\n');
13
+ log_1.log.info('Fetching templates...');
14
+ await (0, template_cache_1.initializeCache)();
15
+ log_1.log.info('Templates fetched successfully!\n');
16
+ new ts_commands_1.CommandDispatcher({
17
+ commands: commands_1.commands,
18
+ }).run();
19
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.branch = branch;
4
+ const ts_commands_1 = require("ts-commands");
5
+ function branch() {
6
+ return {
7
+ key: 'branch',
8
+ type: ts_commands_1.OptionType.string,
9
+ description: 'remote template branch to use',
10
+ };
11
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.verbose = exports.templatize = exports.remoteUrl = exports.org = exports.license = exports.template = exports.name = void 0;
4
+ var name_1 = require("./name");
5
+ Object.defineProperty(exports, "name", { enumerable: true, get: function () { return name_1.name; } });
6
+ var template_1 = require("./template");
7
+ Object.defineProperty(exports, "template", { enumerable: true, get: function () { return template_1.template; } });
8
+ var license_1 = require("./license");
9
+ Object.defineProperty(exports, "license", { enumerable: true, get: function () { return license_1.license; } });
10
+ var org_1 = require("./org");
11
+ Object.defineProperty(exports, "org", { enumerable: true, get: function () { return org_1.org; } });
12
+ var remote_url_1 = require("./remote-url");
13
+ Object.defineProperty(exports, "remoteUrl", { enumerable: true, get: function () { return remote_url_1.remoteUrl; } });
14
+ var templatize_1 = require("./templatize");
15
+ Object.defineProperty(exports, "templatize", { enumerable: true, get: function () { return templatize_1.templatize; } });
16
+ var verbose_1 = require("./verbose");
17
+ Object.defineProperty(exports, "verbose", { enumerable: true, get: function () { return verbose_1.verbose; } });
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.license = license;
4
+ const ts_commands_1 = require("ts-commands");
5
+ function license() {
6
+ return {
7
+ key: 'license',
8
+ type: ts_commands_1.OptionType.string,
9
+ description: 'license name',
10
+ };
11
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.name = name;
4
+ const ts_commands_1 = require("ts-commands");
5
+ function name() {
6
+ return {
7
+ key: 'name',
8
+ type: ts_commands_1.OptionType.string,
9
+ description: 'project name',
10
+ };
11
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.openWith = openWith;
4
+ const ts_commands_1 = require("ts-commands");
5
+ function openWith() {
6
+ return {
7
+ key: 'open-with',
8
+ type: ts_commands_1.OptionType.string,
9
+ description: 'open project with command (e.g. "code")',
10
+ };
11
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.org = org;
4
+ const ts_commands_1 = require("ts-commands");
5
+ function org() {
6
+ return {
7
+ key: 'org',
8
+ type: ts_commands_1.OptionType.string,
9
+ description: 'organization name',
10
+ };
11
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.remoteUrl = remoteUrl;
4
+ const ts_commands_1 = require("ts-commands");
5
+ function remoteUrl() {
6
+ return {
7
+ key: 'remote',
8
+ type: ts_commands_1.OptionType.string,
9
+ description: 'template remote url/path',
10
+ };
11
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.template = template;
4
+ const ts_commands_1 = require("ts-commands");
5
+ function template() {
6
+ return {
7
+ key: 'template',
8
+ type: ts_commands_1.OptionType.string,
9
+ description: 'template type',
10
+ };
11
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.templatize = templatize;
4
+ const ts_commands_1 = require("ts-commands");
5
+ function templatize() {
6
+ return {
7
+ key: 'templatize',
8
+ type: ts_commands_1.OptionType.boolean,
9
+ description: 'create a template',
10
+ };
11
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.type = type;
4
+ const ts_commands_1 = require("ts-commands");
5
+ const templates_1 = require("../../templates");
6
+ function type() {
7
+ return {
8
+ key: 'type',
9
+ type: ts_commands_1.OptionType.string,
10
+ choices: templates_1.templateKeys,
11
+ description: 'template type',
12
+ default: 'base',
13
+ };
14
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.verbose = verbose;
4
+ const ts_commands_1 = require("ts-commands");
5
+ function verbose() {
6
+ return {
7
+ key: 'verbose',
8
+ alias: 'v',
9
+ type: ts_commands_1.OptionType.boolean,
10
+ description: 'Run with verbose logging',
11
+ };
12
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ // {{ remrg:task Start-up and tear-down services for your app }}
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.register = register;
5
+ exports.teardown = teardown;
6
+ /**
7
+ * Initialize & register your app's services here
8
+ */
9
+ async function register() {
10
+ // Register services here
11
+ }
12
+ /**
13
+ * Teardown services here
14
+ */
15
+ async function teardown() {
16
+ // Teardown services here
17
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./template-yaml"), exports);
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getTemplateYaml = getTemplateYaml;
4
+ function getTemplateYaml(options) {
5
+ const fullName = options.organization
6
+ ? `${options.organization}/${options.projectName}`
7
+ : options.projectName;
8
+ return `name: ${fullName}
9
+ version: ${options.version ?? '1.0.0'}
10
+ description: ${options.description ?? ''}
11
+ type: ${options.type ?? 'feature'}
12
+ license: ${options.license ?? 'MIT'}
13
+ access: ${options.access ?? 'private'}
14
+ roots:
15
+ ${options.roots.map((root) => `- ${root}`).join('\n')}
16
+ `;
17
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./template"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });