@trace.market/types 0.2.1 → 0.4.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.
@@ -15,6 +15,7 @@ jobs:
15
15
  permissions:
16
16
  contents: write
17
17
  packages: write
18
+ id-token: write # Required for provenance and OIDC auth
18
19
 
19
20
  steps:
20
21
  - uses: actions/checkout@v4
@@ -48,7 +49,7 @@ jobs:
48
49
 
49
50
  - name: Publish to NPM
50
51
  if: steps.check.outputs.changed == 'true'
51
- run: npm publish --access public
52
+ run: npm publish --provenance --access public
52
53
  env:
53
54
  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
54
55
 
@@ -62,11 +63,11 @@ jobs:
62
63
 
63
64
  - name: Create GitHub Release
64
65
  if: steps.check.outputs.changed == 'true'
65
- uses: actions/create-release@v1
66
- env:
67
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66
+ uses: softprops/action-gh-release@v1
68
67
  with:
69
68
  tag_name: v${{ steps.check.outputs.version }}
70
- release_name: Release v${{ steps.check.outputs.version }}
69
+ name: Release v${{ steps.check.outputs.version }}
71
70
  draft: false
72
71
  prerelease: false
72
+ env:
73
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
package/CHANGELOG.md ADDED
@@ -0,0 +1,34 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## [0.4.0] - 2026-01-19
6
+
7
+ ### ⚠ BREAKING CHANGES
8
+ - **Transport**: `weight` definition changed from "share (0-1)" to "Total vehicle payload in tonnes". This requires data migration for existing records.
9
+
10
+ ### Features
11
+ - **Process Types**: Added `PyrolysisProcess` and `DistillationProcess`.
12
+ - **ToolInstance**: Added `specs` (flexible map for capacity, material, etc.) and `components` (nested tools) to support complex equipment hierarchies like pyrolysis reactors.
13
+ - **Process**: Added `parameters` to `GenericProcess` for capturing real-time or run-specific data (pressure, speed, etc.).
14
+ - **Icons**: Added icons for new processes (`local_fire_department` for Pyrolysis, `science` for Distillation).
15
+
16
+ ## [0.3.0] - 2026-01-19
17
+
18
+ ### ⚠ BREAKING CHANGES
19
+ - **Renaming**: `MachineInstance` is renamed to `ToolInstance`. All references to `machineInstance` in processes are renamed to `toolInstance`.
20
+ - **Structure**: `hr` (Human Resources) field moved from `ToolInstance` to `Process` interface. It is now a sibling of `toolInstance`.
21
+ - **Typing**: `Hr.tasks` is now `string[]` (array of strings) instead of `string`.
22
+ - **Typing**: `KnowHow.inputs` is explicitly defined as a JSONata expression string.
23
+ - **Data Model**: Renamed `CartridgeInstance` to `NonFoodInstance` with category `non-food`.
24
+ - **Data Model**: Removed `PackagingProcess` and `StorageProcess`.
25
+ - **Data Model**: Consolidated `ecoLabels` and `qualityAttributes` into a single `labels` array.
26
+
27
+ ### Features
28
+ - Added `hash` field to `ToolInstance`.
29
+ - Added support for ordered steps in `Hr.tasks`.
30
+ - Validation rules in `KnowHow` are now standardized as JSONata.
31
+
32
+ ### Documentation (descriptions.json)
33
+ - Renamed root field `description` to `header`.
34
+ - Updated all labels and examples to reflect the new "Tool" terminology and "JSONata" rules.
@@ -0,0 +1,8 @@
1
+ import { typeDescriptions } from './src/descriptions';
2
+ import * as fs from 'fs';
3
+ import * as path from 'path';
4
+
5
+ // Extract just the fields needed for the client
6
+ const output = JSON.stringify(typeDescriptions, null, 2);
7
+ fs.writeFileSync(path.join(__dirname, 'src/descriptions.json'), output);
8
+ console.log('Generated src/descriptions.json');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trace.market/types",
3
- "version": "0.2.1",
3
+ "version": "0.4.0",
4
4
  "description": "TypeScript type definitions for Trace Market food supply chain data",
5
5
  "author": "Trace Market Team",
6
6
  "license": "MIT",
@@ -19,13 +19,16 @@
19
19
  "blockchain"
20
20
  ],
21
21
  "scripts": {
22
- "prepublishOnly": "npm run validate",
22
+ "prepublishOnly": "npm run validate && npm run generate-json",
23
+ "generate-json": "rm -f src/descriptions.json && npx ts-node generate-json.ts",
23
24
  "validate": "tsc --noEmit",
24
25
  "version": "git add -A",
25
26
  "postversion": "git push && git push --tags"
26
27
  },
27
28
  "devDependencies": {
28
29
  "@types/geojson": "^7946.0.11",
29
- "typescript": "^5.3.3"
30
+ "@types/node": "^25.0.9",
31
+ "ts-node": "^10.9.2",
32
+ "typescript": "^5.9.3"
30
33
  }
31
34
  }
package/package1.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@trace.market/types",
3
+ "version": "0.1.1",
4
+ "description": "TypeScript type definitions for Trace Market food supply chain data",
5
+ "author": "Trace Market Team",
6
+ "license": "MIT",
7
+ "types": "src/index.d.ts",
8
+ "main": "src/index.d.ts",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/entin-hun/tm-types.git"
12
+ },
13
+ "keywords": [
14
+ "typescript",
15
+ "types",
16
+ "food",
17
+ "supply-chain",
18
+ "traceability",
19
+ "blockchain"
20
+ ],
21
+ "scripts": {
22
+ "prepublishOnly": "npm run validate && npm run generate-json",
23
+ "generate-json": "npx ts-node generate-json.ts",
24
+ "validate": "tsc --noEmit",
25
+ "version": "git add -A",
26
+ "postversion": "git push && git push --tags"
27
+ },
28
+ "devDependencies": {
29
+ "@types/geojson": "^7946.0.11",
30
+ "typescript": "^5.3.3"
31
+ }
32
+ }