@sublime-ui/create-app 0.1.1
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.
- package/LICENSE +21 -0
- package/README.md +14 -0
- package/dist/index.js +48 -0
- package/package.json +43 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Aaron Mkandawire and Sublime UI contributors
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# @sublime-ui/create-app
|
|
2
|
+
|
|
3
|
+
Scaffold a new [Sublime UI](https://sublime-ui.github.io/sublime-ui/) app:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm create @sublime-ui/app@latest my-app
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Prompts for an app name and which targets to include (web / mobile / desktop),
|
|
10
|
+
then writes a complete, runnable app. See the docs for the full walkthrough.
|
|
11
|
+
|
|
12
|
+
## License
|
|
13
|
+
|
|
14
|
+
MIT
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/index.ts
|
|
4
|
+
import { resolve } from "path";
|
|
5
|
+
import { pathToFileURL } from "url";
|
|
6
|
+
import { initApp } from "@sublime-ui/devkit";
|
|
7
|
+
var ALL = ["web", "mobile", "desktop"];
|
|
8
|
+
function parseArgv(argv) {
|
|
9
|
+
const positionals = [];
|
|
10
|
+
let targets;
|
|
11
|
+
let name;
|
|
12
|
+
let install = true;
|
|
13
|
+
let git = true;
|
|
14
|
+
let force = false;
|
|
15
|
+
let yes = false;
|
|
16
|
+
for (let i = 0; i < argv.length; i++) {
|
|
17
|
+
const a = argv[i];
|
|
18
|
+
if (a === "--no-install") install = false;
|
|
19
|
+
else if (a === "--no-git") git = false;
|
|
20
|
+
else if (a === "--force") force = true;
|
|
21
|
+
else if (a === "--yes" || a === "-y") yes = true;
|
|
22
|
+
else if (a === "--name") name = argv[++i];
|
|
23
|
+
else if (a === "--targets") {
|
|
24
|
+
targets = (argv[++i] ?? "").split(",").map((s) => s.trim()).filter((s) => ALL.includes(s));
|
|
25
|
+
} else if (a && !a.startsWith("-")) positionals.push(a);
|
|
26
|
+
}
|
|
27
|
+
const first = positionals[0] ?? ".";
|
|
28
|
+
return {
|
|
29
|
+
dir: resolve(process.cwd(), first),
|
|
30
|
+
...name !== void 0 ? { name } : first !== "." ? { name: first } : {},
|
|
31
|
+
...targets !== void 0 ? { targets } : {},
|
|
32
|
+
install,
|
|
33
|
+
git,
|
|
34
|
+
force,
|
|
35
|
+
yes
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
async function main() {
|
|
39
|
+
const args = parseArgv(process.argv.slice(2));
|
|
40
|
+
const code = await initApp(args);
|
|
41
|
+
process.exit(code);
|
|
42
|
+
}
|
|
43
|
+
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
44
|
+
void main();
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
parseArgv
|
|
48
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sublime-ui/create-app",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Scaffold a new Sublime UI app — npm create @sublime-ui/app my-app.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"sublime-ui",
|
|
7
|
+
"create",
|
|
8
|
+
"scaffold",
|
|
9
|
+
"starter",
|
|
10
|
+
"cross-platform"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://sublime-ui.github.io/sublime-ui/",
|
|
13
|
+
"bugs": "https://github.com/sublime-ui/sublime-ui/issues",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/sublime-ui/sublime-ui.git",
|
|
17
|
+
"directory": "create-app"
|
|
18
|
+
},
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"author": "Aaron Mkandawire",
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"type": "module",
|
|
25
|
+
"bin": {
|
|
26
|
+
"create-app": "./dist/index.js"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist"
|
|
30
|
+
],
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "tsup",
|
|
33
|
+
"typecheck": "tsc --noEmit",
|
|
34
|
+
"test": "vitest run --passWithNoTests",
|
|
35
|
+
"lint": "eslint src"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@sublime-ui/devkit": "^0.1.1"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@types/node": "^22"
|
|
42
|
+
}
|
|
43
|
+
}
|