-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: update template and add script to generate announcement message
- Loading branch information
Showing
4 changed files
with
118 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
#!/usr/bin/env node | ||
|
||
/** | ||
* @license Apache-2.0 | ||
* | ||
* Copyright (c) 2024 The Stdlib Authors. | ||
* | ||
* 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. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
// MODULES // | ||
|
||
var resolve = require( 'path' ).resolve; | ||
var mustache = require( 'mustache' ); | ||
var mkdirp = require( 'mkdirp' ).sync; | ||
var readFile = require( '@stdlib/fs-read-file' ).sync; | ||
var writeFile = require( '@stdlib/fs-write-file' ).sync; | ||
var ENV = require( '@stdlib/process-env' ); | ||
var parseCSV = require( './parse_csv.js' ); | ||
|
||
|
||
// VARIABLES // | ||
|
||
var SENDER = ENV[ 'SENDER' ]; | ||
var NUM_APPS = parseInt( ENV[ 'NUM_APPS' ], 10 ); | ||
var CODING_START = ENV[ 'CODING_START' ]; | ||
|
||
var FOPTS = { | ||
'encoding': 'utf8' | ||
}; | ||
|
||
var tpath = resolve( __dirname, '..', 'templates', 'announcement.md' ); | ||
var TMPL = readFile( tpath, FOPTS ); | ||
|
||
var dpath = resolve( __dirname, 'tmp', 'accepted.csv' ); | ||
var DATA = parseCSV( readFile( dpath, FOPTS ) ); | ||
|
||
|
||
// FUNCTIONS // | ||
|
||
/** | ||
* Returns an object containing template parameters. | ||
* | ||
* @private | ||
* @returns {Object} template parameter object | ||
*/ | ||
function params() { | ||
return { | ||
'number_of_applications': NUM_APPS, | ||
'coding_start_date': CODING_START, | ||
'sender_name': SENDER, | ||
'projects': [] | ||
}; | ||
} | ||
|
||
|
||
// MAIN // | ||
|
||
/** | ||
* Main execution sequence. | ||
* | ||
* @private | ||
* @throws {Error} unexpected error | ||
*/ | ||
function main() { | ||
var opath; | ||
var opts; | ||
var dir; | ||
var err; | ||
var v; | ||
var o; | ||
var t; | ||
var i; | ||
|
||
dir = resolve( __dirname, 'tmp', 'announcement' ); | ||
mkdirp( dir ); | ||
|
||
opts = params(); | ||
for ( i = 0; i < DATA.length; i++ ) { | ||
v = DATA[ i ]; | ||
o = {}; | ||
o.first_name = v.first_name; | ||
o.last_name = v.last_name; | ||
o.project_title = v.project_title; | ||
o.mentors = v.mentor_1 + ', ' + v.mentor_2; | ||
opts.projects.push( o ); | ||
} | ||
t = mustache.render( TMPL, opts ); | ||
|
||
opath = resolve( dir, 'announcement.txt' ); | ||
err = writeFile( opath, t, FOPTS ); | ||
if ( err ) { | ||
throw err; | ||
} | ||
} | ||
|
||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,25 @@ | ||
Hello everyone! | ||
|
||
As many of you may have noticed, Google has announced the results for Google Summer of Code. We are proud to announce that NUMBER_OF_ACCEPTED_APPLICATIONS people have been accepted to work on stdlib this year. The following projects have been accepted: | ||
As many of you may have noticed, Google has announced the results for Google Summer of Code. We are proud to announce that {{number_of_accepted_applications}} people have been accepted to work on stdlib this year. The following projects have been accepted: | ||
|
||
Contributor, Project: Mentors | ||
|
||
FIRST_NAME LAST_NAME, "PROJECT_TITLE". Mentors: MENTOR_NAMES | ||
{{#projects}} | ||
{{first_name}} {{last_name}}, "{{project_title}}". Mentors: {{mentors}} | ||
|
||
{{/projects}} | ||
Join me in congratulating them on their acceptance. | ||
|
||
To everyone whose proposal is accepted, you should be receiving an email from your mentors shortly to discuss how you will be communicating over the summer about your project. You should meet with your mentors about once a week during the summer to go over your progress. | ||
|
||
I would like all of us to strongly encourage contributors to submit pull requests early and often. This will go a long way toward making sure that you don't end the summer with a ton of code written that never gets merged. Contributors should help review pull requests by other contributors, so that we don't get bogged down reviewing too much code. | ||
|
||
The GSoC coding period officially starts May CODING_START_DATE (https://developers.google.com/open-source/gsoc/timeline). | ||
The GSoC coding period officially starts {{coding_start_date}} (https://developers.google.com/open-source/gsoc/timeline). | ||
|
||
I would like to thank all of the contributors who applied this year and everyone who submitted a patch. I would also like to thank all the mentors for helping review patches and proposals. | ||
|
||
This is looking to be another very productive summer for stdlib, and I'm looking forward to it! | ||
|
||
Best, | ||
|
||
YOUR_NAME | ||
{{sender_name}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters