Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change package scope to @progress #26

Merged
merged 5 commits into from
Jun 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .eslintrc

This file was deleted.

14 changes: 14 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
"env": {
"browser": true,
"commonjs": true,
"es2021": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": "latest"
},
"rules": {
}
}
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ jobs:
- name: Publish release
run: ./.github/workflows/release.sh
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN_TELERIK }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.eslintrc.js
.github

14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This projects allows you to push prerelease package versions to NPM, hidden behi

## Prerequisites

- semantic-release **4.x+**
- semantic-release **6.x+**
- git **2.13+** (used for tag parsing)

This project has been tested in Travis-CI and Jenkins builds.
Expand All @@ -15,7 +15,7 @@ This project has been tested in Travis-CI and Jenkins builds.

1. Install the node module through the following command:

npm install --save-dev @telerik/semantic-prerelease
npm install --save-dev @progress/semantic-prerelease

2. Describe the branches that will publish prerelease versions.
In this example, commits in the `develop` branch pushes prerelease versions to the `dev` dist-tag. Use `fallbackTags` to bootstrap the versions.
Expand All @@ -34,11 +34,11 @@ This project has been tested in Travis-CI and Jenkins builds.

// package.json
"release": {
"analyzeCommits": "@telerik/semantic-prerelease/analyzeCommits",
"generateNotes": "@telerik/semantic-prerelease/generateNotes",
"getLastRelease": "@telerik/semantic-prerelease/getLastRelease",
"verifyConditions": "@telerik/semantic-prerelease/verifyConditions",
"verifyRelease": "@telerik/semantic-prerelease/verifyRelease"
"analyzeCommits": "@progress/semantic-prerelease/analyzeCommits",
"generateNotes": "@progress/semantic-prerelease/generateNotes",
"getLastRelease": "@progress/semantic-prerelease/getLastRelease",
"verifyConditions": "@progress/semantic-prerelease/verifyConditions",
"verifyRelease": "@progress/semantic-prerelease/verifyRelease"
}

4. Use `semantic-prerelease publish` instead of `npm publish` in the end of your build. This publishes the prerelease versions behind dist-tags.
Expand Down
2 changes: 1 addition & 1 deletion bin/release-master
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if [ $? -ne 0 ]; then
exit 1
fi

npm update @telerik/semantic-prerelease
npm update @progress/semantic-prerelease
./node_modules/.bin/semantic-prerelease --validate
if [ $? -ne 0 ]; then
"Semantic Prerelase not configured correctly. Aborting."
Expand Down
2 changes: 1 addition & 1 deletion condition-github-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var SRError = require('@semantic-release/error')
module.exports = function (pluginConfig, config, cb) {
var env = config.env

if (!env.hasOwnProperty('GITHUB_ACTION')) {
if (!Object.hasOwnProperty.call(env, 'GITHUB_ACTION')) {
return cb(new SRError(
'semantic-release didn’t run on Github Action and therefore a new version won’t be published.\n' +
'You can customize this behavior using "verifyConditions" plugins: git.io/sr-plugins',
Expand Down
10 changes: 3 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@telerik/semantic-prerelease",
"name": "@progress/semantic-prerelease",
"description": "A set of plug-ins for semantic-release that provide a workflow for prerelease versions.",
"repository": {
"type": "git",
Expand All @@ -14,8 +14,7 @@
},
"scripts": {
"lint": "./node_modules/.bin/eslint *.js bin/*.js",
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
"test": "npm run lint"
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
},
"keywords": [
"semantic-release",
Expand All @@ -24,7 +23,6 @@
"dist-tag"
],
"dependencies": {
"@krux/condition-jenkins": "^1.0.1",
"semantic-release": "^6.3.6"
},
"engines": {
Expand All @@ -34,10 +32,8 @@
"author": "Telerik",
"license": "Apache-2.0",
"devDependencies": {
"@telerik/eslint-config": "1.1.0",
"babel-eslint": "^7.2.3",
"cz-conventional-changelog": "^1.1.5",
"eslint": "^3.19.0",
"eslint": "^8.16.0",
"validate-commit-msg": "^1.1.1"
},
"config": {
Expand Down
4 changes: 2 additions & 2 deletions validateConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ function validateConfig(config) {

['analyzeCommits', 'getLastRelease', 'verifyConditions', 'verifyRelease']
.forEach((plugin) => {
assert(`Expected release.${ plugin } to be set to "@telerik/semantic-prerelease/${ plugin }"`, () =>
release[plugin] == `@telerik/semantic-prerelease/${ plugin }`);
assert(`Expected release.${ plugin } to be set to "@progress/semantic-prerelease/${ plugin }"`, () =>
release[plugin] == `@progress/semantic-prerelease/${ plugin }`);
});

if (!valid) {
Expand Down
15 changes: 3 additions & 12 deletions verifyConditions.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
const utils = require('./utils');

module.exports = function (pluginConfig, config, cb) {
let defaultVerifyConditions;

if (config.env.TRAVIS) {
defaultVerifyConditions = require('@semantic-release/condition-travis');
} else if (config.env.GITHUB_REF) {
defaultVerifyConditions = require('./condition-github-actions');
} else {
defaultVerifyConditions = require('@krux/condition-jenkins');
}

const branch = config.env.TRAVIS_BRANCH || config.env.GIT_LOCAL_BRANCH || utils.ghActionsBranch(config.env);
let verifyConditions = require('./condition-github-actions');
const branch = utils.ghActionsBranch(config.env);

// update semantic-release configuration to publish:
// - from this branch
Expand All @@ -25,5 +16,5 @@ module.exports = function (pluginConfig, config, cb) {
}

// run default build checks with the new configuration
return defaultVerifyConditions(pluginConfig, config, cb);
return verifyConditions(pluginConfig, config, cb);
};
4 changes: 2 additions & 2 deletions verifyRelease.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ module.exports = function (pluginConfig, config, cb) {
if (config.nextRelease) {
// change version suffix of pre-releases from '-number' to '-tag.timestamp'
const now = new Date();
const timestamp = now.toISOString().replace(/[\-T\:]/g, "").slice(0,12);
const timestamp = now.toISOString().replace(/[-T:]/g, "").slice(0,12);
const suffix = `-${config.npm.tag}.${timestamp}`;
const release = config.nextRelease;

if (release.type === 'initial') {
// start releases with 0.1.0 instead of 1.0.0
release.version = '0.1.0';
} else {
release.version = release.version.replace(/\-.+$/, suffix);
release.version = release.version.replace(/-.+$/, suffix);
}

console.log(`Ready for release v${release.version}`);
Expand Down