Skip to content
Draft

I18n #372

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
2818 commits
Select commit Hold shift + click to select a range
c1384da
Merge pull request #312 from valbuild/changeset-release/main
freekh May 23, 2025
f100648
Raw now support objects / arrays / etc...
freekh May 23, 2025
9e0290b
Add getUnpatchedUnencodedVal for tooling
freekh May 25, 2025
41172e8
Import type RawString instead of RawString
freekh May 25, 2025
f07c9ad
Import types
freekh May 25, 2025
1e792c0
Add missing stegaEncode in list
freekh May 25, 2025
4e05200
Rename DecodeValEncodedString to DecodeVal
freekh May 25, 2025
b127c57
Changeset
freekh May 25, 2025
ac53223
Version Packages
github-actions[bot] May 25, 2025
e9525cd
Merge pull request #313 from valbuild/changeset-release/main
freekh May 25, 2025
ee9771a
DecodeVal in functions as well
freekh May 25, 2025
f3c4a13
Also DecodeVal of RichText
freekh May 25, 2025
f560f97
Changeset
freekh May 25, 2025
f9f9eef
Import type
freekh May 25, 2025
ac594d2
Version Packages
github-actions[bot] May 25, 2025
20a419c
Merge pull request #314 from valbuild/changeset-release/main
freekh May 25, 2025
1850e74
Improve error message
freekh May 31, 2025
a6bd470
Rm orphan statement
freekh May 31, 2025
011f0e6
Add min / max validations to number
freekh Jun 3, 2025
62de4cb
Fix ValPath for source path of module files
freekh Jun 11, 2025
96a8447
Fix keysof for empty string modules (e.g. modules that are just a str…
freekh Jun 12, 2025
71f8ed7
Improve validation errors styling
freekh Jun 13, 2025
86970fd
Add popover menu for array items, put delete inside menu
freekh Jun 13, 2025
520509e
Do not use transparent for fields inside the union objects...
freekh Jun 13, 2025
a9a1ead
Add duplicate in array popover menu
freekh Jun 13, 2025
6a77cdc
Show errors inside array of string
freekh Jun 13, 2025
b6e3148
Update UX of validation error menu
freekh Jun 13, 2025
8b380c7
Fix issue richtext editor crashing when changing between types of obj…
freekh Jun 13, 2025
9414271
More space between field label and content
freekh Jun 13, 2025
e9dd307
Avoid overflowing in cards
freekh Jun 13, 2025
48eb806
Update name of null preview to something more user friendly
freekh Jun 13, 2025
1dee14a
Lint
freekh Jun 13, 2025
d4d138b
Changeset
freekh Jun 13, 2025
2c741bc
Version Packages
github-actions[bot] Jun 13, 2025
4eed73e
Merge pull request #317 from valbuild/changeset-release/main
freekh Jun 13, 2025
dedf2ab
Make internal validate method protected, renamed to executeValidate...
freekh Jun 13, 2025
7fedf55
Make assert protected and rename to executeAssert
freekh Jun 13, 2025
8aa7823
Make serialize protected and rename to executeSerialize
freekh Jun 13, 2025
0162b0e
Make all properties private to avoid end-users seeing options that ar…
freekh Jun 13, 2025
64ffb72
Add custom validation functions
freekh Jun 13, 2025
f256e5b
Avoid overflowing on select
freekh Jun 13, 2025
9d11396
Remove annoying loading in string
freekh Jun 13, 2025
34d9ddc
Update look n feel of validation errors
freekh Jun 13, 2025
c71bbbc
Add tool tip on publish button if validation errors are found
freekh Jun 13, 2025
0e9432e
Add message to string regexp validation
freekh Jun 13, 2025
fdb7411
Add missing validate method to array
freekh Jun 13, 2025
3c03546
Complete validate functions for all schema types, add customValidate …
freekh Jun 13, 2025
7809b19
Changeset
freekh Jun 13, 2025
922a08d
Update button theme
freekh Jun 16, 2025
090cda2
Update date field button
freekh Jun 16, 2025
e2ef929
More minor UX updates to buttons
freekh Jun 16, 2025
9c8beaa
Fix s.number().nullable()
freekh Jun 19, 2025
5c648ad
Version Packages
github-actions[bot] Jun 19, 2025
e20f006
Merge pull request #323 from valbuild/changeset-release/main
freekh Jun 19, 2025
0846da7
Fix ValImage runtime failures where src is null
freekh Jun 27, 2025
f6eda3a
Add create script for valbuild
freekh Jun 27, 2025
3a07a22
Changeset
freekh Jun 27, 2025
b570500
Remove eslint from valiation script...
freekh Jun 27, 2025
10dce70
Update package-lock
freekh Jun 27, 2025
6321f56
Lint
freekh Jun 27, 2025
c55d0b4
Remove shebang from index.ts...
freekh Jun 27, 2025
29cd241
Version Packages
github-actions[bot] Jun 27, 2025
80956a4
Merge pull request #347 from valbuild/changeset-release/main
freekh Jun 27, 2025
6d4e4b2
Fix bin.js in create
freekh Jun 27, 2025
c2af3d6
Version Packages
github-actions[bot] Jun 27, 2025
5a55e48
Merge pull request #348 from valbuild/changeset-release/main
freekh Jun 27, 2025
f2a5732
Update README.md
freekh Jun 29, 2025
eb74e94
Update README.md
freekh Jun 29, 2025
ce82a7f
Update README.md
freekh Jun 29, 2025
f9031f2
Update README.md
freekh Jun 29, 2025
7f871e7
Update README.md
freekh Jun 29, 2025
20b1dea
Rename preview -> render...
freekh Jul 1, 2025
99d70ed
After renaming preview to render, select is more appropriate than pre…
freekh Jul 1, 2025
4546bc5
Changeset
freekh Jul 2, 2025
f301d59
Merge pull request #349 from valbuild/refactor-preview-into-render
freekh Jul 2, 2025
cbb9aaa
Fix sync engine get sync status snapshot
freekh Jun 20, 2025
d5bc2aa
Add .routes() to record for sitemap support...
freekh Jun 20, 2025
1801ecb
Version Packages
github-actions[bot] Jul 2, 2025
68b9595
Add useShallowModulesAtPaths (plural)...
freekh Jun 21, 2025
31e5d5f
Add getSitemapTree
freekh Jun 21, 2025
63f048c
Fix s.number().nullable()
freekh Jun 19, 2025
23c0b56
Overlay menu items is now centered
freekh Jun 23, 2025
2cf3a8d
Fix capitalization for module file path with routes (/foo/[...bar]/te…
freekh Jun 23, 2025
4c68954
WIP: basic UI for sitemap
freekh Jun 24, 2025
32c5952
Spelling
freekh Jun 24, 2025
ec71a7d
Spelling
freekh Jun 24, 2025
1d5907e
Improve naming
freekh Jun 24, 2025
6c0a388
Fix broken invalidation of sources....
freekh Jun 24, 2025
b97c0d6
WIP: working on the various add / remove buttons for urls
freekh Jun 26, 2025
80a9241
Tailwind classes
freekh Jul 1, 2025
37498fe
WIP: completed add record, remaining change record
freekh Jul 1, 2025
306f670
Merge pull request #350 from valbuild/changeset-release/main
freekh Jul 2, 2025
013ec11
Add new colors
freekh Jul 2, 2025
801d9db
Group colors in index.css
freekh Jul 2, 2025
42bd24c
Remove senary colors (unused)
freekh Jul 2, 2025
43e1e36
Remove quinary colors
freekh Jul 2, 2025
38ebf26
Clean up colors classes
freekh Jul 2, 2025
52e82b1
More color clean up
freekh Jul 2, 2025
00a6a2b
Update brand colors, fix primary button
freekh Jul 2, 2025
d3f2e62
Clean up colors (errors, secondary)
freekh Jul 2, 2025
2ce4d3c
Color cleanup: remove text-
freekh Jul 2, 2025
df34aee
Clean up colors: fix disabled, remove more text-, remove quaternary
freekh Jul 2, 2025
865540e
Add bg-primary-hover
freekh Jul 2, 2025
0e4dfdc
Add bg-primary-alt
freekh Jul 2, 2025
e3d5d12
Replace bg-primary-alt with fg-primary-alt
freekh Jul 2, 2025
72916ab
Add fg-secondary-alt
freekh Jul 2, 2025
3dd6247
Remove unused color vars from index.css
freekh Jul 2, 2025
a0fc9cd
Nicer badges and tooltips for change sets
freekh Jul 2, 2025
85e0e4a
Nicer tooltip to add record
freekh Jul 2, 2025
e744bee
Fix button inside button issues
freekh Jul 2, 2025
ea78ed1
Fix broken button
freekh Jul 2, 2025
b0f4cf4
Use tooltip instead of hover card to be more consistent with add records
freekh Jul 2, 2025
5c4be89
Use tooltip where appropriate (for tool tips)
freekh Jul 2, 2025
3f8a166
Add tooltip to auto-save
freekh Jul 2, 2025
700fb2d
Fix tooltip trigger button in button issue
freekh Jul 2, 2025
be651e1
Refactor sitemap out of nav menu
freekh Jul 2, 2025
f713712
Change variant of summary button
freekh Jul 2, 2025
973ec99
Create a revert all button
freekh Jul 2, 2025
3be57c4
Fix destructive button
freekh Jul 2, 2025
8840675
Use rename / delete records consistently in record tools and in sitemap
freekh Jul 2, 2025
68623f9
Add a confirmation popup before undo changes
freekh Jul 2, 2025
45783e0
Lint
freekh Jul 2, 2025
5119a8a
Fix button in button
freekh Jul 2, 2025
1e7e054
Make explorer default open + padding
freekh Jul 2, 2025
1f62d07
Sitemap UX updates and fixes
freekh Jul 2, 2025
e2e15e6
Fix issue where you could delete the single page
freekh Jul 2, 2025
72dcb7d
Refactor out useTrees
freekh Jul 2, 2025
648a4a9
Add router-enabled preview button
freekh Jul 2, 2025
9820b3d
Nicer overlay buttons
freekh Jul 3, 2025
7327365
Open/close sitemap node on clicks if it is not a page
freekh Jul 3, 2025
d9d989a
Loading indicator in nav menu (especially nice on mobile)
freekh Jul 3, 2025
7bb6983
Refactor out preview button
freekh Jul 3, 2025
19b1e34
Fix secondary button hover
freekh Jul 3, 2025
d9eb748
Make preview button an anchor link, add tooltip
freekh Jul 3, 2025
87673c2
Add confirmation popover on delete record in tools menu and sitemap
freekh Jul 3, 2025
ac1f527
Close popover after rename of record
freekh Jul 3, 2025
e85b02f
Allow circular keyOf for use with .router
freekh Jul 3, 2025
ca9bf85
Update example with link button
freekh Jul 3, 2025
32b7b28
Update UI of keyOf field
freekh Jul 3, 2025
e55d37f
More next app router fixes + add fetchValRouter util
freekh Jul 3, 2025
c6d085f
Fix z index on confirmation popover in draft changes
freekh Jul 3, 2025
ae68bd8
Simplify example Schema types
freekh Jul 3, 2025
97e1801
Update link example
freekh Jul 4, 2025
e2aef10
Fix typo
freekh Jul 4, 2025
114184c
Auto-fix button in UI if type of source is wrong
freekh Jul 4, 2025
d1f02e0
Fix missing rename in non-router record children
freekh Jul 4, 2025
62e63ac
Add icon to content explorer
freekh Jul 4, 2025
7770d30
Add underline on site map nodes if current route
freekh Jul 4, 2025
6e9eb29
Change label of main page from / to main page since it might be hard …
freekh Jul 4, 2025
31fa282
Use same icons in preview and nav sections
freekh Jul 4, 2025
8088bbf
UI updates to nav menu and site map
freekh Jul 4, 2025
3d4c8a0
Fix issue where non-leaf nodes also are pages
freekh Jul 4, 2025
5857341
Tweak sources and all sources invalidation...
freekh Jul 4, 2025
eee7741
Fix useShallowModulesAtPath
freekh Jul 4, 2025
0857e8e
Rm console.log
freekh Jul 4, 2025
6b21c66
Use router route if available instead of just linking to studio home …
freekh Jul 4, 2025
fac9979
Add min-w to overlay window on large screens
freekh Jul 4, 2025
a4d9213
UI update menu bg
freekh Jul 5, 2025
2c7e0c9
Format
freekh Jul 5, 2025
1a4a624
UI update to date field button
freekh Jul 5, 2025
848249d
Fix example
freekh Jul 5, 2025
8586a76
Make drop zone position a select
freekh Jul 5, 2025
177416a
Fix broken router source path hook
freekh Jul 5, 2025
a19274b
Update broken test data
freekh Jul 5, 2025
47b3e8c
Changeset
freekh Jul 5, 2025
9cd3a34
More icons in sitemap
freekh Jul 5, 2025
0a2e04f
Avoid word break in add route popover
freekh Jul 5, 2025
b5b8bcd
Nicer looking overlay buttons
freekh Jul 5, 2025
5c3994e
Update switch bg color
freekh Jul 5, 2025
6bb0efc
Clean console.{log,debug}
freekh Jul 5, 2025
a7adfb5
Merge pull request #346 from valbuild/app-wide-urls
freekh Jul 5, 2025
9ee1531
Version Packages
github-actions[bot] Jul 5, 2025
2d58dec
Merge pull request #351 from valbuild/changeset-release/main
freekh Jul 7, 2025
2801352
Add avif to common mime types
freekh Jul 7, 2025
6f44a0b
Changeset
freekh Jul 7, 2025
e69c04f
Add useValRoute
freekh Jul 7, 2025
9a503ed
Improve error message
freekh Jul 7, 2025
9eb873d
Fix return type of useValRoute
freekh Jul 7, 2025
4b8a72d
Add fetchValRoute and useValRoute to templates
freekh Jul 7, 2025
c42b549
Add nextAppRouter to templates
freekh Jul 7, 2025
3808fdd
Remove type-assertions
freekh Jul 7, 2025
9487060
Version Packages
github-actions[bot] Jul 7, 2025
7001842
Merge pull request #355 from valbuild/changeset-release/main
freekh Jul 7, 2025
338a221
Fix issue where the overlay would not show the url to the route...
freekh Jul 8, 2025
ab65c0d
Add main page in examples next
freekh Jul 8, 2025
d4840ec
Comments
freekh Jul 8, 2025
b554af3
Also match optional catch-all segments
freekh Jul 8, 2025
9812296
Improve error message if optional
freekh Jul 8, 2025
dccc075
Update generic page example
freekh Jul 8, 2025
177a477
Changeset
freekh Jul 8, 2025
b85ff3c
Hide content explorer if there's nothing to show
freekh Jul 8, 2025
199f516
Make it possible to have unknown params ...
freekh Jul 9, 2025
89e8597
WIP: show patch errors in draft
freekh Aug 11, 2025
4c98225
Fix broken getPatchErrorSnapshot (or at least we think so)
freekh Aug 11, 2025
9d74c3b
Apparently we can be in a situation where we do not find an index...
freekh Aug 11, 2025
d7816d0
Improve patch error UI: add report, ...
freekh Aug 11, 2025
eb43c0f
Add useClient
freekh Aug 11, 2025
4ab69ae
Changeset
freekh Aug 11, 2025
5810d37
Styling updates to draft changes
freekh Aug 12, 2025
b6096bd
Show patch error in offending patch card
freekh Aug 12, 2025
92f98c9
Version Packages
github-actions[bot] Aug 16, 2025
e8365dd
Merge pull request #356 from valbuild/changeset-release/main
freekh Aug 16, 2025
93549a2
Fix error where users could not edit unless there were patch errors
freekh Aug 16, 2025
d338371
Version Packages
github-actions[bot] Aug 16, 2025
635ce19
Merge pull request #357 from valbuild/changeset-release/main
freekh Aug 16, 2025
97a9fda
Fix error message
freekh Aug 16, 2025
d79093d
Simplify query param validation...
freekh Aug 20, 2025
9ac6023
Version Packages
github-actions[bot] Aug 20, 2025
492c352
Merge pull request #360 from valbuild/changeset-release/main
freekh Aug 20, 2025
5513efa
Hope to fix issue where overlay loading spinner would visible even af…
freekh Aug 31, 2025
7eca569
Another stab at fixing how overlay loading appears
freekh Aug 31, 2025
e6fa4a4
Prefix overlay loading classes to avoid changing specificity in user app
freekh Aug 31, 2025
ae1274c
Fix dialog overlay styles
freekh Aug 31, 2025
81b96d6
Use dialog overlay, improve login ui
freekh Aug 31, 2025
ad49d74
Comment
freekh Aug 31, 2025
6245bc0
Reduce flickering when loading Val Studio
freekh Aug 31, 2025
e9f5ffb
Use session storage to save / load config...
freekh Aug 31, 2025
7f719a0
Changeset
freekh Aug 31, 2025
3eb48c8
Add useValRouteUrl and fetchValUrl
freekh Aug 31, 2025
ba91d84
Update packages/next/src/routeFromVal.ts
freekh Aug 31, 2025
0b763dc
Fix wrong type assertion
freekh Aug 31, 2025
4727211
Version Packages
github-actions[bot] Aug 31, 2025
d1465cb
Use a more unique port for the val next example
freekh Sep 17, 2025
3004c84
Add router, render and custom validate to docs
freekh Sep 30, 2025
3008a79
Change license to MIT
freekh Oct 9, 2025
b4f6e82
Changeset
freekh Oct 9, 2025
3160e02
Merge pull request #368 from valbuild/switch-to-mit-license
freekh Oct 9, 2025
49780d0
Update endpoints to use new admin server
freekh Sep 19, 2025
0d71553
Change to new admin server
freekh Sep 19, 2025
a78157b
Change to a simpler endpoint while we are changing the endpoints
freekh Sep 19, 2025
8346691
Update cli endpoint for new admin server
freekh Oct 12, 2025
81a1b38
Fix cli help command
freekh Oct 13, 2025
604a823
Improve error message where exchange code fails
freekh Oct 13, 2025
4ff227a
Add connect CLI command
freekh Oct 13, 2025
d74e456
Replace files command with list-unused-files
freekh Oct 13, 2025
e6aaf57
Changeset
freekh Oct 13, 2025
3a0dc3d
Merge pull request #367 from valbuild/change-to-admin-server
freekh Oct 13, 2025
edb22fa
Version Packages
github-actions[bot] Oct 13, 2025
1cae4dd
Merge pull request #369 from valbuild/changeset-release/main
freekh Oct 13, 2025
7a700f6
Fix connect step to be create-project
freekh Oct 13, 2025
70fcd8f
Version Packages
github-actions[bot] Oct 13, 2025
5e4fe7a
Simplify connect by just using url
freekh Oct 13, 2025
9a2c398
Merge pull request #370 from valbuild/changeset-release/main
freekh Oct 13, 2025
448475f
Update missing links
freekh Oct 13, 2025
5634c0c
Changeset
freekh Oct 13, 2025
b1ac6c5
Fix project url
freekh Oct 13, 2025
1005ad3
Version Packages
github-actions[bot] Oct 13, 2025
4bc8ead
Merge pull request #371 from valbuild/changeset-release/main
freekh Oct 13, 2025
0c55fbf
WIP: experiments with locales
freekh Oct 17, 2025
a27bcca
Added examples of locales
freekh Oct 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
"changelog": false,
"commit": false,
"fixed": [],
"linked": [["@valbuild/*"]],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["example-*"]
}
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
examples/next*
trials

dist
out
tsconfig.tsbuildinfo
27 changes: 27 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* @type {import("eslint").Linter.Config}
*/
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:react/jsx-runtime",
"plugin:@typescript-eslint/recommended",
"prettier",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
plugins: ["react", "@typescript-eslint"],
settings: {
react: {
version: "detect",
},
},
};
83 changes: 83 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Check
on: push
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: npm
- run: npm ci
- run: npm run lint
format:
name: Check format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: npm
- run: npm ci
- run: npm run format
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: npm
- run: npm ci
- run: npm run build
- run: npx jest packages/server/src/readValFile.test.ts
build-next:
name: Build Next.js example
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: npm
- run: npm ci
- run: npm run build
working-directory: examples/next
typecheck:
name: Typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: npm
- run: npm ci
- run: npm run -ws typecheck
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: npm
- run: npm ci
- run: npm test
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: npm
- run: npm ci
- uses: changesets/action@v1
with:
publish: npm run release
version: npm run version-packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ node_modules/
.next
dist
tsconfig.tsbuildinfo
.envrc
.tmp
.DS_Store
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tsconfig.tsbuildinfo
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v22.9.0
17 changes: 17 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# next.js
examples/next*/.next/
examples/next*/out/

# production
examples/next*/build

trials

dist
tsconfig.tsbuildinfo

packages/ui/server/.tmp
out

.tmp
examples/next*/.val/*
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
6 changes: 4 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@
"**/.DS_Store": true,
"**/Thumbs.db": true,
"**/node_modules": true
}
}
},
"cSpell.words": ["flexsearch", "hotspot", "remirror", "retryable", "stega"],
"typescript.preferences.importModuleSpecifier": "relative"
}
7 changes: 7 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright (c) 2025 Fredrik Ekholdt and Blank AS

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
150 changes: 149 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,149 @@
# Val
<p align="center">
<p align="center">
<a href="https://val.build">
<svg width="100" height="100" viewBox="0 0 944 944" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="472" cy="472" r="472" fill="#1D1C28"/>
<g filter="url(#filter0_d_14_601)">
<path d="M181 348C181 345.791 182.791 344 185 344H320C322.209 344 324 345.791 324 348V602C324 604.209 322.209 606 320 606H185C182.791 606 181 604.209 181 602V348Z" fill="#38CD80"/>
</g>
<g filter="url(#filter1_i_14_601)">
<circle cx="252" cy="550" r="24" fill="#1E1F2A"/>
</g>
<path d="M659.085 550.374H658.585H654.427C652.095 550.374 650.434 549.729 649.347 548.522C648.25 547.306 647.658 545.431 647.658 542.807V439.857C647.658 437.924 646.091 436.357 644.158 436.357H629.16C627.227 436.357 625.66 437.924 625.66 439.857V455.828C625.66 456.658 624.986 457.332 624.155 457.332C623.593 457.332 623.072 457.015 622.798 456.508C618.502 448.559 612.704 442.661 605.399 438.838C597.962 434.671 589.622 432.592 580.394 432.592C571.897 432.592 563.846 434.128 556.247 437.2C548.643 440.274 541.944 444.796 536.154 450.761L536.153 450.761C530.537 456.552 526.106 463.693 522.854 472.174C519.598 480.668 517.975 490.411 517.975 501.395V505.697C517.975 516.86 519.597 526.693 522.854 535.187C526.105 543.667 530.535 550.895 536.148 556.864L536.153 556.869L536.159 556.875C541.95 562.659 548.647 567.088 556.246 570.161L556.256 570.165C563.856 573.057 572.083 574.5 580.932 574.5C589.456 574.5 597.527 572.325 605.137 567.982C612.625 563.807 618.519 557.469 622.822 548.992C623.085 548.475 623.609 548.147 624.176 548.147H624.546C625.161 548.147 625.66 548.646 625.66 549.261C625.66 555.468 627.583 560.617 631.452 564.665L631.451 564.665L631.46 564.673C635.511 568.72 640.668 570.735 646.889 570.735H658.585H659.085H661.157H661.657H760C761.933 570.735 763.5 569.168 763.5 567.235V553.874C763.5 551.941 761.933 550.374 760 550.374H733.542C732.161 550.374 731.042 549.255 731.042 547.874V385C731.042 383.067 729.475 381.5 727.542 381.5H680.701C678.768 381.5 677.201 383.067 677.201 385V398.361C677.201 400.294 678.768 401.861 680.701 401.861H706.543C707.924 401.861 709.043 402.981 709.043 404.361V547.874C709.043 549.255 707.924 550.374 706.543 550.374H661.657H661.157H659.085ZM600.117 550.146L600.111 550.149C594.977 552.448 589.304 553.601 583.086 553.601C570.468 553.601 560.194 549.435 552.222 541.12C544.436 532.633 540.512 520.847 540.512 505.697V501.395C540.512 494.274 541.581 487.79 543.712 481.936L543.714 481.931C545.849 475.89 548.778 470.842 552.495 466.775C556.398 462.521 560.92 459.246 566.061 456.944C571.195 454.645 576.867 453.492 583.086 453.492C589.117 453.492 594.696 454.731 599.829 457.207L599.838 457.211L599.848 457.215C605.166 459.517 609.681 462.79 613.4 467.035L613.4 467.035L613.408 467.044C617.306 471.292 620.324 476.431 622.458 482.469L622.459 482.474C624.59 488.328 625.66 494.812 625.66 501.933V505.16C625.66 512.46 624.59 519.125 622.458 525.159C620.324 531.022 617.393 536.075 613.669 540.326C609.95 544.571 605.435 547.844 600.117 550.146ZM464.902 570.735C466.39 570.735 467.716 569.794 468.206 568.389L512.685 441.011C513.479 438.736 511.79 436.357 509.38 436.357H491.006C489.496 436.357 488.157 437.325 487.683 438.758L447.951 558.864C447.716 559.575 447.051 560.055 446.303 560.055C445.554 560.055 444.89 559.575 444.655 558.864L404.923 438.758C404.449 437.325 403.109 436.357 401.6 436.357H383.225C380.815 436.357 379.126 438.736 379.921 441.011L424.399 568.389C424.89 569.794 426.215 570.735 427.704 570.735H464.902Z" fill="white" stroke="white"/>
<defs>
<filter id="filter0_d_14_601" x="127.464" y="290.464" width="250.072" height="369.072" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset/>
<feGaussianBlur stdDeviation="26.768"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0.219608 0 0 0 0 0.803922 0 0 0 0 0.501961 0 0 0 0.3 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_14_601"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_14_601" result="shape"/>
</filter>
<filter id="filter1_i_14_601" x="228" y="526" width="48" height="48" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset/>
<feGaussianBlur stdDeviation="6"/>
<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
<feColorMatrix type="matrix" values="0 0 0 0 0.219608 0 0 0 0 0.803922 0 0 0 0 0.501961 0 0 0 0.3 0"/>
<feBlend mode="normal" in2="shape" result="effect1_innerShadow_14_601"/>
</filter>
</defs>
</svg>
</a>
<br/>
</p>
</p>

# 🐉 HERE BE DRAGONS 🐉

Val is currently in beta - the API can be considered relatively stable, but expect some features to be broken and the UX to be changing.

Join us on [discord](https://discord.gg/cZzqPvaX8k) to get help or give us feedback.

## Table of contents

- [Installation](./packages/next/README.md#Installation)
- [Introduction](#content-as-code)
- [Examples](#examples)
- [Documentation](#documentation)

## Content as code

Val is a CMS library where **content** is **TypeScript** / **JavaScript** files stored in your git repo.

As a CMS, Val is useful because:

- editors can **change content** without having to ask developers to do it for them (and nobody wants that)
- a **well-documented** way to **structure content**
- **image**, **richtext**, ... support is built-in
- built-in **visual editing** which lets editors click-then-edit content (and therefore **code**!) directly in your app
![Visual editing](https://val.build/docs/images/visual-editing.png)
- an embedded studio which lets editors navigate the content structure and make updates there
![Studio](https://val.build/docs/images/studio.png)

<details>
<summary>Definition: editor</summary>
An editor in this context, is a non-technical person that edits content in your application (technical writer, proof-reader, legal, ...).
</details>

<br />

But, with the benefits of **hard-coded** content:

- works seamlessly **locally** or with git **branches**
- content is **type-checked** so you can spend less time on figuring out why something isn't working
![Type check error](https://val.build/docs/images/type-check-error.png)
- content can be refactored (change names, etc) just as if it was hard-coded (because it is)
![Renaming](https://val.build/docs/images/renaming.gif)
- works as normal with your **favorite IDE** without any plugins: search for content, references to usages, ...
![References](https://val.build/docs/images/references.gif)
- **no** need for **code-gen** and extra build steps
- **fast** since the content is literally hosted with the application
- content is **always there** and can never fail (since it is not loaded from somewhere)
- no need to worry about **caching** since content is not fetched from some DB or cloud service
- no need to manage different **environments** with different versions of content
- works out of the box with Vercel **preview links**
- **resolve conflicts** like you normally resolve conflicts: **in git**

Compared to other CMSs, Val has the following advantages:

- **easy** to _grok_: Val is designed to have a minimum of boilerplate and there's **0** query languages to learn
- Vals abstraction model is based on **JSON** and TypeScript (Record, keyof). What this means is that there is nothing to learn (for you or your future colleagues): no "a collection is..." or a "a document is sort of a..." - just JSON and regular TypeScript types
- **no signup** required to use it locally
- **no fees** for content that is in your code: your content is your code, and your code is... yours
- **minimal** API surface: Val is designed to not "infect" your code base
- **easy to remove**: since your content is already in your code and Val is designed to have a minimal surface, it's easy to remove if you want to switch
- eslint rules and [VS Code extension](https://marketplace.visualstudio.com/items?itemName=valbuild.vscode-val-build) for an even **better-than-hard-coded** developer experience

<details>
<summary>Upcoming feature: <strong>i18n</strong></summary>
Val will soon have support for i18n. Follow this repository to get notified when this is the case.
</details>

<details>
<summary>Upcoming feature: <strong>remote content</strong></summary>
Having hard-coded content is great for landing pages, product pages and other pages where the amount of content is manageable.

However, checking in the 10 000th blog entry in git might feel wrong (though we would say it is ok).

Therefore, Val will add `remote content` support which enables you to seamlessly move content to the cloud and back again as desired.
You code will still be the one truth, but the actual content will be hosted on [val.build](https://val.build).

`.remote()` support will also make it possible to have remote images to avoid having to put them in your repository.

There will also be specific support for remote i18n, which will make it possible to split which languages are defined in code, and which are fetched from remote.

More details on `.remote()` will follow later.

</details>

## When to NOT use Val

Val is designed to work well on a single web-app, and currently only supports Next 14+ (more meta-frameworks will supported) and GitHub (more Git providers will follow).

Unless your application fits these requirements, you should have a look elsewhere (at least for now).

In addition, if you have a "content model", i.e. content schemas, that rarely change and you plan on using them in a lot of different applications (web, mobile, etc), Val will most likely not be a great fit.

If that is the case, we recommend having a look at [Sanity](https://sanity.io) instead (we have no affiliation, but if we didn't have Val we would use Sanity).

**NOTE**: Our experience is that, however nice it sounds, it is hard to "nail" the content model down. Usually content (on, for example, your landing page) is derived from what you want to present, not vice-versa. In addition, you should think carefully whether you _really_ want to present the exact same content on all these different surfaces.

<details>
<summary>Upcoming feature: <strong>external content</strong></summary>
Val will support external content, i.e. content from other Val projects, CMSs or DBs some time in the future.
</details>

## Examples

Examples can found [here](./examples).

## Documentation

Val currently only support Next.js.

To get started using Next.js, checkout the [README](./packages/next/README.md).
2 changes: 2 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/** @type {import("@babel/core").TransformOptions} */
module.exports = {
presets: ["@babel/preset-env", "@babel/preset-typescript"],
babelrcRoots: [".", "./packages/*"],
};
2 changes: 1 addition & 1 deletion examples/next/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "next/core-web-vitals"
"extends": ["next/core-web-vitals", "plugin:@valbuild/recommended"]
}
3 changes: 3 additions & 0 deletions examples/next/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

# Val
.val
1 change: 1 addition & 0 deletions examples/next/.nvmrc
Loading
Loading