Skip to content

Commit

Permalink
extract lib/ to tape-lib subpackage
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Nov 28, 2023
1 parent 433846c commit a144075
Show file tree
Hide file tree
Showing 11 changed files with 109 additions and 19 deletions.
1 change: 1 addition & 0 deletions .github/workflows/node-aught.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
range: '< 10'
type: minors
command: npm run tests-only
subpackage: ./lib

node:
name: 'node < 10'
Expand Down
17 changes: 16 additions & 1 deletion .github/workflows/node-pretest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,19 @@ jobs:
tests:
uses: ljharb/actions/.github/workflows/pretest.yml@main
with:
skip-engines: true # bin/tape requires node 8+, but the rest of tape supports 0.4+
skip-engines: true # bin/tape requires node 8+, but tape-lib supports 0.4+. TODO: fix and add engines.node in v6

engines-lib:
runs-on: ubuntu-latest
steps:
- uses: ljharb/actions/node/engines@main
with:
working-directory: lib

pack-lib:
runs-on: ubuntu-latest
steps:
- uses: ljharb/actions/node/pack@main
with:
after_install: cd ../ && npm install
working-directory: lib
1 change: 1 addition & 0 deletions .github/workflows/node-tens.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
range: '>= 10'
type: minors
command: npm run tests-only
subpackage: ./lib

node:
name: 'node >= 10'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# gitignore

/node_modules
**/node_modules

# Only apps should have lockfiles
yarn.lock
Expand Down
2 changes: 1 addition & 1 deletion bin/tape
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ var files = opts._.reduce(function (result, arg) {

var hasImport = require('has-dynamic-import');

var tape = require('../');
var tape = require('tape-lib');

function importFiles(hasSupport) {
if (!hasSupport) {
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
'use strict';

module.exports = require('./lib');
module.exports = require('tape-lib');
3 changes: 3 additions & 0 deletions lib/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package-lock=false
allow-same-version=true
message=v%s
71 changes: 71 additions & 0 deletions lib/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"name": "tape-lib",
"version": "0.0.0",
"description": "TAP-producing test harness library for node and browsers",
"main": "index.js",
"browser": {
"fs": false
},
"exports": {
".": "./index.js",
"./default_stream": "./default_stream.js",
"./results": "./results.js",
"./test": "./test.js",
"./package.json": "./package.json"
},
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated --gitignore=../.gitignore",
"version": "auto-changelog && git add CHANGELOG.md",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"",
"prepublishOnly": "safe-publish-latest",
"prepublish": "not-in-publish || npm run prepublishOnly",
"tests-only": "cd ../ && npm run tests-only",
"test": "cd ../ && npm test"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ljharb/tape.git",
"directory": "lib"
},
"author": "Jordan Harband <ljharb@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/ljharb/tape/issues"
},
"homepage": "https://github.com/ljharb/tape/#readme",
"keywords": [
"tap",
"test",
"harness",
"assert",
"browser"
],
"dependencies": {
"@ljharb/resumer": "^0.0.1",
"@ljharb/through": "^2.3.11",
"array.prototype.every": "^1.1.5",
"call-bind": "^1.0.5",
"deep-equal": "^2.2.3",
"defined": "^1.0.1",
"for-each": "^0.3.3",
"hasown": "^2.0.0",
"inherits": "^2.0.4",
"is-regex": "^1.1.4",
"mock-property": "^1.0.3",
"object-inspect": "^1.13.1",
"object-is": "^1.1.5",
"object-keys": "^1.1.1",
"string.prototype.trim": "^1.2.8"
},
"engines": {
"node": ">= 0.4"
},
"publishConfig": {
"ignore": []
},
"devDependencies": {
"in-publish": "^2.0.1",
"npmignore": "^0.3.0",
"safe-publish-latest": "^2.0.0"
}
}
1 change: 1 addition & 0 deletions node_modules/tape-lib

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 11 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tape",
"version": "5.7.2",
"description": "tap-producing test harness for node and browsers",
"description": "TAP-producing test harness for node and browsers",
"main": "index.js",
"browser": {
"fs": false
Expand All @@ -19,32 +19,24 @@
"example": "example",
"test": "test"
},
"bundledDependencies": [
"tape-lib"
],
"dependencies": {
"@ljharb/resumer": "^0.0.1",
"@ljharb/through": "^2.3.11",
"array.prototype.every": "^1.1.5",
"call-bind": "^1.0.5",
"deep-equal": "^2.2.3",
"defined": "^1.0.1",
"dotignore": "^0.1.2",
"for-each": "^0.3.3",
"get-package-type": "^0.1.0",
"glob": "^7.2.3",
"has-dynamic-import": "^2.0.1",
"hasown": "^2.0.0",
"inherits": "^2.0.4",
"is-regex": "^1.1.4",
"minimist": "^1.2.8",
"mock-property": "^1.0.3",
"object-inspect": "^1.13.1",
"object-is": "^1.1.5",
"object-keys": "^1.1.1",
"object.assign": "^4.1.5",
"resolve": "^2.0.0-next.5",
"string.prototype.trim": "^1.2.8"
},
"devDependencies": {
"@ljharb/eslint-config": "^21.1.0",
"@ljharb/through": "^2.3.11",
"array.prototype.flatmap": "^1.3.2",
"aud": "^2.0.4",
"auto-changelog": "^2.4.0",
Expand All @@ -54,12 +46,13 @@
"es-value-fixtures": "^1.4.2",
"eslint": "=8.8.0",
"falafel": "^2.2.5",
"intl-fallback-symbol": "^1.0.0",
"in-publish": "^2.0.1",
"jackspeak": "=2.1.1",
"js-yaml": "^3.14.0",
"npm-run-posix-or-windows": "^2.0.2",
"npmignore": "^0.3.1",
"nyc": "^10.3.2",
"object-inspect": "^1.13.1",
"safe-publish-latest": "^2.0.0",
"tap": "^8.0.1",
"tap-parser": "^5.4.0"
Expand Down Expand Up @@ -121,7 +114,10 @@
},
"publishConfig": {
"ignore": [
".github/workflows"
".github/workflows",
"lib/*",
"!lib/{default_stream,results,test}.js",
"**/node_modules"
]
}
}
3 changes: 2 additions & 1 deletion test/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ var stripChangingData = function (line) {
var withoutTestDir = line.replace(__dirname, '$TEST');
var withoutPackageDir = withoutTestDir.replace(path.dirname(__dirname), '$TAPE');
var withoutPathSep = withoutPackageDir.replace(new RegExp('\\' + path.sep, 'g'), '/');
var withoutLineNumbers = withoutPathSep.replace(/:\d+:\d+/g, ':$LINE:$COL');
var withoutLibDir = withoutPathSep.replace('$TAPE/node_modules/tape-lib/', '$TAPE/lib/');
var withoutLineNumbers = withoutLibDir.replace(/:\d+:\d+/g, ':$LINE:$COL');
var withoutNestedLineNumbers = withoutLineNumbers.replace(/, <anonymous>:\$LINE:\$COL\)$/, ')');
return withoutNestedLineNumbers;
};
Expand Down

0 comments on commit a144075

Please sign in to comment.