@multiplatform.one/cli 1.0.42 → 1.0.45

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.
@@ -29,7 +29,9 @@ program.command("init").option("-r, --remote <remote>", "the remote to use", "ht
29
29
  ])).name;
30
30
  }
31
31
  const cookieCutterConfig = {
32
- name
32
+ default_context: {
33
+ name
34
+ }
33
35
  };
34
36
  const cookieCutterConfigFile = path.join(await fs.mkdtemp(path.join(os.tmpdir(), "multiplatform-")), "config.json");
35
37
  try {
@@ -79,7 +81,9 @@ program.command("update").option("-r, --remote <remote>", "the remote to use", "
79
81
  if ((await fs.stat(path.resolve(projectRoot, "package.json"))).isFile() && (await fs.stat(path.resolve(projectRoot, "app/package.json"))).isFile() && JSON.parse(await fs.readFile(path.resolve(projectRoot, "app/package.json"), "utf8"))?.dependencies?.["multiplatform.one"]?.length) {
80
82
  const name = JSON.parse(await fs.readFile(path.resolve(projectRoot, "package.json"), "utf8"))?.name;
81
83
  if (name) cookieCutterConfig = {
82
- name
84
+ default_context: {
85
+ name
86
+ }
83
87
  };
84
88
  }
85
89
  if (!cookieCutterConfig) throw new Error("not a multiplatform.one project");
package/lib/types.d.mts CHANGED
@@ -1,5 +1,7 @@
1
1
  interface CookieCutterConfig {
2
- name: string;
2
+ default_context: {
3
+ name: string;
4
+ };
3
5
  }
4
6
 
5
7
  export type { CookieCutterConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplatform.one/cli",
3
- "version": "1.0.42",
3
+ "version": "1.0.45",
4
4
  "author": "BitSpur <support@bitspur.com> (https://bitspur.com)",
5
5
  "contributors": [
6
6
  {
package/scripts/init.sh CHANGED
@@ -1,3 +1,5 @@
1
1
  #!/bin/sh
2
2
 
3
+ set -e
4
+
3
5
  $COOKIECUTTER "$@"
package/scripts/update.sh CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  set -e
4
4
 
5
- git clean -fxd
6
5
  PROJECT_DIR="$(pwd)"
7
6
  TEMP_DIR="$(mktemp -d)"
8
7
  trap 'rm -rf "$TEMP_DIR"' EXIT
@@ -14,6 +13,7 @@ cd "$COOKIECUTTER_DIR"
14
13
  git add .
15
14
  git commit -m "Updated multiplatform.one"
16
15
  cd "$PROJECT_DIR"
16
+ git clean -fxd
17
17
  INITIAL_COMMIT="$(git rev-parse HEAD)"
18
18
  git remote add multiplatform.one "$COOKIECUTTER_DIR"
19
19
  git fetch multiplatform.one
@@ -58,7 +58,7 @@ program
58
58
  ])
59
59
  ).name;
60
60
  }
61
- const cookieCutterConfig: CookieCutterConfig = { name };
61
+ const cookieCutterConfig: CookieCutterConfig = { default_context: { name } };
62
62
  const cookieCutterConfigFile = path.join(await fs.mkdtemp(path.join(os.tmpdir(), 'multiplatform-')), 'config.json');
63
63
  try {
64
64
  await fs.writeFile(cookieCutterConfigFile, JSON.stringify(cookieCutterConfig, null, 2));
@@ -111,7 +111,7 @@ program
111
111
  ]?.length
112
112
  ) {
113
113
  const name = JSON.parse(await fs.readFile(path.resolve(projectRoot, 'package.json'), 'utf8'))?.name;
114
- if (name) cookieCutterConfig = { name };
114
+ if (name) cookieCutterConfig = { default_context: { name } };
115
115
  }
116
116
  if (!cookieCutterConfig) throw new Error('not a multiplatform.one project');
117
117
  const cookieCutterConfigFile = path.join(await fs.mkdtemp(path.join(os.tmpdir(), 'multiplatform-')), 'config.json');
package/src/types.ts CHANGED
@@ -20,5 +20,7 @@
20
20
  */
21
21
 
22
22
  export interface CookieCutterConfig {
23
- name: string;
23
+ default_context: {
24
+ name: string;
25
+ };
24
26
  }