Skip to content

Commit d514bfc

Browse files
stipsanbjoerge
andauthoredMar 20, 2024··
refactor: use PKG_VERSION from @sanity/pkg-utils instead of manually regexing SANITY_VERSION (#6078)
* refactor: use `PKG_VERSION` from `@sanity/pkg-utils` instead of manually regexing `SANITY_VERSION` * chore(sanity): remove unused script (#6090) --------- Co-authored-by: Bjørge Næss <bjoerge@gmail.com>
1 parent d784f82 commit d514bfc

File tree

6 files changed

+5
-102
lines changed

6 files changed

+5
-102
lines changed
 

‎packages/sanity/package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,10 @@
181181
"clean": "rimraf _internal.js cli.js desk.js lib presentation.js router.js",
182182
"coverage": "jest --coverage",
183183
"lint": "eslint .",
184-
"prepublishOnly": "run-s write:version write:ui-version",
185184
"test": "pkg-utils --strict && jest",
186185
"test:ct": "playwright test -c playwright-ct.config.ts",
187186
"watch": "pkg-utils watch --tsconfig tsconfig.lib.json",
188-
"write:playwright-report-as-pr-comment": "node -r esbuild-register playwright-ct/scripts/parsePlaywrightReportJson.ts",
189-
"write:ui-version": "node -r esbuild-register scripts/writeRequiredUIVersion.ts",
190-
"write:version": "node -r esbuild-register scripts/writeVersion.ts"
187+
"write:playwright-report-as-pr-comment": "node -r esbuild-register playwright-ct/scripts/parsePlaywrightReportJson.ts"
191188
},
192189
"dependencies": {
193190
"@dnd-kit/core": "^6.0.5",

‎packages/sanity/scripts/writeRequiredUIVersion.ts

-65
This file was deleted.

‎packages/sanity/scripts/writeVersion.ts

-22
This file was deleted.

‎packages/sanity/src/core/requiredSanityUiVersion.ts

-3
This file was deleted.

‎packages/sanity/src/core/version.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
/**
2-
* TODO: rename to `VERSION`
3-
*
4-
*
2+
* This version is provided by `@sanity/pkg-utils` at build time
53
* @hidden
64
* @beta
75
*/
8-
// This string is overwritten by prepublish script with `.version` from package.json
9-
// The version you see here is only read in monorepo development
10-
export const SANITY_VERSION = '0.0.0-development' as string
6+
export const SANITY_VERSION = process.env.PKG_VERSION || ('0.0.0-development' as string)

‎turbo.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://turbo.build/schema.json",
3-
// This is probably overkill, this will segment between GH actions and everything else for now.
4-
"globalEnv": ["OS", "RUNNER_OS"],
3+
// All environment variables that should invalidate a cached build needs to be declared here
4+
"globalEnv": ["OS", "RUNNER_OS", "PKG_FILE_PATH", "PKG_FORMAT", "PKG_RUNTIME", "PKG_VERSION"],
55
// These root workspace files are reused in workspaces and may affect their build output
66
"globalDependencies": [
77
".babelrc",

0 commit comments

Comments
 (0)
Please sign in to comment.