1.0.0 • Published 2 years ago

front-end-engineering v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Front-end-engineering

How to build an engineered front-end library, combined with Github Actions, that automatically publishes to the full flow of Github and NPM

作者:molvqingtai 链接:https://juejin.cn/post/6971812117993226248

package.json 生成之后,我需要添加如下配置项:

   "main": "index.js",
+  "type": "module",
   "scripts": {
     "test": "echo \"Error: no test specified\" && exit 1"
   },
+  "publishConfig": {
+    "access": "public"
+  }

我们将项目定义为ESM规范,前端社区正逐渐向ESM标准迁移,从Node v12.0.0开始,只要设置了 "type": "module", Node 会将整个项目视为ESM规范,我们就可以直接写裸写 import/export

publishConfig.access表示当前项目发布到NPM的访问级别,它有 restrictedpublic两个选项,restricted表示我们发布到NPM上的是私有包(收费),访问级别默认为 restricted,因为我们是开源项目所以标记为 public

JSONStreamacornacorn-jsxacorn-walkajvansi-escapesansi-stylesansi-regexarray-includesanymatcharray-ifyargparsearray-unionargbabel-plugin-istanbularrifyarray.prototype.flatbabel-jestbabel-plugin-jest-hoistbabel-preset-current-node-syntaxbabel-preset-jestbracesbrace-expansionbalanced-matchbrowserslistbserbs-loggerbuiltinscall-bindcallsitescamelcase-keyschar-regexcamelcaseci-infocliuicaniuse-litecjs-module-lexercollect-v8-coveragechalkcolor-convertbuffer-fromcolor-namecompare-funcconventional-changelog-angularconventional-changelog-conventionalcommitsconcat-mapcoconventional-commits-parserconvert-source-mapcosmiconfigcreate-requirecross-spawndargsdebugdecamelizedecamelize-keysdedentdeep-isdefine-propertiesdetect-newlinedeepmergediffdiff-sequencesdoctrinedir-globdot-propelectron-to-chromiumerror-exemitteryemoji-regexes-abstractes-shim-unscopableses-to-primitiveescaladeescape-string-regexpeslint-config-standardeslint-import-resolver-nodeeslint-module-utilseslint-scopeeslint-plugin-eseslint-utilseslint-visitor-keysespreeesprimaesqueryesrecurseestraverseesutilsexecaexitexpectfast-deep-equalfast-difffast-globfast-json-stable-stringifyfast-levenshteinfastqfb-watchmanfile-entry-cachefill-rangefind-upflat-cacheflattedfs-extrafs.realpathfunction-bindfunction.prototype.namefunctional-red-black-treefunctions-have-namesgensyncget-caller-fileget-intrinsicget-package-typeget-streamget-symbol-descriptiongit-raw-commitsglobglob-parentglobal-dirsglobalsglobbygraceful-fsgrapheme-splitterhard-rejectionhashas-bigintshas-flaghas-property-descriptorshtml-escaperhosted-git-infohuman-signalshas-symbolsignoreimport-freshimport-localimurmurhashindent-stringinflighthas-tostringtaginheritsiniinternal-slotis-arrayishis-bigintis-boolean-objectis-callableis-core-moduleis-date-objectis-extglobis-fullwidth-code-pointis-generator-fnis-globis-negative-zerois-numberis-number-objectis-objis-plain-objis-regexis-shared-array-bufferis-streamis-stringis-symbolis-text-pathis-weakrefisexeistanbul-lib-coverageistanbul-lib-instrumentistanbul-lib-reportistanbul-lib-source-mapsistanbul-reportsjest-changed-filesjest-circusjest-clijest-configjest-diffjest-docblockjest-eachjest-environment-nodejest-get-typejest-haste-mapjest-leak-detectorjest-matcher-utilsjest-message-utiljest-mockjest-pnp-resolverjest-regex-utiljest-resolvejest-resolve-dependenciesjest-runnerjest-runtimejest-snapshotjest-utiljest-validatejest-watcherjest-workerjs-tokensjs-yamljsescjson-parse-even-better-errorsjson-schema-traversejsonparsekind-ofjson-stable-stringify-without-jsonifykleurlevenlevnjson5lines-and-columnslocate-pathlodashlodash.memoizelodash.mergejsonfilelru-cachemake-errormake-dirmakeerrormap-objmeowmerge-streammerge2micromatchmimic-fnmin-indentminimatchminimistminimist-optionsmsnatural-comparenode-int64node-releasesnormalize-package-datanormalize-pathnpm-run-pathobject-inspectobject-keysobject.assignobject.valuesonceonetimeoptionatorp-limitp-locatep-tryparent-moduleparse-jsonpath-existspath-is-absolutepath-keypath-parsepath-typepicocolorspicomatchpiratespkg-dirprelude-lsprettier-linter-helperspretty-formatpunycodepromptsqqueue-microtaskquick-lrureact-isread-pkgread-pkg-upreadable-streamredentregexp.prototype.flagsregexpprequire-directoryrequire-from-stringresolveresolve-cwdresolve-fromresolve-globalresolve.exportsreusifyrimrafrun-parallelsafe-buffersemvershebang-commandshebang-regexside-channelsignal-exitsisteransislashsource-mapsource-map-supportspdx-correctspdx-exceptionsspdx-expression-parsespdx-license-idssplit2sprintf-jsstring.prototype.trimendstack-utilsstring.prototype.trimstartstring_decoderstrip-ansistrip-bomstrip-final-newlinestring-lengthstrip-indentstrip-json-commentssupports-colorstring-widthsupports-preserve-symlinks-flagsupports-hyperlinkstest-excludeterminal-linktext-extensionstext-tablethroughthrough2tmplto-fast-propertiesto-regex-rangetrim-newlinestsconfig-pathstslibtsutilstype-checktype-detecttype-festunbox-primitiveupdate-browserslist-dbuniversalifyuri-jsutil-deprecatev8-compile-cache-libvalidate-npm-package-licensev8-to-istanbulwalkerwhichwhich-boxed-primitiveword-wrapwrap-ansiwrappywrite-file-atomicy18nyallistyamlyargsyargs-parserynyocto-queue
1.0.0

2 years ago