chore: init frontend-source directory with tooling scaffold

Former-commit-id: 435fb8e3e4f8e334ad3b0e95052edbdd9547d197
This commit is contained in:
反编译工作区
2026-04-29 11:39:06 +08:00
parent 824305aebf
commit 640e188270
1171 changed files with 202200 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
const lib = require('./nopt-lib')
const defaultTypeDefs = require('./type-defs')
// This is the version of nopt's API that requires setting typeDefs and invalidHandler
// on the required `nopt` object since it is a singleton. To not do a breaking change
// an API that requires all options be passed in is located in `nopt-lib.js` and
// exported here as lib.
// TODO(breaking): make API only work in non-singleton mode
module.exports = exports = nopt
exports.clean = clean
exports.typeDefs = defaultTypeDefs
exports.lib = lib
function nopt (types, shorthands, args = process.argv, slice = 2) {
return lib.nopt(args.slice(slice), {
types: types || {},
shorthands: shorthands || {},
typeDefs: exports.typeDefs,
invalidHandler: exports.invalidHandler,
})
}
function clean (data, types, typeDefs = exports.typeDefs) {
return lib.clean(data, {
types: types || {},
typeDefs,
invalidHandler: exports.invalidHandler,
})
}