Skip to content

Commit

Permalink
Build: remove stale Insight package from custom builds
Browse files Browse the repository at this point in the history
Close gh-5180
  • Loading branch information
timmywil committed Dec 20, 2022
1 parent 8989500 commit 81d5bd1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 43 deletions.
44 changes: 2 additions & 42 deletions build/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ module.exports = function( grunt ) {
var fs = require( "fs" ),
requirejs = require( "requirejs" ),
slimBuildFlags = require( "./lib/slim-build-flags" ),
Insight = require( "insight" ),
pkg = require( "../../package.json" ),
srcFolder = __dirname + "/../../src/",
rdefineEnd = /\}\s*?\);[^}\w]*$/,
read = function( fileName ) {
Expand Down Expand Up @@ -354,47 +352,9 @@ module.exports = function( grunt ) {
), [] )

.join( ":" ) :
"",
done = this.async(),
insight = new Insight( {
trackingCode: "UA-1076265-4",
pkg: pkg
} );

function exec( trackingAllowed ) {
var tracks = args.length ? args[ 0 ].split( "," ) : [];
var defaultPath = [ "build", "custom" ];

tracks = tracks.map( function( track ) {
return track.replace( /\//g, "+" );
} );

if ( trackingAllowed ) {

// Track individuals
tracks.forEach( function( module ) {
var path = defaultPath.concat( [ "individual" ], module );

insight.track.apply( insight, path );
} );

// Track full command
insight.track.apply( insight, defaultPath.concat( [ "full" ], tracks ) );
}

grunt.task.run( [ "build:*:*" + ( modules ? ":" + modules : "" ), "uglify", "dist" ] );
done();
}
"";

grunt.log.writeln( "Creating custom build...\n" );

// Ask for permission the first time
if ( insight.optOut === undefined ) {
insight.askPermission( null, function( _error, result ) {
exec( result );
} );
} else {
exec( !insight.optOut );
}
grunt.task.run( [ "build:*:*" + ( modules ? ":" + modules : "" ), "uglify", "dist" ] );
} );
};
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"grunt-npmcopy": "0.2.0",
"gzip-js": "0.3.2",
"husky": "4.2.5",
"insight": "0.10.3",
"jsdom": "19.0.0",
"karma": "^6.3.17",
"karma-browserstack-launcher": "1.6.0",
Expand Down

0 comments on commit 81d5bd1

Please sign in to comment.