@ingestron/cli 0.0.0-stage → 1.0.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/LICENSE +202 -0
- package/NOTICE +4 -0
- package/README.md +44 -2
- package/dist/args.d.ts +105 -0
- package/dist/args.d.ts.map +1 -0
- package/dist/args.js +161 -0
- package/dist/args.js.map +1 -0
- package/dist/ask.d.ts +5 -0
- package/dist/ask.d.ts.map +1 -0
- package/dist/ask.js +17 -0
- package/dist/ask.js.map +1 -0
- package/dist/compare.d.ts +13 -0
- package/dist/compare.d.ts.map +1 -0
- package/dist/compare.js +90 -0
- package/dist/compare.js.map +1 -0
- package/dist/environments.d.ts +6 -0
- package/dist/environments.d.ts.map +1 -0
- package/dist/environments.js +25 -0
- package/dist/environments.js.map +1 -0
- package/dist/generate.d.ts +16 -0
- package/dist/generate.d.ts.map +1 -0
- package/dist/generate.js +118 -0
- package/dist/generate.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +46 -0
- package/dist/index.js.map +1 -0
- package/dist/init-choice.d.ts +10 -0
- package/dist/init-choice.d.ts.map +1 -0
- package/dist/init-choice.js +36 -0
- package/dist/init-choice.js.map +1 -0
- package/dist/init-preflight.d.ts +4 -0
- package/dist/init-preflight.d.ts.map +1 -0
- package/dist/init-preflight.js +18 -0
- package/dist/init-preflight.js.map +1 -0
- package/dist/init.d.ts +5 -0
- package/dist/init.d.ts.map +1 -0
- package/dist/init.js +136 -0
- package/dist/init.js.map +1 -0
- package/dist/io.d.ts +8 -0
- package/dist/io.d.ts.map +1 -0
- package/dist/io.js +3 -0
- package/dist/io.js.map +1 -0
- package/dist/main.d.ts +3 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +11 -0
- package/dist/main.js.map +1 -0
- package/dist/outputs.d.ts +12 -0
- package/dist/outputs.d.ts.map +1 -0
- package/dist/outputs.js +53 -0
- package/dist/outputs.js.map +1 -0
- package/dist/packs.d.ts +4 -0
- package/dist/packs.d.ts.map +1 -0
- package/dist/packs.js +5 -0
- package/dist/packs.js.map +1 -0
- package/dist/project-choices.d.ts +27 -0
- package/dist/project-choices.d.ts.map +1 -0
- package/dist/project-choices.js +44 -0
- package/dist/project-choices.js.map +1 -0
- package/dist/project-questions.d.ts +5 -0
- package/dist/project-questions.d.ts.map +1 -0
- package/dist/project-questions.js +43 -0
- package/dist/project-questions.js.map +1 -0
- package/dist/project-recipes.d.ts +14 -0
- package/dist/project-recipes.d.ts.map +1 -0
- package/dist/project-recipes.js +115 -0
- package/dist/project-recipes.js.map +1 -0
- package/dist/request.d.ts +13 -0
- package/dist/request.d.ts.map +1 -0
- package/dist/request.js +110 -0
- package/dist/request.js.map +1 -0
- package/dist/sample-contract.d.ts +11 -0
- package/dist/sample-contract.d.ts.map +1 -0
- package/dist/sample-contract.js +91 -0
- package/dist/sample-contract.js.map +1 -0
- package/dist/sample-read.d.ts +8 -0
- package/dist/sample-read.d.ts.map +1 -0
- package/dist/sample-read.js +89 -0
- package/dist/sample-read.js.map +1 -0
- package/dist/samples.d.ts +33 -0
- package/dist/samples.d.ts.map +1 -0
- package/dist/samples.js +108 -0
- package/dist/samples.js.map +1 -0
- package/dist/scaffold.d.ts +34 -0
- package/dist/scaffold.d.ts.map +1 -0
- package/dist/scaffold.js +106 -0
- package/dist/scaffold.js.map +1 -0
- package/dist/schemas.d.ts +5 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +39 -0
- package/dist/schemas.js.map +1 -0
- package/dist/sources.d.ts +17 -0
- package/dist/sources.d.ts.map +1 -0
- package/dist/sources.js +103 -0
- package/dist/sources.js.map +1 -0
- package/dist/templates.d.ts +64 -0
- package/dist/templates.d.ts.map +1 -0
- package/dist/templates.js +88 -0
- package/dist/templates.js.map +1 -0
- package/package.json +68 -3
- package/project-templates/kafka/README.md +12 -0
- package/project-templates/kafka/connections/events.yaml +8 -0
- package/project-templates/kafka/contracts/page_views.yaml +13 -0
- package/project-templates/kafka/contracts/purchases.yaml +13 -0
- package/project-templates/kafka/flows/events.yaml +10 -0
- package/project-templates/kafka/project.yaml +10 -0
- package/project-templates/kafka/standard.yaml +4 -0
- package/project-templates/kafka/template.yaml +3 -0
- package/project-templates/minimal/README.md +10 -0
- package/project-templates/minimal/connections/shop.yaml +7 -0
- package/project-templates/minimal/contracts/orders.yaml +14 -0
- package/project-templates/minimal/flows/orders.yaml +6 -0
- package/project-templates/minimal/project.yaml +11 -0
- package/project-templates/minimal/standard.yaml +4 -0
- package/project-templates/minimal/template.yaml +7 -0
- package/project-templates/private-files/README.md +29 -0
- package/project-templates/private-files/connections/share.yaml +10 -0
- package/project-templates/private-files/contracts/sales.yaml +14 -0
- package/project-templates/private-files/contracts/stock.yaml +14 -0
- package/project-templates/private-files/flows/stores.yaml +9 -0
- package/project-templates/private-files/platform.yaml +11 -0
- package/project-templates/private-files/project.yaml +19 -0
- package/project-templates/private-files/standard.yaml +11 -0
- package/project-templates/private-files/template.yaml +10 -0
- package/project-templates/private-sql-server/README.md +25 -0
- package/project-templates/private-sql-server/connections/erp.yaml +10 -0
- package/project-templates/private-sql-server/contracts/customers.yaml +14 -0
- package/project-templates/private-sql-server/contracts/invoices.yaml +15 -0
- package/project-templates/private-sql-server/flows/erp.yaml +13 -0
- package/project-templates/private-sql-server/platform.yaml +11 -0
- package/project-templates/private-sql-server/project.yaml +19 -0
- package/project-templates/private-sql-server/standard.yaml +17 -0
- package/project-templates/private-sql-server/template.yaml +10 -0
- package/project-templates/pyspark/README.md +12 -0
- package/project-templates/pyspark/connections/billing.yaml +7 -0
- package/project-templates/pyspark/contracts/invoices.yaml +16 -0
- package/project-templates/pyspark/contracts/monthly_revenue.yaml +14 -0
- package/project-templates/pyspark/flows/billing.yaml +6 -0
- package/project-templates/pyspark/project.yaml +11 -0
- package/project-templates/pyspark/standard.yaml +4 -0
- package/project-templates/pyspark/template.yaml +3 -0
- package/project-templates/pyspark/transforms/monthly_revenue.py +10 -0
- package/project-templates/pyspark/transforms/monthly_revenue.yaml +10 -0
- package/project-templates/retail/README.md +22 -0
- package/project-templates/retail/connections/shop.yaml +8 -0
- package/project-templates/retail/contracts/customers.yaml +12 -0
- package/project-templates/retail/contracts/daily_sales.yaml +19 -0
- package/project-templates/retail/contracts/orders.yaml +16 -0
- package/project-templates/retail/flows/shop.yaml +18 -0
- package/project-templates/retail/platform.yaml +21 -0
- package/project-templates/retail/project.yaml +18 -0
- package/project-templates/retail/standard.yaml +15 -0
- package/project-templates/retail/template.yaml +10 -0
- package/project-templates/retail/transforms/daily_sales.sql +7 -0
- package/project-templates/retail/transforms/daily_sales.yaml +7 -0
- package/project-templates/salesforce/README.md +6 -0
- package/project-templates/salesforce/connections/salesforce.yaml +7 -0
- package/project-templates/salesforce/contracts/accounts.yaml +13 -0
- package/project-templates/salesforce/contracts/opportunities.yaml +14 -0
- package/project-templates/salesforce/flows/salesforce.yaml +7 -0
- package/project-templates/salesforce/project.yaml +9 -0
- package/project-templates/salesforce/standard.yaml +4 -0
- package/project-templates/salesforce/template.yaml +3 -0
- package/project-templates/sql-server/README.md +17 -0
- package/project-templates/sql-server/connections/erp.yaml +8 -0
- package/project-templates/sql-server/contracts/customer_balances.yaml +13 -0
- package/project-templates/sql-server/contracts/customers.yaml +13 -0
- package/project-templates/sql-server/contracts/invoices.yaml +14 -0
- package/project-templates/sql-server/flows/erp.yaml +13 -0
- package/project-templates/sql-server/platform.yaml +6 -0
- package/project-templates/sql-server/project.yaml +13 -0
- package/project-templates/sql-server/standard.yaml +9 -0
- package/project-templates/sql-server/template.yaml +3 -0
- package/project-templates/sql-server/transforms/customer_balances.sql +5 -0
- package/project-templates/sql-server/transforms/customer_balances.yaml +6 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/NOTICE
ADDED
package/README.md
CHANGED
|
@@ -1,3 +1,45 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @ingestron/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The `ingestron` command: generates platform assets from definitions, as the
|
|
4
|
+
organisation's standard says, safely.
|
|
5
|
+
|
|
6
|
+
```sh
|
|
7
|
+
ingestron plan # what would change in each environment's output, with diffs
|
|
8
|
+
ingestron apply # write it; files edited by hand are never overwritten
|
|
9
|
+
ingestron check # for CI: fail when the output is not up to date
|
|
10
|
+
ingestron schemas # editor schemas for VS Code's YAML extension
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
It loads the definitions with [`@ingestron/definitions`](../definitions/README.md),
|
|
14
|
+
builds the files with the packs its standard names, such as the
|
|
15
|
+
[Databricks pack](https://github.com/ingestron/pack-databricks), and
|
|
16
|
+
writes them with [`@ingestron/generate`](../generate/README.md), into
|
|
17
|
+
`build/<environment>/`.
|
|
18
|
+
|
|
19
|
+
## In code
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { run } from "@ingestron/cli";
|
|
23
|
+
|
|
24
|
+
const code = run(["check"], {
|
|
25
|
+
cwd: "definitions",
|
|
26
|
+
write: (text) => process.stdout.write(text),
|
|
27
|
+
});
|
|
28
|
+
process.exitCode = code;
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Checks over every example
|
|
32
|
+
|
|
33
|
+
| Script | Checks |
|
|
34
|
+
| ------------------------------------------ | ----------------------------------------------------------------------------------------------- |
|
|
35
|
+
| `pnpm check:bundle <schema.json>` | Generated Databricks YAML against `databricks bundle schema` of the CLI you deploy with |
|
|
36
|
+
| `PYTHON_LIQUID=<python> pnpm check:parity` | Every SQL file renders the same with python-liquid, so a Python version can share the templates |
|
|
37
|
+
|
|
38
|
+
## Documentation
|
|
39
|
+
|
|
40
|
+
User documentation: https://docs.ingestron.io. The language-neutral rules for this package are in
|
|
41
|
+
[spec/cli](https://github.com/ingestron/ingestron/tree/main/spec/cli).
|
|
42
|
+
|
|
43
|
+
## Licence
|
|
44
|
+
|
|
45
|
+
[Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
package/dist/args.d.ts
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/** What the user asked for. */
|
|
2
|
+
export interface Options {
|
|
3
|
+
command: "plan" | "apply" | "check" | "compare" | "request" | "contract" | "schemas" | "init";
|
|
4
|
+
/** contract: the sample file to draft a contract from. */
|
|
5
|
+
sample?: string;
|
|
6
|
+
/** Environments to generate; empty means every environment in project.yaml. */
|
|
7
|
+
environments: string[];
|
|
8
|
+
/** Folder with project.yaml. */
|
|
9
|
+
definitions: string;
|
|
10
|
+
/** Folder for the generated files; each environment gets a sub-folder. */
|
|
11
|
+
out: string;
|
|
12
|
+
/** Show line diffs in plans. */
|
|
13
|
+
diffs: boolean;
|
|
14
|
+
/** check: do not fail on files in an output folder that were not generated. */
|
|
15
|
+
allowExtra: boolean;
|
|
16
|
+
/** init: the folder to create the project in, the answers given as flags, and --yes. */
|
|
17
|
+
init: {
|
|
18
|
+
folder: string;
|
|
19
|
+
template?: string;
|
|
20
|
+
connector?: string;
|
|
21
|
+
via?: string;
|
|
22
|
+
connectivity?: string;
|
|
23
|
+
name?: string;
|
|
24
|
+
standard?: string;
|
|
25
|
+
set: Record<string, string>;
|
|
26
|
+
yes: boolean;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/** The commands, in the order help shows them. */
|
|
30
|
+
export declare const commands: readonly [{
|
|
31
|
+
readonly name: "plan";
|
|
32
|
+
readonly summary: "Show what would change in each environment's output folder.";
|
|
33
|
+
}, {
|
|
34
|
+
readonly name: "apply";
|
|
35
|
+
readonly summary: "Write the changes. Files edited by hand are never overwritten.";
|
|
36
|
+
}, {
|
|
37
|
+
readonly name: "check";
|
|
38
|
+
readonly summary: "Fail when the output is not up to date (for CI). Writes nothing.";
|
|
39
|
+
}, {
|
|
40
|
+
readonly name: "compare";
|
|
41
|
+
readonly summary: "Show what differs between two environments, after resolving.";
|
|
42
|
+
}, {
|
|
43
|
+
readonly name: "contract";
|
|
44
|
+
readonly summary: "Draft a contract from a sample CSV or JSON file: column names and types.";
|
|
45
|
+
}, {
|
|
46
|
+
readonly name: "request";
|
|
47
|
+
readonly summary: "Print what to ask of whoever runs the data platform, per environment.";
|
|
48
|
+
}, {
|
|
49
|
+
readonly name: "schemas";
|
|
50
|
+
readonly summary: "Write editor schemas for VS Code's YAML extension.";
|
|
51
|
+
}, {
|
|
52
|
+
readonly name: "init";
|
|
53
|
+
readonly summary: "Create a project from a connection and supported ingestion route.";
|
|
54
|
+
}];
|
|
55
|
+
/** The options, in the order help shows them. */
|
|
56
|
+
export declare const flags: readonly [{
|
|
57
|
+
readonly flag: "--connector <id>";
|
|
58
|
+
readonly summary: "init: the source connector; otherwise choose by category.";
|
|
59
|
+
}, {
|
|
60
|
+
readonly flag: "--connectivity <kind>";
|
|
61
|
+
readonly summary: "init: private, workspace or public source reachability.";
|
|
62
|
+
}, {
|
|
63
|
+
readonly flag: "--via <adf|databricks>";
|
|
64
|
+
readonly summary: "init: ADF ingestion into Databricks, or Databricks directly.";
|
|
65
|
+
}, {
|
|
66
|
+
readonly flag: "--env <name>";
|
|
67
|
+
readonly summary: "Only this environment (repeatable). Default: all in project.yaml. init: the environments.";
|
|
68
|
+
}, {
|
|
69
|
+
readonly flag: "--definitions <dir>";
|
|
70
|
+
readonly summary: "Folder with project.yaml. Default: .";
|
|
71
|
+
}, {
|
|
72
|
+
readonly flag: "--out <dir>";
|
|
73
|
+
readonly summary: "Output folder. Default: build";
|
|
74
|
+
}, {
|
|
75
|
+
readonly flag: "--no-diff";
|
|
76
|
+
readonly summary: "Plans without line diffs.";
|
|
77
|
+
}, {
|
|
78
|
+
readonly flag: "--allow-extra";
|
|
79
|
+
readonly summary: "check: allow files in the output folder that were not generated.";
|
|
80
|
+
}, {
|
|
81
|
+
readonly flag: "--template <name|path|url>";
|
|
82
|
+
readonly summary: "init: a built-in template, a folder or a Git URL.";
|
|
83
|
+
}, {
|
|
84
|
+
readonly flag: "--name <id>";
|
|
85
|
+
readonly summary: "init: the project's id; contract: the contract's. Default: the folder's or file's name.";
|
|
86
|
+
}, {
|
|
87
|
+
readonly flag: "--standard <path|url>";
|
|
88
|
+
readonly summary: "init: use this standard instead of the supplied default.";
|
|
89
|
+
}, {
|
|
90
|
+
readonly flag: "--set <value>=<text>";
|
|
91
|
+
readonly summary: "init: answer one of the project configuration questions (repeatable).";
|
|
92
|
+
}, {
|
|
93
|
+
readonly flag: "--yes";
|
|
94
|
+
readonly summary: "init: take the default for every question not answered.";
|
|
95
|
+
}, {
|
|
96
|
+
readonly flag: "--help";
|
|
97
|
+
readonly summary: "Show this text.";
|
|
98
|
+
}];
|
|
99
|
+
/** Usage text for --help and mistakes. */
|
|
100
|
+
export declare const usage: string;
|
|
101
|
+
/** The options, "help", or a message explaining the mistake. */
|
|
102
|
+
export declare function readArgs(args: string[]): Options | "help" | {
|
|
103
|
+
mistake: string;
|
|
104
|
+
};
|
|
105
|
+
//# sourceMappingURL=args.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":"AAGA,+BAA+B;AAC/B,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;IAC9F,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+EAA+E;IAC/E,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,gCAAgC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,0EAA0E;IAC1E,GAAG,EAAE,MAAM,CAAC;IACZ,gCAAgC;IAChC,KAAK,EAAE,OAAO,CAAC;IACf,+EAA+E;IAC/E,UAAU,EAAE,OAAO,CAAC;IACpB,wFAAwF;IACxF,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC5B,GAAG,EAAE,OAAO,CAAC;KACd,CAAC;CACH;AAED,kDAAkD;AAClD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;EAkBX,CAAC;AAEX,iDAAiD;AACjD,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4CR,CAAC;AAKX,0CAA0C;AAC1C,eAAO,MAAM,KAAK,QAQN,CAAC;AAyBb,gEAAgE;AAChE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,GAAG,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAuB/E"}
|
package/dist/args.js
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
// Command-line arguments.
|
|
2
|
+
import { parseArgs } from "node:util";
|
|
3
|
+
/** The commands, in the order help shows them. */
|
|
4
|
+
export const commands = [
|
|
5
|
+
{ name: "plan", summary: "Show what would change in each environment's output folder." },
|
|
6
|
+
{ name: "apply", summary: "Write the changes. Files edited by hand are never overwritten." },
|
|
7
|
+
{ name: "check", summary: "Fail when the output is not up to date (for CI). Writes nothing." },
|
|
8
|
+
{
|
|
9
|
+
name: "compare",
|
|
10
|
+
summary: "Show what differs between two environments, after resolving.",
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: "contract",
|
|
14
|
+
summary: "Draft a contract from a sample CSV or JSON file: column names and types.",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: "request",
|
|
18
|
+
summary: "Print what to ask of whoever runs the data platform, per environment.",
|
|
19
|
+
},
|
|
20
|
+
{ name: "schemas", summary: "Write editor schemas for VS Code's YAML extension." },
|
|
21
|
+
{ name: "init", summary: "Create a project from a connection and supported ingestion route." },
|
|
22
|
+
];
|
|
23
|
+
/** The options, in the order help shows them. */
|
|
24
|
+
export const flags = [
|
|
25
|
+
{
|
|
26
|
+
flag: "--connector <id>",
|
|
27
|
+
summary: "init: the source connector; otherwise choose by category.",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
flag: "--connectivity <kind>",
|
|
31
|
+
summary: "init: private, workspace or public source reachability.",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
flag: "--via <adf|databricks>",
|
|
35
|
+
summary: "init: ADF ingestion into Databricks, or Databricks directly.",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
flag: "--env <name>",
|
|
39
|
+
summary: "Only this environment (repeatable). Default: all in project.yaml. init: the environments.",
|
|
40
|
+
},
|
|
41
|
+
{ flag: "--definitions <dir>", summary: "Folder with project.yaml. Default: ." },
|
|
42
|
+
{ flag: "--out <dir>", summary: "Output folder. Default: build" },
|
|
43
|
+
{ flag: "--no-diff", summary: "Plans without line diffs." },
|
|
44
|
+
{
|
|
45
|
+
flag: "--allow-extra",
|
|
46
|
+
summary: "check: allow files in the output folder that were not generated.",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
flag: "--template <name|path|url>",
|
|
50
|
+
summary: "init: a built-in template, a folder or a Git URL.",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
flag: "--name <id>",
|
|
54
|
+
summary: "init: the project's id; contract: the contract's. Default: the folder's or file's name.",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
flag: "--standard <path|url>",
|
|
58
|
+
summary: "init: use this standard instead of the supplied default.",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
flag: "--set <value>=<text>",
|
|
62
|
+
summary: "init: answer one of the project configuration questions (repeatable).",
|
|
63
|
+
},
|
|
64
|
+
{ flag: "--yes", summary: "init: take the default for every question not answered." },
|
|
65
|
+
{ flag: "--help", summary: "Show this text." },
|
|
66
|
+
];
|
|
67
|
+
/** The width of the options column: the longest flag and two spaces. */
|
|
68
|
+
const flagWidth = Math.max(...flags.map(({ flag }) => flag.length)) + 2;
|
|
69
|
+
/** Usage text for --help and mistakes. */
|
|
70
|
+
export const usage = [
|
|
71
|
+
"Usage: ingestron <plan|apply|check|compare|contract|request|schemas|init> [options]",
|
|
72
|
+
"",
|
|
73
|
+
...commands.map(({ name, summary }) => ` ${name.padEnd(10)}${summary}`),
|
|
74
|
+
"",
|
|
75
|
+
"Options:",
|
|
76
|
+
...flags.map(({ flag, summary }) => ` ${flag.padEnd(flagWidth)}${summary}`),
|
|
77
|
+
"",
|
|
78
|
+
].join("\n");
|
|
79
|
+
const commandNames = new Set(commands.map((command) => command.name));
|
|
80
|
+
const spec = {
|
|
81
|
+
env: { type: "string", multiple: true },
|
|
82
|
+
definitions: { type: "string", default: "." },
|
|
83
|
+
out: { type: "string", default: "build" },
|
|
84
|
+
"no-diff": { type: "boolean", default: false },
|
|
85
|
+
"allow-extra": { type: "boolean", default: false },
|
|
86
|
+
help: { type: "boolean", default: false },
|
|
87
|
+
template: { type: "string" },
|
|
88
|
+
connector: { type: "string" },
|
|
89
|
+
via: { type: "string" },
|
|
90
|
+
connectivity: { type: "string" },
|
|
91
|
+
name: { type: "string" },
|
|
92
|
+
standard: { type: "string" },
|
|
93
|
+
set: { type: "string", multiple: true },
|
|
94
|
+
yes: { type: "boolean", default: false },
|
|
95
|
+
};
|
|
96
|
+
/** The options, "help", or a message explaining the mistake. */
|
|
97
|
+
export function readArgs(args) {
|
|
98
|
+
let parsed;
|
|
99
|
+
try {
|
|
100
|
+
parsed = parseArgs({ args, allowPositionals: true, options: spec });
|
|
101
|
+
}
|
|
102
|
+
catch (cause) {
|
|
103
|
+
return { mistake: cause instanceof Error ? cause.message : String(cause) };
|
|
104
|
+
}
|
|
105
|
+
const { values, positionals } = parsed;
|
|
106
|
+
if (values.help)
|
|
107
|
+
return "help";
|
|
108
|
+
const [command, ...extra] = positionals;
|
|
109
|
+
if (!known(command, extra))
|
|
110
|
+
return { mistake: `Unknown command "${positionals.join(" ")}".` };
|
|
111
|
+
const init = initOptions(values, extra[0]);
|
|
112
|
+
if ("mistake" in init)
|
|
113
|
+
return init;
|
|
114
|
+
return {
|
|
115
|
+
command: command,
|
|
116
|
+
environments: values.env ?? [],
|
|
117
|
+
definitions: values.definitions,
|
|
118
|
+
out: values.out,
|
|
119
|
+
diffs: !values["no-diff"],
|
|
120
|
+
allowExtra: values["allow-extra"],
|
|
121
|
+
...sampleOf(command, extra[0]),
|
|
122
|
+
init,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
/** A command we have, with no more positional arguments than it takes (init and contract take one). */
|
|
126
|
+
function known(command, extra) {
|
|
127
|
+
const most = command === "init" || command === "contract" ? 1 : 0;
|
|
128
|
+
return command !== undefined && commandNames.has(command) && extra.length <= most;
|
|
129
|
+
}
|
|
130
|
+
/** contract's sample file, the one positional argument it takes. */
|
|
131
|
+
function sampleOf(command, file) {
|
|
132
|
+
return command === "contract" && file !== undefined ? { sample: file } : {};
|
|
133
|
+
}
|
|
134
|
+
function initOptions(values, folder = ".") {
|
|
135
|
+
const set = answersOf(values.set ?? []);
|
|
136
|
+
if (typeof set === "string")
|
|
137
|
+
return { mistake: set };
|
|
138
|
+
return {
|
|
139
|
+
folder,
|
|
140
|
+
...(values.template !== undefined && { template: values.template }),
|
|
141
|
+
...(values.connector !== undefined && { connector: values.connector }),
|
|
142
|
+
...(values.via !== undefined && { via: values.via }),
|
|
143
|
+
...(values.connectivity !== undefined && { connectivity: values.connectivity }),
|
|
144
|
+
...(values.name !== undefined && { name: values.name }),
|
|
145
|
+
...(values.standard !== undefined && { standard: values.standard }),
|
|
146
|
+
set,
|
|
147
|
+
yes: values.yes,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
/** `--set key=value` pairs, or a mistake naming the one without `=`. */
|
|
151
|
+
function answersOf(pairs) {
|
|
152
|
+
const answers = {};
|
|
153
|
+
for (const pair of pairs) {
|
|
154
|
+
const at = pair.indexOf("=");
|
|
155
|
+
if (at < 1)
|
|
156
|
+
return `--set ${pair}: write it as <value>=<text>.`;
|
|
157
|
+
answers[pair.slice(0, at)] = pair.slice(at + 1);
|
|
158
|
+
}
|
|
159
|
+
return answers;
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=args.js.map
|
package/dist/args.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"args.js","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AA+BtC,kDAAkD;AAClD,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,6DAA6D,EAAE;IACxF,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,gEAAgE,EAAE;IAC5F,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,kEAAkE,EAAE;IAC9F;QACE,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,8DAA8D;KACxE;IACD;QACE,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,0EAA0E;KACpF;IACD;QACE,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,uEAAuE;KACjF;IACD,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,oDAAoD,EAAE;IAClF,EA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SAAS,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,CAAC;QACpD,GAAG,CAAC,MAAM,CAAC,YAAY,KAAK,SAAS,IAAI,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC;QAC/E,GAAG,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;QACvD,GAAG,CAAC,MAAM,CAAC,QAAQ,KAAK,SAAS,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC;QACnE,GAAG;QACH,GAAG,EAAE,MAAM,CAAC,GAAG;KAChB,CAAC;AACJ,CAAC;AAED,wEAAwE;AACxE,SAAS,SAAS,CAAC,KAAe;IAChC,MAAM,OAAO,GAA2B,EAAE,CAAC;IAC3C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC7B,IAAI,EAAE,GAAG,CAAC;YAAE,OAAO,SAAS,IAAI,+BAA+B,CAAC;QAChE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/ask.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Writes the question and returns the answer line, trimmed. */
|
|
2
|
+
export declare function askInTerminal(question: string): string;
|
|
3
|
+
/** Reads bytes until a newline and decodes them once, so characters of several bytes survive. */
|
|
4
|
+
export declare function readLine(read: (buffer: Buffer) => number): string;
|
|
5
|
+
//# sourceMappingURL=ask.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ask.d.ts","sourceRoot":"","sources":["../src/ask.ts"],"names":[],"mappings":"AAIA,gEAAgE;AAChE,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGtD;AAED,iGAAiG;AACjG,wBAAgB,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,CAKjE"}
|
package/dist/ask.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Asks a question in the terminal and reads one line, synchronously, so the
|
|
2
|
+
// CLI stays a simple function from arguments to an exit code.
|
|
3
|
+
import { readSync } from "node:fs";
|
|
4
|
+
/** Writes the question and returns the answer line, trimmed. */
|
|
5
|
+
export function askInTerminal(question) {
|
|
6
|
+
process.stdout.write(question);
|
|
7
|
+
return readLine((buffer) => readSync(0, buffer, 0, 1, null));
|
|
8
|
+
}
|
|
9
|
+
/** Reads bytes until a newline and decodes them once, so characters of several bytes survive. */
|
|
10
|
+
export function readLine(read) {
|
|
11
|
+
const byte = Buffer.alloc(1);
|
|
12
|
+
const bytes = [];
|
|
13
|
+
while (read(byte) === 1 && byte[0] !== 0x0a)
|
|
14
|
+
bytes.push(byte[0]);
|
|
15
|
+
return Buffer.from(bytes).toString("utf8").trim();
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=ask.js.map
|
package/dist/ask.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ask.js","sourceRoot":"","sources":["../src/ask.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,8DAA8D;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,gEAAgE;AAChE,MAAM,UAAU,aAAa,CAAC,QAAgB;IAC5C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC/B,OAAO,QAAQ,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,QAAQ,CAAC,IAAgC;IACvD,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7B,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI;QAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAE,CAAC,CAAC;IAClE,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type FileSource } from "@ingestron/config";
|
|
2
|
+
import type { Options } from "./args.js";
|
|
3
|
+
import type { Io } from "./io.js";
|
|
4
|
+
/** Prints the comparison of the two environments given, else the project's first two. */
|
|
5
|
+
export declare function compare(options: Options, io: Io): number;
|
|
6
|
+
/**
|
|
7
|
+
* The differences between two environments as Markdown, grouped by platform,
|
|
8
|
+
* names and table; a note with the problems when either does not resolve.
|
|
9
|
+
* @example
|
|
10
|
+
* console.log(compareEnvironments(nodeFiles("definitions"), "dev", "prod"));
|
|
11
|
+
*/
|
|
12
|
+
export declare function compareEnvironments(files: FileSource, a: string, b: string): string;
|
|
13
|
+
//# sourceMappingURL=compare.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compare.d.ts","sourceRoot":"","sources":["../src/compare.ts"],"names":[],"mappings":"AAIA,OAAO,EAAgC,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAElF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAKlC,yFAAyF;AACzF,wBAAgB,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,GAAG,MAAM,CAYxD;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAmBnF"}
|