We are creating an extension of the USWDS; whereby, we leverage the good work here and the modular approach to extend or override.
uswds.min.js and just requiring it into our build. However, ran into issues with JS compiling due to Politespace not being found. Therefore, we copied over /node_modules/uswds/src/js to our /src/js/vendor (following the copy vendor files methodology. Same issue.uswds.min.js to go one folder higher to find the Politespace stored in our /node_modules. The had it be ignored when we do copy-vendor-javascript. This does not seem like a permanent solution.Thoughts?
/node_modules/uswds/src/js directory to /src/js/vendor/src/js/start.js with require('./vendor/start.js');$ gulp release/src/js/vendor/start.js:From:
var Politespace = require('../../node_modules/politespace/src/politespace').Politespace;
To:
var Politespace = require('../../../node_modules/politespace/src/politespace').Politespace;
$ gulp releasegsa/sam-web-design-standards#45
gsa/sam-web-design-standards#13

$ gulp copy-vendor-javascript
gulp.task('copy-vendor-javascript', function (done) {
dutil.logMessage('copy-vendor-javascript', 'Compiling vendor JavaScript');
var stream = gulp.src([ // TODO: Should we copy the USWDS Sass, as it is a vendor?
// './node_modules/uswds/dist/js/uswds.min.js'
'./node_modules/uswds/src/js/**/*.js',
'!./node_modules/uswds/src/js/start.js'
])
.on('error', function (error) {
dutil.logError('copy-vendor-javascript', error);
})
.pipe(gulp.dest('src/js/vendor/'))
.pipe(gulp.dest('_site-assets/js/vendor/'))
return stream;
});
This seems like the last nail on the coffin to remove Politespace and replace it with FieldKit.
Making a note here... check out this comment on how we are moving forward in regards to Politespace removal.
Politespace is still mentioned at: https://standards.usa.gov/form-templates/#02-address-form
Hi @tomberek, that's actually intentional. We removed Politespace as a dependency from the Standards "core", but are still using it on the site for demonstration purposes.
Most helpful comment
This seems like the last nail on the coffin to remove
Politespaceand replace it withFieldKit.