@ggdna/dna-scripts 0.4.0 → 0.5.0
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/README.md +8 -2
- package/dna/_dna.json +4 -0
- package/dna/_generated.json +21 -10
- package/dna/doc/de/guides/scripts-guide.md +27 -0
- package/dna/doc/{guides → en/guides}/scripts-guide.md +2 -2
- package/dna/doc/fa/guides/scripts-guide.md +27 -0
- package/dna/dot-claude/skills/scripts/SKILL.md +5 -5
- package/dna/dot-pubignore +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,9 +5,15 @@ deterministic given local git and file system state, no GitHub API calls.
|
|
|
5
5
|
|
|
6
6
|
## Guides
|
|
7
7
|
|
|
8
|
-
- `dna/doc/guides/scripts-guide.md` — what belongs here, what does not,
|
|
8
|
+
- `dna/doc/en/guides/scripts-guide.md` — what belongs here, what does not,
|
|
9
9
|
and how to add a script
|
|
10
10
|
|
|
11
|
+
Every file of `dna/doc/en/` also ships in German and Farsi, with the
|
|
12
|
+
same name:
|
|
13
|
+
|
|
14
|
+
- `dna/doc/de/guides/`
|
|
15
|
+
- `dna/doc/fa/guides/`
|
|
16
|
+
|
|
11
17
|
## Skills
|
|
12
18
|
|
|
13
19
|
- `/scripts` — checks every script parses, every import resolves, and
|
|
@@ -42,7 +48,7 @@ deterministic given local git and file system state, no GitHub API calls.
|
|
|
42
48
|
|
|
43
49
|
## Publishing
|
|
44
50
|
|
|
45
|
-
`dna/dot-pubignore` keeps `/doc
|
|
51
|
+
`dna/dot-pubignore` keeps `/doc/*/guides/` and `/scripts/` out of the package
|
|
46
52
|
`dart pub publish` uploads. helix joins it with the ignore files of the other
|
|
47
53
|
layers into the project's `.pubignore`.
|
|
48
54
|
|
package/dna/_dna.json
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
// last layer of its own instantiation.
|
|
4
4
|
"version": 2,
|
|
5
5
|
|
|
6
|
+
// Published as a DNA layer: helix requires a tag on every section of
|
|
7
|
+
// dna/ markdown, so the layers above can override each one.
|
|
8
|
+
"isLayer": true,
|
|
9
|
+
|
|
6
10
|
// No parent DNA. This layer is orthogonal: it carries only its own topic
|
|
7
11
|
// and is combined with other layers by the consumer.
|
|
8
12
|
"layers": [],
|
package/dna/_generated.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"name": "base",
|
|
6
6
|
"package": "helix",
|
|
7
7
|
"ecosystem": null,
|
|
8
|
-
"resolvedVersion": "1.
|
|
8
|
+
"resolvedVersion": "1.18.0",
|
|
9
9
|
"via": null,
|
|
10
10
|
"hash": "0x6883da335b415f9d"
|
|
11
11
|
},
|
|
@@ -15,28 +15,39 @@
|
|
|
15
15
|
"ecosystem": null,
|
|
16
16
|
"resolvedVersion": null,
|
|
17
17
|
"via": null,
|
|
18
|
-
"hash": "
|
|
18
|
+
"hash": "0x9463bfb42bfd4adf"
|
|
19
19
|
}
|
|
20
20
|
],
|
|
21
21
|
"claude": {
|
|
22
22
|
"claudeMdInclude": null,
|
|
23
|
-
"claudeMdFromDna": false
|
|
23
|
+
"claudeMdFromDna": false,
|
|
24
|
+
"blockHash": null
|
|
24
25
|
},
|
|
25
|
-
"baseVersion": "1.
|
|
26
|
+
"baseVersion": "1.18.0",
|
|
26
27
|
"baseHash": "0x6883da335b415f9d",
|
|
28
|
+
"configHash": "0xb4650cce9f80108f",
|
|
29
|
+
"gitignoreHash": "0x1b0ee74d5e941279",
|
|
27
30
|
"instances": [
|
|
28
31
|
{
|
|
29
32
|
"path": ".claude/skills/scripts/SKILL.md",
|
|
30
|
-
"hash": "
|
|
33
|
+
"hash": "0xafadcde5bcc41ba1"
|
|
31
34
|
},
|
|
32
35
|
{
|
|
33
36
|
"path": ".pubignore",
|
|
34
|
-
"hash": "
|
|
37
|
+
"hash": "0x81aaee5cc06c02bc"
|
|
35
38
|
},
|
|
36
39
|
{
|
|
37
|
-
"path": "doc/guides/scripts-guide.md",
|
|
40
|
+
"path": "doc/de/guides/scripts-guide.md",
|
|
41
|
+
"hash": "0x383c9cd12612f284"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"path": "doc/en/guides/scripts-guide.md",
|
|
38
45
|
"hash": "0x426857c389049083"
|
|
39
46
|
},
|
|
47
|
+
{
|
|
48
|
+
"path": "doc/fa/guides/scripts-guide.md",
|
|
49
|
+
"hash": "0xf3ae7d988f157168"
|
|
50
|
+
},
|
|
40
51
|
{
|
|
41
52
|
"path": "scripts/delete-feature-branch.js",
|
|
42
53
|
"hash": "0x219ac0a3635ee644"
|
|
@@ -47,7 +58,7 @@
|
|
|
47
58
|
},
|
|
48
59
|
{
|
|
49
60
|
"path": "scripts/functions/current-branch.js",
|
|
50
|
-
"hash": "
|
|
61
|
+
"hash": "0x6610874731cac4e8"
|
|
51
62
|
},
|
|
52
63
|
{
|
|
53
64
|
"path": "scripts/functions/directories.js",
|
|
@@ -67,11 +78,11 @@
|
|
|
67
78
|
},
|
|
68
79
|
{
|
|
69
80
|
"path": "scripts/functions/is-main-up-to-date.js",
|
|
70
|
-
"hash": "
|
|
81
|
+
"hash": "0x305e8c2e6acee6d6"
|
|
71
82
|
},
|
|
72
83
|
{
|
|
73
84
|
"path": "scripts/functions/pull-request-url.js",
|
|
74
|
-
"hash": "
|
|
85
|
+
"hash": "0xf6afe906fbd542f1"
|
|
75
86
|
},
|
|
76
87
|
{
|
|
77
88
|
"path": "scripts/functions/run-command.js",
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@license
|
|
3
|
+
Copyright (c) dnaCopyrightHolder
|
|
4
|
+
|
|
5
|
+
Use of this source code is governed by terms that can be
|
|
6
|
+
found in the LICENSE file in the root of this package.
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
# Skript-Leitfaden
|
|
10
|
+
|
|
11
|
+
Die Node-Skripte, mit denen ein Repo seinen Arbeitsablauf automatisiert, und
|
|
12
|
+
die Funktionen, die sie teilen — vom Lesen des lokalen git-Zustands bis zum
|
|
13
|
+
Aufruf der GitHub-API.
|
|
14
|
+
|
|
15
|
+
## @function Eine Funktion nutzen, statt einen Befehl zu wiederholen <a id="use-a-function-instead-of-repeating-a-command"></a>
|
|
16
|
+
|
|
17
|
+
- Importiere aus `dna/scripts/functions/`, dupliziere nie einen `git`-,
|
|
18
|
+
`gh`- oder Dateisystem-Aufruf über mehrere Skripte hinweg
|
|
19
|
+
- Halte eine Funktion wo möglich rein: gleiche Eingabe, gleiche Ausgabe,
|
|
20
|
+
keine Konsolenausgabe
|
|
21
|
+
|
|
22
|
+
## @script Ein Skript hinzufügen <a id="add-a-script"></a>
|
|
23
|
+
|
|
24
|
+
- Lege es in `dna/scripts/` ab, seine gemeinsam genutzten Teile in
|
|
25
|
+
`dna/scripts/functions/`
|
|
26
|
+
- Gib ihm den Lizenz-Header, den jede Datei hier trägt
|
|
27
|
+
- Rufe es aus einem Leitfaden der Schicht auf, die es braucht
|
|
@@ -11,14 +11,14 @@ found in the LICENSE file in the root of this package.
|
|
|
11
11
|
The node scripts a repo automates its workflow with, and the functions they
|
|
12
12
|
share — from reading local git state to calling the GitHub API.
|
|
13
13
|
|
|
14
|
-
## Use a function instead of repeating a command
|
|
14
|
+
## @function Use a function instead of repeating a command
|
|
15
15
|
|
|
16
16
|
- Import from `dna/scripts/functions/`, never duplicate a `git`, `gh` or
|
|
17
17
|
file system call across scripts
|
|
18
18
|
- Keep a function pure where possible: same input, same output, no
|
|
19
19
|
printing
|
|
20
20
|
|
|
21
|
-
## Add a script
|
|
21
|
+
## @script Add a script
|
|
22
22
|
|
|
23
23
|
- Put it in `dna/scripts/`, its shared parts in `dna/scripts/functions/`
|
|
24
24
|
- Give it the license header every file here carries
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@license
|
|
3
|
+
Copyright (c) dnaCopyrightHolder
|
|
4
|
+
|
|
5
|
+
Use of this source code is governed by terms that can be
|
|
6
|
+
found in the LICENSE file in the root of this package.
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
# راهنمای اسکریپتها
|
|
10
|
+
|
|
11
|
+
اسکریپتهای node که یک مخزن گردش کار خود را با آنها خودکار میکند، و
|
|
12
|
+
توابعی که میان آنها مشترک است — از خواندن وضعیت محلی git تا فراخوانی
|
|
13
|
+
GitHub API.
|
|
14
|
+
|
|
15
|
+
## @function به جای تکرار یک فرمان از یک تابع استفاده کنید <a id="use-a-function-instead-of-repeating-a-command"></a>
|
|
16
|
+
|
|
17
|
+
- از `dna/scripts/functions/` وارد (import) کنید؛ هرگز یک فراخوانی `git`،
|
|
18
|
+
`gh` یا سیستم فایل را در چند اسکریپت تکرار نکنید
|
|
19
|
+
- تا جای ممکن تابع را خالص (pure) نگه دارید: ورودی یکسان، خروجی یکسان،
|
|
20
|
+
بدون چاپ کردن
|
|
21
|
+
|
|
22
|
+
## @script افزودن یک اسکریپت <a id="add-a-script"></a>
|
|
23
|
+
|
|
24
|
+
- آن را در `dna/scripts/` قرار دهید و بخشهای مشترکش را در
|
|
25
|
+
`dna/scripts/functions/`
|
|
26
|
+
- سرآیند مجوز (license header) را که همهی فایلهای اینجا دارند به آن بدهید
|
|
27
|
+
- آن را از راهنمای لایهای که به آن نیاز دارد فراخوانی کنید
|
|
@@ -13,26 +13,26 @@ found in the LICENSE file in the root of this package.
|
|
|
13
13
|
|
|
14
14
|
# Scripts
|
|
15
15
|
|
|
16
|
-
Read `doc/guides/scripts-guide.md` and follow it.
|
|
16
|
+
Read `doc/en/guides/scripts-guide.md` and follow it.
|
|
17
17
|
|
|
18
|
-
## 1. Check every script parses
|
|
18
|
+
## @script 1. Check every script parses
|
|
19
19
|
|
|
20
20
|
Run `node --check` on each file in `scripts/` and `scripts/functions/`.
|
|
21
21
|
|
|
22
22
|
Report any file that fails.
|
|
23
23
|
|
|
24
|
-
## 2. Check the imports resolve
|
|
24
|
+
## @imports 2. Check the imports resolve
|
|
25
25
|
|
|
26
26
|
For each `import … from './functions/…'`, verify the target file exists
|
|
27
27
|
and exports the named symbol.
|
|
28
28
|
|
|
29
29
|
Report an import that resolves to nothing.
|
|
30
30
|
|
|
31
|
-
## 3. Check for duplication
|
|
31
|
+
## @duplication 3. Check for duplication
|
|
32
32
|
|
|
33
33
|
Report a `git`, `fs` or `child_process` call that is copied across two
|
|
34
34
|
scripts instead of living in one shared function.
|
|
35
35
|
|
|
36
|
-
## 4. Fix
|
|
36
|
+
## @fix 4. Fix
|
|
37
37
|
|
|
38
38
|
Write the corrections, then show the diff before committing.
|
package/dna/dot-pubignore
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/doc
|
|
1
|
+
/doc/*/guides/
|
|
2
2
|
/scripts/
|