├── ags ├── .gitignore ├── .npmignore ├── assets │ ├── Standard_dictionary_v4_0_3.ags │ └── Standard_dictionary_v4_0_4.ags ├── .prettierrc ├── src │ ├── rules │ │ ├── index.ts │ │ ├── types.d.ts │ │ └── rulesForParsedAgs │ │ │ ├── types.d.ts │ │ │ ├── index.ts │ │ │ ├── checkGroupAndHeadings.ts │ │ │ ├── checkDataTypes.ts │ │ │ └── checkHeadingsWithDict.ts │ ├── index.ts │ ├── types.ts │ ├── standardDictionaries.ts │ ├── validate.ts │ └── parse.ts ├── eslint.config.mjs ├── jest.config.cjs ├── tsconfig.json ├── rollup.config.js ├── scripts │ ├── profile.cjs │ └── buildDictionaries.ts ├── readme.md ├── package.json └── __tests__ │ └── rules │ ├── rulesForRawData.test.ts │ └── rulesForParsedAgs │ ├── checkGroupAndHeadings.test.ts │ └── checkDataTypes.test.ts ├── ags-validator-app ├── components │ ├── RegisterForm │ │ ├── index.tsx │ │ └── RegisterForm.tsx │ ├── validator │ │ ├── GridView │ │ │ ├── index.tsx │ │ │ └── GridView.tsx │ │ ├── AGSUpload │ │ │ ├── index.tsx │ │ │ └── AGSUpload.tsx │ │ ├── SelectTable │ │ │ ├── index.tsx │ │ │ └── SelectTable.tsx │ │ ├── ViewToolbar │ │ │ ├── index.tsx │ │ │ └── ViewToolbar.tsx │ │ ├── ErrorMessages │ │ │ ├── index.tsx │ │ │ ├── ErrorMessage.tsx │ │ │ ├── SortErrors.tsx │ │ │ └── ErrorMessages.tsx │ │ ├── index.tsx │ │ ├── TextArea │ │ │ ├── index.tsx │ │ │ └── CodeMirrorTextArea.tsx │ │ ├── validator-provider.tsx │ │ ├── store-provider.tsx │ │ └── validator.tsx │ ├── ThemeProvider.tsx │ ├── ui │ │ ├── label.tsx │ │ ├── textarea.tsx │ │ ├── separator.tsx │ │ ├── input.tsx │ │ ├── tooltip.tsx │ │ ├── badge.tsx │ │ ├── popover.tsx │ │ ├── avatar.tsx │ │ ├── button.tsx │ │ ├── tabs.tsx │ │ ├── card.tsx │ │ ├── auto-complete.tsx │ │ ├── table.tsx │ │ ├── dialog.tsx │ │ ├── sheet.tsx │ │ ├── form.tsx │ │ ├── command.tsx │ │ └── dropdown-menu.tsx │ ├── logo │ │ ├── index.tsx │ │ └── groundUpLogo.svg │ ├── ThemeSwitcher.tsx │ ├── NavBar.tsx │ └── mobile-nav.tsx ├── .eslintrc.json ├── app │ ├── favicon.ico │ ├── layout.tsx │ ├── api │ │ └── register │ │ │ └── route.ts │ ├── globals.css │ └── page.tsx ├── next.config.mjs ├── README.md ├── postcss.config.mjs ├── lib │ ├── redux │ │ ├── hooks.ts │ │ └── store.ts │ └── utils.ts ├── components.json ├── .gitignore ├── workers │ ├── validateRawUpdateWorker.js │ └── validateRowUpdateWorker.js ├── package.json ├── tsconfig.json ├── tailwind.config.ts └── hooks │ └── useGridTheme.ts ├── .gitignore ├── package.json ├── .github ├── ISSUE_TEMPLATE │ ├── enhancement.md │ └── bug-report.md ├── workflows │ ├── publish-and-release-ags-lib.yml │ ├── test-ags-lib.yml │ └── check-ags-lib-version.yml └── pull_request_template.md └── README.md /ags/.gitignore: -------------------------------------------------------------------------------- 1 | coverage 2 | dist -------------------------------------------------------------------------------- /ags-validator-app/components/RegisterForm/index.tsx: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **node_modules 2 | package-lock.json 3 | 4 | **.env -------------------------------------------------------------------------------- /ags/.npmignore: -------------------------------------------------------------------------------- 1 | 2 | /node_modules 3 | /src 4 | rollup.config.js 5 | tsconfig.json 6 | .gitignore 7 | -------------------------------------------------------------------------------- /ags-validator-app/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["next/core-web-vitals", "next/typescript"] 3 | } 4 | -------------------------------------------------------------------------------- /ags-validator-app/app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groundup-dev/ags-validator/HEAD/ags-validator-app/app/favicon.ico -------------------------------------------------------------------------------- /ags-validator-app/components/validator/GridView/index.tsx: -------------------------------------------------------------------------------- 1 | import GridView from "./GridView"; 2 | 3 | export default GridView; 4 | -------------------------------------------------------------------------------- /ags-validator-app/components/validator/AGSUpload/index.tsx: -------------------------------------------------------------------------------- 1 | import AGSUpload from "./AGSUpload"; 2 | 3 | export default AGSUpload; 4 | -------------------------------------------------------------------------------- /ags-validator-app/components/validator/SelectTable/index.tsx: -------------------------------------------------------------------------------- 1 | import SelectTable from "./SelectTable"; 2 | 3 | export default SelectTable; 4 | -------------------------------------------------------------------------------- /ags-validator-app/components/validator/ViewToolbar/index.tsx: -------------------------------------------------------------------------------- 1 | import ViewToolbar from "./ViewToolbar"; 2 | 3 | export default ViewToolbar; 4 | -------------------------------------------------------------------------------- /ags-validator-app/next.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = {}; 3 | 4 | export default nextConfig; 5 | -------------------------------------------------------------------------------- /ags/assets/Standard_dictionary_v4_0_3.ags: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groundup-dev/ags-validator/HEAD/ags/assets/Standard_dictionary_v4_0_3.ags -------------------------------------------------------------------------------- /ags/assets/Standard_dictionary_v4_0_4.ags: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/groundup-dev/ags-validator/HEAD/ags/assets/Standard_dictionary_v4_0_4.ags -------------------------------------------------------------------------------- /ags-validator-app/components/validator/ErrorMessages/index.tsx: -------------------------------------------------------------------------------- 1 | import ErrorMessages from "./ErrorMessages"; 2 | 3 | export default ErrorMessages; 4 | -------------------------------------------------------------------------------- /ags-validator-app/components/validator/index.tsx: -------------------------------------------------------------------------------- 1 | import ValidatorProvider from "./validator-provider"; 2 | 3 | export default ValidatorProvider; 4 | -------------------------------------------------------------------------------- /ags-validator-app/components/validator/TextArea/index.tsx: -------------------------------------------------------------------------------- 1 | import CodeMirrorTextArea from "./CodeMirrorTextArea"; 2 | 3 | export default CodeMirrorTextArea; 4 | -------------------------------------------------------------------------------- /ags/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "trailingComma": "all", 3 | "semi": true, 4 | "printWidth": 80, 5 | "tabWidth": 2, 6 | "endOfLine": "auto" 7 | 8 | } -------------------------------------------------------------------------------- /ags-validator-app/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Getting Started 4 | 5 | First, run the development server: 6 | 7 | ```bash 8 | npm run dev 9 | 10 | ``` 11 | 12 | -------------------------------------------------------------------------------- /ags-validator-app/postcss.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('postcss-load-config').Config} */ 2 | const config = { 3 | plugins: { 4 | tailwindcss: {}, 5 | }, 6 | }; 7 | 8 | export default config; 9 | -------------------------------------------------------------------------------- /ags/src/rules/index.ts: -------------------------------------------------------------------------------- 1 | import { rulesForRawString } from "./rulesForRawData"; 2 | import { 3 | rulesForParsedAgs, 4 | rulesForParsedAgsWithDict, 5 | } from "./rulesForParsedAgs"; 6 | 7 | export { rulesForRawString, rulesForParsedAgs, rulesForParsedAgsWithDict }; 8 | -------------------------------------------------------------------------------- /ags-validator-app/components/validator/validator-provider.tsx: -------------------------------------------------------------------------------- 1 | import StoreProvider from "./store-provider"; 2 | import Validator from "./validator"; 3 | 4 | export default function ValidatorProvider() { 5 | return ( 6 | 7 | 8 | 9 | ); 10 | } 11 | -------------------------------------------------------------------------------- /ags/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import globals from "globals"; 2 | import pluginJs from "@eslint/js"; 3 | import tseslint from "typescript-eslint"; 4 | 5 | 6 | export default [ 7 | {files: ["**/*.{js,mjs,cjs,ts}"]}, 8 | {languageOptions: { globals: globals.browser }}, 9 | pluginJs.configs.recommended, 10 | ...tseslint.configs.recommended, 11 | ]; -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ags-validator", 3 | "workspaces" : [ 4 | "ags", "ags-validator-app" 5 | ], 6 | "version": "0.0.1", 7 | "main": "index.js", 8 | "scripts": { 9 | "test": "echo \"Error: no test specified\" && exit 1" 10 | }, 11 | "author": "", 12 | "license": "", 13 | "description": "" 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ags/jest.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: 'ts-jest', 3 | testEnvironment: 'node', 4 | moduleFileExtensions: ['ts', 'js'], 5 | transform: { 6 | '^.+\\.(ts|tsx)$': 'ts-jest', // Use ts-jest to transform TypeScript files 7 | }, 8 | 9 | // setupFilesAfterEnv: ['./jest.setup.js'], // Adjust if you have setup files 10 | }; 11 | -------------------------------------------------------------------------------- /ags-validator-app/components/ThemeProvider.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import * as React from "react"; 4 | import { 5 | ThemeProvider as NextThemesProvider, 6 | ThemeProviderProps, 7 | } from "next-themes"; 8 | 9 | export function ThemeProvider({ children, ...props }: ThemeProviderProps) { 10 | return {children}; 11 | } 12 | -------------------------------------------------------------------------------- /ags/src/rules/types.d.ts: -------------------------------------------------------------------------------- 1 | import { AgsRaw, AgsError, AgsDictionaryVersion } from "../types"; 2 | 3 | // abstract version of the validation step 4 | export type AgsValidationStep = { 5 | rule: number | string; 6 | description: string; 7 | validate: ( 8 | rawAgs: TInputType, 9 | dictVersion?: AgsDictionaryVersion, 10 | ) => AgsError[]; 11 | }; 12 | -------------------------------------------------------------------------------- /ags/src/rules/rulesForParsedAgs/types.d.ts: -------------------------------------------------------------------------------- 1 | import { AgsDictionaryVersion, AgsError, AgsRaw } from "../../types"; 2 | import { AgsValidationStep } from "../types"; 3 | 4 | export type AgsValidationStepParsed = AgsValidationStep; 5 | 6 | export type AgsValidationStepParsedWithDict = AgsValidationStep & { 7 | validate: (rawAgs: AgsRaw, dictVersion: AgsDictionaryVersion) => AgsError[]; 8 | }; 9 | -------------------------------------------------------------------------------- /ags-validator-app/lib/redux/hooks.ts: -------------------------------------------------------------------------------- 1 | import { useDispatch, useSelector, useStore } from "react-redux"; 2 | import type { AppDispatch, AppStore, RootState } from "./store"; 3 | 4 | // Use throughout your app instead of plain `useDispatch` and `useSelector` 5 | export const useAppDispatch = useDispatch.withTypes(); 6 | export const useAppSelector = useSelector.withTypes(); 7 | export const useAppStore = useStore.withTypes(); 8 | -------------------------------------------------------------------------------- /ags-validator-app/components.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://ui.shadcn.com/schema.json", 3 | "style": "default", 4 | "rsc": true, 5 | "tsx": true, 6 | "tailwind": { 7 | "config": "tailwind.config.ts", 8 | "css": "app/globals.css", 9 | "baseColor": "neutral", 10 | "cssVariables": true, 11 | "prefix": "" 12 | }, 13 | "aliases": { 14 | "components": "@/components", 15 | "utils": "@/lib/utils", 16 | "ui": "@/components/ui", 17 | "lib": "@/lib", 18 | "hooks": "@/hooks" 19 | }, 20 | "iconLibrary": "lucide" 21 | } 22 | -------------------------------------------------------------------------------- /ags-validator-app/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | .yarn/install-state.gz 8 | 9 | # testing 10 | /coverage 11 | 12 | # next.js 13 | /.next/ 14 | /out/ 15 | 16 | # production 17 | /build 18 | 19 | # misc 20 | .DS_Store 21 | *.pem 22 | 23 | # debug 24 | npm-debug.log* 25 | yarn-debug.log* 26 | yarn-error.log* 27 | 28 | # local env files 29 | .env*.local 30 | 31 | # vercel 32 | .vercel 33 | 34 | # typescript 35 | *.tsbuildinfo 36 | next-env.d.ts 37 | -------------------------------------------------------------------------------- /ags-validator-app/components/validator/store-provider.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | import { useRef } from "react"; 3 | import { Provider } from "react-redux"; 4 | import { makeStore, AppStore } from "@/lib/redux/store"; 5 | 6 | export default function StoreProvider({ 7 | children, 8 | }: { 9 | children: React.ReactNode; 10 | }) { 11 | const storeRef = useRef(); 12 | if (!storeRef.current) { 13 | // Create the store instance the first time this renders 14 | storeRef.current = makeStore(); 15 | } 16 | 17 | return {children}; 18 | } 19 | -------------------------------------------------------------------------------- /ags/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2018", 4 | "module": "ESNext", 5 | "moduleResolution": "node", 6 | "lib": ["ES2018", "DOM"], 7 | "declaration": true, 8 | "declarationMap": true, 9 | "sourceMap": true, 10 | "outDir": "./dist", 11 | "rootDir": "src", 12 | "strict": true, 13 | "esModuleInterop": true, 14 | "skipLibCheck": true, 15 | "forceConsistentCasingInFileNames": true, 16 | "resolveJsonModule": true 17 | }, 18 | "include": ["src/**/*", "assets/**/*.json"], 19 | "exclude": ["node_modules", "dist", "**/*.test.ts"] 20 | } 21 | -------------------------------------------------------------------------------- /ags/rollup.config.js: -------------------------------------------------------------------------------- 1 | import typescript from '@rollup/plugin-typescript'; 2 | import json from '@rollup/plugin-json'; 3 | import { nodeResolve } from '@rollup/plugin-node-resolve'; 4 | 5 | export default { 6 | input: 'src/index.ts', 7 | output: { 8 | dir: 'dist', 9 | format: 'esm', 10 | sourcemap: true, 11 | }, 12 | plugins: [ 13 | nodeResolve(), 14 | json({ 15 | compact: true, 16 | preferConst: true, 17 | namedExports: true, 18 | }), 19 | typescript({ 20 | tsconfig: './tsconfig.json', 21 | declaration: true, 22 | declarationMap: true, 23 | }), 24 | ], 25 | external: ['zod'], 26 | }; -------------------------------------------------------------------------------- /ags/src/rules/rulesForParsedAgs/index.ts: -------------------------------------------------------------------------------- 1 | import { rule19, rule19a, rule19b, rule7 } from "./checkGroupAndHeadings"; 2 | import { rule10a, rule10b, rule10c, rule9 } from "./checkHeadingsWithDict"; 3 | import { 4 | rule11, 5 | rule13, 6 | rule14, 7 | rule15, 8 | rule16, 9 | rule17, 10 | } from "./checkRequiredGroups"; 11 | import { rule8 } from "./checkDataTypes"; 12 | 13 | export const rulesForParsedAgs = { 14 | rule7, 15 | rule8, 16 | rule19, 17 | rule19a, 18 | rule19b, 19 | }; 20 | 21 | export const rulesForParsedAgsWithDict = { 22 | rule10a, 23 | rule10b, 24 | rule10c, 25 | rule9, 26 | rule11, 27 | rule13, 28 | rule14, 29 | rule15, 30 | rule16, 31 | rule17, 32 | }; 33 | -------------------------------------------------------------------------------- /ags/src/index.ts: -------------------------------------------------------------------------------- 1 | import { 2 | validateAgsData, 3 | validateAgsDataParsed, 4 | validateAgsDataParsedWithDict, 5 | defaultRulesConfig, 6 | } from "./validate"; 7 | import type { RulesConfig } from "./validate"; 8 | 9 | import type { 10 | AgsError, 11 | AgsRaw, 12 | AgsDictionaryVersion, 13 | GroupRaw, 14 | HeadingRaw, 15 | RowRaw, 16 | } from "./types"; 17 | import { parsedAgsToString } from "./parse"; 18 | 19 | export { 20 | defaultRulesConfig, 21 | validateAgsData, 22 | validateAgsDataParsed, 23 | validateAgsDataParsedWithDict, 24 | AgsError, 25 | AgsRaw, 26 | AgsDictionaryVersion, 27 | GroupRaw, 28 | parsedAgsToString, 29 | HeadingRaw, 30 | RowRaw, 31 | RulesConfig, 32 | }; 33 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/enhancement.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Enhancement Request 3 | about: Suggest an idea for improving the application 4 | title: "[ENHANCEMENT] Brief description of the enhancement" 5 | labels: enhancement 6 | assignees: '' 7 | --- 8 | 9 | **Is Your Enhancement Related to a Problem? Please Describe.** 10 | A clear and concise description of the problem or need. 11 | 12 | **Describe the Solution You'd Like** 13 | A clear and concise description of what you want to happen. 14 | 15 | **Describe Alternatives You've Considered** 16 | A clear and concise description of any alternative solutions or features you've considered. 17 | 18 | **Additional Context** 19 | Add any other context or screenshots about the feature request here. 20 | -------------------------------------------------------------------------------- /ags/scripts/profile.cjs: -------------------------------------------------------------------------------- 1 | // Importing fs module using CommonJS 2 | const fs = require('fs'); 3 | 4 | const filepath = '/Users/jamesholcombe/Documents/git/ags-validator/B MONAGS_output_9.ags'; 5 | 6 | // Define an async function to handle the dynamic import of validateAgsData 7 | async function main() { 8 | // Dynamically import the validateAgsData function from the ES module 9 | const { validateAgsData } = await import('../dist/index.js'); 10 | 11 | // Read the file 12 | const data = fs.readFileSync(filepath, 'utf8'); 13 | 14 | // Validate the data 15 | const { errors, parsedAgs } = validateAgsData(data); 16 | 17 | console.log(errors); 18 | } 19 | 20 | // Execute the main function 21 | main().catch(err => console.error(err)); 22 | -------------------------------------------------------------------------------- /ags-validator-app/lib/redux/store.ts: -------------------------------------------------------------------------------- 1 | import { configureStore } from "@reduxjs/toolkit"; 2 | import { agsSlice } from "./ags"; 3 | 4 | export const makeStore = () => { 5 | return configureStore({ 6 | reducer: { 7 | ags: agsSlice.reducer, 8 | }, 9 | // middleware: (getDefaultMiddleware) => 10 | // getDefaultMiddleware({ 11 | // serializableCheck: false, 12 | // immutableCheck: false, 13 | // actionCreatorCheck: false, 14 | // }), 15 | }); 16 | }; 17 | 18 | // Infer the type of makeStore 19 | export type AppStore = ReturnType; 20 | // Infer the `RootState` and `AppDispatch` types from the store itself 21 | export type RootState = ReturnType; 22 | export type AppDispatch = AppStore["dispatch"]; 23 | -------------------------------------------------------------------------------- /ags-validator-app/workers/validateRawUpdateWorker.js: -------------------------------------------------------------------------------- 1 | import { validateAgsData } from "@groundup/ags"; 2 | 3 | 4 | self.onmessage = (event) => { 5 | 6 | const {rawData, rulesConfig, agsDictionaryVersion } = event.data; 7 | 8 | 9 | const {errors, parsedAgs} = validateAgsData(rawData,agsDictionaryVersion, rulesConfig); 10 | 11 | 12 | const parsedAgsNormalized = parsedAgs ? Object.fromEntries( 13 | Object.entries(parsedAgs).map(([label, group]) => [ 14 | label, 15 | { 16 | ...group, 17 | rows: Object.fromEntries( 18 | group.rows.map((row) => [row.lineNumber, row]) 19 | ), 20 | }, 21 | ])) : undefined; 22 | 23 | self.postMessage({ parsedAgsNormalized, errors }); 24 | }; 25 | -------------------------------------------------------------------------------- /.github/workflows/publish-and-release-ags-lib.yml: -------------------------------------------------------------------------------- 1 | name: Publish and Release AGS Package 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | paths: 8 | - 'ags/**' 9 | - '.github/workflows/publish-and-release-ags-lib.yml' 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | permissions: 14 | contents: read 15 | id-token: write 16 | steps: 17 | - uses: actions/checkout@v4 18 | # Setup .npmrc file to publish to npm 19 | - uses: actions/setup-node@v4 20 | with: 21 | node-version: '20.x' 22 | registry-url: 'https://registry.npmjs.org' 23 | - run: npm install --workspace ags 24 | - run: npm publish --workspace ags 25 | env: 26 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} 27 | 28 | -------------------------------------------------------------------------------- /ags-validator-app/lib/utils.ts: -------------------------------------------------------------------------------- 1 | import { clsx, type ClassValue } from "clsx"; 2 | import { twMerge } from "tailwind-merge"; 3 | 4 | export function cn(...inputs: ClassValue[]) { 5 | return twMerge(clsx(inputs)); 6 | } 7 | 8 | export function capitalize(str: string) { 9 | return str.charAt(0).toUpperCase() + str.slice(1); 10 | } 11 | 12 | export function downloadFile(data: string, filename: string) { 13 | const dataStr = "data:text/plain;charset=utf-8," + encodeURIComponent(data); 14 | const downloadAnchorNode = document.createElement("a"); 15 | downloadAnchorNode.setAttribute("href", dataStr); 16 | downloadAnchorNode.setAttribute("download", filename); 17 | document.body.appendChild(downloadAnchorNode); // required for firefox 18 | downloadAnchorNode.click(); 19 | downloadAnchorNode.remove(); 20 | } 21 | -------------------------------------------------------------------------------- /ags/readme.md: -------------------------------------------------------------------------------- 1 | # Ags Validation Library 2 | 3 | This is a TypeScript library for validating AGS (Association of Geotechnical & Geoenvironmental Specialists) data files. 4 | ## Features 5 | 6 | - Validates AGS4 data files 7 | - Provides detailed error reporting 8 | - Supports all versions of AGS4 9 | 10 | ## Installation 11 | 12 | To install the AGS Validation Library, use npm: 13 | 14 | ```bash 15 | npm install @groundup-dev/ags 16 | ``` 17 | 18 | ## Usage 19 | 20 | ```javascript 21 | 22 | import { 23 | validateAgsData, 24 | 25 | } from "@groundup-dev/ags"; 26 | 27 | const agsData = "" // your ags data as string 28 | 29 | const dictVersion = "v4_0_4" 30 | // options: 31 | // "v4_0_3" | "v4_1_1" | "v4_1" | "v4_0_4"; 32 | 33 | const { errors, parsedData } = validateAgsData(agsData, dictVersion) 34 | 35 | 36 | ``` 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /ags-validator-app/components/ui/label.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | 3 | import * as React from "react" 4 | import * as LabelPrimitive from "@radix-ui/react-label" 5 | import { cva, type VariantProps } from "class-variance-authority" 6 | 7 | import { cn } from "@/lib/utils" 8 | 9 | const labelVariants = cva( 10 | "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" 11 | ) 12 | 13 | const Label = React.forwardRef< 14 | React.ElementRef, 15 | React.ComponentPropsWithoutRef & 16 | VariantProps 17 | >(({ className, ...props }, ref) => ( 18 | 23 | )) 24 | Label.displayName = LabelPrimitive.Root.displayName 25 | 26 | export { Label } 27 | -------------------------------------------------------------------------------- /ags-validator-app/components/ui/textarea.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | 3 | import { cn } from "@/lib/utils"; 4 | 5 | export interface TextareaProps 6 | extends React.TextareaHTMLAttributes {} 7 | 8 | const Textarea = React.forwardRef( 9 | ({ className, ...props }, ref) => { 10 | return ( 11 |