@aidc-toolkit/dev 0.0.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.
@@ -0,0 +1,32 @@
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}}
package/.idea/dev.iml ADDED
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="JAVA_MODULE" version="4">
3
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
4
+ <exclude-output />
5
+ <content url="file://$MODULE_DIR$" />
6
+ <orderEntry type="inheritedJdk" />
7
+ <orderEntry type="sourceFolder" forTests="false" />
8
+ </component>
9
+ </module>
@@ -0,0 +1,7 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5
+ <inspection_tool class="UpdateDependencyToLatestVersion" enabled="true" level="WARNING" enabled_by_default="true" editorAttributes="WARNING_ATTRIBUTES" />
6
+ </profile>
7
+ </component>
package/.idea/misc.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="openjdk-21" project-jdk-type="JavaSDK">
4
+ <output url="file://$PROJECT_DIR$/out" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/dev.iml" filepath="$PROJECT_DIR$/.idea/dev.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,12 @@
1
+ <component name="ProjectRunConfigurationManager">
2
+ <configuration default="false" name="build" type="js.build_tools.npm" nameIsGenerated="true">
3
+ <package-json value="$PROJECT_DIR$/package.json" />
4
+ <command value="run" />
5
+ <scripts>
6
+ <script value="build" />
7
+ </scripts>
8
+ <node-interpreter value="project" />
9
+ <envs />
10
+ <method v="2" />
11
+ </configuration>
12
+ </component>
@@ -0,0 +1,12 @@
1
+ <component name="ProjectRunConfigurationManager">
2
+ <configuration default="false" name="eslint" type="js.build_tools.npm" nameIsGenerated="true">
3
+ <package-json value="$PROJECT_DIR$/package.json" />
4
+ <command value="run" />
5
+ <scripts>
6
+ <script value="eslint" />
7
+ </scripts>
8
+ <node-interpreter value="project" />
9
+ <envs />
10
+ <method v="2" />
11
+ </configuration>
12
+ </component>
package/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
package/README.md ADDED
@@ -0,0 +1,49 @@
1
+ # Development Package
2
+
3
+ The AIDC Toolkit `dev` package contains development artefacts only; it is not intended to be used as anything other than
4
+ a development dependency.
5
+
6
+ ## TypeScript Configuration
7
+
8
+ All AIDC Toolkit packages are expected to be built the same way, which implies that they all have the same TypeScript
9
+ configuration. This is supported by the [`tsconfig.json` file](tsconfig.json) in this package. All changes should be managed
10
+ in that file, with other packages declaring their own `tsconfig.json` as follows:
11
+
12
+ ```json
13
+ {
14
+ "extends": "@aidc-toolkit/dev/tsconfig.json"
15
+ }
16
+ ```
17
+
18
+ ## ESLint Configuration
19
+
20
+ All AIDC Toolkit packages are expected to follow a common coding style (enforced by [ESLint](https://eslint.org/)),
21
+ which implies that they all have the same ESLint configuration. This is supported by the [`eslint.config.template.ts`
22
+ file](src/eslint.config.template.ts) in this package. All changes should be managed in that file, with other packages
23
+ declaring their own `eslint.config.js` file as follows:
24
+
25
+ ```javascript
26
+ import tseslint from "typescript-eslint";
27
+ import js from "@eslint/js";
28
+ import stylistic from "@stylistic/eslint-plugin";
29
+ import jsdoc from "eslint-plugin-jsdoc";
30
+ import esLintConfigLove from "eslint-config-love";
31
+ import { esLintConfigAIDCToolkit } from "@aidc-toolkit/dev";
32
+
33
+ export default tseslint.config(
34
+ js.configs.recommended,
35
+ ...tseslint.configs.strictTypeChecked,
36
+ stylistic.configs["recommended-flat"],
37
+ jsdoc.configs["flat/recommended-typescript"],
38
+ esLintConfigLove,
39
+ esLintConfigAIDCToolkit
40
+ );
41
+ ```
42
+
43
+ The ESLint configuration requires the installation of the following development dependencies:
44
+
45
+ - @eslint/js
46
+ - @stylistic/eslint-plugin
47
+ - eslint-config-love
48
+ - eslint-plugin-jsdoc
49
+ - typescript-eslint
@@ -0,0 +1,15 @@
1
+ import tseslint from "typescript-eslint"
2
+ import js from "@eslint/js";
3
+ import stylistic from "@stylistic/eslint-plugin";
4
+ import jsdoc from "eslint-plugin-jsdoc";
5
+ import esLintConfigLove from "eslint-config-love";
6
+ import { esLintConfigAIDCToolkit } from "./dist/index.js";
7
+
8
+ export default tseslint.config(
9
+ js.configs.recommended,
10
+ ...tseslint.configs.strictTypeChecked,
11
+ stylistic.configs["recommended-flat"],
12
+ jsdoc.configs["flat/recommended-typescript"],
13
+ esLintConfigLove,
14
+ esLintConfigAIDCToolkit
15
+ );
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@aidc-toolkit/dev",
3
+ "version": "0.0.1",
4
+ "description": "Shared development artefacts for AIDC Toolkit",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "homepage": "https://github.com/aidc-toolkit",
8
+ "repository": "github:aidc-toolkit/dev",
9
+ "bugs": {
10
+ "url": "https://github.com/aidc-toolkit/dev/issues"
11
+ },
12
+ "license": "Apache-2.0",
13
+ "author": {
14
+ "name": "Kevin Dean",
15
+ "email": "Kevin.Dean@datadevelopment.com",
16
+ "url": "https://www.linkedin.com/in/kdean"
17
+ },
18
+ "scripts": {
19
+ "eslint": "eslint .",
20
+ "build": "tsup src/index.ts --format cjs,esm --dts"
21
+ },
22
+ "devDependencies": {
23
+ "@eslint/js": "^9.10.0",
24
+ "@stylistic/eslint-plugin": "^2.7.2",
25
+ "eslint-config-love": "^64.0.0",
26
+ "eslint-plugin-jsdoc": "^50.2.2",
27
+ "ts-node": "^10.9.2",
28
+ "tsup": "^8.2.4",
29
+ "typescript": "^5.5.4",
30
+ "typescript-eslint": "^8.4.0"
31
+ }
32
+ }
@@ -0,0 +1,64 @@
1
+ import type { ConfigWithExtends } from "typescript-eslint";
2
+
3
+ export const esLintConfigAIDCToolkit: ConfigWithExtends = {
4
+ languageOptions: {
5
+ parserOptions: {
6
+ projectService: true
7
+ }
8
+ },
9
+
10
+ linterOptions: {
11
+ reportUnusedDisableDirectives: "error"
12
+ },
13
+
14
+ rules: {
15
+ "@typescript-eslint/class-literal-property-style": "off",
16
+ "@typescript-eslint/class-methods-use-this": "off",
17
+ "@typescript-eslint/init-declarations": "off",
18
+ "@typescript-eslint/max-params": "off",
19
+ "@typescript-eslint/no-empty-function": "off",
20
+ "@typescript-eslint/no-empty-object-type": "off",
21
+ "@typescript-eslint/no-unnecessary-type-parameters": "off",
22
+ "@typescript-eslint/unbound-method": ["error", {
23
+ ignoreStatic: true
24
+ }],
25
+
26
+ "@stylistic/array-bracket-newline": ["error", "consistent"],
27
+ "@stylistic/brace-style": ["error", "1tbs", {
28
+ allowSingleLine: false
29
+ }],
30
+ "@stylistic/comma-dangle": ["error", "never"],
31
+ "@stylistic/indent": ["error", 4],
32
+ "@stylistic/member-delimiter-style": ["error", {
33
+ multiline: {
34
+ delimiter: "semi",
35
+ requireLast: true
36
+ },
37
+ singleline: {
38
+ delimiter: "semi"
39
+ }
40
+ }],
41
+ "@stylistic/operator-linebreak": ["error", "after"],
42
+ "@stylistic/quotes": ["error", "double"],
43
+ "@stylistic/semi": ["error", "always"],
44
+ "@stylistic/object-curly-newline": ["error", {
45
+ ObjectExpression: {
46
+ multiline: true,
47
+ minProperties: 1
48
+ },
49
+ ObjectPattern: {
50
+ multiline: true,
51
+ minProperties: 1
52
+ }
53
+ }],
54
+ "@stylistic/object-property-newline": "error",
55
+
56
+ "jsdoc/require-returns": ["warn", {
57
+ checkGetters: false
58
+ }],
59
+ "jsdoc/tag-lines": ["warn", "any", {
60
+ count: 1,
61
+ startLines: 1
62
+ }]
63
+ }
64
+ };
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./eslint.config.template.js";
package/tsconfig.json ADDED
@@ -0,0 +1,26 @@
1
+ // https://aka.ms/tsconfig
2
+ {
3
+ "compilerOptions": {
4
+ // Type checking.
5
+ "strict": true,
6
+ "exactOptionalPropertyTypes": true,
7
+ "noFallthroughCasesInSwitch": true,
8
+ "noImplicitOverride": true,
9
+ "noPropertyAccessFromIndexSignature": true,
10
+
11
+ // Modules.
12
+ "module": "nodenext",
13
+ "resolveJsonModule": true,
14
+
15
+ // Interop constraints.
16
+ "esModuleInterop": true,
17
+ "forceConsistentCasingInFileNames": true,
18
+
19
+ // Language and environment.
20
+ "target": "es2020",
21
+ "useDefineForClassFields": true,
22
+
23
+ // Completeness.
24
+ "skipLibCheck": true
25
+ }
26
+ }
package/typedoc.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://typedoc.org/schema.json",
3
+ "sourceLinkExternal": true,
4
+ "groupOrder": [
5
+ "Enumerations",
6
+ "Type Aliases",
7
+ "Interfaces",
8
+ "Classes",
9
+ "Variables",
10
+ "Enumeration Members",
11
+ "Properties",
12
+ "Constructors",
13
+ "Accessors",
14
+ "Methods",
15
+ "*"
16
+ ],
17
+ "sort": []
18
+ }