pepr 0.1.40 → 0.1.42

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/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "engines": {
10
10
  "node": ">=18.0.0"
11
11
  },
12
- "version": "0.1.40",
12
+ "version": "0.1.42",
13
13
  "main": "dist/index.js",
14
14
  "types": "dist/index.d.ts",
15
15
  "pepr": {
@@ -24,7 +24,8 @@
24
24
  }
25
25
  },
26
26
  "scripts": {
27
- "build": "rm -fr dist/* && tsc -p tsconfig.build.json",
27
+ "prebuild": "rm -fr dist/* && node hack/build-template-data.js",
28
+ "build": "tsc -p tsconfig.build.json",
28
29
  "test": "npm run build && ava && node dist/cli.js -V",
29
30
  "lint": "npx eslint src",
30
31
  "lint:fix": "npm run lint -- --fix",
@@ -5,19 +5,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  return (mod && mod.__esModule) ? mod : { "default": mod };
6
6
  };
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
+ const package_json_1 = require("../../package.json");
8
9
  const banner_1 = require("./banner");
9
10
  const build_1 = __importDefault(require("./build"));
10
- const capability_1 = __importDefault(require("./capability"));
11
11
  const deploy_1 = __importDefault(require("./deploy"));
12
12
  const dev_1 = __importDefault(require("./dev"));
13
13
  const init_1 = __importDefault(require("./init"));
14
14
  const root_1 = require("./root");
15
- const test_1 = __importDefault(require("./test"));
16
- const version_1 = require("./version");
17
15
  const program = new root_1.RootCmd();
18
16
  program
19
- .version(version_1.version)
20
- .description(`Pepr Kubernetes Thingy (v${version_1.version})`)
17
+ .version(package_json_1.version)
18
+ .description(`Pepr Kubernetes Thingy (v${package_json_1.version})`)
21
19
  .action(() => {
22
20
  if (program.args.length < 1) {
23
21
  console.log(banner_1.banner);
@@ -29,6 +27,6 @@ program
29
27
  (0, deploy_1.default)(program);
30
28
  (0, dev_1.default)(program);
31
29
  // @todo: finish/re-evaluate these commands
32
- (0, test_1.default)(program);
33
- (0, capability_1.default)(program);
30
+ // test(program);
31
+ // capability(program);
34
32
  program.parse();
@@ -0,0 +1 @@
1
+ { "gitignore": "# Ignore node_modules and Pepr build artifacts\nnode_modules\ndist\ninsecure*\n", "readme": "# Pepr Module\n\nThis is a Pepr Module. [Pepr](https://github.com/defenseunicorns/pepr) is a Kubernetes tranformation system\nwritten in Typescript.\n\nThe `capabilities` directory contains all the capabilities for this module. By default,\na capability is a single typescript file in the format of `capability-name.ts` that is\nimported in the root `pepr.ts` file as `import { HelloPepr } from \"./capabilities/hello-pepr\";`.\nBecause this is typescript, you can organize this however you choose, e.g. creating a sub-folder\nper-capability or common logic in shared files or folders.\n\nExample Structure:\n\n```\nModule Root\n├── package.json\n├── pepr.ts\n└── capabilities\n ├── example-one.ts\n ├── example-three.ts\n └── example-two.ts\n```\n", "peprTS": "import { PeprModule } from \"pepr\";\nimport { HelloPepr } from \"./capabilities/hello-pepr\";\nimport cfg from \"./package.json\";\n\n/**\n * This is the main entrypoint for the Pepr module. It is the file that is run when the module is started.\n * This is where you register your configurations and capabilities with the module.\n */\nnew PeprModule(cfg, [\n // \"HelloPepr\" is a demo capability that is included with Pepr. You can remove it if you want.\n HelloPepr,\n\n // Your additional capabilities go here\n]);\n", "helloPeprTS": "import { Capability, a } from \"pepr\";\n\n/**\n * The HelloPepr Capability is an example capability to demonstrate some general concepts of Pepr.\n * To test this capability you can run `pepr dev` or `npm start` and then run the following command:\n * `kubectl apply -f capabilities/hello-pepr.samples.yaml`\n */\nexport const HelloPepr = new Capability({\n name: \"hello-pepr\",\n description: \"A simple example capability to show how things work.\",\n namespaces: [\"pepr-demo\"],\n});\n\n// Use the 'When' function to create a new Capability Action\nconst { When } = HelloPepr;\n\n/**\n * This is a single Capability Action. They can be in the same file or imported from other files.\n * In this exmaple, when a ConfigMap is created with the name `example-1`, we add a label and annotation.\n *\n * Equivelant to manually running:\n * `kubectl label configmap example-1 pepr=was-here`\n * `kubectl annotate configmap example-1 pepr.dev=annotations-work-too`\n */\nWhen(a.ConfigMap)\n .IsCreated()\n .WithName(\"example-1\")\n .Then(request => {\n request.SetLabel(\"pepr\", \"was-here\").SetAnnotation(\"pepr.dev\", \"annotations-work-too\");\n });\n\n/**\n * This Capabiility Action does the exact same changes for example-2, except this time it uses the `.ThenSet()` feature.\n * You can stack multiple `.Then()` calls, but only a single `.ThenSet()`\n */\nWhen(a.ConfigMap)\n .IsCreated()\n .WithName(\"example-2\")\n .ThenSet({\n metadata: {\n labels: {\n pepr: \"was-here\",\n },\n annotations: {\n \"pepr.dev\": \"annotations-work-too\",\n },\n },\n });\n\n/**\n * This Capability Action combines different styles. Unlike the previous actions, this one will look for any ConfigMap\n * in the `pepr-demo` namespace that has the label `change=by-label` during either CREATE or UPDATE. Note that all\n * conditions added such as `WithName()`, `WithLabel()`, `InNamespace()`, are ANDs so all conditions must be true\n * for the request to be procssed.\n */\nWhen(a.ConfigMap)\n .IsCreatedOrUpdated()\n .WithLabel(\"change\", \"by-label\")\n .Then(request => {\n // The K8s object e are going to mutate\n const cm = request.Raw;\n\n // Get the username and uid of the K8s reuest\n const { username, uid } = request.Request.userInfo;\n\n // Store some data about the request in the configmap\n cm.data[\"username\"] = username;\n cm.data[\"uid\"] = uid;\n\n // You can still mix other ways of making changes too\n request.SetAnnotation(\"pepr.dev\", \"making-waves\");\n });\n" }
@@ -0,0 +1,21 @@
1
+ {
2
+ "Create a new Pepr capability": {
3
+ "prefix": "create pepr capability",
4
+ "body": [
5
+ "import { Capability, a } from 'pepr';",
6
+ "",
7
+ "export const ${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/} = new Capability({",
8
+ "\tname: '${TM_FILENAME_BASE}',",
9
+ "\tdescription: '${1:A brief description of this capability.}',",
10
+ "\tnamespaces: [${2:}],",
11
+ "});",
12
+ "",
13
+ "// Use the 'When' function to create a new Capability Action",
14
+ "const { When } = ${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/};",
15
+ "",
16
+ "// When(a.<Kind>).Is<Event>().Then(change => change.<changes>",
17
+ "When(${3:})"
18
+ ],
19
+ "description": "Creates a new Pepr capability with a specified description, and optional namespaces, and adds a When statement for the specified value."
20
+ }
21
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "arrowParens": "avoid",
3
+ "bracketSameLine": false,
4
+ "bracketSpacing": true,
5
+ "embeddedLanguageFormatting": "auto",
6
+ "insertPragma": false,
7
+ "printWidth": 80,
8
+ "quoteProps": "as-needed",
9
+ "requirePragma": false,
10
+ "semi": true,
11
+ "tabWidth": 2,
12
+ "useTabs": false
13
+ }
@@ -0,0 +1,45 @@
1
+ [
2
+ {
3
+ "apiVersion": "v1",
4
+ "kind": "Namespace",
5
+ "metadata": {
6
+ "name": "pepr-demo"
7
+ }
8
+ },
9
+ {
10
+ "apiVersion": "v1",
11
+ "kind": "ConfigMap",
12
+ "metadata": {
13
+ "name": "example-1",
14
+ "namespace": "pepr-demo"
15
+ },
16
+ "data": {
17
+ "key": "ex-1-val"
18
+ }
19
+ },
20
+ {
21
+ "apiVersion": "v1",
22
+ "kind": "ConfigMap",
23
+ "metadata": {
24
+ "name": "example-2",
25
+ "namespace": "pepr-demo"
26
+ },
27
+ "data": {
28
+ "key": "ex-2-val"
29
+ }
30
+ },
31
+ {
32
+ "apiVersion": "v1",
33
+ "kind": "ConfigMap",
34
+ "metadata": {
35
+ "name": "example-3",
36
+ "namespace": "pepr-demo",
37
+ "labels": {
38
+ "change": "by-label"
39
+ }
40
+ },
41
+ "data": {
42
+ "key": "ex-3-val"
43
+ }
44
+ }
45
+ ]
@@ -1,8 +1,4 @@
1
1
  import { InitOptions } from "./walkthrough";
2
- export declare function genPeprTS(): {
3
- path: string;
4
- data: string;
5
- };
6
2
  export declare function genPkgJSON(opts: InitOptions): {
7
3
  data: {
8
4
  name: string;
@@ -20,6 +16,7 @@ export declare function genPkgJSON(opts: InitOptions): {
20
16
  };
21
17
  };
22
18
  scripts: {
19
+ "k3d-setup": string;
23
20
  build: string;
24
21
  start: string;
25
22
  };
@@ -33,6 +30,36 @@ export declare function genPkgJSON(opts: InitOptions): {
33
30
  path: string;
34
31
  print: string;
35
32
  };
33
+ export declare function genPeprTS(): {
34
+ path: string;
35
+ data: string;
36
+ };
37
+ export declare const readme: {
38
+ path: string;
39
+ data: string;
40
+ };
41
+ export declare const helloPeprTS: {
42
+ path: string;
43
+ data: string;
44
+ };
45
+ export declare const gitIgnore: {
46
+ path: string;
47
+ data: string;
48
+ };
49
+ export declare const samplesYaml: {
50
+ path: string;
51
+ data: string;
52
+ };
53
+ export declare const snippet: {
54
+ path: string;
55
+ data: {
56
+ "Create a new Pepr capability": {
57
+ prefix: string;
58
+ body: string[];
59
+ description: string;
60
+ };
61
+ };
62
+ };
36
63
  export declare const tsConfig: {
37
64
  path: string;
38
65
  data: {
@@ -48,10 +75,6 @@ export declare const tsConfig: {
48
75
  include: string[];
49
76
  };
50
77
  };
51
- export declare const gitIgnore: {
52
- path: string;
53
- data: string;
54
- };
55
78
  export declare const prettierRC: {
56
79
  path: string;
57
80
  data: {
@@ -68,19 +91,3 @@ export declare const prettierRC: {
68
91
  useTabs: boolean;
69
92
  };
70
93
  };
71
- export declare const readme: {
72
- path: string;
73
- data: string;
74
- };
75
- export declare const samplesYaml: {
76
- path: string;
77
- data: string;
78
- };
79
- export declare const helloPeprTS: {
80
- path: string;
81
- data: string;
82
- };
83
- export declare const snippet: {
84
- path: string;
85
- data: string;
86
- };
@@ -1,35 +1,21 @@
1
1
  "use strict";
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  // SPDX-FileCopyrightText: 2023-Present The Pepr Authors
4
+ var __importDefault = (this && this.__importDefault) || function (mod) {
5
+ return (mod && mod.__esModule) ? mod : { "default": mod };
6
+ };
4
7
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.snippet = exports.helloPeprTS = exports.samplesYaml = exports.readme = exports.prettierRC = exports.gitIgnore = exports.tsConfig = exports.genPkgJSON = exports.genPeprTS = void 0;
8
+ exports.prettierRC = exports.tsConfig = exports.snippet = exports.samplesYaml = exports.gitIgnore = exports.helloPeprTS = exports.readme = exports.genPeprTS = exports.genPkgJSON = void 0;
6
9
  const client_node_1 = require("@kubernetes/client-node");
7
10
  const util_1 = require("util");
8
11
  const uuid_1 = require("uuid");
9
12
  const package_json_1 = require("../../../package.json");
10
- const version_1 = require("../version");
13
+ const data_json_1 = __importDefault(require("./templates/data.json"));
14
+ const pepr_code_snippets_json_1 = __importDefault(require("./templates/pepr.code-snippets.json"));
15
+ const prettierrc_json_1 = __importDefault(require("./templates/prettierrc.json"));
16
+ const samples_json_1 = __importDefault(require("./templates/samples.json"));
17
+ const tsconfig_json_1 = __importDefault(require("./templates/tsconfig.json"));
11
18
  const utils_1 = require("./utils");
12
- function genPeprTS() {
13
- return {
14
- path: "pepr.ts",
15
- data: `import { PeprModule } from "pepr";
16
- import cfg from "./package.json";
17
- import { HelloPepr } from "./capabilities/hello-pepr";
18
-
19
- /**
20
- * This is the main entrypoint for the Pepr module. It is the file that is run when the module is started.
21
- * This is where you register your configurations and capabilities with the module.
22
- */
23
- new PeprModule(cfg, [
24
- // "HelloPepr" is a demo capability that is included with Pepr. You can remove it if you want.
25
- HelloPepr,
26
-
27
- // Your additional capabilities go here
28
- ]);
29
- `,
30
- };
31
- }
32
- exports.genPeprTS = genPeprTS;
33
19
  function genPkgJSON(opts) {
34
20
  // Generate a random UUID for the module based on the module name
35
21
  const uuid = (0, uuid_1.v5)(opts.name, (0, uuid_1.v4)());
@@ -44,7 +30,7 @@ function genPkgJSON(opts) {
44
30
  keywords: ["pepr", "k8s", "policy-engine", "pepr-module", "security"],
45
31
  pepr: {
46
32
  name: opts.name.trim(),
47
- version: version_1.version,
33
+ version: package_json_1.version,
48
34
  uuid,
49
35
  onError: opts.errorBehavior,
50
36
  alwaysIgnore: {
@@ -53,11 +39,12 @@ function genPkgJSON(opts) {
53
39
  },
54
40
  },
55
41
  scripts: {
42
+ "k3d-setup": package_json_1.scripts["e2e-dev-setup"],
56
43
  build: "pepr build",
57
44
  start: "pepr dev",
58
45
  },
59
46
  dependencies: {
60
- pepr: `^${version_1.version}`,
47
+ pepr: `^${package_json_1.version}`,
61
48
  },
62
49
  devDependencies: {
63
50
  typescript,
@@ -70,219 +57,38 @@ function genPkgJSON(opts) {
70
57
  };
71
58
  }
72
59
  exports.genPkgJSON = genPkgJSON;
73
- exports.tsConfig = {
74
- path: "tsconfig.json",
75
- data: {
76
- compilerOptions: {
77
- esModuleInterop: true,
78
- lib: ["ES2020"],
79
- moduleResolution: "node",
80
- resolveJsonModule: true,
81
- rootDir: ".",
82
- strict: false,
83
- target: "ES2020",
84
- },
85
- include: ["**/*.ts"],
86
- },
60
+ function genPeprTS() {
61
+ return {
62
+ path: "pepr.ts",
63
+ data: data_json_1.default.peprTS,
64
+ };
65
+ }
66
+ exports.genPeprTS = genPeprTS;
67
+ exports.readme = {
68
+ path: "README.md",
69
+ data: data_json_1.default.readme,
70
+ };
71
+ exports.helloPeprTS = {
72
+ path: "hello-pepr.ts",
73
+ data: data_json_1.default.helloPeprTS,
87
74
  };
88
75
  exports.gitIgnore = {
89
76
  path: ".gitignore",
90
- data: `# Ignore node_modules and Pepr build artifacts
91
- node_modules
92
- dist
93
- insecure*
94
- `,
95
- };
96
- exports.prettierRC = {
97
- path: ".prettierrc",
98
- data: {
99
- arrowParens: "avoid",
100
- bracketSameLine: false,
101
- bracketSpacing: true,
102
- embeddedLanguageFormatting: "auto",
103
- insertPragma: false,
104
- printWidth: 80,
105
- quoteProps: "as-needed",
106
- requirePragma: false,
107
- semi: true,
108
- tabWidth: 2,
109
- useTabs: false,
110
- },
111
- };
112
- exports.readme = {
113
- path: "README.md",
114
- data: `# Pepr Module
115
-
116
- This is a Pepr module. It is a module that can be used with the [Pepr]() framework.
117
-
118
- The \`capabilities\` directory contains all the capabilities for this module. By default,
119
- a capability is a single typescript file in the format of \`capability-name.ts\` that is
120
- imported in the root \`pepr.ts\` file as \`import { HelloPepr } from "./capabilities/hello-pepr";\`.
121
- Because this is typescript, you can organize this however you choose, e.g. creating a sub-folder
122
- per-capability or common logic in shared files or folders.
123
-
124
- Example Structure:
125
-
126
- \`\`\`
127
- Module Root
128
- ├── package.json
129
- ├── pepr.ts
130
- └── capabilities
131
- ├── example-one.ts
132
- ├── example-three.ts
133
- └── example-two.ts
134
- \`\`\`
135
- `,
77
+ data: data_json_1.default.gitignore,
136
78
  };
137
79
  exports.samplesYaml = {
138
80
  path: "hello-pepr.samples.yaml",
139
- data: [
140
- {
141
- apiVersion: "v1",
142
- kind: "Namespace",
143
- metadata: {
144
- name: "pepr-demo",
145
- },
146
- },
147
- {
148
- apiVersion: "v1",
149
- kind: "ConfigMap",
150
- metadata: {
151
- name: "example-1",
152
- namespace: "pepr-demo",
153
- },
154
- data: {
155
- key: "ex-1-val",
156
- },
157
- },
158
- {
159
- apiVersion: "v1",
160
- kind: "ConfigMap",
161
- metadata: {
162
- name: "example-2",
163
- namespace: "pepr-demo",
164
- },
165
- data: {
166
- key: "ex-2-val",
167
- },
168
- },
169
- {
170
- apiVersion: "v1",
171
- kind: "ConfigMap",
172
- metadata: {
173
- name: "example-3",
174
- namespace: "pepr-demo",
175
- labels: {
176
- change: "by-label",
177
- },
178
- },
179
- data: {
180
- key: "ex-3-val",
181
- },
182
- },
183
- ]
184
- .map(r => (0, client_node_1.dumpYaml)(r, { noRefs: true }))
185
- .join("---\n"),
186
- };
187
- exports.helloPeprTS = {
188
- path: "hello-pepr.ts",
189
- data: `import { Capability, a } from "pepr";
190
-
191
- /**
192
- * The HelloPepr is an example capability to demonstrate some general concepts of Pepr.
193
- * To test this capability you can run \`pepr dev\` and then run the following command:
194
- * \`kubectl apply -f capabilities/hello-pepr.samples.yaml\`
195
- */
196
- export const HelloPepr = new Capability({
197
- name: "hello-pepr",
198
- description: "A simple example capability to show how things work.",
199
- namespaces: ["pepr-demo"],
200
- });
201
-
202
- // Use the 'When' function to create a new Capability Action
203
- const { When } = HelloPepr;
204
-
205
- /**
206
- * This is a single Capability Action. They can be in the same file or put imported from other files.
207
- * In this exmaple, when a ConfigMap is created with the name \`example-1\`, then add a label and annotation.
208
- *
209
- * Equivelant to manually running:
210
- * \`kubectl label configmap example-1 pepr=was-here\`
211
- * \`kubectl annotate configmap example-1 pepr.dev=annotations-work-too\`
212
- */
213
- When(a.ConfigMap)
214
- .IsCreated()
215
- .WithName("example-1")
216
- .Then(request =>
217
- request
218
- .SetLabel("pepr", "was-here")
219
- .SetAnnotation("pepr.dev", "annotations-work-too")
220
- );
221
-
222
- /**
223
- * This Capabiility Action does the exact same changes for example-2, except this time it uses the \`.ThenSet()\` feature.
224
- * You can stack multiple \`.Then()\` calls, but only a single \`.ThenSet()\`
225
- */
226
- When(a.ConfigMap)
227
- .IsCreated()
228
- .WithName("example-2")
229
- .ThenSet({
230
- metadata: {
231
- labels: {
232
- pepr: "was-here",
233
- },
234
- annotations: {
235
- "pepr.dev": "annotations-work-too",
236
- },
237
- },
238
- });
239
-
240
- /**
241
- * This Capability Action combines different styles. Unlike the previous actions, this one will look for any ConfigMap
242
- * in the \`pepr-demo\` namespace that has the label \`change=by-label\` during either CREATE or UPDATE. Note that all
243
- * conditions added such as \`WithName()\`, \`WithLabel()\`, \`InNamespace()\`, are ANDs so all conditions must be true
244
- * for the request to be procssed.
245
- */
246
- When(a.ConfigMap)
247
- .IsCreatedOrUpdated()
248
- .WithLabel("change", "by-label")
249
- .Then(request => {
250
- // The K8s object e are going to mutate
251
- const cm = request.Raw;
252
-
253
- // Get the username and uid of the K8s reuest
254
- const { username, uid } = request.Request.userInfo;
255
-
256
- // Store some data about the request in the configmap
257
- cm.data["username"] = username;
258
- cm.data["uid"] = uid;
259
-
260
- // You can still mix other ways of making changes too
261
- request.SetAnnotation("pepr.dev", "making-waves");
262
- });
263
- `,
81
+ data: samples_json_1.default.map(r => (0, client_node_1.dumpYaml)(r, { noRefs: true })).join("---\n"),
264
82
  };
265
83
  exports.snippet = {
266
84
  path: "pepr.code-snippets",
267
- data: `{
268
- "Create a new Pepr capability": {
269
- "prefix": "create pepr capability",
270
- "body": [
271
- "import { Capability, a } from 'pepr';",
272
- "",
273
- "export const $\{TM_FILENAME_BASE/(.*)/$\{1:/pascalcase}/} = new Capability({",
274
- "\\tname: '$\{TM_FILENAME_BASE}',",
275
- "\\tdescription: '$\{1:A brief description of this capability.}',",
276
- "\\tnamespaces: [$\{2:}],",
277
- "});",
278
- "",
279
- "// Use the 'When' function to create a new Capability Action",
280
- "const { When } = $\{TM_FILENAME_BASE/(.*)/$\{1:/pascalcase}/};",
281
- "",
282
- "// When(a.<Kind>).Is<Event>().Then(change => change.<changes>",
283
- "When($\{3:})"
284
- ],
285
- "description": "Creates a new Pepr capability with a specified description, and optional namespaces, and adds a When statement for the specified value."
286
- }
287
- }`,
85
+ data: pepr_code_snippets_json_1.default,
86
+ };
87
+ exports.tsConfig = {
88
+ path: "tsconfig.json",
89
+ data: tsconfig_json_1.default,
90
+ };
91
+ exports.prettierRC = {
92
+ path: ".prettierrc",
93
+ data: prettierrc_json_1.default,
288
94
  };
@@ -0,0 +1,23 @@
1
+ // This is a helper script to collect the contents of the template files before building the CLI
2
+
3
+ /* eslint-disable */
4
+ const fs = require("fs");
5
+ const path = require("path");
6
+
7
+ const baseDir = path.join(__dirname, "..", "src", "cli", "init", "templates");
8
+
9
+ // Read the text file
10
+ const gitignore = fs.readFileSync(path.join(baseDir, "gitignore"), "utf8");
11
+ const readme = fs.readFileSync(path.join(baseDir, "README.md"), "utf8");
12
+ const peprTS = fs.readFileSync(path.join(baseDir, "pepr.ts"), "utf8");
13
+ const helloPeprTS = fs.readFileSync(path.join(baseDir, "hello-pepr.ts"), "utf8");
14
+
15
+ fs.writeFileSync(
16
+ path.join(baseDir, "data.json"),
17
+ JSON.stringify({
18
+ gitignore,
19
+ readme,
20
+ peprTS,
21
+ helloPeprTS,
22
+ })
23
+ );
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "engines": {
10
10
  "node": ">=18.0.0"
11
11
  },
12
- "version": "0.1.40",
12
+ "version": "0.1.42",
13
13
  "main": "dist/index.js",
14
14
  "types": "dist/index.d.ts",
15
15
  "pepr": {
@@ -24,7 +24,8 @@
24
24
  }
25
25
  },
26
26
  "scripts": {
27
- "build": "rm -fr dist/* && tsc -p tsconfig.build.json",
27
+ "prebuild": "rm -fr dist/* && node hack/build-template-data.js",
28
+ "build": "tsc -p tsconfig.build.json",
28
29
  "test": "npm run build && ava && node dist/cli.js -V",
29
30
  "lint": "npx eslint src",
30
31
  "lint:fix": "npm run lint -- --fix",
@@ -1,4 +1,4 @@
1
1
  {
2
- "extends": "./tsconfig.json",
3
- "exclude": ["node_modules", "dist", "fixtures", "**/*.test.ts"]
2
+ "extends": "./tsconfig.json",
3
+ "exclude": ["node_modules", "dist", "fixtures", "**/*.test.ts", "src/cli/init/templates"]
4
4
  }
package/.env DELETED
File without changes
@@ -1 +0,0 @@
1
- export declare const version: string;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- // SPDX-License-Identifier: Apache-2.0
3
- // SPDX-FileCopyrightText: 2023-Present The Pepr Authors
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.version = void 0;
6
- exports.version = process.env.PEPR_VERSION || "development";