Skip to content
23 changes: 17 additions & 6 deletions CONTRIBUTE.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,11 @@ Enter prerelease mode and made the first prerelease
npx changeset pre enter beta
npx changeset version
git add .
git commit -m "Enter prerelease mode and version packages"
npx changeset publish
git commit -m "chore: release vX.X.X-beta.X"

npm run publish -- -- beta

git tag "vX.X.X-beta.X"
git push --follow-tags
```

Expand All @@ -110,7 +113,9 @@ To add another prerelease, run:
npx changeset version
git add .
git commit -m "Version packages"
npx changeset publish
npm run publish -- -- beta

git tag "x.x.x-beta.x"
git push --follow-tags
```

Expand All @@ -128,8 +133,11 @@ npx changeset
npx changeset version
# review the updated files
git add .
git commit -m "chore: Release vX.X.X"
npx changeset publish
git commit -m "chore: release vX.X.X"

npm run publish -- -- latest

git tag "vX.X.X"
git push --follow-tags
# create a new release on github
```
Expand All @@ -140,5 +148,8 @@ git push --follow-tags
docker run -it --rm --name verdaccio -p 4873:4873 verdaccio/verdaccio
npm adduser --registry http://localhost:4873
npm login --registry http://localhost:4873
npm_config_registry=http://localhost:4873 npx changeset publish
npm_config_registry=http://localhost:4873 npm run publish -- -- latest

# use the new package
npm_config_registry=http://localhost:4873 npm i cypress-debugger --@currents:registry=http://localhost:4873
```
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"lint": "turbo run lint",
"format": "prettier --check .",
"format-fix": "prettier --write .",
"prepare": "husky install"
"prepare": "husky install",
"publish": "turbo run publish"
},
"devDependencies": {
"@changesets/cli": "^2.26.1",
Expand Down
5 changes: 3 additions & 2 deletions packages/cypress-debugger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "cypress-debugger",
"version": "1.0.5",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"types": "./src/index.ts",
"author": "Currents Software Inc",
"homepage": "https://github.com/currents-dev/cypress-debugger",
"bugs": {
Expand All @@ -20,7 +20,8 @@
"scripts": {
"build": "tsup-node --dts",
"dev": "tsup --watch",
"lint": "eslint --fix"
"lint": "eslint --fix",
"publish": "node ./publish.js"
},
"keywords": [
"cypress",
Expand Down
39 changes: 39 additions & 0 deletions packages/cypress-debugger/publish.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env node

const { execSync } = require('child_process');
const fs = require('fs');
const pkg = require('./package.json');
const { argv } = require('process');

const tag = argv[2];

if (!tag) {
console.error('ERROR: You must specify a tag (latest|beta)');
process.exit(1);
}

const newPkg = {
...pkg,
types: undefined,
files: ['*'],
exports: {
'.': {
import: './index.mjs',
require: './index.js',
types: './index.d.ts',
},
},
};
delete newPkg['types'];

fs.writeFileSync(
'./dist/package.json',
JSON.stringify(newPkg, null, 2),
'utf-8'
);
fs.copyFileSync('./README.md', './dist/README.md');
fs.copyFileSync('../../LICENSE.md', './dist/LICENSE.md');
execSync(`npm pack --dry-run && npm publish --tag ${tag}`, {
cwd: './dist',
stdio: 'inherit',
});
10 changes: 9 additions & 1 deletion packages/plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"scripts": {
"build": "tsup-node",
"dev": "tsup --watch",
"lint": "eslint src --fix"
"lint": "eslint src --fix",
"publish": "node ./publish.js"
},
"files": [
"dist",
Expand All @@ -26,5 +27,12 @@
"@neuralegion/cypress-har-generator": "^5.16.4",
"chrome-remote-interface": "^0.32.1",
"debug": "^4.3.4"
},
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"
}
}
}
39 changes: 39 additions & 0 deletions packages/plugin/publish.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env node

const { execSync } = require('child_process');
const fs = require('fs');
const pkg = require('./package.json');
const { argv } = require('process');

const tag = argv[2];

if (!tag) {
console.error('ERROR: You must specify a tag (latest|beta)');
process.exit(1);
}

const newPkg = {
...pkg,
types: undefined,
files: ['*'],
exports: {
'.': {
import: './index.mjs',
require: './index.js',
types: './index.d.ts',
},
},
};
delete newPkg['types'];

fs.writeFileSync(
'./dist/package.json',
JSON.stringify(newPkg, null, 2),
'utf-8'
);
fs.copyFileSync('./README.md', './dist/README.md');
fs.copyFileSync('../../LICENSE.md', './dist/LICENSE.md');
execSync(`npm pack --dry-run && npm publish --tag ${tag}`, {
cwd: './dist',
stdio: 'inherit',
});
10 changes: 9 additions & 1 deletion packages/support/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"scripts": {
"build": "tsup-node",
"dev": "tsup --watch",
"lint": "eslint src --fix"
"lint": "eslint src --fix",
"publish": "node ./publish.js"
},
"files": [
"dist",
Expand All @@ -29,5 +30,12 @@
"json-stringify-safe": "^5.0.1",
"lodash": "^4.17.21",
"rrweb": "^2.0.0-alpha.4"
},
"exports": {
".": {
"require": "./index.js",
"import": "./index.mjs",
"types": "./index.d.ts"
}
}
}
39 changes: 39 additions & 0 deletions packages/support/publish.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env node

const { execSync } = require('child_process');
const fs = require('fs');
const pkg = require('./package.json');
const { argv } = require('process');

const tag = argv[2];

if (!tag) {
console.error('ERROR: You must specify a tag (latest|beta)');
process.exit(1);
}

const newPkg = {
...pkg,
types: undefined,
files: ['*'],
exports: {
'.': {
import: './index.mjs',
require: './index.js',
types: './index.d.ts',
},
},
};
delete newPkg['types'];

fs.writeFileSync(
'./dist/package.json',
JSON.stringify(newPkg, null, 2),
'utf-8'
);
fs.copyFileSync('./README.md', './dist/README.md');
fs.copyFileSync('../../LICENSE.md', './dist/LICENSE.md');
execSync(`npm pack --dry-run && npm publish --tag ${tag}`, {
cwd: './dist',
stdio: 'inherit',
});
4 changes: 4 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"$schema": "https://turbo.build/schema.json",
"globalDependencies": ["**/.env.*local"],
"pipeline": {
"publish": {
"dependsOn": ["^build"],
"cache": false
},
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**"],
Expand Down