Skip to content

Commit fd04206

Browse files
committed
Initial commit
0 parents  commit fd04206

15 files changed

+1919
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist/
2+
node_modules/

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Alex Rozanski
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

data/platform.yml

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
platforms:
2+
- id: iOS
3+
name: iOS
4+
versions:
5+
- "11.0"
6+
- "11.1"
7+
- "11.2"
8+
- "11.3"
9+
- "11.4"
10+
- "12.0"
11+
- "12.1"
12+
- "12.2"
13+
- "12.3"
14+
- "12.4"
15+
- "13.0"
16+
- "13.1"
17+
- "13.2"
18+
- "13.3"
19+
- "13.4"
20+
- "13.5"
21+
- "13.6"
22+
- "13.7"
23+
- "14.0"
24+
- "14.1"
25+
- "14.2"
26+
- "14.3"
27+
- "14.5"
28+
- "14.6"
29+
- "14.7"
30+
- "14.8"
31+
- "15.0"
32+
- "15.1"
33+
- "15.2"
34+
- "15.3"
35+
- "15.4"
36+
- "16.0"
37+
- "16.1"
38+
- id: macOS
39+
name: macOS
40+
versions:
41+
- "10.13"
42+
- "10.13.1"
43+
- "10.13.2"
44+
- "10.13.4"
45+
- "10.14"
46+
- "10.14.1"
47+
- "10.14.4"
48+
- "10.14.6"
49+
- "10.15"
50+
- "10.15.1"
51+
- "10.16"
52+
- "11.0"
53+
- "12.0"
54+
- "13.0"
55+
- id: watchOS
56+
name: watchOS
57+
versions:
58+
- "4.0"
59+
- "4.1"
60+
- "4.2"
61+
- "4.3"
62+
- "5.0"
63+
- "5.1"
64+
- "5.2"
65+
- "5.3"
66+
- "6.0"
67+
- "6.1"
68+
- "6.2"
69+
- "7.0"
70+
- "7.1"
71+
- "7.2"
72+
- "7.3"
73+
- "7.4"
74+
- "7.5"
75+
- "7.6"
76+
- "8.0"
77+
- "8.1"
78+
- "8.3"
79+
- "8.4"
80+
- "8.5"
81+
- "9.0"
82+
- "9.1"
83+
- id: tvOS
84+
name: tvOS
85+
versions:
86+
- "11.0"
87+
- "11.1"
88+
- "11.2"
89+
- "11.3"
90+
- "11.4"
91+
- "12.0"
92+
- "12.1"
93+
- "12.2"
94+
- "12.3"
95+
- "12.4"
96+
- "13.0"
97+
- "13.2"
98+
- "13.3"
99+
- "13.4"
100+
- "14.0"
101+
- "14.1"
102+
- "14.2"
103+
- "14.3"
104+
- "14.5"
105+
- "14.6"
106+
- "14.7"
107+
- "15.0"
108+
- "15.1"
109+
- "15.2"
110+
- "15.3"
111+
- "15.4"
112+
- "16.0"
113+
- "16.1"

data/swift.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
swiftVersions:
2+
- version: "5.8"
3+
releaseDate: 30 Mar 23
4+
xcodeVersion: "14.3"
5+
- version: "5.7"
6+
releaseDate: 12 Sep 22
7+
xcodeVersion: "14.0"
8+
- version: "5.6.1"
9+
releaseDate: 16 May 22
10+
xcodeVersion: "13.4"
11+
- version: "5.6"
12+
releaseDate: 14 Mar 22
13+
xcodeVersion: "13.3"
14+
- version: "5.5.2"
15+
releaseDate: 13 Dec 21
16+
xcodeVersion: "13.2"
17+
- version: "5.5.1"
18+
releaseDate: 25 Oct 21
19+
xcodeVersion: "13.1"
20+
- version: "5.5"
21+
releaseDate: 20 Sep 21
22+
xcodeVersion: "13.0"
23+
- version: "5.4.2"
24+
releaseDate: 21 Jun 21
25+
xcodeVersion: "12.5.1"
26+
- version: "5.4"
27+
releaseDate: 26 Apr 21
28+
xcodeVersion: "12.5"

data/test.json

Whitespace-only changes.

esbuild.config.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const { yamlPlugin } = require('esbuild-plugin-yaml');
2+
3+
require('esbuild').build({
4+
entryPoints: ['index.ts'],
5+
bundle: true,
6+
outdir: 'dist',
7+
plugins: [yamlPlugin()],
8+
loader: {
9+
'.yaml': 'text',
10+
'.yml': 'text',
11+
},
12+
platform: 'node',
13+
}).catch((e) => console.error(e.message));

index.ts

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env node
2+
3+
import { exit } from "process";
4+
import { parse } from "./lib/cli";
5+
import { promptConfig } from "./lib/prompt";
6+
import packageJson from "./package.json";
7+
8+
const cli = parse(process.argv, packageJson);
9+
10+
(async function () {
11+
const config = await promptConfig(cli.projectDirectory);
12+
if (config == null) {
13+
console.log("Exiting.");
14+
exit(1);
15+
}
16+
17+
console.log(config);
18+
})();

lib/cli.ts

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { Command } from "commander";
2+
3+
export type Arguments = {
4+
projectDirectory?: string;
5+
};
6+
7+
export const parse = (
8+
args: NodeJS.Process["argv"],
9+
packageJson: { name: string; version: string }
10+
) => {
11+
const { name, version } = packageJson;
12+
13+
let parsedArgs: Arguments = {};
14+
const values = new Command(name)
15+
.version(version)
16+
.argument("[project-directory]")
17+
.usage(`[project-directory]`)
18+
.action((dir) => {
19+
parsedArgs.projectDirectory = dir;
20+
})
21+
.allowUnknownOption()
22+
.parse(args);
23+
24+
return parsedArgs;
25+
};

0 commit comments

Comments
 (0)