Skip to content

Commit

Permalink
ci(): Remove browser publish that is no more necessary with new build (
Browse files Browse the repository at this point in the history
  • Loading branch information
asturur authored Feb 4, 2023
1 parent ec8f561 commit 1d628e8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 34 deletions.
5 changes: 1 addition & 4 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
.github/
.nyc_output/
.vscode/
cli_output/
lib/*.jar
lib/*.png
coverage/
test/
test*
dist/all.min.js
dist/all.min.js.gz
dist/fabric.require.js
dist/fabric.min.js.gz
.DS_Store
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## [next]

- ci(): Removed the browser publish script [#8656](https://github.com/fabricjs/fabric.js/pull/8656)
- feat(): Node entry point [#8632](https://github.com/fabricjs/fabric.js/pull/8632)
- chore(): Change import and export strategy [#8622](https://github.com/fabricjs/fabric.js/pull/8622)
- chore(): rename files to modern style [#8621](https://github.com/fabricjs/fabric.js/pull/8621)
Expand Down
30 changes: 0 additions & 30 deletions publish.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
var cp = require('child_process');
var path = require('path');
var fs = require('fs');

// useful changelog regexp for atom
// \(#([0-9]+)\) [#$1](https://github.com/fabricjs/fabric.js/pull/$1)

// eslint-disable-next-line no-undef
var pkgPath = path.resolve(__dirname, './package.json');
var pkgText = fs.readFileSync(pkgPath); // get original pkg text to restore it later
var pkgObject = JSON.parse(pkgText); // parsed pkg to override its fields
var args = process.argv.slice(2).join(' '); // args will be passed to npm publish (like --dry-run)
var preRelease = process.env.PRE_RELEASE;

Expand All @@ -18,29 +9,8 @@ if (preRelease === 'true') {
args = '--tag beta ' + args;
}

// override package.json with updated fields
fs.writeFileSync(
pkgPath,
JSON.stringify(
Object.assign(pkgObject, {
optionalDependencies: {},
version: pkgObject.version + '-browser',
}),
null,
'\t'
)
);

console.log('npm publish ' + args);

// publish -browser version
cp.execSync('npm publish ' + args);

console.log('Browser package is published');

// restore the original package.json contents
fs.writeFileSync(pkgPath, pkgText);

// publish the main version (the package is published "above" the -browser version)
cp.execSync('npm publish ' + args);

Expand Down

0 comments on commit 1d628e8

Please sign in to comment.