@multiplatform.one/cli 1.0.26 → 1.0.28

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplatform.one/cli",
3
- "version": "1.0.26",
3
+ "version": "1.0.28",
4
4
  "author": "BitSpur <support@bitspur.com> (https://bitspur.com)",
5
5
  "contributors": [
6
6
  {
@@ -29,8 +29,8 @@
29
29
  "files": [
30
30
  "bin",
31
31
  "lib",
32
- "src",
33
- "update"
32
+ "scripts",
33
+ "src"
34
34
  ],
35
35
  "license": "Apache-2.0",
36
36
  "repository": {
@@ -51,7 +51,7 @@
51
51
  "@types/node": "~20.12.13",
52
52
  "tsup": "^8.1.0",
53
53
  "typescript": "~5.3.3",
54
- "@multiplatform.one/utils": "^0.0.11"
54
+ "@multiplatform.one/utils": "^0.0.13"
55
55
  },
56
56
  "dependencies": {
57
57
  "commander": "^9.5.0",
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+
3
+ cookiecutter "$@"
@@ -0,0 +1,56 @@
1
+ #!/bin/sh
2
+
3
+ set -e
4
+
5
+ MULTIPLATFORM_REMOTE="$1"
6
+ if ! (cat app/package.json | grep -q multiplatform.one); then
7
+ echo "\033[0;31mError:\033[0m not a multiplatform.one project" >&2
8
+ exit 1
9
+ fi
10
+ if ! git rev-parse --is-inside-work-tree > /dev/null 2>&1; then
11
+ echo "\033[0;31mError:\033[0m not inside a git repository" >&2
12
+ exit 1
13
+ fi
14
+ cd "$(git rev-parse --show-toplevel)"
15
+ if ! git diff --cached --exit-code > /dev/null; then
16
+ echo "\033[0;31mError:\033[0m there are uncommitted changes" >&2
17
+ exit 1
18
+ fi
19
+ git clean -fxd
20
+ PROJECT_DIR="$(pwd)"
21
+ TEMP_DIR="$(mktemp -d)"
22
+ trap 'rm -rf "$TEMP_DIR"' EXIT
23
+ echo "TEMP_DIR $TEMP_DIR"
24
+ cd "$TEMP_DIR"
25
+ cookiecutter "$@"
26
+ COOKIECUTTER_DIR="$TEMP_DIR/$(ls "$TEMP_DIR")"
27
+ if [ -d "$TEMP_DIR/multiplatform.one" ]; then
28
+ MULTIPLATFORM_DIR="$TEMP_DIR/multiplatform_one"
29
+ else
30
+ MULTIPLATFORM_DIR="$TEMP_DIR/multiplatform.one"
31
+ fi
32
+ git clone "$MULTIPLATFORM_REMOTE" "$MULTIPLATFORM_DIR"
33
+ cd "$COOKIECUTTER_DIR"
34
+ rm -rf .git
35
+ mv "$MULTIPLATFORM_DIR/.git" .git
36
+ git add .
37
+ git commit -m "Updated multiplatform.one"
38
+ cd "$PROJECT_DIR"
39
+ INITIAL_COMMIT="$(git rev-parse HEAD)"
40
+ git remote add multiplatform.one "$COOKIECUTTER_DIR"
41
+ git fetch multiplatform.one
42
+ git merge --allow-unrelated-histories multiplatform.one/main || true
43
+ git remote remove multiplatform.one
44
+ if [ -f .updateignore ]; then
45
+ while IFS= read -r pattern; do
46
+ find . -name "$pattern" -exec git checkout "$INITIAL_COMMIT" -- '{}' +
47
+ done < .updateignore
48
+ fi
49
+ while IFS= read -r pattern; do
50
+ find . -name "$pattern" -exec git checkout "$INITIAL_COMMIT" -- '{}' +
51
+ done <<EOF
52
+ .mkpm/cache.tar.gz
53
+ platforms/storybook/.lostpixel/baseline
54
+ pnpm-lock.yaml
55
+ EOF
56
+ pnpm install