@proteinjs/reflection-build 1.4.4 → 1.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/test/examples/source-repository/a/generated/index.js +1 -1
- package/dist/test/examples/source-repository/a/generated/index.js.map +1 -1
- package/dist/test/examples/source-repository/b/generated/index.js +1 -1
- package/dist/test/examples/source-repository/b/generated/index.js.map +1 -1
- package/package.json +4 -5
- package/test/examples/source-repository/a/dist/generated/index.js +1 -1
- package/test/examples/source-repository/a/dist/generated/index.js.map +1 -1
- package/test/examples/source-repository/a/generated/index.ts +33 -38
- package/test/examples/source-repository/a/node_modules/.package-lock.json +63 -6
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/.eslintrc.js +20 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/.prettierignore +4 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/.prettierrc +8 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/CHANGELOG.md +58 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/index.d.ts +5 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/index.js +18 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/index.js.map +1 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/FlattenedSourceGraph.d.ts +19 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/FlattenedSourceGraph.js +555 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/FlattenedSourceGraph.js.map +1 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/Loadable.d.ts +3 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/Loadable.js +5 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/Loadable.js.map +1 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/SourceRepository.d.ts +45 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/SourceRepository.js +176 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/SourceRepository.js.map +1 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/SourceRepositoryFilter.d.ts +11 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/SourceRepositoryFilter.js +9 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/SourceRepositoryFilter.js.map +1 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/sourceGraphTypes.d.ts +13 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/sourceGraphTypes.js +19 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/sourceGraphTypes.js.map +1 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/types.d.ts +221 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/types.js +234 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/dist/src/types.js.map +1 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/index.ts +5 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/jest.config.js +9 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/package.json +42 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/src/FlattenedSourceGraph.ts +702 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/src/Loadable.ts +2 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/src/SourceRepository.ts +250 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/src/SourceRepositoryFilter.ts +15 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/src/sourceGraphTypes.ts +14 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/src/types.ts +236 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/tsconfig.json +19 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/reflection/types/@dagrejs/graphlib.d.ts +1 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/CHANGELOG.md +33 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/src/PackageUtil.js +108 -18
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/src/PackageUtil.js.map +1 -1
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/jest.config.js +9 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/package.json +4 -3
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/src/PackageUtil.ts +92 -2
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/test/PackageUtil.symlinkDependencies.test.ts +254 -0
- package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/tsconfig.json +1 -1
- package/test/examples/source-repository/a/node_modules/bindings/LICENSE.md +22 -0
- package/test/examples/source-repository/a/node_modules/bindings/README.md +98 -0
- package/test/examples/source-repository/a/node_modules/bindings/bindings.js +221 -0
- package/test/examples/source-repository/a/node_modules/bindings/package.json +28 -0
- package/test/examples/source-repository/a/node_modules/file-uri-to-path/.travis.yml +30 -0
- package/test/examples/source-repository/a/node_modules/file-uri-to-path/History.md +21 -0
- package/test/examples/source-repository/a/node_modules/file-uri-to-path/LICENSE +20 -0
- package/test/examples/source-repository/a/node_modules/file-uri-to-path/README.md +74 -0
- package/test/examples/source-repository/a/node_modules/file-uri-to-path/index.d.ts +2 -0
- package/test/examples/source-repository/a/node_modules/file-uri-to-path/index.js +66 -0
- package/test/examples/source-repository/a/node_modules/file-uri-to-path/package.json +32 -0
- package/test/examples/source-repository/a/node_modules/file-uri-to-path/test/test.js +24 -0
- package/test/examples/source-repository/a/node_modules/file-uri-to-path/test/tests.json +13 -0
- package/test/examples/source-repository/a/node_modules/fsevents/LICENSE +22 -0
- package/test/examples/source-repository/a/node_modules/fsevents/README.md +89 -0
- package/test/examples/source-repository/a/node_modules/fsevents/fsevents.d.ts +46 -0
- package/test/examples/source-repository/a/node_modules/fsevents/fsevents.js +83 -0
- package/test/examples/source-repository/a/node_modules/fsevents/fsevents.node +0 -0
- package/test/examples/source-repository/a/node_modules/fsevents/package.json +62 -0
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/.travis.yml +103 -0
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/ISSUE_TEMPLATE.md +8 -0
- package/{LICENSE → test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/LICENSE} +6 -5
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/Readme.md +78 -0
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/binding.gyp +21 -0
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/build/.target.mk +53 -0
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/build/Makefile +352 -0
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/build/Release/.deps/Release/.node.d +1 -0
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/build/Release/.deps/Release/obj.target/fse/fsevents.o.d.raw +79 -0
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/build/Release/.node +0 -0
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/build/binding.Makefile +6 -0
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/build/fse.target.mk +191 -0
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/build/gyp-mac-tool +766 -0
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/fsevents.cc +88 -0
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/fsevents.js +106 -0
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/install.js +13 -0
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/package.json +34 -0
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/src/async.cc +43 -0
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/src/constants.cc +110 -0
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/src/methods.cc +44 -0
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/src/storage.cc +27 -0
- package/test/examples/source-repository/a/node_modules/glob-watcher/node_modules/fsevents/src/thread.cc +71 -0
- package/test/examples/source-repository/a/node_modules/nan/CHANGELOG.md +557 -0
- package/test/examples/source-repository/a/node_modules/nan/CMakeLists.txt +138 -0
- package/test/examples/source-repository/a/node_modules/nan/LICENSE.md +9 -0
- package/test/examples/source-repository/a/node_modules/nan/README.md +456 -0
- package/test/examples/source-repository/a/node_modules/nan/doc/asyncworker.md +146 -0
- package/test/examples/source-repository/a/node_modules/nan/doc/buffers.md +54 -0
- package/test/examples/source-repository/a/node_modules/nan/doc/callback.md +76 -0
- package/test/examples/source-repository/a/node_modules/nan/doc/converters.md +41 -0
- package/test/examples/source-repository/a/node_modules/nan/doc/errors.md +226 -0
- package/test/examples/source-repository/a/node_modules/nan/doc/json.md +62 -0
- package/test/examples/source-repository/a/node_modules/nan/doc/maybe_types.md +583 -0
- package/test/examples/source-repository/a/node_modules/nan/doc/methods.md +672 -0
- package/test/examples/source-repository/a/node_modules/nan/doc/new.md +147 -0
- package/test/examples/source-repository/a/node_modules/nan/doc/node_misc.md +123 -0
- package/test/examples/source-repository/a/node_modules/nan/doc/object_wrappers.md +263 -0
- package/test/examples/source-repository/a/node_modules/nan/doc/persistent.md +296 -0
- package/test/examples/source-repository/a/node_modules/nan/doc/scopes.md +73 -0
- package/test/examples/source-repository/a/node_modules/nan/doc/script.md +58 -0
- package/test/examples/source-repository/a/node_modules/nan/doc/string_bytes.md +62 -0
- package/test/examples/source-repository/a/node_modules/nan/doc/v8_internals.md +199 -0
- package/test/examples/source-repository/a/node_modules/nan/doc/v8_misc.md +85 -0
- package/test/examples/source-repository/a/node_modules/nan/include_dirs.js +1 -0
- package/test/examples/source-repository/a/node_modules/nan/nan.h +2958 -0
- package/test/examples/source-repository/a/node_modules/nan/nan_callbacks.h +92 -0
- package/test/examples/source-repository/a/node_modules/nan/nan_callbacks_12_inl.h +520 -0
- package/test/examples/source-repository/a/node_modules/nan/nan_callbacks_pre_12_inl.h +520 -0
- package/test/examples/source-repository/a/node_modules/nan/nan_converters.h +72 -0
- package/test/examples/source-repository/a/node_modules/nan/nan_converters_43_inl.h +68 -0
- package/test/examples/source-repository/a/node_modules/nan/nan_converters_pre_43_inl.h +42 -0
- package/test/examples/source-repository/a/node_modules/nan/nan_define_own_property_helper.h +29 -0
- package/test/examples/source-repository/a/node_modules/nan/nan_implementation_12_inl.h +430 -0
- package/test/examples/source-repository/a/node_modules/nan/nan_implementation_pre_12_inl.h +263 -0
- package/test/examples/source-repository/a/node_modules/nan/nan_json.h +166 -0
- package/test/examples/source-repository/a/node_modules/nan/nan_maybe_43_inl.h +356 -0
- package/test/examples/source-repository/a/node_modules/nan/nan_maybe_pre_43_inl.h +268 -0
- package/test/examples/source-repository/a/node_modules/nan/nan_new.h +340 -0
- package/test/examples/source-repository/a/node_modules/nan/nan_object_wrap.h +156 -0
- package/test/examples/source-repository/a/node_modules/nan/nan_persistent_12_inl.h +132 -0
- package/test/examples/source-repository/a/node_modules/nan/nan_persistent_pre_12_inl.h +242 -0
- package/test/examples/source-repository/a/node_modules/nan/nan_private.h +73 -0
- package/test/examples/source-repository/a/node_modules/nan/nan_scriptorigin.h +76 -0
- package/test/examples/source-repository/a/node_modules/nan/nan_string_bytes.h +305 -0
- package/test/examples/source-repository/a/node_modules/nan/nan_typedarray_contents.h +96 -0
- package/test/examples/source-repository/a/node_modules/nan/nan_weak.h +437 -0
- package/test/examples/source-repository/a/node_modules/nan/package.json +38 -0
- package/test/examples/source-repository/a/node_modules/nan/tools/1to2.js +412 -0
- package/test/examples/source-repository/a/node_modules/nan/tools/README.md +14 -0
- package/test/examples/source-repository/a/node_modules/nan/tools/package.json +19 -0
- package/test/examples/source-repository/a/package-lock.json +12 -8
- package/test/examples/source-repository/a/package.json +3 -3
- package/test/examples/source-repository/b/dist/generated/index.js +1 -1
- package/test/examples/source-repository/b/dist/generated/index.js.map +1 -1
- package/test/examples/source-repository/b/generated/index.ts +11 -10
- package/test/examples/source-repository/b/node_modules/.package-lock.json +61 -4
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/.eslintrc.js +20 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/.prettierignore +4 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/.prettierrc +8 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/CHANGELOG.md +58 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/index.d.ts +5 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/index.js +18 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/index.js.map +1 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/FlattenedSourceGraph.d.ts +19 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/FlattenedSourceGraph.js +555 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/FlattenedSourceGraph.js.map +1 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/Loadable.d.ts +3 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/Loadable.js +5 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/Loadable.js.map +1 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/SourceRepository.d.ts +45 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/SourceRepository.js +176 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/SourceRepository.js.map +1 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/SourceRepositoryFilter.d.ts +11 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/SourceRepositoryFilter.js +9 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/SourceRepositoryFilter.js.map +1 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/sourceGraphTypes.d.ts +13 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/sourceGraphTypes.js +19 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/sourceGraphTypes.js.map +1 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/types.d.ts +221 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/types.js +234 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/dist/src/types.js.map +1 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/index.ts +5 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/jest.config.js +9 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/package.json +42 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/src/FlattenedSourceGraph.ts +702 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/src/Loadable.ts +2 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/src/SourceRepository.ts +250 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/src/SourceRepositoryFilter.ts +15 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/src/sourceGraphTypes.ts +14 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/src/types.ts +236 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/tsconfig.json +19 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/reflection/types/@dagrejs/graphlib.d.ts +1 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/CHANGELOG.md +33 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/src/PackageUtil.js +108 -18
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/dist/src/PackageUtil.js.map +1 -1
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/jest.config.js +9 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/package.json +4 -3
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/src/PackageUtil.ts +92 -2
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/test/PackageUtil.symlinkDependencies.test.ts +254 -0
- package/test/examples/source-repository/b/node_modules/@proteinjs/util-node/tsconfig.json +1 -1
- package/test/examples/source-repository/b/node_modules/bindings/LICENSE.md +22 -0
- package/test/examples/source-repository/b/node_modules/bindings/README.md +98 -0
- package/test/examples/source-repository/b/node_modules/bindings/bindings.js +221 -0
- package/test/examples/source-repository/b/node_modules/bindings/package.json +28 -0
- package/test/examples/source-repository/b/node_modules/file-uri-to-path/.travis.yml +30 -0
- package/test/examples/source-repository/b/node_modules/file-uri-to-path/History.md +21 -0
- package/test/examples/source-repository/b/node_modules/file-uri-to-path/LICENSE +20 -0
- package/test/examples/source-repository/b/node_modules/file-uri-to-path/README.md +74 -0
- package/test/examples/source-repository/b/node_modules/file-uri-to-path/index.d.ts +2 -0
- package/test/examples/source-repository/b/node_modules/file-uri-to-path/index.js +66 -0
- package/test/examples/source-repository/b/node_modules/file-uri-to-path/package.json +32 -0
- package/test/examples/source-repository/b/node_modules/file-uri-to-path/test/test.js +24 -0
- package/test/examples/source-repository/b/node_modules/file-uri-to-path/test/tests.json +13 -0
- package/test/examples/source-repository/b/node_modules/fsevents/LICENSE +22 -0
- package/test/examples/source-repository/b/node_modules/fsevents/README.md +89 -0
- package/test/examples/source-repository/b/node_modules/fsevents/fsevents.d.ts +46 -0
- package/test/examples/source-repository/b/node_modules/fsevents/fsevents.js +83 -0
- package/test/examples/source-repository/b/node_modules/fsevents/fsevents.node +0 -0
- package/test/examples/source-repository/b/node_modules/fsevents/package.json +62 -0
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/.travis.yml +103 -0
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/ISSUE_TEMPLATE.md +8 -0
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/LICENSE +22 -0
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/Readme.md +78 -0
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/binding.gyp +21 -0
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/build/.target.mk +53 -0
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/build/Makefile +352 -0
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/build/Release/.deps/Release/.node.d +1 -0
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/build/Release/.deps/Release/obj.target/fse/fsevents.o.d.raw +79 -0
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/build/Release/.node +0 -0
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/build/binding.Makefile +6 -0
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/build/fse.target.mk +191 -0
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/build/gyp-mac-tool +766 -0
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/fsevents.cc +88 -0
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/fsevents.js +106 -0
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/install.js +13 -0
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/package.json +34 -0
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/src/async.cc +43 -0
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/src/constants.cc +110 -0
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/src/methods.cc +44 -0
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/src/storage.cc +27 -0
- package/test/examples/source-repository/b/node_modules/glob-watcher/node_modules/fsevents/src/thread.cc +71 -0
- package/test/examples/source-repository/b/node_modules/nan/CHANGELOG.md +557 -0
- package/test/examples/source-repository/b/node_modules/nan/CMakeLists.txt +138 -0
- package/test/examples/source-repository/b/node_modules/nan/LICENSE.md +9 -0
- package/test/examples/source-repository/b/node_modules/nan/README.md +456 -0
- package/test/examples/source-repository/b/node_modules/nan/doc/asyncworker.md +146 -0
- package/test/examples/source-repository/b/node_modules/nan/doc/buffers.md +54 -0
- package/test/examples/source-repository/b/node_modules/nan/doc/callback.md +76 -0
- package/test/examples/source-repository/b/node_modules/nan/doc/converters.md +41 -0
- package/test/examples/source-repository/b/node_modules/nan/doc/errors.md +226 -0
- package/test/examples/source-repository/b/node_modules/nan/doc/json.md +62 -0
- package/test/examples/source-repository/b/node_modules/nan/doc/maybe_types.md +583 -0
- package/test/examples/source-repository/b/node_modules/nan/doc/methods.md +672 -0
- package/test/examples/source-repository/b/node_modules/nan/doc/new.md +147 -0
- package/test/examples/source-repository/b/node_modules/nan/doc/node_misc.md +123 -0
- package/test/examples/source-repository/b/node_modules/nan/doc/object_wrappers.md +263 -0
- package/test/examples/source-repository/b/node_modules/nan/doc/persistent.md +296 -0
- package/test/examples/source-repository/b/node_modules/nan/doc/scopes.md +73 -0
- package/test/examples/source-repository/b/node_modules/nan/doc/script.md +58 -0
- package/test/examples/source-repository/b/node_modules/nan/doc/string_bytes.md +62 -0
- package/test/examples/source-repository/b/node_modules/nan/doc/v8_internals.md +199 -0
- package/test/examples/source-repository/b/node_modules/nan/doc/v8_misc.md +85 -0
- package/test/examples/source-repository/b/node_modules/nan/include_dirs.js +1 -0
- package/test/examples/source-repository/b/node_modules/nan/nan.h +2958 -0
- package/test/examples/source-repository/b/node_modules/nan/nan_callbacks.h +92 -0
- package/test/examples/source-repository/b/node_modules/nan/nan_callbacks_12_inl.h +520 -0
- package/test/examples/source-repository/b/node_modules/nan/nan_callbacks_pre_12_inl.h +520 -0
- package/test/examples/source-repository/b/node_modules/nan/nan_converters.h +72 -0
- package/test/examples/source-repository/b/node_modules/nan/nan_converters_43_inl.h +68 -0
- package/test/examples/source-repository/b/node_modules/nan/nan_converters_pre_43_inl.h +42 -0
- package/test/examples/source-repository/b/node_modules/nan/nan_define_own_property_helper.h +29 -0
- package/test/examples/source-repository/b/node_modules/nan/nan_implementation_12_inl.h +430 -0
- package/test/examples/source-repository/b/node_modules/nan/nan_implementation_pre_12_inl.h +263 -0
- package/test/examples/source-repository/b/node_modules/nan/nan_json.h +166 -0
- package/test/examples/source-repository/b/node_modules/nan/nan_maybe_43_inl.h +356 -0
- package/test/examples/source-repository/b/node_modules/nan/nan_maybe_pre_43_inl.h +268 -0
- package/test/examples/source-repository/b/node_modules/nan/nan_new.h +340 -0
- package/test/examples/source-repository/b/node_modules/nan/nan_object_wrap.h +156 -0
- package/test/examples/source-repository/b/node_modules/nan/nan_persistent_12_inl.h +132 -0
- package/test/examples/source-repository/b/node_modules/nan/nan_persistent_pre_12_inl.h +242 -0
- package/test/examples/source-repository/b/node_modules/nan/nan_private.h +73 -0
- package/test/examples/source-repository/b/node_modules/nan/nan_scriptorigin.h +76 -0
- package/test/examples/source-repository/b/node_modules/nan/nan_string_bytes.h +305 -0
- package/test/examples/source-repository/b/node_modules/nan/nan_typedarray_contents.h +96 -0
- package/test/examples/source-repository/b/node_modules/nan/nan_weak.h +437 -0
- package/test/examples/source-repository/b/node_modules/nan/package.json +38 -0
- package/test/examples/source-repository/b/node_modules/nan/tools/1to2.js +412 -0
- package/test/examples/source-repository/b/node_modules/nan/tools/README.md +14 -0
- package/test/examples/source-repository/b/node_modules/nan/tools/package.json +19 -0
- package/test/examples/source-repository/b/package-lock.json +10 -6
- package/test/examples/source-repository/b/package.json +3 -3
package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/dist/src/PackageUtil.js
CHANGED
|
@@ -74,6 +74,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
74
74
|
exports.PackageUtil = void 0;
|
|
75
75
|
var typescript_1 = __importDefault(require("typescript"));
|
|
76
76
|
var path = __importStar(require("path"));
|
|
77
|
+
var fs = __importStar(require("fs/promises"));
|
|
77
78
|
var util_1 = require("@proteinjs/util");
|
|
78
79
|
var cmd_1 = require("./cmd");
|
|
79
80
|
var Fs_1 = require("./Fs");
|
|
@@ -463,10 +464,10 @@ var PackageUtil = /** @class */ (function () {
|
|
|
463
464
|
_a.label = 3;
|
|
464
465
|
case 3:
|
|
465
466
|
linkDependencies = function (dependencies) { return __awaiter(_this, void 0, void 0, function () {
|
|
466
|
-
var _a, _b, _c, _i, dependencyPackageName, dependencyPath, symlinkPath;
|
|
467
|
-
var
|
|
468
|
-
return __generator(this, function (
|
|
469
|
-
switch (
|
|
467
|
+
var _a, _b, _c, _i, dependencyPackageName, dependencyPath, symlinkPath, symlinkParent, e_1, relativeDependencyPath, depPackageJson, _d, _e, bin, binEntries, binName, bareName, dotBinDir, _f, binEntries_1, _g, name_3, relPath, binFilePath, shimPath, e_2, shimTargetAbsolute, shimRelative;
|
|
468
|
+
var _h;
|
|
469
|
+
return __generator(this, function (_j) {
|
|
470
|
+
switch (_j.label) {
|
|
470
471
|
case 0:
|
|
471
472
|
if (!dependencies) {
|
|
472
473
|
return [2 /*return*/];
|
|
@@ -476,34 +477,123 @@ var PackageUtil = /** @class */ (function () {
|
|
|
476
477
|
for (_c in _a)
|
|
477
478
|
_b.push(_c);
|
|
478
479
|
_i = 0;
|
|
479
|
-
|
|
480
|
+
_j.label = 1;
|
|
480
481
|
case 1:
|
|
481
|
-
if (!(_i < _b.length)) return [3 /*break*/,
|
|
482
|
+
if (!(_i < _b.length)) return [3 /*break*/, 26];
|
|
482
483
|
_c = _b[_i];
|
|
483
|
-
if (!(_c in _a)) return [3 /*break*/,
|
|
484
|
+
if (!(_c in _a)) return [3 /*break*/, 25];
|
|
484
485
|
dependencyPackageName = _c;
|
|
485
|
-
dependencyPath = ((
|
|
486
|
+
dependencyPath = ((_h = localPackageMap[dependencyPackageName]) === null || _h === void 0 ? void 0 : _h.filePath)
|
|
486
487
|
? path.dirname(localPackageMap[dependencyPackageName].filePath)
|
|
487
488
|
: null;
|
|
488
489
|
if (!dependencyPath) {
|
|
489
|
-
return [3 /*break*/,
|
|
490
|
+
return [3 /*break*/, 25];
|
|
490
491
|
}
|
|
491
492
|
symlinkPath = path.join(nodeModulesPath, dependencyPackageName);
|
|
492
|
-
|
|
493
|
+
symlinkParent = path.dirname(symlinkPath);
|
|
494
|
+
return [4 /*yield*/, Fs_1.Fs.exists(symlinkParent)];
|
|
493
495
|
case 2:
|
|
494
|
-
if (
|
|
495
|
-
return [4 /*yield*/, Fs_1.Fs.
|
|
496
|
+
if (!!(_j.sent())) return [3 /*break*/, 4];
|
|
497
|
+
return [4 /*yield*/, Fs_1.Fs.createFolder(symlinkParent)];
|
|
496
498
|
case 3:
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
case 4:
|
|
499
|
+
_j.sent();
|
|
500
|
+
_j.label = 4;
|
|
501
|
+
case 4:
|
|
502
|
+
_j.trys.push([4, 7, , 8]);
|
|
503
|
+
return [4 /*yield*/, fs.lstat(symlinkPath)];
|
|
500
504
|
case 5:
|
|
501
|
-
|
|
502
|
-
|
|
505
|
+
_j.sent();
|
|
506
|
+
// Existing entry (symlink, file, or directory) — remove it.
|
|
507
|
+
// `deleteFolder` (fs-extra `remove`) handles all three.
|
|
508
|
+
return [4 /*yield*/, Fs_1.Fs.deleteFolder(symlinkPath)];
|
|
503
509
|
case 6:
|
|
510
|
+
// Existing entry (symlink, file, or directory) — remove it.
|
|
511
|
+
// `deleteFolder` (fs-extra `remove`) handles all three.
|
|
512
|
+
_j.sent();
|
|
513
|
+
return [3 /*break*/, 8];
|
|
514
|
+
case 7:
|
|
515
|
+
e_1 = _j.sent();
|
|
516
|
+
if (e_1.code !== 'ENOENT') {
|
|
517
|
+
throw e_1;
|
|
518
|
+
}
|
|
519
|
+
return [3 /*break*/, 8];
|
|
520
|
+
case 8:
|
|
521
|
+
relativeDependencyPath = path.relative(symlinkParent, dependencyPath);
|
|
522
|
+
return [4 /*yield*/, (0, cmd_1.cmd)('ln', ['-s', relativeDependencyPath, symlinkPath], { cwd: packageDir })];
|
|
523
|
+
case 9:
|
|
524
|
+
_j.sent();
|
|
525
|
+
_e = (_d = JSON).parse;
|
|
526
|
+
return [4 /*yield*/, Fs_1.Fs.readFile(localPackageMap[dependencyPackageName].filePath)];
|
|
527
|
+
case 10:
|
|
528
|
+
depPackageJson = _e.apply(_d, [_j.sent()]);
|
|
529
|
+
bin = depPackageJson.bin;
|
|
530
|
+
binEntries = [];
|
|
531
|
+
if (bin && typeof bin === 'object') {
|
|
532
|
+
for (binName in bin) {
|
|
533
|
+
binEntries.push({ name: binName, relPath: bin[binName] });
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
else if (bin && typeof bin === 'string') {
|
|
537
|
+
bareName = dependencyPackageName.includes('/')
|
|
538
|
+
? dependencyPackageName.split('/').pop()
|
|
539
|
+
: dependencyPackageName;
|
|
540
|
+
binEntries.push({ name: bareName, relPath: bin });
|
|
541
|
+
}
|
|
542
|
+
if (!(binEntries.length > 0)) return [3 /*break*/, 25];
|
|
543
|
+
dotBinDir = path.join(nodeModulesPath, '.bin');
|
|
544
|
+
return [4 /*yield*/, Fs_1.Fs.exists(dotBinDir)];
|
|
545
|
+
case 11:
|
|
546
|
+
if (!!(_j.sent())) return [3 /*break*/, 13];
|
|
547
|
+
return [4 /*yield*/, Fs_1.Fs.createFolder(dotBinDir)];
|
|
548
|
+
case 12:
|
|
549
|
+
_j.sent();
|
|
550
|
+
_j.label = 13;
|
|
551
|
+
case 13:
|
|
552
|
+
_f = 0, binEntries_1 = binEntries;
|
|
553
|
+
_j.label = 14;
|
|
554
|
+
case 14:
|
|
555
|
+
if (!(_f < binEntries_1.length)) return [3 /*break*/, 25];
|
|
556
|
+
_g = binEntries_1[_f], name_3 = _g.name, relPath = _g.relPath;
|
|
557
|
+
binFilePath = path.resolve(dependencyPath, relPath);
|
|
558
|
+
return [4 /*yield*/, Fs_1.Fs.exists(binFilePath)];
|
|
559
|
+
case 15:
|
|
560
|
+
if (!_j.sent()) return [3 /*break*/, 17];
|
|
561
|
+
return [4 /*yield*/, fs.chmod(binFilePath, 493)];
|
|
562
|
+
case 16:
|
|
563
|
+
_j.sent();
|
|
564
|
+
_j.label = 17;
|
|
565
|
+
case 17:
|
|
566
|
+
shimPath = path.join(dotBinDir, name_3);
|
|
567
|
+
_j.label = 18;
|
|
568
|
+
case 18:
|
|
569
|
+
_j.trys.push([18, 21, , 22]);
|
|
570
|
+
return [4 /*yield*/, fs.lstat(shimPath)];
|
|
571
|
+
case 19:
|
|
572
|
+
_j.sent();
|
|
573
|
+
return [4 /*yield*/, Fs_1.Fs.deleteFolder(shimPath)];
|
|
574
|
+
case 20:
|
|
575
|
+
_j.sent();
|
|
576
|
+
return [3 /*break*/, 22];
|
|
577
|
+
case 21:
|
|
578
|
+
e_2 = _j.sent();
|
|
579
|
+
if (e_2.code !== 'ENOENT') {
|
|
580
|
+
throw e_2;
|
|
581
|
+
}
|
|
582
|
+
return [3 /*break*/, 22];
|
|
583
|
+
case 22:
|
|
584
|
+
shimTargetAbsolute = path.join(nodeModulesPath, dependencyPackageName, relPath);
|
|
585
|
+
shimRelative = path.relative(dotBinDir, shimTargetAbsolute);
|
|
586
|
+
return [4 /*yield*/, (0, cmd_1.cmd)('ln', ['-s', shimRelative, shimPath], { cwd: packageDir })];
|
|
587
|
+
case 23:
|
|
588
|
+
_j.sent();
|
|
589
|
+
_j.label = 24;
|
|
590
|
+
case 24:
|
|
591
|
+
_f++;
|
|
592
|
+
return [3 /*break*/, 14];
|
|
593
|
+
case 25:
|
|
504
594
|
_i++;
|
|
505
595
|
return [3 /*break*/, 1];
|
|
506
|
-
case
|
|
596
|
+
case 26: return [2 /*return*/];
|
|
507
597
|
}
|
|
508
598
|
});
|
|
509
599
|
}); };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PackageUtil.js","sourceRoot":"","sources":["../../src/PackageUtil.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA4B;AAC5B,yCAA6B;AAC7B,wCAAyD;AACzD,6BAA4B;AAC5B,2BAA0B;AA+B1B;IAAA;IAuUA,CAAC;IAtUC;;;;;OAKG;IACU,2BAAe,GAA5B,UAA6B,QAAmB,EAAE,OAAgB;;;;;;8BAClC,EAAR,qBAAQ;;;6BAAR,CAAA,sBAAQ,CAAA;wBAAnB,OAAO;wBACR,SAA6C,OAAO,KAAhD,EAAE,OAAO,GAAgC,OAAO,QAAvC,EAAE,YAAY,GAAkB,OAAO,aAAzB,EAAE,WAAW,GAAK,OAAO,YAAZ,CAAa;wBACvD,oBAAoB,GAAG,OAAO,YAAY,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC;wBACjF,mBAAmB,GAAG,OAAO,WAAW,KAAK,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC;wBAC/E,IAAI,GAAG;4BACX,GAAG;4BACH,UAAG,mBAAmB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAE;4BAC9E,UAAG,MAAI,SAAG,OAAO,CAAC,CAAC,CAAC,WAAI,OAAO,CAAE,CAAC,CAAC,CAAC,EAAE,CAAE;yBACzC,CAAC;wBACE,OAAO,SAAA,CAAC;wBACZ,IAAI,OAAO,EAAE;4BACX,OAAO,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;yBAC5B;wBACM,qBAAM,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
21
21
|
"clean": "rm -rf dist/ node_modules/",
|
|
22
22
|
"build": "tsc",
|
|
23
|
-
"watch": "tsc -w -p ."
|
|
23
|
+
"watch": "tsc -w -p .",
|
|
24
|
+
"test": "jest --passWithNoTests"
|
|
24
25
|
},
|
|
25
26
|
"dependencies": {
|
|
26
27
|
"@dagrejs/graphlib": "2.1.4",
|
|
@@ -42,5 +43,5 @@
|
|
|
42
43
|
"jest": "^29.6.4",
|
|
43
44
|
"ts-jest": "^29.1.1"
|
|
44
45
|
},
|
|
45
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "d05f0a962e993acae4c4667ec1fe890d13b55710"
|
|
46
47
|
}
|
package/test/examples/source-repository/a/node_modules/@proteinjs/util-node/src/PackageUtil.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
2
|
import * as path from 'path';
|
|
3
|
+
import * as fs from 'fs/promises';
|
|
3
4
|
import { Graph, GraphAlgorithms } from '@proteinjs/util';
|
|
4
5
|
import { cmd } from './cmd';
|
|
5
6
|
import { Fs } from './Fs';
|
|
@@ -349,11 +350,100 @@ export class PackageUtil {
|
|
|
349
350
|
}
|
|
350
351
|
|
|
351
352
|
const symlinkPath = path.join(nodeModulesPath, dependencyPackageName);
|
|
352
|
-
|
|
353
|
+
const symlinkParent = path.dirname(symlinkPath);
|
|
354
|
+
if (!(await Fs.exists(symlinkParent))) {
|
|
355
|
+
await Fs.createFolder(symlinkParent);
|
|
356
|
+
}
|
|
357
|
+
// Clear out any existing entry at symlinkPath before creating the
|
|
358
|
+
// new symlink. Use `fs.lstat` rather than `Fs.exists` because
|
|
359
|
+
// `Fs.exists` is `fs.stat`-backed — which FOLLOWS symlinks and
|
|
360
|
+
// throws on a broken target, making broken symlinks invisible
|
|
361
|
+
// here. That's a real failure mode: if a prior run produced a
|
|
362
|
+
// symlink to a path that no longer exists (e.g. after the tree
|
|
363
|
+
// was moved, mounted elsewhere, or retargeted by tooling), the
|
|
364
|
+
// broken link survives the `Fs.exists` check, the delete is
|
|
365
|
+
// skipped, and `ln -s` then fails with "File exists".
|
|
366
|
+
try {
|
|
367
|
+
await fs.lstat(symlinkPath);
|
|
368
|
+
// Existing entry (symlink, file, or directory) — remove it.
|
|
369
|
+
// `deleteFolder` (fs-extra `remove`) handles all three.
|
|
353
370
|
await Fs.deleteFolder(symlinkPath);
|
|
371
|
+
} catch (e: any) {
|
|
372
|
+
if (e.code !== 'ENOENT') {
|
|
373
|
+
throw e;
|
|
374
|
+
}
|
|
375
|
+
// Nothing there — nothing to clean up.
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
// Use a RELATIVE link target so the workspace is portable across
|
|
379
|
+
// mount points (a developer's laptop, CI containers, a remote
|
|
380
|
+
// sandbox, etc.) without having to re-run `symlink-workspace` just
|
|
381
|
+
// because the absolute root path changed. `ln -s TARGET LINK`
|
|
382
|
+
// resolves TARGET relative to the directory containing the link —
|
|
383
|
+
// i.e. `symlinkParent` — so we compute the relative path from there.
|
|
384
|
+
const relativeDependencyPath = path.relative(symlinkParent, dependencyPath);
|
|
385
|
+
await cmd('ln', ['-s', relativeDependencyPath, symlinkPath], { cwd: packageDir });
|
|
386
|
+
|
|
387
|
+
// Create `.bin/<name>` shims for every bin the dependency declares.
|
|
388
|
+
//
|
|
389
|
+
// This is normally npm's job: `npm install` creates shims at
|
|
390
|
+
// `node_modules/.bin/<name>` pointing into the installed package so
|
|
391
|
+
// lifecycle scripts like `npm run watch` (where npm prepends
|
|
392
|
+
// `./node_modules/.bin` to PATH) can find them. `symlink-workspace`
|
|
393
|
+
// bypasses `npm install`, so without this loop the shims only exist
|
|
394
|
+
// if the user happened to run `npm install` at some point and they
|
|
395
|
+
// survive. They don't survive a broken-symlink sweep, a fresh
|
|
396
|
+
// checkout, or a move to a new host — so we create them ourselves.
|
|
397
|
+
//
|
|
398
|
+
// Also chmod +x the bin target: tsc output doesn't preserve the
|
|
399
|
+
// execute bit that `npm install` sets from the published tarball.
|
|
400
|
+
const depPackageJson = JSON.parse(await Fs.readFile(localPackageMap[dependencyPackageName].filePath));
|
|
401
|
+
const bin = depPackageJson.bin;
|
|
402
|
+
const binEntries: Array<{ name: string; relPath: string }> = [];
|
|
403
|
+
if (bin && typeof bin === 'object') {
|
|
404
|
+
for (const binName in bin) {
|
|
405
|
+
binEntries.push({ name: binName, relPath: bin[binName] });
|
|
406
|
+
}
|
|
407
|
+
} else if (bin && typeof bin === 'string') {
|
|
408
|
+
// Shorthand: `"bin": "./path"` — the exposed name is the
|
|
409
|
+
// package's bare name (scope stripped). Matches npm behavior.
|
|
410
|
+
const bareName = dependencyPackageName.includes('/')
|
|
411
|
+
? dependencyPackageName.split('/').pop()!
|
|
412
|
+
: dependencyPackageName;
|
|
413
|
+
binEntries.push({ name: bareName, relPath: bin });
|
|
354
414
|
}
|
|
355
415
|
|
|
356
|
-
|
|
416
|
+
if (binEntries.length > 0) {
|
|
417
|
+
const dotBinDir = path.join(nodeModulesPath, '.bin');
|
|
418
|
+
if (!(await Fs.exists(dotBinDir))) {
|
|
419
|
+
await Fs.createFolder(dotBinDir);
|
|
420
|
+
}
|
|
421
|
+
for (const { name, relPath } of binEntries) {
|
|
422
|
+
const binFilePath = path.resolve(dependencyPath, relPath);
|
|
423
|
+
if (await Fs.exists(binFilePath)) {
|
|
424
|
+
await fs.chmod(binFilePath, 0o755);
|
|
425
|
+
}
|
|
426
|
+
const shimPath = path.join(dotBinDir, name);
|
|
427
|
+
// Same lstat-based cleanup as for the dep symlink — broken
|
|
428
|
+
// shims from a prior run in a different environment would
|
|
429
|
+
// otherwise make `ln -s` fail with "File exists".
|
|
430
|
+
try {
|
|
431
|
+
await fs.lstat(shimPath);
|
|
432
|
+
await Fs.deleteFolder(shimPath);
|
|
433
|
+
} catch (e: any) {
|
|
434
|
+
if (e.code !== 'ENOENT') {
|
|
435
|
+
throw e;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
// Relative target: from `node_modules/.bin` into the dep
|
|
439
|
+
// directory. Goes through the dep's symlinked node_modules
|
|
440
|
+
// entry (not into the source tree) so the shim continues to
|
|
441
|
+
// resolve correctly after the workspace is relocated.
|
|
442
|
+
const shimTargetAbsolute = path.join(nodeModulesPath, dependencyPackageName, relPath);
|
|
443
|
+
const shimRelative = path.relative(dotBinDir, shimTargetAbsolute);
|
|
444
|
+
await cmd('ln', ['-s', shimRelative, shimPath], { cwd: packageDir });
|
|
445
|
+
}
|
|
446
|
+
}
|
|
357
447
|
}
|
|
358
448
|
};
|
|
359
449
|
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import * as path from 'path';
|
|
2
|
+
import * as fs from 'fs/promises';
|
|
3
|
+
import * as os from 'os';
|
|
4
|
+
import { PackageUtil, LocalPackage, LocalPackageMap } from '../src/PackageUtil';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Regression tests for PackageUtil.symlinkDependencies.
|
|
8
|
+
*
|
|
9
|
+
* The important property: the symlinks it creates must use RELATIVE targets
|
|
10
|
+
* so the workspace is portable across mount points. If absolute paths slip
|
|
11
|
+
* back in, a symlinked workspace breaks whenever its root directory moves
|
|
12
|
+
* (developer laptop vs CI container vs sandbox vs coworker's checkout), and
|
|
13
|
+
* every environment change requires re-running `symlink-workspace`.
|
|
14
|
+
*/
|
|
15
|
+
describe('PackageUtil.symlinkDependencies — relative link targets', () => {
|
|
16
|
+
let workspaceRoot: string;
|
|
17
|
+
|
|
18
|
+
beforeEach(async () => {
|
|
19
|
+
workspaceRoot = await fs.mkdtemp(path.join(os.tmpdir(), 'symlink-rel-'));
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
afterEach(async () => {
|
|
23
|
+
if (workspaceRoot) {
|
|
24
|
+
await fs.rm(workspaceRoot, { recursive: true, force: true }).catch(() => {
|
|
25
|
+
/* ignore — directory may have already been moved */
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Create a package.json on disk and return the `LocalPackage` record that
|
|
32
|
+
* `symlinkDependencies` expects.
|
|
33
|
+
*/
|
|
34
|
+
const writePackage = async (
|
|
35
|
+
relPath: string,
|
|
36
|
+
name: string,
|
|
37
|
+
deps: Record<string, string> = {}
|
|
38
|
+
): Promise<LocalPackage> => {
|
|
39
|
+
const dir = path.join(workspaceRoot, relPath);
|
|
40
|
+
await fs.mkdir(dir, { recursive: true });
|
|
41
|
+
const pkgPath = path.join(dir, 'package.json');
|
|
42
|
+
const packageJson = { name, version: '1.0.0', dependencies: deps };
|
|
43
|
+
await fs.writeFile(pkgPath, JSON.stringify(packageJson, null, 2));
|
|
44
|
+
return { name, filePath: pkgPath, packageJson };
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
test('created symlink target is relative, not absolute', async () => {
|
|
48
|
+
const depPkg = await writePackage('packages/dep', '@scope/dep');
|
|
49
|
+
const consumerPkg = await writePackage('packages/consumer', '@scope/consumer', {
|
|
50
|
+
'@scope/dep': '^1.0.0',
|
|
51
|
+
});
|
|
52
|
+
const packageMap: LocalPackageMap = {
|
|
53
|
+
'@scope/dep': depPkg,
|
|
54
|
+
'@scope/consumer': consumerPkg,
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
await PackageUtil.symlinkDependencies(consumerPkg, packageMap);
|
|
58
|
+
|
|
59
|
+
const symlinkPath = path.join(workspaceRoot, 'packages/consumer/node_modules/@scope/dep');
|
|
60
|
+
const linkTarget = await fs.readlink(symlinkPath);
|
|
61
|
+
|
|
62
|
+
expect(path.isAbsolute(linkTarget)).toBe(false);
|
|
63
|
+
// From .../packages/consumer/node_modules/@scope up to .../packages, then down to dep.
|
|
64
|
+
expect(linkTarget).toBe(path.join('..', '..', '..', 'dep'));
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
test('symlink still resolves after the workspace is moved to a new root', async () => {
|
|
68
|
+
const depPkg = await writePackage('packages/dep', '@scope/dep');
|
|
69
|
+
const consumerPkg = await writePackage('packages/consumer', '@scope/consumer', {
|
|
70
|
+
'@scope/dep': '^1.0.0',
|
|
71
|
+
});
|
|
72
|
+
const packageMap: LocalPackageMap = {
|
|
73
|
+
'@scope/dep': depPkg,
|
|
74
|
+
'@scope/consumer': consumerPkg,
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
// Drop a marker file inside the dep package so we can verify the symlink
|
|
78
|
+
// resolves into it by path after the move.
|
|
79
|
+
const markerRelativePath = path.join('packages/consumer/node_modules/@scope/dep/marker.txt');
|
|
80
|
+
await fs.writeFile(path.join(workspaceRoot, 'packages/dep/marker.txt'), 'hello');
|
|
81
|
+
|
|
82
|
+
await PackageUtil.symlinkDependencies(consumerPkg, packageMap);
|
|
83
|
+
|
|
84
|
+
// Move the entire workspace to a new absolute path. If the symlink target
|
|
85
|
+
// were absolute (pointing at the old workspaceRoot), every resolution
|
|
86
|
+
// through it would now fail. With a relative target it continues to work.
|
|
87
|
+
const movedRoot = workspaceRoot + '-moved';
|
|
88
|
+
await fs.rename(workspaceRoot, movedRoot);
|
|
89
|
+
const prevRoot = workspaceRoot;
|
|
90
|
+
workspaceRoot = movedRoot; // redirect afterEach cleanup at the new location
|
|
91
|
+
|
|
92
|
+
const markerThroughSymlink = path.join(movedRoot, markerRelativePath);
|
|
93
|
+
const content = await fs.readFile(markerThroughSymlink, 'utf8');
|
|
94
|
+
expect(content).toBe('hello');
|
|
95
|
+
|
|
96
|
+
// Sanity check: confirm the old absolute path really is gone, so we know
|
|
97
|
+
// the move happened and we're not accidentally resolving through the
|
|
98
|
+
// original location via some leftover absolute link.
|
|
99
|
+
await expect(fs.stat(prevRoot)).rejects.toThrow();
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
test('replaces a pre-existing BROKEN symlink (prior run pointed at a now-missing path)', async () => {
|
|
103
|
+
// Regression test for the Fs.exists-vs-broken-symlink bug.
|
|
104
|
+
//
|
|
105
|
+
// `Fs.exists` is stat-backed: it follows symlinks and throws on a
|
|
106
|
+
// broken target, so broken symlinks read as "doesn't exist". If
|
|
107
|
+
// symlinkDependencies relied on Fs.exists alone to decide whether to
|
|
108
|
+
// pre-delete, a broken symlink from a prior run (e.g. a sandbox with
|
|
109
|
+
// a different mount point, a cross-machine checkout, a moved tree)
|
|
110
|
+
// would survive the pre-delete step and cause `ln -s` to fail with
|
|
111
|
+
// "File exists".
|
|
112
|
+
const depPkg = await writePackage('packages/dep', '@scope/dep');
|
|
113
|
+
const consumerPkg = await writePackage('packages/consumer', '@scope/consumer', {
|
|
114
|
+
'@scope/dep': '^1.0.0',
|
|
115
|
+
});
|
|
116
|
+
const packageMap: LocalPackageMap = {
|
|
117
|
+
'@scope/dep': depPkg,
|
|
118
|
+
'@scope/consumer': consumerPkg,
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
// Manually plant a broken symlink where the dep link would go,
|
|
122
|
+
// simulating the "ran symlink-workspace in a different environment
|
|
123
|
+
// earlier" state.
|
|
124
|
+
const symlinkDir = path.join(workspaceRoot, 'packages/consumer/node_modules/@scope');
|
|
125
|
+
await fs.mkdir(symlinkDir, { recursive: true });
|
|
126
|
+
const symlinkPath = path.join(symlinkDir, 'dep');
|
|
127
|
+
await fs.symlink('/nonexistent/absolute/path/that/cannot/resolve', symlinkPath);
|
|
128
|
+
|
|
129
|
+
// Confirm the broken state before we invoke symlinkDependencies.
|
|
130
|
+
await expect(fs.stat(symlinkPath)).rejects.toMatchObject({ code: 'ENOENT' });
|
|
131
|
+
// lstat succeeds because it doesn't follow the link.
|
|
132
|
+
const brokenStat = await fs.lstat(symlinkPath);
|
|
133
|
+
expect(brokenStat.isSymbolicLink()).toBe(true);
|
|
134
|
+
|
|
135
|
+
// This must NOT throw "File exists" — it should overwrite the broken link.
|
|
136
|
+
await PackageUtil.symlinkDependencies(consumerPkg, packageMap);
|
|
137
|
+
|
|
138
|
+
// Fresh symlink with a relative target.
|
|
139
|
+
const newTarget = await fs.readlink(symlinkPath);
|
|
140
|
+
expect(path.isAbsolute(newTarget)).toBe(false);
|
|
141
|
+
expect(newTarget).toBe(path.join('..', '..', '..', 'dep'));
|
|
142
|
+
|
|
143
|
+
// And it resolves — the dep directory exists.
|
|
144
|
+
const resolvedStat = await fs.stat(symlinkPath);
|
|
145
|
+
expect(resolvedStat.isDirectory()).toBe(true);
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
test('creates node_modules/.bin shims for deps that declare a `bin` field (object form)', async () => {
|
|
149
|
+
// Regression test for the missing-.bin-shim bug. `npm install`
|
|
150
|
+
// normally writes `node_modules/.bin/<name>` shims for every `bin` a
|
|
151
|
+
// dependency declares, and npm prepends `./node_modules/.bin` to PATH
|
|
152
|
+
// when running lifecycle scripts. If `symlink-workspace` doesn't
|
|
153
|
+
// create these shims itself, running `npm run watch` in a consumer
|
|
154
|
+
// package fails with `command not found` as soon as the shim from a
|
|
155
|
+
// prior `npm install` gets cleaned up (or the tree is freshly cloned).
|
|
156
|
+
const toolPkg = await writePackage('packages/tool', '@scope/tool');
|
|
157
|
+
// Populate a bin script in the tool's dist so the shim has something
|
|
158
|
+
// to resolve to.
|
|
159
|
+
const runBuildPath = path.join(workspaceRoot, 'packages/tool/dist/bin/run-build.js');
|
|
160
|
+
const runWatchPath = path.join(workspaceRoot, 'packages/tool/dist/bin/run-watch.js');
|
|
161
|
+
await fs.mkdir(path.dirname(runBuildPath), { recursive: true });
|
|
162
|
+
await fs.writeFile(runBuildPath, '#!/usr/bin/env node\nconsole.log("build");\n');
|
|
163
|
+
await fs.writeFile(runWatchPath, '#!/usr/bin/env node\nconsole.log("watch");\n');
|
|
164
|
+
// Re-write the tool's package.json with a `bin` entry.
|
|
165
|
+
toolPkg.packageJson.bin = {
|
|
166
|
+
'tool-build': 'dist/bin/run-build.js',
|
|
167
|
+
'tool-watch': 'dist/bin/run-watch.js',
|
|
168
|
+
};
|
|
169
|
+
await fs.writeFile(toolPkg.filePath, JSON.stringify(toolPkg.packageJson, null, 2));
|
|
170
|
+
|
|
171
|
+
const consumerPkg = await writePackage('packages/consumer', 'consumer', {
|
|
172
|
+
'@scope/tool': '^1.0.0',
|
|
173
|
+
});
|
|
174
|
+
const packageMap: LocalPackageMap = {
|
|
175
|
+
'@scope/tool': toolPkg,
|
|
176
|
+
consumer: consumerPkg,
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
await PackageUtil.symlinkDependencies(consumerPkg, packageMap);
|
|
180
|
+
|
|
181
|
+
const binDir = path.join(workspaceRoot, 'packages/consumer/node_modules/.bin');
|
|
182
|
+
const buildShim = path.join(binDir, 'tool-build');
|
|
183
|
+
const watchShim = path.join(binDir, 'tool-watch');
|
|
184
|
+
|
|
185
|
+
// Both shims exist as symlinks.
|
|
186
|
+
expect((await fs.lstat(buildShim)).isSymbolicLink()).toBe(true);
|
|
187
|
+
expect((await fs.lstat(watchShim)).isSymbolicLink()).toBe(true);
|
|
188
|
+
|
|
189
|
+
// Shim targets are relative.
|
|
190
|
+
const buildTarget = await fs.readlink(buildShim);
|
|
191
|
+
const watchTarget = await fs.readlink(watchShim);
|
|
192
|
+
expect(path.isAbsolute(buildTarget)).toBe(false);
|
|
193
|
+
expect(path.isAbsolute(watchTarget)).toBe(false);
|
|
194
|
+
|
|
195
|
+
// Shims resolve end-to-end — readFile through the shim returns the
|
|
196
|
+
// actual script contents, which means the whole chain
|
|
197
|
+
// (`.bin/name` → `../@scope/tool/dist/bin/...`) is intact.
|
|
198
|
+
const buildScript = await fs.readFile(buildShim, 'utf8');
|
|
199
|
+
const watchScript = await fs.readFile(watchShim, 'utf8');
|
|
200
|
+
expect(buildScript).toContain('console.log("build")');
|
|
201
|
+
expect(watchScript).toContain('console.log("watch")');
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
test('creates `.bin` shim for bin-as-string shorthand using the bare package name', async () => {
|
|
205
|
+
const toolPkg = await writePackage('packages/tool', '@scope/only-tool');
|
|
206
|
+
const onlyScriptPath = path.join(workspaceRoot, 'packages/tool/bin.js');
|
|
207
|
+
await fs.writeFile(onlyScriptPath, '#!/usr/bin/env node\nconsole.log("only");\n');
|
|
208
|
+
toolPkg.packageJson.bin = './bin.js';
|
|
209
|
+
await fs.writeFile(toolPkg.filePath, JSON.stringify(toolPkg.packageJson, null, 2));
|
|
210
|
+
|
|
211
|
+
const consumerPkg = await writePackage('packages/consumer', 'consumer', {
|
|
212
|
+
'@scope/only-tool': '^1.0.0',
|
|
213
|
+
});
|
|
214
|
+
const packageMap: LocalPackageMap = {
|
|
215
|
+
'@scope/only-tool': toolPkg,
|
|
216
|
+
consumer: consumerPkg,
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
await PackageUtil.symlinkDependencies(consumerPkg, packageMap);
|
|
220
|
+
|
|
221
|
+
// Bare name — scope stripped — just like npm.
|
|
222
|
+
const shim = path.join(workspaceRoot, 'packages/consumer/node_modules/.bin/only-tool');
|
|
223
|
+
expect((await fs.lstat(shim)).isSymbolicLink()).toBe(true);
|
|
224
|
+
const content = await fs.readFile(shim, 'utf8');
|
|
225
|
+
expect(content).toContain('console.log("only")');
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
test('handles scoped and unscoped dependencies uniformly', async () => {
|
|
229
|
+
const scopedDep = await writePackage('packages/scoped', '@scope/foo');
|
|
230
|
+
const unscopedDep = await writePackage('packages/unscoped', 'bar');
|
|
231
|
+
const consumerPkg = await writePackage('packages/consumer', 'consumer', {
|
|
232
|
+
'@scope/foo': '^1.0.0',
|
|
233
|
+
bar: '^1.0.0',
|
|
234
|
+
});
|
|
235
|
+
const packageMap: LocalPackageMap = {
|
|
236
|
+
'@scope/foo': scopedDep,
|
|
237
|
+
bar: unscopedDep,
|
|
238
|
+
consumer: consumerPkg,
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
await PackageUtil.symlinkDependencies(consumerPkg, packageMap);
|
|
242
|
+
|
|
243
|
+
const scopedLink = await fs.readlink(path.join(workspaceRoot, 'packages/consumer/node_modules/@scope/foo'));
|
|
244
|
+
const unscopedLink = await fs.readlink(path.join(workspaceRoot, 'packages/consumer/node_modules/bar'));
|
|
245
|
+
|
|
246
|
+
expect(path.isAbsolute(scopedLink)).toBe(false);
|
|
247
|
+
expect(path.isAbsolute(unscopedLink)).toBe(false);
|
|
248
|
+
|
|
249
|
+
// Scoped packages are nested one level deeper under node_modules/@scope,
|
|
250
|
+
// so the relative target has one extra `..`.
|
|
251
|
+
expect(scopedLink).toBe(path.join('..', '..', '..', 'scoped'));
|
|
252
|
+
expect(unscopedLink).toBe(path.join('..', '..', 'unscoped'));
|
|
253
|
+
});
|
|
254
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
(The MIT License)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
'Software'), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
20
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
22
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|