moracarta 2.1.0 ā 2.1.2
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/README.md +10 -8
- package/package.json +29 -4
- package/src/commands/cliConfig.js +24 -3
- package/src/commands/postInstall.js +17 -0
package/README.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# Moracarta
|
|
2
2
|
|
|
3
|
-
**Create your own personalized love-letter website and deploy it completely for free
|
|
3
|
+
**Create your own personalized love-letter website and deploy it completely for free. Available as an npm package**
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/moracarta)
|
|
6
|
+
[](https://www.npmjs.com/package/moracarta)
|
|
4
7
|
|
|
5
8
|
š **[Live Demo](https://moracarta.pages.dev/)**
|
|
6
9
|
|
|
@@ -12,17 +15,16 @@
|
|
|
12
15
|
š Free web deployment
|
|
13
16
|
š No database required
|
|
14
17
|
|
|
15
|
-
## **
|
|
18
|
+
## **You can have your own working URL in less than 5 minutes**
|
|
16
19
|
|
|
17
20
|
**And it's as simple as:**
|
|
18
21
|
|
|
19
22
|
```bash
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
moracarta
|
|
24
|
-
moracarta
|
|
25
|
-
moracarta deploy
|
|
23
|
+
npm init -y
|
|
24
|
+
npm i moracarta
|
|
25
|
+
npx moracarta setup
|
|
26
|
+
npx moracarta build
|
|
27
|
+
npx moracarta deploy
|
|
26
28
|
```
|
|
27
29
|
|
|
28
30
|
### App Demo
|
package/package.json
CHANGED
|
@@ -1,10 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "moracarta",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "",
|
|
6
|
+
"license": "MIT",
|
|
6
7
|
"main": "index.js",
|
|
7
|
-
|
|
8
|
+
"keywords": [
|
|
9
|
+
"cli",
|
|
10
|
+
"scaffold",
|
|
11
|
+
"static-site",
|
|
12
|
+
"cloudflare",
|
|
13
|
+
"wrangler",
|
|
14
|
+
"gift",
|
|
15
|
+
"envelope",
|
|
16
|
+
"letters",
|
|
17
|
+
"romantic",
|
|
18
|
+
"html-css-js"
|
|
19
|
+
],
|
|
20
|
+
"files": [
|
|
21
|
+
"index.html",
|
|
22
|
+
"vite.config.mjs",
|
|
23
|
+
"public",
|
|
24
|
+
"src/commands",
|
|
25
|
+
"src/config/fonts.js",
|
|
26
|
+
"src/data/letters.example.js",
|
|
27
|
+
"src/data/lettersLoader.js",
|
|
28
|
+
"src/i18n",
|
|
29
|
+
"src/scripts",
|
|
30
|
+
"src/services",
|
|
31
|
+
"src/styles",
|
|
32
|
+
"src/views"
|
|
33
|
+
],
|
|
34
|
+
"postinstall": "node src/commands/postinstall.js",
|
|
8
35
|
"bin": {
|
|
9
36
|
"moracarta": "src/commands/cliConfig.js"
|
|
10
37
|
},
|
|
@@ -20,9 +47,7 @@
|
|
|
20
47
|
"type": "git",
|
|
21
48
|
"url": "git+https://github.com/WesleyHanauer/moracarta.git"
|
|
22
49
|
},
|
|
23
|
-
"keywords": [],
|
|
24
50
|
"author": "",
|
|
25
|
-
"license": "ISC",
|
|
26
51
|
"bugs": {
|
|
27
52
|
"url": "https://github.com/WesleyHanauer/moracarta/issues"
|
|
28
53
|
},
|
|
@@ -20,13 +20,34 @@ const VITE_ARGS = {
|
|
|
20
20
|
preview: ["preview"]
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
+
const HELP_TEXT = `
|
|
24
|
+
š Moracarta ā build your own love-letter website
|
|
25
|
+
|
|
26
|
+
Usage: moracarta <command>
|
|
27
|
+
|
|
28
|
+
Commands:
|
|
29
|
+
setup Scaffold the site into your project and configure it interactively
|
|
30
|
+
add Add a letter from a public Google Docs tab
|
|
31
|
+
remove Remove a letter you've already added
|
|
32
|
+
dev Start the local dev server to preview your site
|
|
33
|
+
build Build the site for production
|
|
34
|
+
preview Preview the production build locally
|
|
35
|
+
deploy Build and deploy the site to Cloudflare Pages
|
|
36
|
+
|
|
37
|
+
Run 'moracarta setup' first if you haven't already.
|
|
38
|
+
`;
|
|
39
|
+
|
|
23
40
|
const command = process.argv[2];
|
|
24
41
|
const commandArguments = process.argv.slice(3);
|
|
25
42
|
|
|
43
|
+
if (!command || command === "--help" || command === "-h") {
|
|
44
|
+
console.log(HELP_TEXT);
|
|
45
|
+
process.exit(0);
|
|
46
|
+
}
|
|
47
|
+
|
|
26
48
|
if (!COMMANDS.has(command)) {
|
|
27
|
-
console.error(
|
|
28
|
-
|
|
29
|
-
);
|
|
49
|
+
console.error(`Unknown command: ${command}`);
|
|
50
|
+
console.log(HELP_TEXT);
|
|
30
51
|
process.exit(1);
|
|
31
52
|
}
|
|
32
53
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
|
|
4
|
+
const packageRoot = resolve(fileURLToPath(new URL("../..", import.meta.url)));
|
|
5
|
+
|
|
6
|
+
// npm sets INIT_CWD to wherever the install was actually run from.
|
|
7
|
+
// If that's this repo itself, we're installing moracarta's own
|
|
8
|
+
// dependencies for development, not installing moracarta as a
|
|
9
|
+
// package, so skip the message.
|
|
10
|
+
const initCwd = process.env.INIT_CWD;
|
|
11
|
+
|
|
12
|
+
if (initCwd && resolve(initCwd) === packageRoot) {
|
|
13
|
+
process.exit(0);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
console.log("\nš Thanks for installing Moracarta!");
|
|
17
|
+
console.log("Run 'npx moracarta --help' to see available commands.\n");
|