@aidc-toolkit/dev 0.9.4 → 0.9.5

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.
@@ -0,0 +1,73 @@
1
+ name: Build project and publish to NPM
2
+
3
+ inputs:
4
+ project:
5
+ description: Project to be built and published
6
+ required: true
7
+ node_version:
8
+ description: Node version
9
+ required: true
10
+ node_auth_token:
11
+ description: Node authentication token for publishing to NPM
12
+ required: true
13
+ no_test:
14
+ description: If true, test is not run
15
+ required: false
16
+ terminal_pre_build:
17
+ description: If true, terminal session is started before build step is run
18
+ required: false
19
+ terminal_post_build:
20
+ description: If true, terminal session is started after build step is run
21
+ required: false
22
+
23
+ runs:
24
+ using: composite
25
+
26
+ steps:
27
+ - name: Setup node
28
+ uses: actions/setup-node@v4
29
+ with:
30
+ node-version: ${{ inputs.node_version }}
31
+ registry-url: https://registry.npmjs.org/
32
+
33
+ - name: Checkout
34
+ uses: actions/checkout@v4
35
+
36
+ - name: Start terminal session (pre build)
37
+ if: inputs.terminal_pre_build == 'true'
38
+ uses: mxschmitt/action-tmate@v3
39
+
40
+ - name: Build ${{ inputs.project }}
41
+ shell: bash
42
+ run: |
43
+ # Removing package-lock.json is necessary to force download of all dependencies including linked dependencies.
44
+ rm package-lock.json
45
+
46
+ npm install
47
+
48
+ # This is necessary to work around platform-specific optional dependencies bug
49
+ # (https://github.com/npm/cli/issues/4828).
50
+ npm install @rollup/rollup-linux-x64-gnu
51
+
52
+ # All projects have build script.
53
+ npm run build
54
+
55
+ - name: Start terminal session (post build)
56
+ if: inputs.terminal_post_build == 'true'
57
+ uses: mxschmitt/action-tmate@v3
58
+
59
+ - name: Test ${{ inputs.project }}
60
+ if: inputs.no_test != 'true'
61
+ shell: bash
62
+ run: |
63
+ # Project must have test script.
64
+ npm run test
65
+
66
+ - name: Publish ${{ inputs.project }}
67
+ # Publish is valid only as part of release.
68
+ if: github.event_name == 'release'
69
+ shell: bash
70
+ env:
71
+ NODE_AUTH_TOKEN: ${{ inputs.node_auth_token }}
72
+ run: |
73
+ npm publish --access public
@@ -0,0 +1,21 @@
1
+ name: Build and publish
2
+
3
+ on:
4
+ release:
5
+ types:
6
+ - published
7
+
8
+ jobs:
9
+ build-and-publish:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - name: Build and publish dev
14
+ uses: aidc-toolkit/dev/.github/actions/build-publish@main
15
+ with:
16
+ project: dev
17
+ node_version: ${{ vars.NODE_VERSION }}
18
+ node_auth_token: ${{ secrets.NODE_AUTH_TOKEN }}
19
+ no_test: true
20
+ terminal_pre_build: ${{ vars.TERMINAL_PRE_BUILD }}
21
+ terminal_post_build: ${{ vars.TERMINAL_POST_BUILD }}
package/dist/index.cjs ADDED
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var src_exports = {};
32
+ __export(src_exports, {
33
+ esLintConfigAIDCToolkit: () => esLintConfigAIDCToolkit
34
+ });
35
+ module.exports = __toCommonJS(src_exports);
36
+
37
+ // src/eslint.config.template.ts
38
+ var import_js = __toESM(require("@eslint/js"), 1);
39
+ var import_eslint_plugin = __toESM(require("@stylistic/eslint-plugin"), 1);
40
+ var import_eslint_config_love = __toESM(require("eslint-config-love"), 1);
41
+ var import_eslint_plugin_jsdoc = __toESM(require("eslint-plugin-jsdoc"), 1);
42
+ var import_typescript_eslint = __toESM(require("typescript-eslint"), 1);
43
+ var esLintConfigAIDCToolkit = import_typescript_eslint.default.config(
44
+ {
45
+ ignores: ["eslint.config.js", "dist"]
46
+ },
47
+ import_js.default.configs.recommended,
48
+ ...import_typescript_eslint.default.configs.strictTypeChecked,
49
+ import_eslint_plugin.default.configs["recommended-flat"],
50
+ import_eslint_plugin_jsdoc.default.configs["flat/recommended-typescript"],
51
+ import_eslint_config_love.default,
52
+ {
53
+ languageOptions: {
54
+ parserOptions: {
55
+ projectService: true
56
+ }
57
+ },
58
+ linterOptions: {
59
+ reportUnusedDisableDirectives: "error"
60
+ },
61
+ rules: {
62
+ "no-dupe-class-members": "off",
63
+ "no-redeclare": "off",
64
+ "no-unused-vars": "off",
65
+ "@typescript-eslint/class-literal-property-style": "off",
66
+ "@typescript-eslint/class-methods-use-this": "off",
67
+ "@typescript-eslint/init-declarations": "off",
68
+ "@typescript-eslint/max-params": "off",
69
+ "@typescript-eslint/no-empty-function": "off",
70
+ "@typescript-eslint/no-empty-object-type": "off",
71
+ "@typescript-eslint/no-magic-numbers": "off",
72
+ "@typescript-eslint/no-unnecessary-type-parameters": "off",
73
+ "@typescript-eslint/no-unused-vars": [
74
+ "error",
75
+ {
76
+ argsIgnorePattern: "^_",
77
+ varsIgnorePattern: "^_",
78
+ caughtErrorsIgnorePattern: "^_"
79
+ }
80
+ ],
81
+ "@typescript-eslint/prefer-destructuring": "off",
82
+ "@typescript-eslint/unbound-method": ["error", {
83
+ ignoreStatic: true
84
+ }],
85
+ "@stylistic/array-bracket-newline": ["error", "consistent"],
86
+ "@stylistic/brace-style": ["error", "1tbs", {
87
+ allowSingleLine: false
88
+ }],
89
+ "@stylistic/comma-dangle": ["error", "never"],
90
+ "@stylistic/indent": ["error", 4],
91
+ "@stylistic/member-delimiter-style": ["error", {
92
+ multiline: {
93
+ delimiter: "semi",
94
+ requireLast: true
95
+ },
96
+ singleline: {
97
+ delimiter: "semi"
98
+ }
99
+ }],
100
+ "@stylistic/no-trailing-spaces": ["off"],
101
+ "@stylistic/operator-linebreak": ["error", "after"],
102
+ "@stylistic/quotes": ["error", "double"],
103
+ "@stylistic/semi": ["error", "always"],
104
+ "@stylistic/object-curly-newline": ["error", {
105
+ ObjectExpression: {
106
+ multiline: true,
107
+ minProperties: 1
108
+ },
109
+ ObjectPattern: {
110
+ multiline: true,
111
+ minProperties: 1
112
+ }
113
+ }],
114
+ "@stylistic/object-property-newline": "error",
115
+ "jsdoc/require-description": ["warn", {
116
+ contexts: ["ClassDeclaration", "ClassProperty", "FunctionDeclaration", "MethodDefinition", "TSEnumDeclaration", "TSInterfaceDeclaration", "TSModuleDeclaration", "TSTypeAliasDeclaration"]
117
+ }],
118
+ "jsdoc/require-jsdoc": ["warn", {
119
+ contexts: ["ClassDeclaration", "ClassProperty", "FunctionDeclaration", "MethodDefinition", "TSEnumDeclaration", "TSInterfaceDeclaration", "TSModuleDeclaration", "TSTypeAliasDeclaration"]
120
+ }],
121
+ "jsdoc/require-returns": ["warn", {
122
+ checkGetters: false
123
+ }],
124
+ "jsdoc/tag-lines": ["warn", "any", {
125
+ count: 1,
126
+ startLines: 1
127
+ }]
128
+ }
129
+ },
130
+ {
131
+ files: [
132
+ "test/**/*"
133
+ ],
134
+ rules: {
135
+ "jsdoc/require-jsdoc": "off",
136
+ "@typescript-eslint/dot-notation": "off"
137
+ }
138
+ }
139
+ );
140
+ // Annotate the CommonJS export names for ESM import in node:
141
+ 0 && (module.exports = {
142
+ esLintConfigAIDCToolkit
143
+ });
@@ -0,0 +1,5 @@
1
+ import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
2
+
3
+ declare const esLintConfigAIDCToolkit: _typescript_eslint_utils_ts_eslint.FlatConfig.ConfigArray;
4
+
5
+ export { esLintConfigAIDCToolkit };
@@ -0,0 +1,5 @@
1
+ import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
2
+
3
+ declare const esLintConfigAIDCToolkit: _typescript_eslint_utils_ts_eslint.FlatConfig.ConfigArray;
4
+
5
+ export { esLintConfigAIDCToolkit };
package/dist/index.js ADDED
@@ -0,0 +1,106 @@
1
+ // src/eslint.config.template.ts
2
+ import js from "@eslint/js";
3
+ import stylistic from "@stylistic/eslint-plugin";
4
+ import esLintConfigLove from "eslint-config-love";
5
+ import jsdoc from "eslint-plugin-jsdoc";
6
+ import tseslint from "typescript-eslint";
7
+ var esLintConfigAIDCToolkit = tseslint.config(
8
+ {
9
+ ignores: ["eslint.config.js", "dist"]
10
+ },
11
+ js.configs.recommended,
12
+ ...tseslint.configs.strictTypeChecked,
13
+ stylistic.configs["recommended-flat"],
14
+ jsdoc.configs["flat/recommended-typescript"],
15
+ esLintConfigLove,
16
+ {
17
+ languageOptions: {
18
+ parserOptions: {
19
+ projectService: true
20
+ }
21
+ },
22
+ linterOptions: {
23
+ reportUnusedDisableDirectives: "error"
24
+ },
25
+ rules: {
26
+ "no-dupe-class-members": "off",
27
+ "no-redeclare": "off",
28
+ "no-unused-vars": "off",
29
+ "@typescript-eslint/class-literal-property-style": "off",
30
+ "@typescript-eslint/class-methods-use-this": "off",
31
+ "@typescript-eslint/init-declarations": "off",
32
+ "@typescript-eslint/max-params": "off",
33
+ "@typescript-eslint/no-empty-function": "off",
34
+ "@typescript-eslint/no-empty-object-type": "off",
35
+ "@typescript-eslint/no-magic-numbers": "off",
36
+ "@typescript-eslint/no-unnecessary-type-parameters": "off",
37
+ "@typescript-eslint/no-unused-vars": [
38
+ "error",
39
+ {
40
+ argsIgnorePattern: "^_",
41
+ varsIgnorePattern: "^_",
42
+ caughtErrorsIgnorePattern: "^_"
43
+ }
44
+ ],
45
+ "@typescript-eslint/prefer-destructuring": "off",
46
+ "@typescript-eslint/unbound-method": ["error", {
47
+ ignoreStatic: true
48
+ }],
49
+ "@stylistic/array-bracket-newline": ["error", "consistent"],
50
+ "@stylistic/brace-style": ["error", "1tbs", {
51
+ allowSingleLine: false
52
+ }],
53
+ "@stylistic/comma-dangle": ["error", "never"],
54
+ "@stylistic/indent": ["error", 4],
55
+ "@stylistic/member-delimiter-style": ["error", {
56
+ multiline: {
57
+ delimiter: "semi",
58
+ requireLast: true
59
+ },
60
+ singleline: {
61
+ delimiter: "semi"
62
+ }
63
+ }],
64
+ "@stylistic/no-trailing-spaces": ["off"],
65
+ "@stylistic/operator-linebreak": ["error", "after"],
66
+ "@stylistic/quotes": ["error", "double"],
67
+ "@stylistic/semi": ["error", "always"],
68
+ "@stylistic/object-curly-newline": ["error", {
69
+ ObjectExpression: {
70
+ multiline: true,
71
+ minProperties: 1
72
+ },
73
+ ObjectPattern: {
74
+ multiline: true,
75
+ minProperties: 1
76
+ }
77
+ }],
78
+ "@stylistic/object-property-newline": "error",
79
+ "jsdoc/require-description": ["warn", {
80
+ contexts: ["ClassDeclaration", "ClassProperty", "FunctionDeclaration", "MethodDefinition", "TSEnumDeclaration", "TSInterfaceDeclaration", "TSModuleDeclaration", "TSTypeAliasDeclaration"]
81
+ }],
82
+ "jsdoc/require-jsdoc": ["warn", {
83
+ contexts: ["ClassDeclaration", "ClassProperty", "FunctionDeclaration", "MethodDefinition", "TSEnumDeclaration", "TSInterfaceDeclaration", "TSModuleDeclaration", "TSTypeAliasDeclaration"]
84
+ }],
85
+ "jsdoc/require-returns": ["warn", {
86
+ checkGetters: false
87
+ }],
88
+ "jsdoc/tag-lines": ["warn", "any", {
89
+ count: 1,
90
+ startLines: 1
91
+ }]
92
+ }
93
+ },
94
+ {
95
+ files: [
96
+ "test/**/*"
97
+ ],
98
+ rules: {
99
+ "jsdoc/require-jsdoc": "off",
100
+ "@typescript-eslint/dot-notation": "off"
101
+ }
102
+ }
103
+ );
104
+ export {
105
+ esLintConfigAIDCToolkit
106
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aidc-toolkit/dev",
3
- "version": "0.9.4",
3
+ "version": "0.9.5",
4
4
  "description": "Shared development artefacts for AIDC Toolkit",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -34,9 +34,10 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@eslint/js": "^9.15.0",
37
- "@stylistic/eslint-plugin": "^2.10.1",
38
- "eslint-config-love": "^99.0.0",
37
+ "@rollup/rollup-linux-x64-gnu": "^4.27.3",
38
+ "@stylistic/eslint-plugin": "^2.11.0",
39
+ "eslint-config-love": "^101.0.0",
39
40
  "eslint-plugin-jsdoc": "^50.5.0",
40
- "typescript-eslint": "^8.14.0"
41
+ "typescript-eslint": "^8.15.0"
41
42
  }
42
43
  }
@@ -65,6 +65,7 @@ export const esLintConfigAIDCToolkit = tseslint.config(
65
65
  delimiter: "semi"
66
66
  }
67
67
  }],
68
+ "@stylistic/no-trailing-spaces": ["off"],
68
69
  "@stylistic/operator-linebreak": ["error", "after"],
69
70
  "@stylistic/quotes": ["error", "double"],
70
71
  "@stylistic/semi": ["error", "always"],
@@ -1,32 +0,0 @@
1
- # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
- # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
-
4
- name: Node.js Package
5
-
6
- on:
7
- release:
8
- types: [created]
9
-
10
- jobs:
11
- build:
12
- runs-on: ubuntu-latest
13
- steps:
14
- - uses: actions/checkout@v4
15
- - uses: actions/setup-node@v4
16
- with:
17
- node-version: 22
18
- - run: npm ci
19
-
20
- publish-npm:
21
- needs: build
22
- runs-on: ubuntu-latest
23
- steps:
24
- - uses: actions/checkout@v4
25
- - uses: actions/setup-node@v4
26
- with:
27
- node-version: 22
28
- registry-url: https://registry.npmjs.org/
29
- - run: npm ci
30
- - run: npm publish --access public
31
- env:
32
- NODE_AUTH_TOKEN: ${{secrets.npm_token}}