@tricoteuses/assemblee 3.1.0 → 3.1.1

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/datasets.d.ts CHANGED
@@ -16,8 +16,6 @@ export interface Datasets {
16
16
  dossiersLegislatifs: Dataset[];
17
17
  scrutins: Dataset[];
18
18
  questions: Dataset[];
19
- comptesRendusSeances: Dataset[];
20
- comptesRendusCommissions: Dataset[];
21
19
  comptesRendus: Dataset[];
22
20
  }
23
21
  export declare enum DatasetStructure {
@@ -33,10 +31,8 @@ export declare enum EnabledDatasets {
33
31
  Photos = 16,
34
32
  Scrutins = 32,
35
33
  Questions = 64,
36
- ComptesRendusSeances = 128,
37
- ComptesRendusCommissions = 256,
38
- ComptesRendus = 512,
39
- All = 1023
34
+ ComptesRendus = 128,
35
+ All = 255
40
36
  }
41
37
  export declare function getDatasets(): string[];
42
38
  export declare function validDataset(dir: string[]): boolean;
package/lib/git.js CHANGED
@@ -1,150 +1,135 @@
1
- import e from "fs-extra";
2
- import t from "node:path";
3
- import { execSync as n } from "node:child_process";
4
- //#region src/git.ts
5
- var r = 50 * 1024 * 1024;
6
- function i(r) {
7
- e.existsSync(t.join(r, ".git")) || (e.ensureDirSync(r), n("git init", {
8
- cwd: r,
9
- env: process.env,
10
- encoding: "utf-8",
11
- stdio: [
12
- "ignore",
13
- "ignore",
14
- "pipe"
15
- ]
16
- }));
1
+ import { execSync as i } from "node:child_process";
2
+ import d from "fs-extra";
3
+ import a from "node:path";
4
+ const f = 50 * 1024 * 1024;
5
+ function m(t) {
6
+ d.existsSync(a.join(t, ".git")) || (d.ensureDirSync(t), i("git init", {
7
+ cwd: t,
8
+ env: process.env,
9
+ encoding: "utf-8",
10
+ stdio: ["ignore", "ignore", "pipe"]
11
+ }));
17
12
  }
18
- function a(e, t) {
19
- i(e), n("git add .", {
20
- cwd: e,
21
- env: process.env,
22
- encoding: "utf-8",
23
- stdio: [
24
- "ignore",
25
- "ignore",
26
- "pipe"
27
- ],
28
- maxBuffer: r
29
- });
30
- try {
31
- return n(`git commit -m "${t}" --quiet`, {
32
- cwd: e,
33
- env: process.env,
34
- encoding: "utf-8",
35
- stdio: [
36
- "ignore",
37
- "pipe",
38
- "pipe"
39
- ]
40
- }), !0;
41
- } catch (e) {
42
- let t = e;
43
- if (t.stdout === null || !/nothing to commit|rien à valider/.test(String(t.stdout ?? ""))) throw console.error(t.output), e;
44
- return !1;
45
- }
13
+ function h(t, n) {
14
+ m(t), i("git add .", {
15
+ cwd: t,
16
+ env: process.env,
17
+ encoding: "utf-8",
18
+ stdio: ["ignore", "ignore", "pipe"],
19
+ maxBuffer: f
20
+ });
21
+ try {
22
+ return i(`git commit -m "${n}" --quiet`, {
23
+ cwd: t,
24
+ env: process.env,
25
+ encoding: "utf-8",
26
+ stdio: ["ignore", "pipe", "pipe"]
27
+ }), !0;
28
+ } catch (o) {
29
+ const e = o;
30
+ if (e.stdout === null || !/nothing to commit|rien à valider/.test(String(e.stdout ?? "")))
31
+ throw console.error(e.output), o;
32
+ return !1;
33
+ }
46
34
  }
47
- function o(e, t, r) {
48
- let i = 0;
49
- if (a(e, t)) for (let t of r || []) try {
50
- n(`git push ${t} master`, {
51
- cwd: e,
52
- env: process.env,
53
- encoding: "utf-8",
54
- stdio: [
55
- "ignore",
56
- "ignore",
57
- "pipe"
58
- ]
59
- });
60
- } catch (e) {
61
- let t = e;
62
- console.error(t.output), i = t.status ?? 1;
63
- }
64
- else i = 10;
65
- return i;
35
+ function x(t, n, o) {
36
+ let e = 0;
37
+ if (h(t, n))
38
+ for (const c of o || [])
39
+ try {
40
+ i(`git push ${c} master`, {
41
+ cwd: t,
42
+ env: process.env,
43
+ encoding: "utf-8",
44
+ stdio: ["ignore", "ignore", "pipe"]
45
+ });
46
+ } catch (r) {
47
+ const s = r;
48
+ console.error(s.output), e = s.status ?? 1;
49
+ }
50
+ else
51
+ e = 10;
52
+ return e;
66
53
  }
67
- function s(e) {
68
- return n("git reset --hard origin/master", {
69
- cwd: e,
70
- env: process.env,
71
- encoding: "utf-8",
72
- stdio: [
73
- "ignore",
74
- "ignore",
75
- "pipe"
76
- ]
77
- }), n("git pull --rebase", {
78
- cwd: e,
79
- env: process.env,
80
- encoding: "utf-8",
81
- stdio: [
82
- "ignore",
83
- "ignore",
84
- "pipe"
85
- ]
86
- }), !0;
54
+ function P(t) {
55
+ return i("git reset --hard origin/master", {
56
+ cwd: t,
57
+ env: process.env,
58
+ encoding: "utf-8",
59
+ stdio: ["ignore", "ignore", "pipe"]
60
+ }), i("git pull --rebase", {
61
+ cwd: t,
62
+ env: process.env,
63
+ encoding: "utf-8",
64
+ stdio: ["ignore", "ignore", "pipe"]
65
+ }), !0;
87
66
  }
88
- function c(e, t, r) {
89
- e !== void 0 && n(`git clone ${e}/${t}.git`, {
90
- cwd: r,
91
- env: process.env,
92
- encoding: "utf-8",
93
- stdio: [
94
- "ignore",
95
- "ignore",
96
- "pipe"
97
- ]
98
- });
67
+ function A(t, n, o) {
68
+ t !== void 0 && i(`git clone ${t}/${n}.git`, {
69
+ cwd: o,
70
+ env: process.env,
71
+ encoding: "utf-8",
72
+ stdio: ["ignore", "ignore", "pipe"]
73
+ });
99
74
  }
100
- function l(e, t, i) {
101
- try {
102
- i && console.log(`git -C ${e} ${t}`);
103
- let a = n(`git ${t}`, {
104
- cwd: e,
105
- maxBuffer: r
106
- }).toString().trim();
107
- return i && console.log(a), a;
108
- } catch (e) {
109
- let t = e;
110
- for (let e of ["stdout", "stderr"]) console.error(`${e}: ${String(t[e] ?? "")}`);
111
- throw e;
112
- }
75
+ function $(t, n, o) {
76
+ try {
77
+ o && console.log(`git -C ${t} ${n}`);
78
+ const e = i(`git ${n}`, {
79
+ cwd: t,
80
+ maxBuffer: f
81
+ }).toString().trim();
82
+ return o && console.log(e), e;
83
+ } catch (e) {
84
+ const c = e;
85
+ for (const r of ["stdout", "stderr"])
86
+ console.error(`${r}: ${String(c[r] ?? "")}`);
87
+ throw e;
88
+ }
113
89
  }
114
- function u(e, t, i) {
115
- try {
116
- i && console.log(`git -C ${e} ${t}`);
117
- let a = n(`git ${t}`, {
118
- cwd: e,
119
- stdio: [
120
- "ignore",
121
- "pipe",
122
- "pipe"
123
- ],
124
- maxBuffer: r
125
- }).toString().trim();
126
- return i && console.log(a), !0;
127
- } catch (e) {
128
- if (e.status != 0) return !1;
129
- throw e;
130
- }
90
+ function F(t, n, o) {
91
+ try {
92
+ o && console.log(`git -C ${t} ${n}`);
93
+ const e = i(`git ${n}`, {
94
+ cwd: t,
95
+ stdio: ["ignore", "pipe", "pipe"],
96
+ maxBuffer: f
97
+ }).toString().trim();
98
+ return o && console.log(e), !0;
99
+ } catch (e) {
100
+ if (e.status != 0) return !1;
101
+ throw e;
102
+ }
131
103
  }
132
- function d(e, t, n = {}) {
133
- let { diffFilter: r } = n;
134
- try {
135
- let n = l(e, `diff --name-status --diff-filter=${r ?? "AMR"} ${t}`, !1), i = /* @__PURE__ */ new Map();
136
- for (let e of n.split("\n")) {
137
- if (e.trim().length === 0) continue;
138
- let t = e.split(" ");
139
- if (t.length >= 2) {
140
- let e = t[0].charAt(0), n = t[1];
141
- i.set(n, e);
142
- }
143
- }
144
- return i;
145
- } catch {
146
- return console.error(`Error getting changed files since commit ${t}`), /* @__PURE__ */ new Map();
147
- }
104
+ function B(t, n, o = {}) {
105
+ const { diffFilter: e } = o;
106
+ try {
107
+ const r = $(
108
+ t,
109
+ `diff --name-status --diff-filter=${e ?? "AMR"} ${n}`,
110
+ !1
111
+ ), s = /* @__PURE__ */ new Map();
112
+ for (const g of r.split(`
113
+ `)) {
114
+ if (g.trim().length === 0) continue;
115
+ const u = g.split(" ");
116
+ if (u.length >= 2) {
117
+ const l = u[0].charAt(0), p = u[1];
118
+ s.set(p, l);
119
+ }
120
+ }
121
+ return s;
122
+ } catch {
123
+ return console.error(`Error getting changed files since commit ${n}`), /* @__PURE__ */ new Map();
124
+ }
148
125
  }
149
- //#endregion
150
- export { c as clone, a as commit, o as commitAndPush, d as getChangedFilesSinceCommit, i as initRepo, s as resetAndPull, l as run, u as test };
126
+ export {
127
+ A as clone,
128
+ h as commit,
129
+ x as commitAndPush,
130
+ B as getChangedFilesSinceCommit,
131
+ m as initRepo,
132
+ P as resetAndPull,
133
+ $ as run,
134
+ F as test
135
+ };