Skip to content

Commit

Permalink
chore: Split trace-anything into its own module
Browse files Browse the repository at this point in the history
After running `npm install`, trace-anything.js is now a symlink into
the node_modules/ folder.

This change also replaces the build system with gulp, since it was
getting too complicated to update that shell script to create the
perfect zip file while dealing with symlinks.

Change-Id: I771b0856892454aa6961b408e09565c2150e2bf6
  • Loading branch information
joeyparrish committed Nov 11, 2021
1 parent a3a183d commit 5d94863
Show file tree
Hide file tree
Showing 6 changed files with 9,056 additions and 2,236 deletions.
4 changes: 1 addition & 3 deletions PUBLISHING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Preparing a version to publish:
3. Commit the version number change.
4. Tag the commit with the version number.
5. Push commits and tags to github.
6. Run `./package.sh` to generate a zip file for publication.
6. Run `npm run build` to generate a zip file for publication.

Publishing a new version:

Expand All @@ -24,5 +24,3 @@ Publishing a new version:
10. If you are prompted to pay a one-time fee (which you should expense), sadly,
it seems that your edits were lost and you must start again at step 2.

TODO: Find a way to start the fee process before your first publication.

47 changes: 47 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* Copyright 2021 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @fileoverview Build system based on Gulp.
*/

const gulp = require('gulp');
const rename = require('gulp-rename');
const zip = require('gulp-zip');

/**
* @return {!Stream}
*/
function packageExtension() {
const version = require('./manifest.json').version;

const sources = gulp.src([
'LICENSE',
'README.md',
'icons/*',
'manifest.json',
'*.js',
'*.html',
], {base: './'});

return sources
.pipe(rename((path) => {
path.dirname = `eme_logger/${path.dirname}`;
}))
.pipe(zip(`eme_logger-${version}.zip`))
.pipe(gulp.dest('.'));
}

// The default command for this gulpfile is just to package the extension.
exports.default = packageExtension;
Loading

0 comments on commit 5d94863

Please sign in to comment.