@canva/cli 0.0.1-beta.5 → 0.0.1-beta.7
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/cli.js +246 -246
- package/package.json +1 -1
- package/templates/base/package.json +6 -6
- package/templates/base/scripts/copy-env.ts +10 -0
- package/templates/common/conf/eslint-i18n.mjs +2 -2
- package/templates/dam/package.json +20 -19
- package/templates/dam/scripts/copy-env.ts +10 -0
- package/templates/gen_ai/package.json +22 -21
- package/templates/gen_ai/scripts/copy-env.ts +10 -0
- package/templates/hello_world/package.json +21 -20
- package/templates/hello_world/scripts/copy-env.ts +10 -0
package/package.json
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
7
7
|
"author": "Canva Pty Ltd.",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@canva/app-ui-kit": "^4.
|
|
9
|
+
"@canva/app-ui-kit": "^4.3.0",
|
|
10
10
|
"@canva/asset": "^2.0.0",
|
|
11
|
-
"@canva/design": "^2.1
|
|
11
|
+
"@canva/design": "^2.2.1",
|
|
12
12
|
"@canva/error": "^2.0.0",
|
|
13
13
|
"@canva/platform": "^2.0.0",
|
|
14
14
|
"@canva/user": "^2.0.0",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"@types/debug": "4.1.12",
|
|
23
23
|
"@types/express": "4.17.21",
|
|
24
24
|
"@types/express-serve-static-core": "4.19.6",
|
|
25
|
-
"@types/jest": "29.5.
|
|
25
|
+
"@types/jest": "29.5.14",
|
|
26
26
|
"@types/jsonwebtoken": "9.0.7",
|
|
27
27
|
"@types/node": "20.10.0",
|
|
28
28
|
"@types/node-fetch": "2.6.11",
|
|
29
29
|
"@types/node-forge": "1.3.11",
|
|
30
30
|
"@types/nodemon": "1.19.6",
|
|
31
31
|
"@types/prompts": "2.4.9",
|
|
32
|
-
"@types/react": "18.3.
|
|
32
|
+
"@types/react": "18.3.12",
|
|
33
33
|
"@types/react-dom": "18.3.1",
|
|
34
34
|
"@types/webpack-env": "1.18.5",
|
|
35
35
|
"chalk": "4.1.2",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"jest": "29.7.0",
|
|
46
46
|
"jsonwebtoken": "9.0.2",
|
|
47
47
|
"jwks-rsa": "3.1.0",
|
|
48
|
-
"mini-css-extract-plugin": "2.9.
|
|
48
|
+
"mini-css-extract-plugin": "2.9.2",
|
|
49
49
|
"node-fetch": "3.3.2",
|
|
50
50
|
"node-forge": "1.3.1",
|
|
51
51
|
"nodemon": "3.0.1",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"ts-node": "10.9.2",
|
|
60
60
|
"typescript": "5.5.4",
|
|
61
61
|
"url-loader": "4.1.1",
|
|
62
|
-
"webpack": "5.
|
|
62
|
+
"webpack": "5.96.1",
|
|
63
63
|
"webpack-cli": "5.1.4",
|
|
64
64
|
"webpack-dev-server": "5.1.0",
|
|
65
65
|
"yargs": "17.7.2"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import * as fs from "fs";
|
|
3
|
+
import * as path from "path";
|
|
4
|
+
|
|
5
|
+
const envPath = path.resolve(__dirname, "..", ".env");
|
|
6
|
+
const templatePath = path.resolve(__dirname, "..", ".env.template");
|
|
7
|
+
|
|
8
|
+
if (!fs.existsSync(envPath)) {
|
|
9
|
+
fs.copyFileSync(templatePath, envPath);
|
|
10
|
+
}
|
|
@@ -23,8 +23,8 @@ export default [
|
|
|
23
23
|
},
|
|
24
24
|
},
|
|
25
25
|
],
|
|
26
|
-
"formatjs/enforce-description": "error",
|
|
27
|
-
"formatjs/enforce-default-message": "error",
|
|
26
|
+
"formatjs/enforce-description": ["error", "literal"],
|
|
27
|
+
"formatjs/enforce-default-message": ["error", "literal"],
|
|
28
28
|
"formatjs/enforce-placeholders": "error",
|
|
29
29
|
"formatjs/no-id": "error",
|
|
30
30
|
"formatjs/no-emoji": "error",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "digital_asset_management",
|
|
4
4
|
"description": "An example app leveraging @canva/app-components to develop a digital asset management (DAM) app.",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"extract": "formatjs extract src/**/*.{ts,tsx} --out-file dist/messages_en.json",
|
|
6
|
+
"extract": "formatjs extract \"src/**/*.{ts,tsx}\" --out-file dist/messages_en.json",
|
|
7
7
|
"build": "webpack --config webpack.config.cjs --mode production && npm run extract",
|
|
8
8
|
"format": "prettier '**/*.{css,ts,tsx}' --no-config --write",
|
|
9
9
|
"format:check": "prettier '**/*.{css,ts,tsx}' --no-config --check --ignore-path",
|
|
@@ -13,45 +13,46 @@
|
|
|
13
13
|
"lint:types": "tsc",
|
|
14
14
|
"start": "ts-node ./scripts/start/start.ts",
|
|
15
15
|
"test": "jest --no-cache",
|
|
16
|
-
"test:watch": "jest --watchAll"
|
|
16
|
+
"test:watch": "jest --watchAll",
|
|
17
|
+
"postinstall": "ts-node ./scripts/copy-env.ts"
|
|
17
18
|
},
|
|
18
19
|
"dependencies": {
|
|
19
20
|
"@canva/app-components": "^1.0.0-beta.29",
|
|
20
|
-
"@canva/app-i18n-kit": "^1.0.
|
|
21
|
-
"@canva/app-ui-kit": "^4.
|
|
21
|
+
"@canva/app-i18n-kit": "^1.0.1",
|
|
22
|
+
"@canva/app-ui-kit": "^4.3.0",
|
|
22
23
|
"@canva/asset": "^2.0.0",
|
|
23
|
-
"@canva/design": "^2.1
|
|
24
|
+
"@canva/design": "^2.2.1",
|
|
24
25
|
"@canva/platform": "^2.0.0",
|
|
25
26
|
"@canva/user": "^2.0.0",
|
|
26
27
|
"cookie-parser": "1.4.7",
|
|
27
28
|
"cors": "2.8.5",
|
|
28
29
|
"react": "18.3.1",
|
|
29
30
|
"react-dom": "18.3.1",
|
|
30
|
-
"react-intl": "6.
|
|
31
|
+
"react-intl": "6.8.7"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
33
34
|
"@eslint/eslintrc": "3.1.0",
|
|
34
|
-
"@eslint/js": "9.
|
|
35
|
-
"@formatjs/cli": "6.
|
|
36
|
-
"@formatjs/ts-transformer": "3.13.
|
|
35
|
+
"@eslint/js": "9.14.0",
|
|
36
|
+
"@formatjs/cli": "6.3.8",
|
|
37
|
+
"@formatjs/ts-transformer": "3.13.22",
|
|
37
38
|
"@ngrok/ngrok": "1.4.1",
|
|
38
39
|
"@svgr/webpack": "8.1.0",
|
|
39
40
|
"@types/cors": "2.8.17",
|
|
40
41
|
"@types/debug": "4.1.12",
|
|
41
42
|
"@types/express": "4.17.21",
|
|
42
43
|
"@types/express-serve-static-core": "4.19.6",
|
|
43
|
-
"@types/jest": "29.5.
|
|
44
|
+
"@types/jest": "29.5.14",
|
|
44
45
|
"@types/jsonwebtoken": "9.0.7",
|
|
45
46
|
"@types/node": "20.10.0",
|
|
46
47
|
"@types/node-fetch": "2.6.11",
|
|
47
48
|
"@types/node-forge": "1.3.11",
|
|
48
49
|
"@types/nodemon": "1.19.6",
|
|
49
50
|
"@types/prompts": "2.4.9",
|
|
50
|
-
"@types/react": "18.3.
|
|
51
|
+
"@types/react": "18.3.12",
|
|
51
52
|
"@types/react-dom": "18.3.1",
|
|
52
53
|
"@types/webpack-env": "1.18.5",
|
|
53
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
54
|
-
"@typescript-eslint/parser": "8.
|
|
54
|
+
"@typescript-eslint/eslint-plugin": "8.13.0",
|
|
55
|
+
"@typescript-eslint/parser": "8.13.0",
|
|
55
56
|
"chalk": "4.1.2",
|
|
56
57
|
"cli-table3": "0.6.5",
|
|
57
58
|
"css-loader": "7.1.2",
|
|
@@ -59,17 +60,17 @@
|
|
|
59
60
|
"cssnano": "7.0.6",
|
|
60
61
|
"debug": "4.3.7",
|
|
61
62
|
"dotenv": "16.4.5",
|
|
62
|
-
"eslint": "9.
|
|
63
|
-
"eslint-plugin-formatjs": "5.
|
|
64
|
-
"eslint-plugin-jest": "28.
|
|
65
|
-
"eslint-plugin-react": "7.37.
|
|
63
|
+
"eslint": "9.14.0",
|
|
64
|
+
"eslint-plugin-formatjs": "5.2.2",
|
|
65
|
+
"eslint-plugin-jest": "28.9.0",
|
|
66
|
+
"eslint-plugin-react": "7.37.2",
|
|
66
67
|
"exponential-backoff": "3.1.1",
|
|
67
68
|
"express": "4.21.1",
|
|
68
69
|
"express-basic-auth": "1.2.1",
|
|
69
70
|
"jest": "29.7.0",
|
|
70
71
|
"jsonwebtoken": "9.0.2",
|
|
71
72
|
"jwks-rsa": "3.1.0",
|
|
72
|
-
"mini-css-extract-plugin": "2.9.
|
|
73
|
+
"mini-css-extract-plugin": "2.9.2",
|
|
73
74
|
"node-fetch": "3.3.2",
|
|
74
75
|
"node-forge": "1.3.1",
|
|
75
76
|
"nodemon": "3.0.1",
|
|
@@ -83,7 +84,7 @@
|
|
|
83
84
|
"ts-node": "10.9.2",
|
|
84
85
|
"typescript": "5.5.4",
|
|
85
86
|
"url-loader": "4.1.1",
|
|
86
|
-
"webpack": "5.
|
|
87
|
+
"webpack": "5.96.1",
|
|
87
88
|
"webpack-cli": "5.1.4",
|
|
88
89
|
"webpack-dev-server": "5.1.0",
|
|
89
90
|
"yargs": "17.7.2"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import * as fs from "fs";
|
|
3
|
+
import * as path from "path";
|
|
4
|
+
|
|
5
|
+
const envPath = path.resolve(__dirname, "..", ".env");
|
|
6
|
+
const templatePath = path.resolve(__dirname, "..", ".env.template");
|
|
7
|
+
|
|
8
|
+
if (!fs.existsSync(envPath)) {
|
|
9
|
+
fs.copyFileSync(templatePath, envPath);
|
|
10
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "gen_ai",
|
|
4
4
|
"description": "An example app demonstrating common patterns that you might use in a generative AI app.",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"extract": "formatjs extract src/**/*.{ts,tsx} --out-file dist/messages_en.json",
|
|
6
|
+
"extract": "formatjs extract \"src/**/*.{ts,tsx}\" --out-file dist/messages_en.json",
|
|
7
7
|
"build": "webpack --config webpack.config.cjs --mode production && npm run extract",
|
|
8
8
|
"format": "prettier '**/*.{css,ts,tsx}' --no-config --write",
|
|
9
9
|
"format:check": "prettier '**/*.{css,ts,tsx}' --no-config --check --ignore-path",
|
|
@@ -13,13 +13,14 @@
|
|
|
13
13
|
"lint:types": "tsc",
|
|
14
14
|
"start": "ts-node ./scripts/start/start.ts",
|
|
15
15
|
"test": "jest --no-cache",
|
|
16
|
-
"test:watch": "jest --watchAll"
|
|
16
|
+
"test:watch": "jest --watchAll",
|
|
17
|
+
"postinstall": "ts-node ./scripts/copy-env.ts"
|
|
17
18
|
},
|
|
18
19
|
"dependencies": {
|
|
19
|
-
"@canva/app-i18n-kit": "^1.0.
|
|
20
|
-
"@canva/app-ui-kit": "^4.
|
|
20
|
+
"@canva/app-i18n-kit": "^1.0.1",
|
|
21
|
+
"@canva/app-ui-kit": "^4.3.0",
|
|
21
22
|
"@canva/asset": "^2.0.0",
|
|
22
|
-
"@canva/design": "^2.1
|
|
23
|
+
"@canva/design": "^2.2.1",
|
|
23
24
|
"@canva/platform": "^2.0.0",
|
|
24
25
|
"@canva/user": "^2.0.0",
|
|
25
26
|
"cookie-parser": "1.4.7",
|
|
@@ -28,32 +29,32 @@
|
|
|
28
29
|
"obscenity": "0.4.0",
|
|
29
30
|
"react": "18.3.1",
|
|
30
31
|
"react-dom": "18.3.1",
|
|
31
|
-
"react-error-boundary": "4.
|
|
32
|
-
"react-intl": "6.
|
|
33
|
-
"react-router-dom": "6.
|
|
32
|
+
"react-error-boundary": "4.1.2",
|
|
33
|
+
"react-intl": "6.8.7",
|
|
34
|
+
"react-router-dom": "6.28.0"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
37
|
"@eslint/eslintrc": "3.1.0",
|
|
37
|
-
"@eslint/js": "9.
|
|
38
|
-
"@formatjs/cli": "6.
|
|
39
|
-
"@formatjs/ts-transformer": "3.13.
|
|
38
|
+
"@eslint/js": "9.14.0",
|
|
39
|
+
"@formatjs/cli": "6.3.8",
|
|
40
|
+
"@formatjs/ts-transformer": "3.13.22",
|
|
40
41
|
"@ngrok/ngrok": "1.4.1",
|
|
41
42
|
"@svgr/webpack": "8.1.0",
|
|
42
43
|
"@types/debug": "4.1.12",
|
|
43
44
|
"@types/express": "4.17.21",
|
|
44
45
|
"@types/express-serve-static-core": "4.19.6",
|
|
45
|
-
"@types/jest": "29.5.
|
|
46
|
+
"@types/jest": "29.5.14",
|
|
46
47
|
"@types/jsonwebtoken": "9.0.7",
|
|
47
48
|
"@types/node": "20.10.0",
|
|
48
49
|
"@types/node-fetch": "2.6.11",
|
|
49
50
|
"@types/node-forge": "1.3.11",
|
|
50
51
|
"@types/nodemon": "1.19.6",
|
|
51
52
|
"@types/prompts": "2.4.9",
|
|
52
|
-
"@types/react": "18.3.
|
|
53
|
+
"@types/react": "18.3.12",
|
|
53
54
|
"@types/react-dom": "18.3.1",
|
|
54
55
|
"@types/webpack-env": "1.18.5",
|
|
55
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
56
|
-
"@typescript-eslint/parser": "8.
|
|
56
|
+
"@typescript-eslint/eslint-plugin": "8.13.0",
|
|
57
|
+
"@typescript-eslint/parser": "8.13.0",
|
|
57
58
|
"chalk": "4.1.2",
|
|
58
59
|
"cli-table3": "0.6.5",
|
|
59
60
|
"css-loader": "7.1.2",
|
|
@@ -61,17 +62,17 @@
|
|
|
61
62
|
"cssnano": "7.0.6",
|
|
62
63
|
"debug": "4.3.7",
|
|
63
64
|
"dotenv": "16.4.5",
|
|
64
|
-
"eslint": "9.
|
|
65
|
-
"eslint-plugin-formatjs": "5.
|
|
66
|
-
"eslint-plugin-jest": "28.
|
|
67
|
-
"eslint-plugin-react": "7.37.
|
|
65
|
+
"eslint": "9.14.0",
|
|
66
|
+
"eslint-plugin-formatjs": "5.2.2",
|
|
67
|
+
"eslint-plugin-jest": "28.9.0",
|
|
68
|
+
"eslint-plugin-react": "7.37.2",
|
|
68
69
|
"exponential-backoff": "3.1.1",
|
|
69
70
|
"express": "4.21.1",
|
|
70
71
|
"express-basic-auth": "1.2.1",
|
|
71
72
|
"jest": "29.7.0",
|
|
72
73
|
"jsonwebtoken": "9.0.2",
|
|
73
74
|
"jwks-rsa": "3.1.0",
|
|
74
|
-
"mini-css-extract-plugin": "2.9.
|
|
75
|
+
"mini-css-extract-plugin": "2.9.2",
|
|
75
76
|
"node-fetch": "3.3.2",
|
|
76
77
|
"node-forge": "1.3.1",
|
|
77
78
|
"nodemon": "3.0.1",
|
|
@@ -85,7 +86,7 @@
|
|
|
85
86
|
"ts-node": "10.9.2",
|
|
86
87
|
"typescript": "5.5.4",
|
|
87
88
|
"url-loader": "4.1.1",
|
|
88
|
-
"webpack": "5.
|
|
89
|
+
"webpack": "5.96.1",
|
|
89
90
|
"webpack-cli": "5.1.4",
|
|
90
91
|
"webpack-dev-server": "5.1.0",
|
|
91
92
|
"yargs": "17.7.2"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import * as fs from "fs";
|
|
3
|
+
import * as path from "path";
|
|
4
|
+
|
|
5
|
+
const envPath = path.resolve(__dirname, "..", ".env");
|
|
6
|
+
const templatePath = path.resolve(__dirname, "..", ".env.template");
|
|
7
|
+
|
|
8
|
+
if (!fs.existsSync(envPath)) {
|
|
9
|
+
fs.copyFileSync(templatePath, envPath);
|
|
10
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "empty-template",
|
|
4
4
|
"description": "An empty Canva App",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"extract": "formatjs extract src/**/*.{ts,tsx} --out-file dist/messages_en.json",
|
|
6
|
+
"extract": "formatjs extract \"src/**/*.{ts,tsx}\" --out-file dist/messages_en.json",
|
|
7
7
|
"build": "webpack --config webpack.config.cjs --mode production && npm run extract",
|
|
8
8
|
"format": "prettier '**/*.{css,ts,tsx}' --no-config --write",
|
|
9
9
|
"format:check": "prettier '**/*.{css,ts,tsx}' --no-config --check --ignore-path",
|
|
@@ -13,35 +13,36 @@
|
|
|
13
13
|
"lint:types": "tsc",
|
|
14
14
|
"start": "ts-node ./scripts/start/start.ts",
|
|
15
15
|
"test": "jest --no-cache --passWithNoTests",
|
|
16
|
-
"test:watch": "jest --watchAll"
|
|
16
|
+
"test:watch": "jest --watchAll",
|
|
17
|
+
"postinstall": "ts-node ./scripts/copy-env.ts"
|
|
17
18
|
},
|
|
18
19
|
"dependencies": {
|
|
19
|
-
"@canva/app-
|
|
20
|
-
"@canva/app-
|
|
21
|
-
"@canva/design": "^2.1
|
|
22
|
-
"@canva/platform": "^2.0.0",
|
|
20
|
+
"@canva/app-i18n-kit": "^1.0.1",
|
|
21
|
+
"@canva/app-ui-kit": "^4.3.0",
|
|
22
|
+
"@canva/design": "^2.2.1",
|
|
23
23
|
"@canva/error": "^2.0.0",
|
|
24
|
+
"@canva/platform": "^2.0.0",
|
|
24
25
|
"react": "18.3.1",
|
|
25
26
|
"react-dom": "18.3.1",
|
|
26
|
-
"react-intl": "6.
|
|
27
|
+
"react-intl": "6.8.7"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
29
30
|
"@eslint/eslintrc": "3.1.0",
|
|
30
|
-
"@eslint/js": "9.
|
|
31
|
-
"@formatjs/cli": "6.
|
|
32
|
-
"@formatjs/ts-transformer": "3.13.
|
|
31
|
+
"@eslint/js": "9.14.0",
|
|
32
|
+
"@formatjs/cli": "6.3.8",
|
|
33
|
+
"@formatjs/ts-transformer": "3.13.22",
|
|
33
34
|
"@ngrok/ngrok": "1.4.1",
|
|
34
35
|
"@svgr/webpack": "8.1.0",
|
|
35
|
-
"@types/jest": "29.5.
|
|
36
|
+
"@types/jest": "29.5.14",
|
|
36
37
|
"@types/node": "20.10.0",
|
|
37
38
|
"@types/node-fetch": "2.6.11",
|
|
38
39
|
"@types/node-forge": "1.3.11",
|
|
39
40
|
"@types/nodemon": "1.19.6",
|
|
40
|
-
"@types/react": "18.3.
|
|
41
|
+
"@types/react": "18.3.12",
|
|
41
42
|
"@types/react-dom": "18.3.1",
|
|
42
43
|
"@types/webpack-env": "1.18.5",
|
|
43
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
44
|
-
"@typescript-eslint/parser": "8.
|
|
44
|
+
"@typescript-eslint/eslint-plugin": "8.13.0",
|
|
45
|
+
"@typescript-eslint/parser": "8.13.0",
|
|
45
46
|
"chalk": "4.1.2",
|
|
46
47
|
"cli-table3": "0.6.5",
|
|
47
48
|
"css-loader": "7.1.2",
|
|
@@ -49,12 +50,12 @@
|
|
|
49
50
|
"cssnano": "7.0.6",
|
|
50
51
|
"debug": "4.3.7",
|
|
51
52
|
"dotenv": "16.4.5",
|
|
52
|
-
"eslint": "9.
|
|
53
|
-
"eslint-plugin-formatjs": "5.
|
|
54
|
-
"eslint-plugin-jest": "28.
|
|
55
|
-
"eslint-plugin-react": "7.37.
|
|
53
|
+
"eslint": "9.14.0",
|
|
54
|
+
"eslint-plugin-formatjs": "5.2.2",
|
|
55
|
+
"eslint-plugin-jest": "28.9.0",
|
|
56
|
+
"eslint-plugin-react": "7.37.2",
|
|
56
57
|
"jest": "29.7.0",
|
|
57
|
-
"mini-css-extract-plugin": "2.9.
|
|
58
|
+
"mini-css-extract-plugin": "2.9.2",
|
|
58
59
|
"node-fetch": "3.3.2",
|
|
59
60
|
"node-forge": "1.3.1",
|
|
60
61
|
"nodemon": "3.0.1",
|
|
@@ -67,7 +68,7 @@
|
|
|
67
68
|
"ts-node": "10.9.2",
|
|
68
69
|
"typescript": "5.5.4",
|
|
69
70
|
"url-loader": "4.1.1",
|
|
70
|
-
"webpack": "5.
|
|
71
|
+
"webpack": "5.96.1",
|
|
71
72
|
"webpack-cli": "5.1.4",
|
|
72
73
|
"webpack-dev-server": "5.1.0",
|
|
73
74
|
"yargs": "17.7.2"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import * as fs from "fs";
|
|
3
|
+
import * as path from "path";
|
|
4
|
+
|
|
5
|
+
const envPath = path.resolve(__dirname, "..", ".env");
|
|
6
|
+
const templatePath = path.resolve(__dirname, "..", ".env.template");
|
|
7
|
+
|
|
8
|
+
if (!fs.existsSync(envPath)) {
|
|
9
|
+
fs.copyFileSync(templatePath, envPath);
|
|
10
|
+
}
|