add schema release script
This commit is contained in:
Родитель
1e1c52e253
Коммит
9b1630c850
|
@ -15,7 +15,9 @@
|
|||
"generate_schema": "typescript-json-schema javascript/schema/tsconfig.json WorfklowJson > schema/workflow.json",
|
||||
"jest": "NODE_OPTIONS=--experimental-vm-modules yarn node $(yarn bin jest) --runInBand",
|
||||
"ci": "run-s build generate_schema lint jest git_is_clean",
|
||||
"publish": "yarn workspaces foreach --exclude '@data-wrangling-components/project' --exclude '@data-wrangling-components/schema' -pv npm publish --tolerate-republish --access public",
|
||||
"publish_packages": "yarn workspaces foreach --exclude '@data-wrangling-components/project' --exclude '@data-wrangling-components/schema' -pv npm publish --tolerate-republish --access public",
|
||||
"cut_schema": "yarn node scripts/release-schema.mjs",
|
||||
"release": "run-s publish_packages cut_schema",
|
||||
"update_sdks": "yarn dlx @yarnpkg/sdks vscode"
|
||||
},
|
||||
"prettier": "@essex/prettier-config",
|
||||
|
@ -27,6 +29,7 @@
|
|||
"@essex/scripts": "^22.0.1",
|
||||
"@types/jest": "^27.5.0",
|
||||
"@types/node": "^17.0.31",
|
||||
"@types/semver": "^7",
|
||||
"arquero": "^4.8.8",
|
||||
"eslint": "^8.14.0",
|
||||
"husky": "^7.0.4",
|
||||
|
@ -36,6 +39,7 @@
|
|||
"node-fetch": "^3.2.4",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^2.6.2",
|
||||
"semver": "^7.3.7",
|
||||
"typescript": "^4.6.4",
|
||||
"typescript-json-schema": "^0.53.0"
|
||||
},
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,23 @@
|
|||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
import { fileURLToPath } from 'url'
|
||||
import { dirname } from 'path'
|
||||
import semver from 'semver'
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
const __dirname = dirname(__filename)
|
||||
|
||||
const { version: schemaVersion } = JSON.parse(fs.readFileSync(path.join(__dirname, '../javascript/schema/package.json'), { encoding: 'utf8' }))
|
||||
|
||||
console.log("schema version is", schemaVersion)
|
||||
const currentSchema = path.join(__dirname, '../schema/workflow.json')
|
||||
const schemaReleases = path.join(__dirname, '../schema/releases')
|
||||
|
||||
const majorVersionFile = path.join(schemaReleases, `workflow-v${semver.major(schemaVersion)}.json`)
|
||||
const specificVersionFile = path.join(schemaReleases, `workflow-v${schemaVersion}.json`)
|
||||
|
||||
if (fs.existsSync(specificVersionFile)) {
|
||||
throw new Error(`workflow schema version ${schemaVersion} has already been created`)
|
||||
}
|
||||
fs.copyFileSync(currentSchema, majorVersionFile)
|
||||
fs.copyFileSync(currentSchema, specificVersionFile)
|
11
yarn.lock
11
yarn.lock
|
@ -1588,6 +1588,7 @@ __metadata:
|
|||
"@essex/scripts": ^22.0.1
|
||||
"@types/jest": ^27.5.0
|
||||
"@types/node": ^17.0.31
|
||||
"@types/semver": ^7
|
||||
arquero: ^4.8.8
|
||||
eslint: ^8.14.0
|
||||
husky: ^7.0.4
|
||||
|
@ -1597,6 +1598,7 @@ __metadata:
|
|||
node-fetch: ^3.2.4
|
||||
npm-run-all: ^4.1.5
|
||||
prettier: ^2.6.2
|
||||
semver: ^7.3.7
|
||||
typescript: ^4.6.4
|
||||
typescript-json-schema: ^0.53.0
|
||||
languageName: unknown
|
||||
|
@ -3819,6 +3821,13 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/semver@npm:^7":
|
||||
version: 7.3.9
|
||||
resolution: "@types/semver@npm:7.3.9"
|
||||
checksum: 60bfcfdfa7f937be2c6f4b37ddb6714fb0f27b05fe4cbdfdd596a97d35ed95d13ee410efdd88e72a66449d0384220bf20055ab7d6b5df10de4990fbd20e5cbe0
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/serve-index@npm:^1.9.1":
|
||||
version: 1.9.1
|
||||
resolution: "@types/serve-index@npm:1.9.1"
|
||||
|
@ -12055,7 +12064,7 @@ __metadata:
|
|||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"semver@npm:^7.3.5, semver@npm:~7.3.0":
|
||||
"semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:~7.3.0":
|
||||
version: 7.3.7
|
||||
resolution: "semver@npm:7.3.7"
|
||||
dependencies:
|
||||
|
|
Загрузка…
Ссылка в новой задаче