Skip to content

Commit

Permalink
release-it trial
Browse files Browse the repository at this point in the history
  • Loading branch information
izelnakri committed May 23, 2021
1 parent d6477d5 commit 109a21d
Show file tree
Hide file tree
Showing 11 changed files with 4,199 additions and 353 deletions.
4,444 changes: 4,106 additions & 338 deletions package-lock.json

Large diffs are not rendered by default.

42 changes: 35 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"name": "emberx",
"type": "module",
"version": "1.0.4",
"version": "0.0.5",
"author": "Izel Nakri",
"description": "",
"license": "MIT",
"engines": {
"node": ">= 12.0"
"node": ">= 15.0"
},
"repository": {
"type": "git",
"url": "https://github.com/izelnakri/emberx.git"
},
"workspaces": [
"packages/@emberx/*",
Expand All @@ -15,9 +19,17 @@
"scripts": {
"lint": "eslint . --ext=js,ts --cache",
"build": "npm run libs:build",
"changelog:unreleased": "node_modules/.bin/auto-changelog --stdout --commit-limit false --package --unreleased-only --hide-credit --sort-commits date-desc",
"changelog:preview": "node_modules/.bin/auto-changelog --stdout --commit-limit false --package -u --sort-commits date-desc",
"changelog:update": "node_modules/.bin/auto-changelog --commit-limit false --package --sort-commits date-desc",
"libs:build": "npm run libs:clean && node scripts/build-libraries.js",
"libs:clean": "node scripts/clean-libraries.js",
"libs:release": "node scripts/release-libraries.js",
"dev": "webpack-dev-server",
"prepack": "npm run build",
"release:alpha": "node_modules/.bin/release-it --preRelease=alpha --no-git.requireUpstream",
"release:beta": "node_modules/.bin/release-it --preRelease=beta --no-git.requireUpstream",
"release": "node_modules/.bin/release-it",
"test": "npm run build && node_modules/.bin/qunitx packages --browser --debug",
"test:ci": "node_modules/.bin/qunitx test/index.ts --browser --debug --failFast",
"typecheck": "tsc --project tsconfig.json --noEmit --skipLibCheck"
Expand All @@ -29,15 +41,17 @@
"@glimmer/interfaces": "^0.79.2",
"@glimmer/modifier": "2.0.0-beta.16",
"@glimmer/opcode-compiler": "^0.79.2",
"@glimmer/tracking": "2.0.0-beta.16",
"@glimmer/ssr": "^2.0.0-beta.16",
"@glimmer/tracking": "2.0.0-beta.16",
"route-recognizer": "^0.3.4",
"router_js": "^7.3.0"
},
"devDependencies": {
"@babel/preset-typescript": "^7.13.0",
"auto-changelog": "^2.2.1",
"babel-loader": "^8.2.2",
"bootstrap": "^5.0.1",
"release-it": "^14.6.2",
"qunit-dom": "^1.6.0",
"qunitx": "^0.1.10",
"tsconfig-paths-webpack-plugin": "^3.5.1",
Expand All @@ -52,10 +66,9 @@
},
"browserslist": {
"production": [
"last 2 Edge versions",
"last 2 Chrome versions",
"last 2 Firefox versions",
"last 2 Safari versions"
"last 1 Chrome version",
"last 1 Firefox version",
"last 1 Safari version"
],
"development": [
"last 1 Chrome version",
Expand All @@ -75,5 +88,20 @@
"htmlPaths": [
"test/index.html"
]
},
"release-it": {
"npm": false,
"publishConfig": {
"access": "public"
},
"git": {
"changelog": "npm run changelog:unreleased"
},
"github": {
"release": true
},
"hooks": {
"after:bump": "npm run changelog:update && npm run libs:release ${version}"
}
}
}
2 changes: 1 addition & 1 deletion packages/@emberx/component/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@emberx/component",
"type": "module",
"version": "0.0.3",
"version": "0.0.5",
"author": "Izel Nakri",
"files": [
"dist/*"
Expand Down
2 changes: 1 addition & 1 deletion packages/@emberx/helper/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@emberx/helper",
"type": "module",
"version": "0.0.3",
"version": "0.0.5",
"author": "Izel Nakri",
"description": "",
"files": [
Expand Down
3 changes: 2 additions & 1 deletion packages/@emberx/link-to/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@emberx/link-to",
"version": "0.0.1",
"type": "module",
"version": "0.0.5",
"author": "Izel Nakri",
"description": "",
"files": [
Expand Down
3 changes: 2 additions & 1 deletion packages/@emberx/route/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@emberx/route",
"version": "0.0.1",
"type": "module",
"version": "0.0.5",
"author": "Izel Nakri",
"description": "",
"files": [
Expand Down
3 changes: 2 additions & 1 deletion packages/@emberx/router/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@emberx/router",
"version": "0.0.1",
"type": "module",
"version": "0.0.5",
"author": "Izel Nakri",
"description": "",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/@emberx/ssr/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@emberx/ssr",
"type": "module",
"version": "0.0.3",
"version": "0.0.5",
"author": "Izel Nakri",
"files": [
"dist/*"
Expand Down
3 changes: 2 additions & 1 deletion packages/@emberx/string/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@emberx/string",
"version": "0.0.1",
"type": "module",
"version": "0.0.5",
"author": "Izel Nakri",
"description": "",
"files": [
Expand Down
3 changes: 2 additions & 1 deletion packages/@emberx/test-helpers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@emberx/test-helpers",
"version": "0.0.1",
"type": "module",
"version": "0.0.5",
"author": "Izel Nakri",
"description": "",
"files": [
Expand Down
45 changes: 45 additions & 0 deletions scripts/release-libraries.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import fs from 'fs/promises';
import { promisify } from 'util';
import { exec } from 'child_process';

const shell = promisify(exec);
const version = process.argv[2];

if (!version) {
console.error('No version provided for upgrade!');
process.exit(1);
}

const TARGET_LIBRARIES = [
'@emberx/component',
'@emberx/helper',
'@emberx/link-to',
'@emberx/route',
'@emberx/router',
'@emberx/ssr',
'@emberx/string',
'@emberx/test-helpers'
]

await Promise.all(TARGET_LIBRARIES.map((libraryName) => bumpVersion(libraryName, version, TARGET_LIBRARIES)));
await Promise.all(TARGET_LIBRARIES.map((libraryName) => shell(`npm publish --workspace=${libraryName} --access public`)));

async function bumpVersion(libraryName, version, allLibrariesToUpgrade) {
let packageJSON = await fs.readFile(`packages/${libraryName}/package.json`);

let oldJSON = JSON.parse(packageJSON.toString());

oldJSON.version = version;

let oldDependencies = Object.keys(oldJSON.dependencies || {});

oldJSON.dependencies = oldDependencies.reduce((result, dependency) => {
if (TARGET_LIBRARIES.includes(dependency)) {
return { ...result, [dependency]: version };
}

return { ...result, [dependency]: oldJSON.dependencies[dependency] };
}, oldDependencies);

await fs.writeFile(`packages/${libraryName}/package.json`, JSON.stringify(oldJSON, null, 2));
}

0 comments on commit 109a21d

Please sign in to comment.