@dougefresh/ci 0.1.11 → 0.1.14

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/dist/index.js DELETED
@@ -1,212 +0,0 @@
1
- import { PROMPT } from './ai.js';
2
- export var Arch;
3
- (function (Arch) {
4
- Arch["ARM64"] = "vars.RUNNER_ARM64";
5
- Arch["AMD64"] = "vars.RUNNER_AMD64";
6
- Arch["WIN"] = "vars.RUNNER_WIN";
7
- Arch["MAC"] = "vars.RUNNER_MAC";
8
- })(Arch || (Arch = {}));
9
- export const JobDefaults = {
10
- fmt: {
11
- if: true,
12
- continueOnError: false,
13
- run: 'cargo +nightly fmt --check --all',
14
- },
15
- semver: {
16
- if: true,
17
- continueOnError: false,
18
- },
19
- hack: {
20
- if: true,
21
- continueOnError: false,
22
- run: 'cargo hack --feature-powerset check',
23
- },
24
- docCheck: {
25
- if: true,
26
- continueOnError: false,
27
- run: 'cargo +nightly docs-rs',
28
- },
29
- cargoSort: {
30
- if: true,
31
- continueOnError: false,
32
- run: 'if [ -f ./scripts/cargo-sort.sh ]; then\n ./scripts/cargo-sort.sh\nelse\n cargo sort -c -g\nfi\n',
33
- },
34
- dependencies: {
35
- if: true,
36
- continueOnError: false,
37
- run: 'cargo machete --with-metadata',
38
- },
39
- sanitizers: {
40
- enabled: true,
41
- address: {
42
- if: true,
43
- continueOnError: false,
44
- run: 'cargo test --lib --tests --no-fail-fast --target x86_64-unknown-linux-gnu -- --no-capture',
45
- },
46
- leak: {
47
- if: true,
48
- continueOnError: false,
49
- run: 'cargo test --target x86_64-unknown-linux-gnu -- --no-capture',
50
- },
51
- thread: {
52
- if: false,
53
- continueOnError: false,
54
- run: 'cargo test --target x86_64-unknown-linux-gnu -- --test-threads=1',
55
- },
56
- },
57
- coverage: {
58
- if: true,
59
- continueOnError: false,
60
- matrix: {
61
- os: [Arch.ARM64],
62
- toolchains: ['stable'],
63
- features: ['default'],
64
- },
65
- run: `
66
- cmd="cargo llvm-cov \${LLVM_ARGS} --locked --lcov --output-path lcov-\${FEATURES}.info --no-fail-fast"
67
- if [ "$FEATURES" == "default" ]; then
68
- $cmd -- --no-capture $CARGO_ARGS
69
- else
70
- $cmd --features "$FEATURES" -- --no-capture $CARGO_ARGS
71
- fi
72
- `,
73
- },
74
- clippy: {
75
- if: true,
76
- continueOnError: false,
77
- run: '',
78
- flags: '',
79
- matrix: {
80
- os: [Arch.ARM64],
81
- toolchains: ['stable'],
82
- features: ['default'],
83
- },
84
- },
85
- extra: {
86
- if: false,
87
- continueOnError: false,
88
- run: '',
89
- name: 'extra',
90
- matrix: {
91
- os: [Arch.ARM64],
92
- toolchains: ['stable'],
93
- features: ['default'],
94
- },
95
- },
96
- };
97
- export class RustWorkflow {
98
- jobs;
99
- global;
100
- release;
101
- ai;
102
- constructor() {
103
- this.jobs = {
104
- fmt: JobDefaults.fmt,
105
- docCheck: JobDefaults.docCheck,
106
- semver: JobDefaults.semver,
107
- dependencies: JobDefaults.dependencies,
108
- hack: JobDefaults.hack,
109
- cargoSort: JobDefaults.cargoSort,
110
- sanitizers: JobDefaults.sanitizers,
111
- clippy: JobDefaults.clippy,
112
- coverage: JobDefaults.coverage,
113
- extra: JobDefaults.extra,
114
- };
115
- this.global = { packages: {} };
116
- this.release = {
117
- publish: true,
118
- bin: false,
119
- debian: false,
120
- profile: 'release',
121
- os: [Arch.AMD64],
122
- };
123
- this.ai = {
124
- prompt: PROMPT,
125
- additional: '',
126
- enabled: true,
127
- track_progress: true,
128
- allowed_bots: '*',
129
- claude_args: ' --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(find),Bash(diff),Bash(jq),Bash(git),Bash(cargo),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)"',
130
- use_sticky_comment: false,
131
- };
132
- }
133
- linuxPackages(packages) {
134
- this.global.packages.Linux = packages.join(',');
135
- return this;
136
- }
137
- semver(enable) {
138
- this.jobs.semver.if = enable;
139
- return this;
140
- }
141
- extra(name, run) {
142
- this.jobs.extra.if = true;
143
- this.jobs.extra.name = name;
144
- this.jobs.extra.run = run;
145
- return this;
146
- }
147
- withRelease(r) {
148
- this.release = r;
149
- return this;
150
- }
151
- clippy(opts) {
152
- if (opts?.flags)
153
- this.jobs.clippy.flags = opts.flags;
154
- if (opts?.run)
155
- this.jobs.clippy.run = opts.run;
156
- if (opts?.if !== undefined)
157
- this.jobs.clippy.if = opts.if;
158
- if (opts?.continueOnError !== undefined)
159
- this.jobs.clippy.continueOnError = opts.continueOnError;
160
- if (opts?.matrix) {
161
- if (opts.matrix.toolchains)
162
- this.jobs.clippy.matrix.toolchains = opts.matrix.toolchains;
163
- if (opts.matrix.features)
164
- this.jobs.clippy.matrix.features = opts.matrix.features;
165
- if (opts.matrix.os)
166
- this.jobs.clippy.matrix.os = opts.matrix.os;
167
- }
168
- return this;
169
- }
170
- disableSanitizers() {
171
- this.jobs.sanitizers.enabled = false;
172
- return this;
173
- }
174
- disableAi() {
175
- this.ai.enabled = false;
176
- return this;
177
- }
178
- additionalPrompt(prompt) {
179
- this.ai.additional = prompt;
180
- return this;
181
- }
182
- build() {
183
- // os:
184
- // - target: aarch64-unknown-linux-gnu
185
- // os: ubicloud-standard-8-arm
186
- // - target: x86_64-unknown-linux-gnu
187
- // os: ubicloud-standard-4
188
- // - target: aarch64-apple-darwin
189
- // os: macos-latest
190
- // # - target: x86_64-pc-windows-msvc
191
- // # os: windows-latest
192
- return {
193
- ai: this.ai,
194
- release: {
195
- bin: this.release.bin,
196
- publish: this.release.publish,
197
- debian: this.release.debian,
198
- profile: this.release.profile,
199
- matrix: {
200
- os: [Arch.AMD64],
201
- target: ['x86_64-unknown-linux-gnu'],
202
- },
203
- },
204
- global: this.global,
205
- jobs: this.jobs,
206
- };
207
- }
208
- }
209
- export function createRustWorkflow() {
210
- return new RustWorkflow();
211
- }
212
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sour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AAC;IAED,KAAK;QACH,QAAQ;QACR,0CAA0C;QAC1C,oCAAoC;QACpC,yCAAyC;QACzC,gCAAgC;QAChC,qCAAqC;QACrC,yBAAyB;QACzB,wCAAwC;QACxC,4BAA4B;QAC5B,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,OAAO,EAAE;gBACP,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG;gBACrB,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO;gBAC7B,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;gBAC3B,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO;gBAC7B,MAAM,EAAE;oBACN,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC;oBAChB,MAAM,EAAE,CAAC,0BAA0B,CAAC;iBACrC;aACF;YACD,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC;IACJ,CAAC;CACF;AAED,MAAM,UAAU,kBAAkB;IAChC,OAAO,IAAI,YAAY,EAAE,CAAC;AAC5B,CAAC"}
package/src/ai.ts DELETED
@@ -1,61 +0,0 @@
1
- export interface AiJob {
2
- enabled: boolean;
3
- allowed_bots: string;
4
- claude_args: string;
5
- use_sticky_comment: boolean;
6
- track_progress: boolean;
7
- prompt: string;
8
- additional: string;
9
- }
10
-
11
- export const PROMPT = `
12
- Perform a comprehensive code review with the following focus areas:
13
- Provide detailed feedback using inline comments for ONLY issues, no praise inline comments.
14
- Use top-level comments for general observations or praise
15
- Do not be shy, I am a big boy and can handle criticism gracefully. I welcome feedback and suggestions.
16
-
17
-
18
- ## Rust tooling
19
-
20
- You should have access to cargo cli. You can use this to verify the build yourself, or use it to run tests (or a specific test)
21
- If you encounter an error running cargo, please comment on this PR. If you desire more rust tools, such as rust-analyzer, or any cargo plugin to help review then please notify on pull request
22
-
23
-
24
- ## Permissions
25
-
26
- If you are denied access to a tool, shell command, or github API resource (via gh cli) then notify the pull request author that you would like access to that tool.
27
- As an example, we use CodeCov to our test coverage, if you like to have access to historical data, we can provide you with the CodeCov CLI tool and access.
28
- In general, if you need something, just ask.
29
-
30
-
31
- Review this PR against our team checklist:
32
-
33
- ## Code Quality
34
- - [ ] Code follows our style guide
35
- - [ ] No commented-out code
36
- - [ ] Meaningful variable names
37
- - [ ] DRY principle followed
38
-
39
- ## Testing
40
- - [ ] Unit tests for new functions
41
- - [ ] Integration tests for new endpoints
42
- - [ ] Edge cases covered
43
- - [ ] Test coverage > 80%
44
-
45
- ## Documentation
46
- - [ ] README updated if needed
47
- - [ ] API docs updated
48
- - [ ] Inline comments for complex logic
49
- - [ ] CHANGELOG.md updated
50
-
51
- ## Security
52
- - [ ] No hardcoded credentials
53
- - [ ] Input validation implemented
54
- - [ ] Proper error handling
55
- - [ ] No sensitive data in logs
56
-
57
- For each item, check if it is satisfied and comment on any that need attention.
58
- Post a summary comment with checklist results.
59
-
60
-
61
- `;