create-seamless 0.0.1-beta.0 ā 0.0.1-beta.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/index.js +15 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { execSync } from "child_process";
|
|
3
|
-
import path from "path";
|
|
4
3
|
|
|
5
|
-
const project = process.argv[2] || "
|
|
4
|
+
const project = process.argv[2] || "demo-app";
|
|
6
5
|
|
|
7
6
|
console.log(`š Creating project: ${project}...\n`);
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
// Step 1: Clone the starter template
|
|
9
|
+
execSync(`npx degit seamless-auth-starter-react ${project}`, {
|
|
10
10
|
stdio: "inherit",
|
|
11
11
|
});
|
|
12
12
|
|
|
13
|
+
// Step 2: Generate HTTPS certs for Vite
|
|
14
|
+
console.log(`\nš Generating HTTPS certificates...\n`);
|
|
15
|
+
const certDir = path.join(process.cwd(), project, ".cert");
|
|
16
|
+
if (!fs.existsSync(certDir)) {
|
|
17
|
+
fs.mkdirSync(certDir);
|
|
18
|
+
}
|
|
19
|
+
const pems = selfsigned.generate(null, { days: 365 });
|
|
20
|
+
fs.writeFileSync(path.join(certDir, "cert.pem"), pems.cert);
|
|
21
|
+
fs.writeFileSync(path.join(certDir, "key.pem"), pems.private);
|
|
22
|
+
|
|
13
23
|
console.log(`
|
|
14
24
|
ā
Done!
|
|
15
25
|
ā cd ${project}
|
|
16
26
|
ā npm install
|
|
17
27
|
ā npm run dev
|
|
28
|
+
|
|
29
|
+
š” Note: The browser may ask you to trust the certificate the first time.
|
|
18
30
|
`);
|