ReactFlow前端拖拽模型与参数配置功能MVP
This commit is contained in:
1 parent
70c91ed019
commit
d3b99304fb
2001 files changed
+349044
-548
No files matched your search
Generated
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
Copyright (c) 2015, npm, Inc
|
||||
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
["_http_agent","_http_client","_http_common","_http_incoming","_http_outgoing","_http_server","_stream_duplex","_stream_passthrough","_stream_readable","_stream_transform","_stream_wrap","_stream_writable","_tls_common","_tls_wrap","assert","assert/strict","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","dns/promises","domain","events","fs","fs/promises","http","http2","https","inspector","inspector/promises","module","net","os","path","path/posix","path/win32","perf_hooks","process","punycode","querystring","readline","readline/promises","repl","stream","stream/consumers","stream/promises","stream/web","string_decoder","sys","timers","timers/promises","tls","trace_events","tty","url","util","util/types","v8","vm","wasi","worker_threads","zlib","node:sea","node:sqlite","node:test","node:test/reporters"]
|
||||
Generated
Vendored
+114
@@ -0,0 +1,114 @@
|
||||
'use strict'
|
||||
const builtins = require('./builtin-modules.json')
|
||||
|
||||
var scopedPackagePattern = new RegExp('^(?:@([^/]+?)[/])?([^/]+?)$')
|
||||
var exclusionList = [
|
||||
'node_modules',
|
||||
'favicon.ico',
|
||||
]
|
||||
|
||||
function validate (name) {
|
||||
var warnings = []
|
||||
var errors = []
|
||||
|
||||
if (name === null) {
|
||||
errors.push('name cannot be null')
|
||||
return done(warnings, errors)
|
||||
}
|
||||
|
||||
if (name === undefined) {
|
||||
errors.push('name cannot be undefined')
|
||||
return done(warnings, errors)
|
||||
}
|
||||
|
||||
if (typeof name !== 'string') {
|
||||
errors.push('name must be a string')
|
||||
return done(warnings, errors)
|
||||
}
|
||||
|
||||
if (!name.length) {
|
||||
errors.push('name length must be greater than zero')
|
||||
}
|
||||
|
||||
if (name.startsWith('.')) {
|
||||
errors.push('name cannot start with a period')
|
||||
}
|
||||
|
||||
if (name.startsWith('-')) {
|
||||
errors.push('name cannot start with a hyphen')
|
||||
}
|
||||
|
||||
if (name.match(/^_/)) {
|
||||
errors.push('name cannot start with an underscore')
|
||||
}
|
||||
|
||||
if (name.trim() !== name) {
|
||||
errors.push('name cannot contain leading or trailing spaces')
|
||||
}
|
||||
|
||||
// No funny business
|
||||
exclusionList.forEach(function (excludedName) {
|
||||
if (name.toLowerCase() === excludedName) {
|
||||
errors.push(excludedName + ' is not a valid package name')
|
||||
}
|
||||
})
|
||||
|
||||
// Generate warnings for stuff that used to be allowed
|
||||
|
||||
// core module names like http, events, util, etc
|
||||
if (builtins.includes(name.toLowerCase())) {
|
||||
warnings.push(name + ' is a core module name')
|
||||
}
|
||||
|
||||
if (name.length > 214) {
|
||||
warnings.push('name can no longer contain more than 214 characters')
|
||||
}
|
||||
|
||||
// mIxeD CaSe nAMEs
|
||||
if (name.toLowerCase() !== name) {
|
||||
warnings.push('name can no longer contain capital letters')
|
||||
}
|
||||
|
||||
if (/[~'!()*]/.test(name.split('/').slice(-1)[0])) {
|
||||
warnings.push('name can no longer contain special characters ("~\'!()*")')
|
||||
}
|
||||
|
||||
if (encodeURIComponent(name) !== name) {
|
||||
// Maybe it's a scoped package name, like @user/package
|
||||
var nameMatch = name.match(scopedPackagePattern)
|
||||
if (nameMatch) {
|
||||
var user = nameMatch[1]
|
||||
var pkg = nameMatch[2]
|
||||
|
||||
if (pkg.startsWith('.')) {
|
||||
errors.push('name cannot start with a period')
|
||||
}
|
||||
|
||||
if (encodeURIComponent(user) === user && encodeURIComponent(pkg) === pkg) {
|
||||
return done(warnings, errors)
|
||||
}
|
||||
}
|
||||
|
||||
errors.push('name can only contain URL-friendly characters')
|
||||
}
|
||||
|
||||
return done(warnings, errors)
|
||||
}
|
||||
|
||||
var done = function (warnings, errors) {
|
||||
var result = {
|
||||
validForNewPackages: errors.length === 0 && warnings.length === 0,
|
||||
validForOldPackages: errors.length === 0,
|
||||
warnings: warnings,
|
||||
errors: errors,
|
||||
}
|
||||
if (!result.warnings.length) {
|
||||
delete result.warnings
|
||||
}
|
||||
if (!result.errors.length) {
|
||||
delete result.errors
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
module.exports = validate
|
||||
Generated
Vendored
+59
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"name": "validate-npm-package-name",
|
||||
"version": "7.0.2",
|
||||
"description": "Give me a string and I'll tell you if it's a valid npm package name",
|
||||
"main": "lib/",
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@npmcli/eslint-config": "^6.0.0",
|
||||
"@npmcli/template-oss": "4.28.1"
|
||||
},
|
||||
"scripts": {
|
||||
"builtin-fixture": "node -e \"console.log(JSON.stringify(require('node:module').builtinModules))\" > ./lib/builtin-modules.json",
|
||||
"cov:test": "TAP_FLAGS='--cov' npm run test:code",
|
||||
"test:code": "tap ${TAP_FLAGS:-'--'} test/*.js",
|
||||
"test:style": "standard",
|
||||
"test": "node --test './test/**/*.js'",
|
||||
"lint": "npm run eslint",
|
||||
"postlint": "template-oss-check",
|
||||
"template-oss-apply": "template-oss-apply --force",
|
||||
"lintfix": "npm run eslint -- --fix",
|
||||
"snap": "node --test --test-update-snapshots './test/**/*.js'",
|
||||
"posttest": "npm run lint",
|
||||
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"",
|
||||
"test:node20": "node --test test",
|
||||
"test:cover": "node --test --experimental-test-coverage --test-timeout=3000 --test-coverage-lines=100 --test-coverage-functions=100 --test-coverage-branches=100 './test/**/*.js'"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/npm/validate-npm-package-name.git"
|
||||
},
|
||||
"keywords": [
|
||||
"npm",
|
||||
"package",
|
||||
"names",
|
||||
"validation"
|
||||
],
|
||||
"author": "GitHub Inc.",
|
||||
"license": "ISC",
|
||||
"bugs": {
|
||||
"url": "https://github.com/npm/validate-npm-package-name/issues"
|
||||
},
|
||||
"homepage": "https://github.com/npm/validate-npm-package-name",
|
||||
"files": [
|
||||
"bin/",
|
||||
"lib/"
|
||||
],
|
||||
"engines": {
|
||||
"node": "^20.17.0 || >=22.9.0"
|
||||
},
|
||||
"templateOSS": {
|
||||
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
||||
"version": "4.28.1",
|
||||
"publish": true,
|
||||
"testRunner": "node:test",
|
||||
"latestCiVersion": 24
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user