@oneblink/release-cli 3.4.0 → 4.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,6 @@
1
1
  import path from 'path';
2
2
  import prepareCloneRepository from './prepareCloneRepository.js';
3
3
  const productRepositories = [
4
- {
5
- label: '@oneblink/apps (NPM package)',
6
- repositoryName: 'apps',
7
- type: 'NPM',
8
- isPublic: true,
9
- },
10
4
  {
11
5
  label: '@oneblink/apps-react (NPM package)',
12
6
  repositoryName: 'apps-react',
@@ -45,10 +45,10 @@ function deltaToMarkdown(diff, oldPkg, cwd) {
45
45
  oldVersion = strictVersion(oldVersionRange);
46
46
  }
47
47
  return Promise.all([
48
- npm.nameToMarkdown(name),
49
- npm.changelogUrlFor(name, cwd),
50
- npm.releaseUrlFor(name, version, cwd),
51
- oldVersion && npm.releaseUrlFor(name, oldVersion, cwd),
48
+ npm.nameToMarkdown(name), // -> nameMd
49
+ npm.changelogUrlFor(name, cwd), // -> changelogUrl
50
+ npm.releaseUrlFor(name, version, cwd), // -> releaseUrl
51
+ oldVersion && npm.releaseUrlFor(name, oldVersion, cwd), // -> oldReleaseUrl
52
52
  promise, // -> result
53
53
  ]).then(([nameMd, changelogUrl, releaseUrl, oldReleaseUrl, result]) => {
54
54
  const versionMd = versionToMarkdown(version, releaseUrl || changelogUrl);
@@ -5,6 +5,7 @@ import * as npm from './npm.js';
5
5
  const octokit = new Octokit({
6
6
  auth: process.env.GITHUB_OAUTH_TOKEN,
7
7
  });
8
+ octokit.log.debug = () => undefined;
8
9
  function changelogUrlAt(projectUrl) {
9
10
  const changelogUrl = projectUrl + '/blob/master/CHANGELOG.md';
10
11
  return http
@@ -0,0 +1,27 @@
1
+ name: Run tests
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+
13
+ strategy:
14
+ matrix:
15
+ node-version: [14.x, 16.x, 18.x]
16
+ # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
17
+
18
+ steps:
19
+ - uses: actions/checkout@v3
20
+ - name: Use Node.js ${{ matrix.node-version }}
21
+ uses: actions/setup-node@v3
22
+ with:
23
+ node-version: ${{ matrix.node-version }}
24
+ cache: 'npm'
25
+ - run: npm ci
26
+ - run: npm run build --if-present
27
+ - run: npm test
File without changes
@@ -1,5 +1,3 @@
1
- [![CircleCI](https://circleci.com/gh/stiang/remove-markdown.svg?style=svg&circle-token=cac2feef7dc90e6b8578aec361be369412be1c6a)](https://circleci.com/gh/stiang/remove-markdown)
2
-
3
1
  ## What is it?
4
2
  **remove-markdown** is a node.js module that will remove (strip) Markdown formatting from text.
5
3
  *Markdown formatting* means pretty much anything that doesn’t look like regular text, like square brackets, asterisks etc.
@@ -43,5 +41,6 @@ PRs are very much welcome. Here are some ideas for future enhancements:
43
41
  ## Credits
44
42
  The code is based on [Markdown Service Tools - Strip Markdown](http://brettterpstra.com/2013/10/18/a-markdown-service-to-strip-markdown/) by Brett Terpstra.
45
43
 
46
- ## Author
47
- Stian Grytøyr
44
+ ## Authors
45
+ Stian Grytøyr (original creator)
46
+ [zuchka](https://github.com/zuchka) (maintainer since 2023)
@@ -0,0 +1,11 @@
1
+ declare function removeMd(md: string, options?: {
2
+ stripListLeaders?: boolean;
3
+ listUnicodeChar?: string;
4
+ gfm?: boolean;
5
+ useImgAltText: boolean;
6
+ abbr?: boolean;
7
+ replaceLinksWithURL?: boolean;
8
+ htmlTagsToSkip?: string[];
9
+ }): string;
10
+
11
+ export = removeMd;
@@ -7,6 +7,7 @@ module.exports = function(md, options) {
7
7
  options.abbr = options.hasOwnProperty('abbr') ? options.abbr : false;
8
8
  options.replaceLinksWithURL = options.hasOwnProperty('replaceLinksWithURL') ? options.replaceLinksWithURL : false;
9
9
  options.htmlTagsToSkip = options.hasOwnProperty('htmlTagsToSkip') ? options.htmlTagsToSkip : [];
10
+ options.throwError = options.hasOwnProperty('throwError') ? options.throwError : false;
10
11
 
11
12
  var output = md || '';
12
13
 
@@ -66,12 +67,12 @@ module.exports = function(md, options) {
66
67
  // Remove inline links
67
68
  .replace(/\[([^\]]*?)\][\[\(].*?[\]\)]/g, options.replaceLinksWithURL ? '$2' : '$1')
68
69
  // Remove blockquotes
69
- .replace(/^\s{0,3}>\s?/gm, '')
70
+ .replace(/^(\n)?\s{0,3}>\s?/gm, '$1')
70
71
  // .replace(/(^|\n)\s{0,3}>\s?/g, '\n\n')
71
72
  // Remove reference-style links?
72
73
  .replace(/^\s{1,2}\[(.*?)\]: (\S+)( ".*?")?\s*$/g, '')
73
74
  // Remove atx-style headers
74
- .replace(/^(\n)?\s{0,}#{1,6}\s+| {0,}(\n)?\s{0,}#{0,} #{0,}(\n)?\s{0,}$/gm, '$1$2$3')
75
+ .replace(/^(\n)?\s{0,}#{1,6}\s*( (.+))? +#+$|^(\n)?\s{0,}#{1,6}\s*( (.+))?$/gm, '$1$3$4$6')
75
76
  // Remove * emphasis
76
77
  .replace(/([\*]+)(\S)(.*?\S)??\1/g, '$2$3')
77
78
  // Remove _ emphasis. Unlike *, _ emphasis gets rendered only if
@@ -89,7 +90,9 @@ module.exports = function(md, options) {
89
90
  // Replace strike through
90
91
  .replace(/~(.*?)~/g, '$1');
91
92
  } catch(e) {
92
- console.error(e);
93
+ if (options.throwError) throw e;
94
+
95
+ console.error("remove-markdown encountered error: %s", e);
93
96
  return md;
94
97
  }
95
98
  return output;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remove-markdown",
3
- "version": "0.5.0",
3
+ "version": "0.5.5",
4
4
  "description": "Remove Markdown formatting from text",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "https://github.com/stiang/remove-markdown.git"
11
+ "url": "https://github.com/zuchka/remove-markdown.git"
12
12
  },
13
13
  "keywords": [
14
14
  "markdown"
@@ -16,12 +16,12 @@
16
16
  "author": "Stian Grytøyr",
17
17
  "license": "MIT",
18
18
  "bugs": {
19
- "url": "https://github.com/stiang/remove-markdown/issues"
19
+ "url": "https://github.com/zuchka/remove-markdown/issues"
20
20
  },
21
- "homepage": "https://github.com/stiang/remove-markdown",
21
+ "homepage": "https://github.com/zuchka/remove-markdown",
22
22
  "devDependencies": {
23
23
  "chai": "^4.0.2",
24
- "mocha": "^2.1.0",
24
+ "mocha": "^10.2.0",
25
25
  "should": "^5.0.0"
26
26
  }
27
27
  }
@@ -124,16 +124,16 @@ describe('remove Markdown', function () {
124
124
 
125
125
  it('should remove blockquotes over multiple lines', function () {
126
126
  const string = '> I am a blockquote firstline \n>I am a blockquote secondline';
127
- const expected = 'I am a blockquote firstline\nI am a blockquote secondline';
127
+ const expected = 'I am a blockquote firstline \nI am a blockquote secondline';
128
128
  expect(removeMd(string)).to.equal(expected);
129
129
  });
130
130
 
131
- // it('should remove blockquotes following other content', function () {
132
- // const string = '## A headline\n\nA paragraph of text\n\n> I am a blockquote';
133
- // const expected = 'A headline\n\nA paragraph of text\n\nI am a blockquote';
131
+ it('should remove blockquotes following other content', function () {
132
+ const string = '## A headline\n\nA paragraph of text\n\n> I am a blockquote';
133
+ const expected = 'A headline\n\nA paragraph of text\n\nI am a blockquote';
134
134
 
135
- // expect(removeMd(string)).to.equal(expected);
136
- // });
135
+ expect(removeMd(string)).to.equal(expected);
136
+ });
137
137
 
138
138
  it('should not remove greater than signs', function () {
139
139
  var tests = [
@@ -181,7 +181,19 @@ describe('remove Markdown', function () {
181
181
  expect(removeMd(paragraph)).to.match(expected);
182
182
 
183
183
  const duration = Date.now()-start;
184
- expect(duration).to.be.lt(500);
184
+ expect(duration).to.be.lt(1000);
185
+ });
186
+
187
+ it('should work fast even with lots of whitespace', function () {
188
+ const string = 'Some text with lots of whitespace';
189
+ const expected = 'Some text with lots of whitespace';
190
+ expect(removeMd(string)).to.equal(expected);
191
+ });
192
+
193
+ it('should still remove escaped markdown syntax', function () {
194
+ const string = '\# Heading in _italic_';
195
+ const expected = 'Heading in italic';
196
+ expect(removeMd(string)).to.equal(expected);
185
197
  });
186
198
  });
187
199
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oneblink/release-cli",
3
3
  "description": "Used internally by OneBlink to release repositories quickly and consistently",
4
- "version": "3.4.0",
4
+ "version": "4.0.0-beta.1",
5
5
  "author": "OneBlink <developers@oneblink> (https://github.com/oneblink)",
6
6
  "bin": {
7
7
  "oneblink-release": "dist/bin.js"
@@ -13,46 +13,47 @@
13
13
  "changelog-parser"
14
14
  ],
15
15
  "dependencies": {
16
- "@octokit/rest": "^20.0.2",
17
- "boxen": "^7.1.1",
18
- "chalk": "^5.3.0",
16
+ "@octokit/rest": "^22.0.1",
17
+ "boxen": "^8.0.1",
18
+ "chalk": "^5.6.2",
19
19
  "changelog-parser": "^3.0.1",
20
20
  "dependency-diff": "^1.0.4",
21
21
  "enquirer": "^2.4.1",
22
- "execa": "^8.0.1",
22
+ "execa": "^9.6.1",
23
23
  "github-url-from-git": "^1.5.0",
24
- "meow": "^12.1.1",
25
- "ora": "^7.0.1",
26
- "patch-package": "^8.0.0",
27
- "prettier": "^3.0.3",
28
- "read-package-up": "^11.0.0",
29
- "semver": "^7.5.4",
30
- "update-notifier": "^7.0.0"
24
+ "meow": "^14.0.0",
25
+ "ora": "^9.0.0",
26
+ "patch-package": "^8.0.1",
27
+ "prettier": "^3.8.0",
28
+ "read-package-up": "^12.0.0",
29
+ "semver": "^7.7.3",
30
+ "update-notifier": "^7.3.1"
31
31
  },
32
32
  "devDependencies": {
33
- "@types/changelog-parser": "^2.8.3",
34
- "@types/github-url-from-git": "^1.5.2",
35
- "@types/jest": "^29.5.7",
36
- "@types/node": "^20.8.10",
37
- "@types/semver": "^7.5.4",
38
- "@types/update-notifier": "^6.0.6",
39
- "@typescript-eslint/eslint-plugin": "^6.10.0",
40
- "@typescript-eslint/parser": "^6.10.0",
41
- "cross-env": "^7.0.3",
42
- "eslint": "^8.53.0",
43
- "eslint-config-prettier": "^9.0.0",
44
- "eslint-plugin-prettier": "^5.0.1",
45
- "jest": "^29.7.0",
46
- "prettier-plugin-jsdoc": "^1.1.1",
47
- "ts-jest": "^29.1.1",
48
- "typescript": "^5.2.2"
33
+ "@eslint/eslintrc": "^3.3.3",
34
+ "@eslint/js": "^9.39.2",
35
+ "@microsoft/eslint-plugin-sdl": "^1.1.0",
36
+ "@types/changelog-parser": "^2.8.4",
37
+ "@types/github-url-from-git": "^1.5.3",
38
+ "@types/node": "^24.10.8",
39
+ "@types/semver": "^7.7.1",
40
+ "@types/update-notifier": "^6.0.8",
41
+ "@typescript-eslint/eslint-plugin": "^8.53.0",
42
+ "@typescript-eslint/parser": "^8.53.0",
43
+ "cross-env": "^10.1.0",
44
+ "eslint": "^9.39.2",
45
+ "eslint-config-prettier": "^10.1.8",
46
+ "eslint-plugin-prettier": "^5.5.5",
47
+ "fixpack": "^4.0.0",
48
+ "prettier-plugin-jsdoc": "^1.8.0",
49
+ "typescript": "^5.9.3"
49
50
  },
50
51
  "directories": {
51
52
  "test": "test"
52
53
  },
53
54
  "engines": {
54
- "node": ">=20",
55
- "npm": ">=10"
55
+ "node": ">=24",
56
+ "npm": ">=11"
56
57
  },
57
58
  "files": [
58
59
  "dist",
@@ -73,14 +74,13 @@
73
74
  },
74
75
  "scripts": {
75
76
  "build": "tsc --build",
76
- "eslint": "eslint --fix --cache --quiet ./src",
77
- "jest": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --silent",
77
+ "eslint": "eslint --fix --cache .",
78
78
  "postinstall": "patch-package",
79
79
  "prepare": "npm run build",
80
80
  "prerelease": "npm run build",
81
- "pretest": "npm run eslint",
81
+ "pretest": "npm run eslint && npm run typescript && fixpack",
82
82
  "release": "node dist/bin.js repository --no-name --cwd .",
83
- "test": "npm run jest",
83
+ "test": "echo \"no tests\"",
84
84
  "typescript": "tsc --noEmit"
85
85
  },
86
86
  "type": "module"
@@ -1,84 +0,0 @@
1
- # This configuration was automatically generated from a CircleCI 1.0 config.
2
- # It should include any build commands you had along with commands that CircleCI
3
- # inferred from your project structure. We strongly recommend you read all the
4
- # comments in this file to understand the structure of CircleCI 2.0, as the idiom
5
- # for configuration has changed substantially in 2.0 to allow arbitrary jobs rather
6
- # than the prescribed lifecycle of 1.0. In general, we recommend using this generated
7
- # configuration as a reference rather than using it in production, though in most
8
- # cases it should duplicate the execution of your original 1.0 config.
9
- version: 2
10
- jobs:
11
- build:
12
- working_directory: ~/stiang/remove-markdown
13
- parallelism: 1
14
- shell: /bin/bash --login
15
- # CircleCI 2.0 does not support environment variables that refer to each other the same way as 1.0 did.
16
- # If any of these refer to each other, rewrite them so that they don't or see https://circleci.com/docs/2.0/env-vars/#interpolating-environment-variables-to-set-other-environment-variables .
17
- environment:
18
- CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
19
- CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
20
- # In CircleCI 1.0 we used a pre-configured image with a large number of languages and other packages.
21
- # In CircleCI 2.0 you can now specify your own image, or use one of our pre-configured images.
22
- # The following configuration line tells CircleCI to use the specified docker image as the runtime environment for you job.
23
- # We have selected a pre-built image that mirrors the build environment we use on
24
- # the 1.0 platform, but we recommend you choose an image more tailored to the needs
25
- # of each job. For more information on choosing an image (or alternatively using a
26
- # VM instead of a container) see https://circleci.com/docs/2.0/executor-types/
27
- # To see the list of pre-built images that CircleCI provides for most common languages see
28
- # https://circleci.com/docs/2.0/circleci-images/
29
- docker:
30
- - image: circleci/build-image:ubuntu-14.04-XXL-upstart-1189-5614f37
31
- command: /sbin/init
32
- steps:
33
- # Machine Setup
34
- # If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each
35
- # The following `checkout` command checks out your code to your working directory. In 1.0 we did this implicitly. In 2.0 you can choose where in the course of a job your code should be checked out.
36
- - checkout
37
- # Prepare for artifact and test results collection equivalent to how it was done on 1.0.
38
- # In many cases you can simplify this from what is generated here.
39
- # 'See docs on artifact collection here https://circleci.com/docs/2.0/artifacts/'
40
- - run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
41
- # Dependencies
42
- # This would typically go in either a build or a build-and-test job when using workflows
43
- # Restore the dependency cache
44
- - restore_cache:
45
- keys:
46
- # This branch if available
47
- - v1-dep-{{ .Branch }}-
48
- # Default branch if not
49
- - v1-dep-master-
50
- # Any branch if there are none on the default branch - this should be unnecessary if you have your default branch configured correctly
51
- - v1-dep-
52
- # The following line was run implicitly in your 1.0 builds based on what CircleCI inferred about the structure of your project. In 2.0 you need to be explicit about which commands should be run. In some cases you can discard inferred commands if they are not relevant to your project.
53
- - run: if [ -z "${NODE_ENV:-}" ]; then export NODE_ENV=test; fi
54
- - run: export PATH="~/stiang/remove-markdown/node_modules/.bin:$PATH"
55
- - run: npm install
56
- # Save dependency cache
57
- - save_cache:
58
- key: v1-dep-{{ .Branch }}-{{ epoch }}
59
- paths:
60
- # This is a broad list of cache paths to include many possible development environments
61
- # You can probably delete some of these entries
62
- - vendor/bundle
63
- - ~/virtualenvs
64
- - ~/.m2
65
- - ~/.ivy2
66
- - ~/.bundle
67
- - ~/.go_workspace
68
- - ~/.gradle
69
- - ~/.cache/bower
70
- - ./node_modules
71
- # Test
72
- # This would typically be a build job when using workflows, possibly combined with build
73
- # The following line was run implicitly in your 1.0 builds based on what CircleCI inferred about the structure of your project. In 2.0 you need to be explicit about which commands should be run. In some cases you can discard inferred commands if they are not relevant to your project.
74
- - run: npm test
75
- # Teardown
76
- # If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each
77
- # Save test results
78
- - store_test_results:
79
- path: /tmp/circleci-test-results
80
- # Save artifacts
81
- - store_artifacts:
82
- path: /tmp/circleci-artifacts
83
- - store_artifacts:
84
- path: /tmp/circleci-test-results