Skip to content

Commit

Permalink
refactor: use PKG_VERSION from @sanity/pkg-utils instead of manua…
Browse files Browse the repository at this point in the history
…lly 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 <[email protected]>
  • Loading branch information
2 people authored and hermanwikner committed Mar 21, 2024
1 parent 7637167 commit a3c6736
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 102 deletions.
5 changes: 1 addition & 4 deletions packages/sanity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,10 @@
"clean": "rimraf _internal.js cli.js desk.js lib presentation.js router.js",
"coverage": "jest --coverage",
"lint": "eslint .",
"prepublishOnly": "run-s write:version write:ui-version",
"test": "pkg-utils --strict && jest",
"test:ct": "playwright test -c playwright-ct.config.ts",
"watch": "pkg-utils watch --tsconfig tsconfig.lib.json",
"write:playwright-report-as-pr-comment": "node -r esbuild-register playwright-ct/scripts/parsePlaywrightReportJson.ts",
"write:ui-version": "node -r esbuild-register scripts/writeRequiredUIVersion.ts",
"write:version": "node -r esbuild-register scripts/writeVersion.ts"
"write:playwright-report-as-pr-comment": "node -r esbuild-register playwright-ct/scripts/parsePlaywrightReportJson.ts"
},
"dependencies": {
"@dnd-kit/core": "^6.0.5",
Expand Down
65 changes: 0 additions & 65 deletions packages/sanity/scripts/writeRequiredUIVersion.ts

This file was deleted.

22 changes: 0 additions & 22 deletions packages/sanity/scripts/writeVersion.ts

This file was deleted.

3 changes: 0 additions & 3 deletions packages/sanity/src/core/requiredSanityUiVersion.ts

This file was deleted.

8 changes: 2 additions & 6 deletions packages/sanity/src/core/version.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
/**
* TODO: rename to `VERSION`
*
*
* This version is provided by `@sanity/pkg-utils` at build time
* @hidden
* @beta
*/
// This string is overwritten by prepublish script with `.version` from package.json
// The version you see here is only read in monorepo development
export const SANITY_VERSION = '0.0.0-development' as string
export const SANITY_VERSION = process.env.PKG_VERSION || ('0.0.0-development' as string)
4 changes: 2 additions & 2 deletions turbo.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://turbo.build/schema.json",
// This is probably overkill, this will segment between GH actions and everything else for now.
"globalEnv": ["OS", "RUNNER_OS"],
// All environment variables that should invalidate a cached build needs to be declared here
"globalEnv": ["OS", "RUNNER_OS", "PKG_FILE_PATH", "PKG_FORMAT", "PKG_RUNTIME", "PKG_VERSION"],
// These root workspace files are reused in workspaces and may affect their build output
"globalDependencies": [
".babelrc",
Expand Down

0 comments on commit a3c6736

Please sign in to comment.