├── .commitlintrc.json ├── .czrc ├── .editorconfig ├── .eslintignore ├── .eslintrc.json ├── .github └── workflows │ ├── build_test.yml │ └── build_test_release.yml ├── .gitignore ├── .husky ├── commit-msg ├── pre-commit └── prepare-commit-msg ├── .nvmrc ├── .prettierignore ├── .prettierrc ├── .vscode ├── extensions.json └── settings.json ├── LICENSE ├── README.md ├── apps ├── docs │ ├── .eslintrc.json │ ├── components │ │ └── card │ │ │ ├── index.tsx │ │ │ └── style.module.css │ ├── index.d.ts │ ├── next-env.d.ts │ ├── next.config.js │ ├── pages │ │ ├── _app.tsx │ │ ├── _meta.json │ │ ├── about.mdx │ │ ├── docs │ │ │ ├── _meta.json │ │ │ ├── tutorial.mdx │ │ │ └── tutorial │ │ │ │ ├── _meta.json │ │ │ │ ├── advanced │ │ │ │ ├── _meta.json │ │ │ │ └── current-change.mdx │ │ │ │ ├── basic │ │ │ │ ├── action.mdx │ │ │ │ ├── hybrid.mdx │ │ │ │ └── state.mdx │ │ │ │ ├── getting-started.mdx │ │ │ │ ├── registry.mdx │ │ │ │ ├── trrack.mdx │ │ │ │ └── typescript.mdx │ │ ├── index.mdx │ │ ├── index.module.css │ │ ├── showcase.mdx │ │ ├── showcase.module.css │ │ └── typings.d.ts │ ├── postcss.config.js │ ├── project.json │ ├── public │ │ ├── .gitkeep │ │ └── assets │ │ │ ├── trrack_architecture.png │ │ │ ├── trrack_overview.png │ │ │ └── upset2.png │ ├── styles │ │ └── globals.css │ ├── tailwind.config.js │ ├── theme.config.jsx │ └── tsconfig.json ├── dummy-testing-library │ ├── .babelrc │ ├── .browserslistrc │ ├── .eslintrc.json │ ├── project.json │ ├── src │ │ ├── app │ │ │ ├── App.module.css │ │ │ ├── App.tsx │ │ │ ├── components │ │ │ │ └── graphRender.tsx │ │ │ └── utils │ │ │ │ └── translate.ts │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.tsx │ │ ├── polyfills.ts │ │ └── styles.css │ ├── tsconfig.app.json │ └── tsconfig.json ├── react-trrack-example │ ├── .babelrc │ ├── .browserslistrc │ ├── .eslintrc.json │ ├── jest.config.ts │ ├── project.json │ ├── src │ │ ├── app │ │ │ ├── App.tsx │ │ │ ├── components │ │ │ │ └── Navbar.tsx │ │ │ └── store │ │ │ │ ├── trrack.ts │ │ │ │ └── types.ts │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.tsx │ │ ├── polyfills.ts │ │ └── styles.css │ ├── tsconfig.app.json │ ├── tsconfig.json │ └── tsconfig.spec.json ├── rtk-trrack-example │ ├── .babelrc │ ├── .browserslistrc │ ├── .eslintrc.json │ ├── jest.config.ts │ ├── project.json │ ├── src │ │ ├── app │ │ │ ├── App.tsx │ │ │ ├── components │ │ │ │ └── Navbar.tsx │ │ │ ├── features │ │ │ │ ├── counter │ │ │ │ │ ├── counterSlice.ts │ │ │ │ │ └── types.ts │ │ │ │ ├── posts │ │ │ │ │ └── postSlice.ts │ │ │ │ └── todo │ │ │ │ │ ├── taskSlice.ts │ │ │ │ │ └── types.ts │ │ │ └── store │ │ │ │ └── store.ts │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.tsx │ │ ├── polyfills.ts │ │ └── styles.css │ ├── tsconfig.app.json │ ├── tsconfig.json │ └── tsconfig.spec.json └── trrack-lineup-example │ ├── .babelrc │ ├── .eslintrc.json │ ├── browserslist │ ├── jest.config.ts │ ├── project.json │ ├── src │ ├── app │ │ ├── app.element.css │ │ ├── app.element.ts │ │ ├── lineup-manager.ts │ │ └── lineup-setup.ts │ ├── assets │ │ └── .gitkeep │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ ├── polyfills.ts │ ├── styles.css │ └── test-setup.ts │ ├── tsconfig.app.json │ ├── tsconfig.json │ └── tsconfig.spec.json ├── babel.config.json ├── commitlint.config.js ├── index.html ├── jest.config.ts ├── jest.preset.js ├── lint-staged.config.js ├── nx.json ├── package.json ├── packages ├── core │ ├── .babelrc │ ├── .editorconfig │ ├── .eslintrc.json │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── project.json │ ├── release.config.js │ ├── src │ │ ├── event │ │ │ └── index.ts │ │ ├── graph │ │ │ ├── components │ │ │ │ ├── index.ts │ │ │ │ └── node.ts │ │ │ ├── graph-slice.ts │ │ │ ├── index.ts │ │ │ └── provenance-graph.ts │ │ ├── index.ts │ │ ├── provenance │ │ │ ├── index.ts │ │ │ ├── trrack-config-opts.ts │ │ │ ├── trrack-events.ts │ │ │ ├── trrack.ts │ │ │ └── types.ts │ │ ├── registry │ │ │ ├── action.ts │ │ │ ├── index.ts │ │ │ └── reg.ts │ │ └── utils │ │ │ ├── id.ts │ │ │ └── index.ts │ ├── tests │ │ ├── event.spec.ts │ │ ├── import_export.test.ts │ │ ├── metadata-artifact.spec.ts │ │ └── node.spec.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ ├── tsconfig.spec.json │ └── vite.config.ts └── redux │ ├── .babelrc │ ├── .editorconfig │ ├── .eslintrc.json │ ├── CHANGELOG.md │ ├── README.md │ ├── package.json │ ├── project.json │ ├── release.config.js │ ├── src │ ├── index.ts │ ├── slice │ │ ├── index.ts │ │ ├── trrackableSliceCreator.ts │ │ ├── types.ts │ │ └── utils.ts │ └── store │ │ ├── index.ts │ │ ├── trrackStore.ts │ │ ├── trrackableStoreCreator.ts │ │ ├── types.ts │ │ └── utils.ts │ ├── tests │ └── index.spec.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ ├── tsconfig.spec.json │ └── vite.config.ts ├── release.config.base.js ├── tools ├── generators │ └── .gitkeep ├── scripts │ └── publish.mjs └── tsconfig.tools.json ├── tsconfig.base.json ├── vercel.json └── yarn.lock /.commitlintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["@commitlint/config-conventional"], 3 | "rules": {} 4 | } 5 | -------------------------------------------------------------------------------- /.czrc: -------------------------------------------------------------------------------- 1 | { 2 | "path": "@commitlint/cz-commitlint" 3 | } 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | node_modules/ 3 | **/*/node_modules/**/* 4 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "ignorePatterns": ["**/*"], 4 | "plugins": ["@nrwl/nx"], 5 | "globals": { 6 | "vi": true 7 | }, 8 | "overrides": [ 9 | { 10 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], 11 | "rules": { 12 | "@nrwl/nx/enforce-module-boundaries": [ 13 | "error", 14 | { 15 | "enforceBuildableLibDependency": true, 16 | "allow": [], 17 | "depConstraints": [ 18 | { 19 | "sourceTag": "*", 20 | "onlyDependOnLibsWithTags": ["*"] 21 | } 22 | ] 23 | } 24 | ] 25 | } 26 | }, 27 | { 28 | "files": ["*.ts", "*.tsx"], 29 | "extends": ["plugin:@nrwl/nx/typescript"], 30 | "rules": {} 31 | }, 32 | { 33 | "files": ["*.js", "*.jsx"], 34 | "extends": ["plugin:@nrwl/nx/javascript"], 35 | "rules": {} 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /.github/workflows/build_test.yml: -------------------------------------------------------------------------------- 1 | name: Build -> Test 2 | 3 | on: 4 | push: 5 | branches-ignore: 6 | - main 7 | - next 8 | - alpha 9 | - beta 10 | - '*.x*' 11 | pull_request: 12 | branches: 13 | - main 14 | - next 15 | - alpha 16 | - beta 17 | - '*.x*' 18 | 19 | jobs: 20 | test: 21 | name: Test -> Build 22 | runs-on: ubuntu-latest 23 | 24 | steps: 25 | - name: Checkout 26 | uses: actions/checkout@v3 27 | with: 28 | fetch-depth: 0 29 | 30 | - name: Track main 31 | run: git branch --track main origin/main || echo "Already done" 32 | 33 | - name: 'Derive appropriate SHAs for base and head for `nx affected` commands' 34 | uses: nrwl/nx-set-shas@v3 35 | 36 | - run: | 37 | echo "BASE: ${{ env.NX_BASE }}" 38 | echo "HEAD: ${{ env.NX_HEAD }}" 39 | 40 | - name: Setup LTS Node 41 | uses: actions/setup-node@v3 42 | with: 43 | node-version: 'lts/*' 44 | cache: 'yarn' 45 | 46 | - name: Install yarn 47 | run: npm install -g yarn 48 | 49 | - name: Get yarn cache directory path 50 | id: yarn-cache-dir-path 51 | run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT 52 | 53 | - name: Cache yarn dependencies 54 | uses: actions/cache@v3 55 | id: yarn-cache 56 | with: 57 | path: | 58 | ${{ steps.yarn-cache-dir-path.outputs.dir }} 59 | **\node_modules 60 | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} 61 | restore-keys: | 62 | ${{ runner.os }}-yarn- 63 | 64 | - name: Install dependencies 65 | if: steps.yarn-cache.outputs.cache-hit != 'true' 66 | run: yarn install 67 | 68 | - name: Build 69 | run: | 70 | RUN=CI yarn run build-affected-libs 71 | 72 | - name: Test 73 | run: | 74 | RUN=CI yarn run test-affected-libs 75 | -------------------------------------------------------------------------------- /.github/workflows/build_test_release.yml: -------------------------------------------------------------------------------- 1 | name: Build -> Test -> Release 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | - next 8 | - alpha 9 | - beta 10 | - '*.x*' 11 | 12 | env: 13 | HUSKY: 0 14 | GIT_AUTHOR_NAME: kirangadhave 15 | GIT_AUTHOR_EMAIL: kirangadhave2@gmail.com 16 | GIT_COMMITTER_NAME: kirangadhave 17 | GIT_COMMITTER_EMAIL: kirangadhave2@gmail.com 18 | 19 | jobs: 20 | release: 21 | name: Build -> Test -> Release 22 | runs-on: ubuntu-latest 23 | 24 | steps: 25 | - name: Checkout 26 | uses: actions/checkout@v3 27 | with: 28 | fetch-depth: 0 29 | token: ${{ secrets.TRRACK_GITHUB_TOKEN }} 30 | 31 | - name: Track main 32 | run: git branch --track main origin/main || echo "Already done" 33 | 34 | - name: 'Derive appropriate SHAs for base and head for `nx affected` commands' 35 | uses: nrwl/nx-set-shas@v3 36 | 37 | - run: | 38 | echo "BASE: ${{ env.NX_BASE }}" 39 | echo "HEAD: ${{ env.NX_HEAD }}" 40 | 41 | - name: Setup LTS Node 42 | uses: actions/setup-node@v3 43 | with: 44 | node-version: 'lts/*' 45 | cache: 'yarn' 46 | 47 | - name: Install yarn 48 | run: npm install -g yarn 49 | 50 | - name: Get yarn cache directory path 51 | id: yarn-cache-dir-path 52 | run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT 53 | 54 | - name: Cache yarn dependencies 55 | uses: actions/cache@v3 56 | id: yarn-cache 57 | with: 58 | path: | 59 | ${{ steps.yarn-cache-dir-path.outputs.dir }} 60 | **\node_modules 61 | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} 62 | restore-keys: | 63 | ${{ runner.os }}-yarn- 64 | 65 | - name: Install dependencies 66 | if: steps.yarn-cache.outputs.cache-hit != 'true' 67 | run: yarn install 68 | 69 | - name: Build 70 | run: | 71 | RUN=CI yarn run build-affected-libs 72 | 73 | - name: Test 74 | run: | 75 | RUN=CI yarn run test-affected-libs 76 | 77 | - name: Release 78 | if: ${{ success() && (github.event_name != 'pull_request' || github.event.action == 'closed' && github.event.pull_request.merged == true) }} 79 | env: 80 | GITHUB_TOKEN: ${{ secrets.TRRACK_GITHUB_TOKEN }} 81 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }} 82 | run: | 83 | RUN=CI yarn run release 84 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | yarn-error.log 34 | testem.log 35 | /typings 36 | 37 | # System Files 38 | .DS_Store 39 | Thumbs.db 40 | 41 | # Next.js 42 | .next 43 | 44 | # Nx 45 | migrations.json 46 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | npx --no -- commitlint --edit "$1" || (echo "Commit using 'yarn commit' command"; exit 1;) 5 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | npx lint-staged --relative 5 | -------------------------------------------------------------------------------- /.husky/prepare-commit-msg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | 5 | exec < /dev/tty && npx cz --hook || true < /dev/null 6 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | v18.17.1 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # Add files here to ignore them from prettier formatting 2 | 3 | /dist 4 | /coverage 5 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true 3 | } 4 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "nrwl.angular-console", 4 | "esbenp.prettier-vscode", 5 | "dbaeumer.vscode-eslint", 6 | "firsttris.vscode-jest-runner" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "conventionalCommits.scopes": ["core"] 3 | } 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2022, The Trrack Team 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Trrack 2 | 3 | Trrack stands for **r**eproducible **track**ing. Originally Trrack is a web-based provenance tracking library that can track application state in directed provenance graph. 4 | 5 | This branch implements action based provenance tracking. 6 | 7 | [](https://github.com/Trrack/trrackjs/blob/main/LICENSE) 8 | [](https://www.npmjs.com/package/@trrack/core) 9 | [](https://www.npmjs.com/package/@trrack/core) 10 | [](https://github.com/Trrack/trrackjs/actions/workflows/release.yml?query=branch%3Amain) 11 | 12 | 13 | ## Development 14 | 15 | Clone the repository and switch to `trrack-action` branch. 16 | This project was generated using [Nx](https://nx.dev). Please refer to [Nx](https://nx.dev) for more any questions about monorepo setup. 17 | 18 | ### Basic 19 | Serve the react example by running the following: 20 | 21 | ```bash 22 | npx nx react-trrack-example:serve 23 | ``` 24 | Any changes made to the `core` package will cause updates to the react example for easier testing 25 | 26 | ### Advanced 27 | To get started with development run: 28 | 29 | ```bash 30 | yarn install # Trrack can also work with npm, but it uses workspaces feature which we have only tested with yarn. 31 | 32 | yarn dev:all # Will run all examples 33 | 34 | yarn test:all:watch # Will run tests for all trrack pacakges in watch mode 35 | ``` 36 | 37 | The repository is structured as follows: 38 | 39 | ```bash 40 | trrack-monorepo 41 | | 42 | |--- pacakges # trrack library is located in this folder 43 | |--- core # Core action-based tracking library 44 | |--- redux # Redux toolkit wrapper for core 45 | | 46 | |--- apps # Trrack examples are located in this folder 47 | |--- react-trrack-example 48 | |--- rtk-trrack-example 49 | ``` 50 | 51 | Following the standards for Nx monorepos please install any dependency for the applications directly to root workspace. This ensures all the applications use same versions of any dependency. For the packages, install the dependency to appropriate package. 52 | -------------------------------------------------------------------------------- /apps/docs/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "plugin:@nrwl/nx/react-typescript", 4 | "next", 5 | "next/core-web-vitals", 6 | "../../.eslintrc.json" 7 | ], 8 | "ignorePatterns": ["!**/*", ".next/**/*"], 9 | "overrides": [ 10 | { 11 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], 12 | "rules": { 13 | "@next/next/no-html-link-for-pages": ["error", "apps/docs/pages"] 14 | } 15 | }, 16 | { 17 | "files": ["*.ts", "*.tsx"], 18 | "rules": {} 19 | }, 20 | { 21 | "files": ["*.js", "*.jsx"], 22 | "rules": {} 23 | } 24 | ], 25 | "rules": { 26 | "@next/next/no-html-link-for-pages": "off" 27 | }, 28 | "env": { 29 | "jest": true 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /apps/docs/components/card/index.tsx: -------------------------------------------------------------------------------- 1 | import cn from 'clsx'; 2 | import Link from 'next/link'; 3 | import React from 'react'; 4 | 5 | import styles from './style.module.css'; 6 | 7 | export function Card({ 8 | children, 9 | title, 10 | icon, 11 | image, 12 | arrow, 13 | demo, 14 | href, 15 | ...props 16 | }) { 17 | const animatedArrow = arrow ? ( 18 | 24 | → 25 | 26 | ) : null; 27 | 28 | if (image) { 29 | return ( 30 | 40 | {children} 41 | 48 | {icon} 49 | 50 | {title} 51 | {animatedArrow} 52 | 53 | 54 | 55 | ); 56 | } 57 | 58 | return ( 59 | 69 | 76 | {icon} 77 | {title} 78 | {animatedArrow} 79 | 80 | 81 | ); 82 | } 83 | 84 | export function Cards({ children, num, ...props }) { 85 | return ( 86 |
15 | 16 | Get started → 17 | 18 |
19 | 20 |9 | Some project powered by Trrack 10 |
11 | 12 |{JSON.stringify(post, null, 2)}90 |
19 | : never;
20 | }>;
21 |
22 | export type LabelGenerators = {
23 | [key: string]: LabelGenerator
79 | // : never;
80 | }>;
81 |
82 | export type GeneratedDoUndoActionCreators = {
83 | [key: string]: (
84 | args: Parameters