@voltsproject/volt-cli 0.1.2 → 0.1.4

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.
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="MaterialThemeProjectNewConfig">
4
+ <option name="metadata">
5
+ <MTProjectMetadataState>
6
+ <option name="migrated" value="true" />
7
+ <option name="pristineConfig" value="false" />
8
+ <option name="userId" value="6cdf64e7:19c300db1e2:-7ffe" />
9
+ </MTProjectMetadataState>
10
+ </option>
11
+ </component>
12
+ </project>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/volt-cli.iml" filepath="$PROJECT_DIR$/.idea/volt-cli.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
package/.idea/php.xml ADDED
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="MessDetectorOptionsConfiguration">
4
+ <option name="transferred" value="true" />
5
+ </component>
6
+ <component name="PHPCSFixerOptionsConfiguration">
7
+ <option name="transferred" value="true" />
8
+ </component>
9
+ <component name="PHPCodeSnifferOptionsConfiguration">
10
+ <option name="highlightLevel" value="WARNING" />
11
+ <option name="transferred" value="true" />
12
+ </component>
13
+ <component name="PhpStanOptionsConfiguration">
14
+ <option name="transferred" value="true" />
15
+ </component>
16
+ <component name="PsalmOptionsConfiguration">
17
+ <option name="transferred" value="true" />
18
+ </component>
19
+ </project>
package/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="WEB_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$" />
5
+ <orderEntry type="inheritedJdk" />
6
+ <orderEntry type="sourceFolder" forTests="false" />
7
+ </component>
8
+ </module>
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@voltsproject/volt-cli",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "A simple CLI tool for creating Volts projects",
5
5
  "bin": {
6
6
  "volt": "dist/bin/volt.js"
7
7
  },
8
8
  "scripts": {
9
9
  "build": "tsc",
10
- "postinstall": "npm run build",
10
+ "postinstall": "chmod +x dist/bin/volt.js",
11
11
  "prepublishOnly": "npm run build"
12
12
  },
13
13
  "publishConfig": {
package/src/bin/volt.ts DELETED
@@ -1,51 +0,0 @@
1
- #!/usr/bin/env node
2
- import { Command } from 'commander';
3
- import process from 'node:process';
4
- import * as fs from 'node:fs';
5
- import { fileURLToPath } from 'node:url';
6
- import path from 'node:path';
7
- import chalk from 'chalk';
8
- import { exec } from 'node:child_process';
9
-
10
- interface IPackage
11
- {
12
- version: string;
13
- }
14
-
15
- const program: Command = new Command();
16
-
17
- const getPackageInformation: () => Promise<IPackage> = async (): Promise<IPackage> => {
18
- const contents = fs.readFileSync(path.join(getDirname(), '../../package.json'));
19
-
20
- return JSON.parse(contents.toString());
21
- }
22
-
23
- const getDirname = () => {
24
- return path.dirname(fileURLToPath(import.meta.url));
25
- }
26
-
27
- const runShellCommand = (command: string): void => {
28
- exec(command, (error, stdout, stderr) => {
29
- if (error) {
30
- console.error(chalk.red(`Error: ${error.message}`));
31
- return;
32
- }
33
- if (stderr) {
34
- console.error(chalk.yellow(`stderr: ${stderr}`));
35
- }
36
- console.log(chalk.green(`stdout: ${stdout}`));
37
- });
38
- };
39
-
40
- getPackageInformation().then((packageData: IPackage) => {
41
- program.version(packageData.version);
42
-
43
- program.command('new')
44
- .argument('<name>')
45
- .action((name: string) => {
46
- console.log(chalk.blue(`Creating a new project:`) + chalk.bold(` ${name}`));
47
- runShellCommand(`git clone https://gitlab.winningsoftware.co.uk/open-source/volts.git ${name} && cd ${name} && rm -rf .git && npm install`);
48
- });
49
-
50
- program.parse(process.argv);
51
- });