@baeta/plugin-gitignore 0.1.2 → 0.1.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @baeta/plugin-gitignore
2
2
 
3
+ ## 0.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#180](https://github.com/andreisergiu98/baeta/pull/180) [`483c709`](https://github.com/andreisergiu98/baeta/commit/483c70932f815fd114732c00b74f9488d7924c72) Thanks [@andreisergiu98](https://github.com/andreisergiu98)! - Raise minimum required NodeJS version to 22.12.0. Drop CommonJS builds in favor of the require_esm feature from NodeJS 22.12.0 onwards.
8
+
9
+ - [`de6e89c`](https://github.com/andreisergiu98/baeta/commit/de6e89c1b592e280967c73a4137d24ee56ef1857) Thanks [@andreisergiu98](https://github.com/andreisergiu98)! - raise es target to 2024
10
+
11
+ - Updated dependencies [[`483c709`](https://github.com/andreisergiu98/baeta/commit/483c70932f815fd114732c00b74f9488d7924c72), [`de6e89c`](https://github.com/andreisergiu98/baeta/commit/de6e89c1b592e280967c73a4137d24ee56ef1857)]:
12
+ - @baeta/generator-sdk@0.1.3
13
+
3
14
  ## 0.1.2
4
15
 
5
16
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baeta/plugin-gitignore",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "keywords": [
5
5
  "baeta",
6
6
  "graphql",
@@ -28,8 +28,7 @@
28
28
  "exports": {
29
29
  ".": {
30
30
  "types": "./dist/index.d.ts",
31
- "import": "./dist/index.js",
32
- "require": "./dist/index.cjs"
31
+ "default": "./dist/index.js"
33
32
  }
34
33
  },
35
34
  "types": "dist/index.d.ts",
@@ -44,24 +43,23 @@
44
43
  "types": "tsc --noEmit"
45
44
  },
46
45
  "dependencies": {
47
- "@baeta/generator-sdk": "^0.1.2"
46
+ "@baeta/generator-sdk": "^0.1.3"
48
47
  },
49
48
  "devDependencies": {
50
49
  "@baeta/builder": "^0.0.0",
51
50
  "@baeta/tsconfig": "^0.0.0",
52
- "@types/node": "^22.9.1",
53
- "typescript": "^5.6.3"
51
+ "@types/node": "^22.10.1",
52
+ "typescript": "^5.7.2"
54
53
  },
55
54
  "engines": {
56
- "node": ">=22.0.0"
55
+ "node": ">=22.12.0"
57
56
  },
58
57
  "publishConfig": {
59
58
  "access": "public",
60
59
  "exports": {
61
60
  ".": {
62
61
  "types": "./dist/index.d.ts",
63
- "import": "./dist/index.js",
64
- "require": "./dist/index.cjs"
62
+ "default": "./dist/index.js"
65
63
  }
66
64
  }
67
65
  },
@@ -73,5 +71,12 @@
73
71
  "--no-warnings",
74
72
  "--experimental-transform-types"
75
73
  ]
74
+ },
75
+ "typedocOptions": {
76
+ "entryPoints": [
77
+ "./index.ts"
78
+ ],
79
+ "readme": "none",
80
+ "tsconfig": "./tsconfig.json"
76
81
  }
77
82
  }
package/dist/index.cjs DELETED
@@ -1,39 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// index.ts
2
- var _path = require('path');
3
- var _generatorsdk = require('@baeta/generator-sdk');
4
- var allowedTags = ["cloudflare"];
5
- function gitignorePlugin(options) {
6
- return _generatorsdk.createPluginV1.call(void 0, {
7
- name: "gitignore-plugin",
8
- actionName: "add generated files to .gitignore",
9
- generate: async (ctx, next) => {
10
- await next();
11
- const ignoredTags = [..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _ => _.ignoreTags]), () => ( [])), ...allowedTags];
12
- const modulesDir = ctx.generatorOptions.modulesDir;
13
- const moduleDefinitionName = ctx.generatorOptions.moduleDefinitionName;
14
- const filePaths = ctx.fileManager.files.filter((file2) => {
15
- return !file2.filename.endsWith(moduleDefinitionName) && !ignoredTags.includes(file2.tag);
16
- }).map((file2) => file2.filename);
17
- const generatedPaths = filePaths.map((file2) => _path.relative.call(void 0, ctx.generatorOptions.cwd, file2)).filter((file2) => !file2.endsWith(moduleDefinitionName));
18
- generatedPaths.push(
19
- `${_path.relative.call(void 0, ctx.generatorOptions.cwd, modulesDir)}/**/${moduleDefinitionName}`
20
- );
21
- generatedPaths.sort((a, b) => a.localeCompare(b));
22
- const gitignoreStart = "# Generated by Baeta - Begin";
23
- const gitignoreInner = generatedPaths.join("\n");
24
- const gitignoreEnd = "# Generated by Baeta - End";
25
- const file = new (0, _generatorsdk.FileBlock)(
26
- _path.resolve.call(void 0, ctx.generatorOptions.cwd, ".gitignore"),
27
- gitignoreInner,
28
- gitignoreStart,
29
- gitignoreEnd,
30
- "gitignore"
31
- );
32
- ctx.fileManager.add(file);
33
- }
34
- });
35
- }
36
-
37
-
38
- exports.gitignorePlugin = gitignorePlugin;
39
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/baeta/baeta/packages/plugin-gitignore/dist/index.cjs","../index.ts"],"names":["file"],"mappings":"AAAA;ACAA,4BAAkC;AAClC,oDAA0C;AAM1C,IAAM,YAAA,EAAc,CAAC,YAAY,CAAA;AAE1B,SAAS,eAAA,CAAgB,OAAA,EAA4B;AAC3D,EAAA,OAAO,0CAAA;AAAe,IACrB,IAAA,EAAM,kBAAA;AAAA,IACN,UAAA,EAAY,oCAAA;AAAA,IACZ,QAAA,EAAU,MAAA,CAAO,GAAA,EAAK,IAAA,EAAA,GAAS;AAC9B,MAAA,MAAM,IAAA,CAAK,CAAA;AAEX,MAAA,MAAM,YAAA,EAAc,CAAC,oCAAI,OAAA,2BAAS,YAAA,UAAc,CAAC,GAAA,EAAI,GAAG,WAAW,CAAA;AAEnE,MAAA,MAAM,WAAA,EAAa,GAAA,CAAI,gBAAA,CAAiB,UAAA;AACxC,MAAA,MAAM,qBAAA,EAAuB,GAAA,CAAI,gBAAA,CAAiB,oBAAA;AAElD,MAAA,MAAM,UAAA,EAAY,GAAA,CAAI,WAAA,CAAY,KAAA,CAChC,MAAA,CAAO,CAACA,KAAAA,EAAAA,GAAS;AACjB,QAAA,OAAO,CAACA,KAAAA,CAAK,QAAA,CAAS,QAAA,CAAS,oBAAoB,EAAA,GAAK,CAAC,WAAA,CAAY,QAAA,CAASA,KAAAA,CAAK,GAAG,CAAA;AAAA,MACvF,CAAC,CAAA,CACA,GAAA,CAAI,CAACA,KAAAA,EAAAA,GAASA,KAAAA,CAAK,QAAQ,CAAA;AAE7B,MAAA,MAAM,eAAA,EAAiB,SAAA,CACrB,GAAA,CAAI,CAACA,KAAAA,EAAAA,GAAS,4BAAA,GAAS,CAAI,gBAAA,CAAiB,GAAA,EAAKA,KAAI,CAAC,CAAA,CACtD,MAAA,CAAO,CAACA,KAAAA,EAAAA,GAAS,CAACA,KAAAA,CAAK,QAAA,CAAS,oBAAoB,CAAC,CAAA;AAEvD,MAAA,cAAA,CAAe,IAAA;AAAA,QACd,CAAA,EAAA;AACD,MAAA;AAEA,MAAA;AAEA,MAAA;AACA,MAAA;AACA,MAAA;AAEA,MAAA;AACC,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACA,QAAA;AACD,MAAA;AAEA,MAAA;AACD,IAAA;AACA,EAAA;AACF;ADjBS;AACA;AACA","file":"/home/runner/work/baeta/baeta/packages/plugin-gitignore/dist/index.cjs","sourcesContent":[null,"import { relative, resolve } from 'node:path';\nimport { FileBlock, createPluginV1 } from '@baeta/generator-sdk';\n\nexport interface GitignoreOptions {\n\tignoreTags?: string[];\n}\n\nconst allowedTags = ['cloudflare'];\n\nexport function gitignorePlugin(options?: GitignoreOptions) {\n\treturn createPluginV1({\n\t\tname: 'gitignore-plugin',\n\t\tactionName: 'add generated files to .gitignore',\n\t\tgenerate: async (ctx, next) => {\n\t\t\tawait next();\n\n\t\t\tconst ignoredTags = [...(options?.ignoreTags ?? []), ...allowedTags];\n\n\t\t\tconst modulesDir = ctx.generatorOptions.modulesDir;\n\t\t\tconst moduleDefinitionName = ctx.generatorOptions.moduleDefinitionName;\n\n\t\t\tconst filePaths = ctx.fileManager.files\n\t\t\t\t.filter((file) => {\n\t\t\t\t\treturn !file.filename.endsWith(moduleDefinitionName) && !ignoredTags.includes(file.tag);\n\t\t\t\t})\n\t\t\t\t.map((file) => file.filename);\n\n\t\t\tconst generatedPaths = filePaths\n\t\t\t\t.map((file) => relative(ctx.generatorOptions.cwd, file))\n\t\t\t\t.filter((file) => !file.endsWith(moduleDefinitionName));\n\n\t\t\tgeneratedPaths.push(\n\t\t\t\t`${relative(ctx.generatorOptions.cwd, modulesDir)}/**/${moduleDefinitionName}`,\n\t\t\t);\n\n\t\t\tgeneratedPaths.sort((a, b) => a.localeCompare(b));\n\n\t\t\tconst gitignoreStart = '# Generated by Baeta - Begin';\n\t\t\tconst gitignoreInner = generatedPaths.join('\\n');\n\t\t\tconst gitignoreEnd = '# Generated by Baeta - End';\n\n\t\t\tconst file = new FileBlock(\n\t\t\t\tresolve(ctx.generatorOptions.cwd, '.gitignore'),\n\t\t\t\tgitignoreInner,\n\t\t\t\tgitignoreStart,\n\t\t\t\tgitignoreEnd,\n\t\t\t\t'gitignore',\n\t\t\t);\n\n\t\t\tctx.fileManager.add(file);\n\t\t},\n\t});\n}\n"]}
package/dist/index.d.cts DELETED
@@ -1,8 +0,0 @@
1
- import * as _baeta_generator_sdk from '@baeta/generator-sdk';
2
-
3
- interface GitignoreOptions {
4
- ignoreTags?: string[];
5
- }
6
- declare function gitignorePlugin(options?: GitignoreOptions): _baeta_generator_sdk.GeneratorPluginV1<unknown>;
7
-
8
- export { type GitignoreOptions, gitignorePlugin };