@multiplatform.one/cli 1.0.25 → 1.0.27
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/lib/bin/multiplatformOne.mjs +2 -2
- package/package.json +4 -4
- package/scripts/init.sh +3 -0
- package/scripts/update.sh +47 -0
- package/src/bin/multiplatformOne.ts +3 -3
|
@@ -6,7 +6,7 @@ import { program } from "commander";
|
|
|
6
6
|
program.name("multiplatform.one");
|
|
7
7
|
program.command("init").argument("[remote]", "the remote to use", "https://gitlab.com/bitspur/multiplatform.one/cookiecutter").description("init multiplatform.one").action(async (remote) => {
|
|
8
8
|
await execa("sh", [
|
|
9
|
-
path.resolve(path.dirname(fileURLToPath(import.meta.url)), "
|
|
9
|
+
path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../../scripts/init.sh"),
|
|
10
10
|
remote
|
|
11
11
|
], {
|
|
12
12
|
stdio: "inherit"
|
|
@@ -14,7 +14,7 @@ program.command("init").argument("[remote]", "the remote to use", "https://gitla
|
|
|
14
14
|
});
|
|
15
15
|
program.command("update").argument("[remote]", "the remote to use", "https://gitlab.com/bitspur/multiplatform.one/cookiecutter").description("update multiplatform.one").action(async (remote) => {
|
|
16
16
|
await execa("sh", [
|
|
17
|
-
path.resolve(path.dirname(fileURLToPath(import.meta.url)), "
|
|
17
|
+
path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../../scripts/update.sh"),
|
|
18
18
|
remote
|
|
19
19
|
], {
|
|
20
20
|
stdio: "inherit"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@multiplatform.one/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.27",
|
|
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
|
-
"
|
|
33
|
-
"
|
|
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.
|
|
54
|
+
"@multiplatform.one/utils": "^0.0.12"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"commander": "^9.5.0",
|
package/scripts/init.sh
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
|
|
3
|
+
set -e
|
|
4
|
+
|
|
5
|
+
if ! (cat app/package.json | grep -q multiplatform.one); then
|
|
6
|
+
echo "\033[0;31mError:\033[0m not a multiplatform.one project" >&2
|
|
7
|
+
exit 1
|
|
8
|
+
fi
|
|
9
|
+
if ! git rev-parse --is-inside-work-tree > /dev/null 2>&1; then
|
|
10
|
+
echo "\033[0;31mError:\033[0m not inside a git repository" >&2
|
|
11
|
+
exit 1
|
|
12
|
+
fi
|
|
13
|
+
cd "$(git rev-parse --show-toplevel)"
|
|
14
|
+
if ! git diff --cached --exit-code > /dev/null; then
|
|
15
|
+
echo "\033[0;31mError:\033[0m there are uncommitted changes" >&2
|
|
16
|
+
exit 1
|
|
17
|
+
fi
|
|
18
|
+
git clean -fxd
|
|
19
|
+
PROJECT_DIR="$(pwd)"
|
|
20
|
+
TEMP_DIR="$(mktemp -d)"
|
|
21
|
+
trap 'rm -rf "$TEMP_DIR"' EXIT
|
|
22
|
+
echo "TEMP_DIR $TEMP_DIR"
|
|
23
|
+
cd "$TEMP_DIR"
|
|
24
|
+
cookiecutter "$@"
|
|
25
|
+
COOKIECUTTER_DIR="$TEMP_DIR/$(ls "$TEMP_DIR")"
|
|
26
|
+
cd "$COOKIECUTTER_DIR"
|
|
27
|
+
git add .
|
|
28
|
+
git commit -m "Updated multiplatform.one"
|
|
29
|
+
cd "$PROJECT_DIR"
|
|
30
|
+
INITIAL_COMMIT="$(git rev-parse HEAD)"
|
|
31
|
+
git remote add multiplatform.one "$COOKIECUTTER_DIR"
|
|
32
|
+
git fetch multiplatform.one
|
|
33
|
+
git merge --allow-unrelated-histories multiplatform.one/main || true
|
|
34
|
+
git remote remove multiplatform.one
|
|
35
|
+
if [ -f .updateignore ]; then
|
|
36
|
+
while IFS= read -r pattern; do
|
|
37
|
+
find . -name "$pattern" -exec git checkout "$INITIAL_COMMIT" -- '{}' +
|
|
38
|
+
done < .updateignore
|
|
39
|
+
fi
|
|
40
|
+
while IFS= read -r pattern; do
|
|
41
|
+
find . -name "$pattern" -exec git checkout "$INITIAL_COMMIT" -- '{}' +
|
|
42
|
+
done <<EOF
|
|
43
|
+
.mkpm/cache.tar.gz
|
|
44
|
+
platforms/storybook/.lostpixel/baseline
|
|
45
|
+
pnpm-lock.yaml
|
|
46
|
+
EOF
|
|
47
|
+
pnpm install
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* File: /src/multiplatformOne.ts
|
|
2
|
+
* File: /src/bin/multiplatformOne.ts
|
|
3
3
|
* Project: @multiplatform.one/cli
|
|
4
4
|
* File Created: 22-06-2024 14:17:12
|
|
5
5
|
* Author: Clay Risser
|
|
@@ -31,7 +31,7 @@ program
|
|
|
31
31
|
.argument('[remote]', 'the remote to use', 'https://gitlab.com/bitspur/multiplatform.one/cookiecutter')
|
|
32
32
|
.description('init multiplatform.one')
|
|
33
33
|
.action(async (remote) => {
|
|
34
|
-
await execa('sh', [path.resolve(path.dirname(fileURLToPath(import.meta.url)), '
|
|
34
|
+
await execa('sh', [path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../scripts/init.sh'), remote], {
|
|
35
35
|
stdio: 'inherit',
|
|
36
36
|
});
|
|
37
37
|
});
|
|
@@ -41,7 +41,7 @@ program
|
|
|
41
41
|
.argument('[remote]', 'the remote to use', 'https://gitlab.com/bitspur/multiplatform.one/cookiecutter')
|
|
42
42
|
.description('update multiplatform.one')
|
|
43
43
|
.action(async (remote) => {
|
|
44
|
-
await execa('sh', [path.resolve(path.dirname(fileURLToPath(import.meta.url)), '
|
|
44
|
+
await execa('sh', [path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../scripts/update.sh'), remote], {
|
|
45
45
|
stdio: 'inherit',
|
|
46
46
|
});
|
|
47
47
|
});
|