├── docs ├── .nojekyll ├── img │ ├── electrode.png │ ├── favicon.png │ └── electrode-io-logo.png ├── blog │ ├── rss.xml │ └── atom.xml └── assets │ └── js │ ├── 1.ffc6cf64.js.LICENSE.txt │ └── 22.8d440061.js ├── docusaurus ├── static │ ├── .nojekyll │ └── img │ │ ├── favicon.png │ │ ├── electrode.png │ │ └── electrode-io-logo.png ├── babel.config.js ├── src │ ├── components │ │ └── HomepageFeatures.module.css │ ├── pages │ │ ├── index.module.css │ │ └── index.js │ └── css │ │ └── custom.css ├── .gitignore ├── sidebars.js ├── docs │ ├── commands │ │ ├── prepare.md │ │ ├── publish.md │ │ └── updated.md │ └── getting-started │ │ └── publish.md └── package.json ├── packages ├── fyn │ ├── test │ │ ├── .no-fynpo │ │ ├── scenarios │ │ │ ├── .no-fynpo │ │ │ ├── fynpo-sample │ │ │ │ ├── .gitignore │ │ │ │ ├── fynpo.config.js │ │ │ │ ├── CHANGELOG.md │ │ │ │ ├── step-01 │ │ │ │ │ ├── nm-tree.yaml │ │ │ │ │ ├── pkg.json │ │ │ │ │ └── index.js │ │ │ │ ├── packages │ │ │ │ │ ├── pkg2-b │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── pkg2 │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── pkg1 │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── cir1 │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── cir2 │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── icir1 │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── icir2 │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── icir3 │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── foo1 │ │ │ │ │ │ └── package.json │ │ │ │ │ └── ifoo1 │ │ │ │ │ │ └── package.json │ │ │ │ ├── test1 │ │ │ │ │ └── package.json │ │ │ │ ├── tests │ │ │ │ │ ├── t2 │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── t1 │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── skip │ │ │ │ │ │ └── package.json │ │ │ │ │ └── @scope │ │ │ │ │ │ └── pkg1 │ │ │ │ │ │ └── package.json │ │ │ │ ├── @scope │ │ │ │ │ └── pkg-2 │ │ │ │ │ │ └── package.json │ │ │ │ ├── .ignore-dir │ │ │ │ │ └── package.json │ │ │ │ └── step-02 │ │ │ │ │ ├── _fynpo-data.json │ │ │ │ │ ├── nm-tree.yaml │ │ │ │ │ └── index.js │ │ │ ├── .gitignore │ │ │ ├── locked-change-major │ │ │ │ ├── step-01 │ │ │ │ │ ├── index.js │ │ │ │ │ └── pkg.json │ │ │ │ ├── step-02 │ │ │ │ │ ├── pkg.json │ │ │ │ │ ├── index.js │ │ │ │ │ ├── nm-tree.yaml │ │ │ │ │ └── lock.yaml │ │ │ │ └── README.md │ │ │ ├── package-fyn │ │ │ │ ├── step-01 │ │ │ │ │ ├── index.js │ │ │ │ │ ├── pkg.json │ │ │ │ │ └── nm-tree.yaml │ │ │ │ ├── mod-e │ │ │ │ │ └── package.json │ │ │ │ ├── pkg-a │ │ │ │ │ ├── package-fyn.json │ │ │ │ │ └── package.json │ │ │ │ └── pkg-b │ │ │ │ │ ├── package-fyn.json │ │ │ │ │ └── package.json │ │ │ ├── local-hard-linking │ │ │ │ ├── step-01 │ │ │ │ │ ├── index.js │ │ │ │ │ ├── pkg.json │ │ │ │ │ └── nm-tree.yaml │ │ │ │ ├── step-02 │ │ │ │ │ ├── index.js │ │ │ │ │ ├── pkg.json │ │ │ │ │ └── nm-tree.yaml │ │ │ │ ├── step-04 │ │ │ │ │ ├── index.js │ │ │ │ │ ├── pkg.json │ │ │ │ │ ├── lock.yaml │ │ │ │ │ └── nm-tree.yaml │ │ │ │ ├── e1 │ │ │ │ │ ├── index.js │ │ │ │ │ └── package.json │ │ │ │ └── step-03 │ │ │ │ │ ├── index.js │ │ │ │ │ ├── pkg.json │ │ │ │ │ └── nm-tree.yaml │ │ │ ├── platform-check-good │ │ │ │ └── step-01 │ │ │ │ │ ├── index.js │ │ │ │ │ ├── pkg.json │ │ │ │ │ └── nm-tree.yaml │ │ │ ├── remote-url-semver │ │ │ │ └── step-01 │ │ │ │ │ ├── index.js │ │ │ │ │ ├── pkg.json │ │ │ │ │ └── nm-tree.yaml │ │ │ ├── locked-change-dedupe-2 │ │ │ │ ├── step-01 │ │ │ │ │ ├── index.js │ │ │ │ │ ├── pkg.json │ │ │ │ │ ├── lock.yaml │ │ │ │ │ └── nm-tree.yaml │ │ │ │ ├── step-02 │ │ │ │ │ ├── index.js │ │ │ │ │ ├── pkg.json │ │ │ │ │ ├── nm-tree.yaml │ │ │ │ │ └── lock.yaml │ │ │ │ └── README.md │ │ │ ├── locked-change-dedupe │ │ │ │ ├── step-01 │ │ │ │ │ ├── index.js │ │ │ │ │ ├── pkg.json │ │ │ │ │ ├── lock.yaml │ │ │ │ │ └── nm-tree.yaml │ │ │ │ ├── step-02 │ │ │ │ │ ├── index.js │ │ │ │ │ ├── pkg.json │ │ │ │ │ ├── nm-tree.yaml │ │ │ │ │ └── lock.yaml │ │ │ │ └── README.md │ │ │ ├── locked-change-indirect │ │ │ │ ├── step-01 │ │ │ │ │ ├── index.js │ │ │ │ │ ├── pkg.json │ │ │ │ │ ├── lock.yaml │ │ │ │ │ └── nm-tree.yaml │ │ │ │ ├── step-02 │ │ │ │ │ ├── index.js │ │ │ │ │ ├── pkg.json │ │ │ │ │ ├── nm-tree.yaml │ │ │ │ │ └── lock.yaml │ │ │ │ └── README.md │ │ │ ├── platform-check │ │ │ │ ├── step-01 │ │ │ │ │ ├── index.js │ │ │ │ │ ├── pkg.json │ │ │ │ │ └── nm-tree.yaml │ │ │ │ ├── step-02 │ │ │ │ │ ├── index.js │ │ │ │ │ ├── pkg.json │ │ │ │ │ └── nm-tree.yaml │ │ │ │ └── step-03 │ │ │ │ │ ├── index.js │ │ │ │ │ ├── pkg.json │ │ │ │ │ └── nm-tree.yaml │ │ │ ├── missing-peer-dep │ │ │ │ ├── README.md │ │ │ │ └── step-01 │ │ │ │ │ ├── pkg.json │ │ │ │ │ ├── index.js │ │ │ │ │ └── nm-tree.yaml │ │ │ ├── add-remove-pkg │ │ │ │ ├── step-01 │ │ │ │ │ ├── pkg.json │ │ │ │ │ ├── index.js │ │ │ │ │ ├── lock.yaml │ │ │ │ │ └── nm-tree.yaml │ │ │ │ ├── step-02 │ │ │ │ │ ├── index.js │ │ │ │ │ ├── pkg.json │ │ │ │ │ ├── lock.yaml │ │ │ │ │ └── nm-tree.yaml │ │ │ │ └── step-03 │ │ │ │ │ ├── index.js │ │ │ │ │ ├── pkg.json │ │ │ │ │ ├── lock.yaml │ │ │ │ │ └── nm-tree.yaml │ │ │ ├── stat-pkg │ │ │ │ └── step-01 │ │ │ │ │ ├── index.js │ │ │ │ │ └── pkg.json │ │ │ ├── npm-shrinkwrap │ │ │ │ ├── step-01 │ │ │ │ │ ├── index.js │ │ │ │ │ └── pkg.json │ │ │ │ └── step-02 │ │ │ │ │ ├── index.js │ │ │ │ │ └── pkg.json │ │ │ ├── nested-dep │ │ │ │ ├── step-02 │ │ │ │ │ ├── pkg.json │ │ │ │ │ ├── index.js │ │ │ │ │ └── nm-tree.yaml │ │ │ │ └── step-01 │ │ │ │ │ ├── pkg.json │ │ │ │ │ ├── index.js │ │ │ │ │ └── nm-tree.yaml │ │ │ ├── bin-linker │ │ │ │ ├── step-01 │ │ │ │ │ ├── pkg.json │ │ │ │ │ ├── index.js │ │ │ │ │ └── nm-tree.yaml │ │ │ │ ├── step-02 │ │ │ │ │ ├── pkg.json │ │ │ │ │ ├── index.js │ │ │ │ │ └── nm-tree.yaml │ │ │ │ └── step-03 │ │ │ │ │ ├── pkg.json │ │ │ │ │ ├── index.js │ │ │ │ │ └── nm-tree.yaml │ │ │ ├── fyn-shrinkwrap │ │ │ │ └── step-01 │ │ │ │ │ ├── index.js │ │ │ │ │ ├── pkg.json │ │ │ │ │ └── nm-tree.yaml │ │ │ ├── fyn-central │ │ │ │ └── step-01 │ │ │ │ │ ├── pkg.json │ │ │ │ │ ├── index.js │ │ │ │ │ └── nm-tree.yaml │ │ │ ├── build-local │ │ │ │ ├── step-01 │ │ │ │ │ ├── pkg.json │ │ │ │ │ └── index.js │ │ │ │ ├── step-02 │ │ │ │ │ └── index.js │ │ │ │ └── step-03 │ │ │ │ │ └── index.js │ │ │ ├── auto-deep-resolve │ │ │ │ └── step-01 │ │ │ │ │ ├── pkg.json │ │ │ │ │ ├── nm-tree.yaml │ │ │ │ │ └── index.js │ │ │ ├── locked-npm-dedupe │ │ │ │ ├── step-01 │ │ │ │ │ ├── index.js │ │ │ │ │ ├── pkg.json │ │ │ │ │ └── nm-tree.yaml │ │ │ │ └── README.md │ │ │ └── optional-check │ │ │ │ └── step-01 │ │ │ │ ├── pkg.json │ │ │ │ └── nm-tree.yaml │ │ ├── .gitignore │ │ ├── fixtures │ │ │ ├── mod-g-v3 │ │ │ │ ├── bin │ │ │ │ │ ├── bin1.js │ │ │ │ │ └── bin2.js │ │ │ │ └── package.json │ │ │ ├── mod-i │ │ │ │ ├── bin │ │ │ │ │ └── bin1.js │ │ │ │ └── package.json │ │ │ ├── e1 │ │ │ │ ├── .gitignore │ │ │ │ ├── package.json │ │ │ │ └── index.js │ │ │ ├── mock-npm │ │ │ │ ├── pkg │ │ │ │ │ ├── mod-g │ │ │ │ │ │ ├── 4.0.0 │ │ │ │ │ │ │ └── package │ │ │ │ │ │ │ │ └── bin │ │ │ │ │ │ │ │ ├── x.js │ │ │ │ │ │ │ │ └── bin1.js │ │ │ │ │ │ ├── 2.0.1 │ │ │ │ │ │ │ └── package │ │ │ │ │ │ │ │ └── bin │ │ │ │ │ │ │ │ ├── bin1.js │ │ │ │ │ │ │ │ └── bin2.js │ │ │ │ │ │ └── 3.0.0 │ │ │ │ │ │ │ └── package │ │ │ │ │ │ │ └── bin │ │ │ │ │ │ │ ├── bin2.js │ │ │ │ │ │ │ └── binx.js │ │ │ │ │ ├── mod-e │ │ │ │ │ │ └── pkg.json │ │ │ │ │ ├── mod-err │ │ │ │ │ │ └── pkg.json │ │ │ │ │ ├── mod-h │ │ │ │ │ │ └── 2.0.0 │ │ │ │ │ │ │ └── package │ │ │ │ │ │ │ └── npm-shrinkwrap.json │ │ │ │ │ ├── mod-ns2 │ │ │ │ │ │ └── 1.0.0 │ │ │ │ │ │ │ └── package │ │ │ │ │ │ │ └── npm-shrinkwrap.json │ │ │ │ │ └── mod-ns │ │ │ │ │ │ └── 1.0.0 │ │ │ │ │ │ └── package │ │ │ │ │ │ └── npm-shrinkwrap.json │ │ │ │ └── metas │ │ │ │ │ ├── mod-i.yml │ │ │ │ │ ├── mod-j.yml │ │ │ │ │ ├── always-change.yml │ │ │ │ │ ├── mod-bad-os.yml │ │ │ │ │ ├── mod-bad-cpu.yml │ │ │ │ │ ├── mod-err.yml │ │ │ │ │ ├── mod-ns2.yml │ │ │ │ │ ├── mod-drop-tgz.yml │ │ │ │ │ ├── mod-ns.yml │ │ │ │ │ ├── mod-os-cpu.yml │ │ │ │ │ ├── mod-f.yml │ │ │ │ │ ├── mod-d.yml │ │ │ │ │ ├── mod-b.yml │ │ │ │ │ ├── mod-e.yml │ │ │ │ │ ├── mod-c.yml │ │ │ │ │ └── mod-g.yml │ │ │ ├── lifecycle-scripts │ │ │ │ ├── f2 │ │ │ │ │ └── package.json │ │ │ │ ├── f3 │ │ │ │ │ └── package.json │ │ │ │ └── f1 │ │ │ │ │ └── package.json │ │ │ ├── mod-g │ │ │ │ ├── bin │ │ │ │ │ ├── bin1.js │ │ │ │ │ └── bin2.js │ │ │ │ └── package.json │ │ │ ├── mod-h │ │ │ │ ├── bin │ │ │ │ │ └── bin1.js │ │ │ │ └── package.json │ │ │ └── pkg-a │ │ │ │ └── package.json │ │ ├── .eslintrc.js │ │ ├── dep-on-pkg1 │ │ │ └── package.json │ │ ├── spec │ │ │ ├── util │ │ │ │ ├── uniq-id.spec.js │ │ │ │ ├── hard-link-dir.spec.js │ │ │ │ └── path-up-each.spec.js │ │ │ └── fyn-config.spec.js │ │ ├── test-dist-fetch.js │ │ ├── test-resolve.js │ │ ├── test-fetch.js │ │ └── test-link.js │ ├── .eslintignore │ ├── stubs │ │ ├── iconv-loader.js │ │ ├── xml2js.js │ │ ├── debug.js │ │ ├── resolve-from.js │ │ └── iconv-lite.js │ ├── lib │ │ ├── util │ │ │ ├── xaa.js │ │ │ ├── defer.js │ │ │ ├── inflight.js │ │ │ ├── promise-queue.js │ │ │ ├── sort-obj-keys.js │ │ │ ├── npm-config-env.js │ │ │ ├── uniq-id.js │ │ │ ├── file-ops.js │ │ │ ├── base-util.js │ │ │ └── path-up-each.js │ │ ├── cli-logger.js │ │ ├── logger.js │ │ ├── pkg-bin-linker.js │ │ ├── log-items.js │ │ ├── constants.js │ │ ├── symbols.js │ │ └── fyn-config.js │ ├── bin │ │ ├── node-gyp.js │ │ ├── index.js │ │ ├── fyn.js │ │ ├── fun.js │ │ └── bundle.js │ ├── yarn │ │ ├── README.md │ │ ├── src │ │ │ ├── constants.js │ │ │ ├── util │ │ │ │ └── map.js │ │ │ └── errors.js │ │ ├── .babelrc.js │ │ └── index.js │ ├── images │ │ └── fyn-demo.gif │ ├── .eslintrc.js │ ├── es6-promisify │ │ ├── package.json │ │ └── es6-promisify.js │ ├── cli │ │ ├── fyn.js │ │ ├── fun.js │ │ ├── default-rc.js │ │ └── mypkg.js │ ├── .gitignore │ └── npm-behavior.md ├── create-fynpo │ ├── templates │ │ ├── README.md │ │ ├── _npmrc │ │ ├── fynpo.config.js │ │ ├── _gitignore │ │ └── _package.js │ ├── bin │ │ └── create-fynpo.js │ ├── xrun-tasks.ts │ ├── docs │ │ ├── assets │ │ │ ├── icons.png │ │ │ ├── icons@2x.png │ │ │ ├── widgets.png │ │ │ ├── widgets@2x.png │ │ │ └── search.js │ │ └── .nojekyll │ ├── .eslintrc.js │ ├── src │ │ ├── interfaces.ts │ │ ├── initialize-git.ts │ │ ├── index.ts │ │ └── prep-fynpo-dir.ts │ ├── .gitignore │ └── tsconfig.json ├── fynpo │ ├── test │ │ └── sample │ │ │ ├── lerna.json │ │ │ ├── CHANGELOG.md │ │ │ ├── package.json │ │ │ └── packages │ │ │ ├── pkg1 │ │ │ └── package.json │ │ │ └── pkg2 │ │ │ └── package.json │ ├── stubs │ │ ├── iconv-loader.js │ │ ├── parser-flow.js │ │ ├── parser-typescript.js │ │ ├── xml2js.js │ │ ├── debug.js │ │ ├── resolve-from.js │ │ ├── iconv-lite.js │ │ └── util-types.js │ ├── src │ │ ├── fynpo.ts │ │ ├── logger.ts │ │ ├── is-ci.ts │ │ ├── utils │ │ │ └── get-current-branch.ts │ │ ├── npm-run-script.ts │ │ └── read-changelog-versions.ts │ ├── xrun-tasks.ts │ ├── bin │ │ └── fynpo.js │ ├── .gitignore │ ├── .eslintrc.js │ ├── tsconfig.json │ ├── templates │ │ └── fynpo.config.js │ └── __tests__ │ │ ├── fynpo.test.ts │ │ ├── bootstrap.test.ts │ │ ├── utils.test.ts │ │ └── topo-runner.test.ts ├── init-package │ ├── README.md │ ├── xrun-tasks.ts │ ├── test │ │ └── test.ts │ ├── .gitignore │ └── tsconfig.json ├── fynpo-base │ ├── xrun-tasks.ts │ ├── __test__ │ │ ├── electrode │ │ │ ├── README.md │ │ │ └── packages │ │ │ │ ├── subapp-pkg-util │ │ │ │ └── package.json │ │ │ │ ├── opt-archetype-check │ │ │ │ └── package.json │ │ │ │ ├── electrode-cdn-file-loader │ │ │ │ └── package.json │ │ │ │ ├── electrode-node-resolver │ │ │ │ └── package.json │ │ │ │ ├── electrode-archetype-webpack-dll │ │ │ │ └── package.json │ │ │ │ ├── subapp-util │ │ │ │ └── package.json │ │ │ │ ├── xarc-opt-sass │ │ │ │ └── package.json │ │ │ │ └── xarc-opt-less │ │ │ │ └── package.json │ │ ├── sample │ │ │ ├── fynpo.config.json │ │ │ ├── CHANGELOG.md │ │ │ ├── package.json │ │ │ ├── node_modules │ │ │ │ └── blah │ │ │ │ │ └── package.json │ │ │ ├── packages │ │ │ │ ├── pkg2 │ │ │ │ │ └── package.json │ │ │ │ ├── pkg2-b │ │ │ │ │ └── package.json │ │ │ │ ├── pkg1 │ │ │ │ │ └── package.json │ │ │ │ ├── cir1 │ │ │ │ │ └── package.json │ │ │ │ ├── cir2 │ │ │ │ │ └── package.json │ │ │ │ ├── icir1 │ │ │ │ │ └── package.json │ │ │ │ ├── icir2 │ │ │ │ │ └── package.json │ │ │ │ ├── icir3 │ │ │ │ │ └── package.json │ │ │ │ ├── foo1 │ │ │ │ │ └── package.json │ │ │ │ └── ifoo1 │ │ │ │ │ └── package.json │ │ │ ├── test1 │ │ │ │ └── package.json │ │ │ ├── tests │ │ │ │ ├── t2 │ │ │ │ │ └── package.json │ │ │ │ ├── t1 │ │ │ │ │ └── package.json │ │ │ │ ├── skip │ │ │ │ │ └── package.json │ │ │ │ └── @scope │ │ │ │ │ └── pkg1 │ │ │ │ │ └── package.json │ │ │ ├── .ignore-dir │ │ │ │ └── package.json │ │ │ └── @scope │ │ │ │ └── pkg-2 │ │ │ │ └── package.json │ │ └── read-packages.test.ts │ ├── README.md │ ├── docs │ │ ├── assets │ │ │ ├── icons.png │ │ │ ├── icons@2x.png │ │ │ ├── widgets.png │ │ │ ├── widgets@2x.png │ │ │ └── highlight.css │ │ └── .nojekyll │ ├── src │ │ └── util.ts │ ├── .gitignore │ └── tsconfig.json └── fynpo-cli │ ├── README.md │ ├── xrun-tasks.ts │ ├── .gitignore │ ├── tsconfig.json │ └── bin │ └── fynpo.ts ├── .npmrc ├── testing └── monorepo-test │ ├── .gitignore │ ├── packages │ ├── pkg-foo │ │ ├── .gitignore │ │ ├── src │ │ │ └── index.ts │ │ ├── package.json │ │ └── tsconfig.json │ └── pkg-bar │ │ ├── test │ │ └── index.spec.js │ │ └── package.json │ ├── fynpo.json │ └── package.json ├── .gitignore ├── .github └── workflows │ └── ci.yml └── package.json /docs/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docusaurus/static/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/fyn/test/.no-fynpo: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/.no-fynpo: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/create-fynpo/templates/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/fyn/test/.gitignore: -------------------------------------------------------------------------------- 1 | fyn-lock.* 2 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://registry.npmjs.com/ 2 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mod-g-v3/bin/bin1.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mod-g-v3/bin/bin2.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mod-i/bin/bin1.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/e1/.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | -------------------------------------------------------------------------------- /packages/fynpo/test/sample/lerna.json: -------------------------------------------------------------------------------- 1 | {"fynpo":true} -------------------------------------------------------------------------------- /testing/monorepo-test/.gitignore: -------------------------------------------------------------------------------- 1 | fyn-lock.yaml 2 | dist -------------------------------------------------------------------------------- /testing/monorepo-test/packages/pkg-foo/.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | -------------------------------------------------------------------------------- /packages/fyn/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | test/scenarios 3 | -------------------------------------------------------------------------------- /packages/fyn/stubs/iconv-loader.js: -------------------------------------------------------------------------------- 1 | module.exports = null; 2 | -------------------------------------------------------------------------------- /packages/fynpo/stubs/iconv-loader.js: -------------------------------------------------------------------------------- 1 | module.exports = null; 2 | -------------------------------------------------------------------------------- /packages/fynpo/stubs/parser-flow.js: -------------------------------------------------------------------------------- 1 | module.exports = {}; 2 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mock-npm/pkg/mod-g/4.0.0/package/bin/x.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/fynpo/stubs/parser-typescript.js: -------------------------------------------------------------------------------- 1 | module.exports = {}; 2 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/lifecycle-scripts/f2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mock-npm/pkg/mod-g/2.0.1/package/bin/bin1.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mock-npm/pkg/mod-g/2.0.1/package/bin/bin2.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mock-npm/pkg/mod-g/3.0.0/package/bin/bin2.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mock-npm/pkg/mod-g/3.0.0/package/bin/binx.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mock-npm/pkg/mod-g/4.0.0/package/bin/bin1.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fynpo-sample/.gitignore: -------------------------------------------------------------------------------- 1 | .fynpo-data.json 2 | -------------------------------------------------------------------------------- /packages/fyn/stubs/xml2js.js: -------------------------------------------------------------------------------- 1 | throw new Error("xml2js module not bundled"); 2 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/.gitignore: -------------------------------------------------------------------------------- 1 | */package.json 2 | fyn-debug.log 3 | -------------------------------------------------------------------------------- /packages/init-package/README.md: -------------------------------------------------------------------------------- 1 | initialize package.json for npm package 2 | -------------------------------------------------------------------------------- /packages/fyn/lib/util/xaa.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | module.exports = require("xaa"); 3 | -------------------------------------------------------------------------------- /packages/fynpo/src/fynpo.ts: -------------------------------------------------------------------------------- 1 | import { fynpoMain } from "."; 2 | fynpoMain(); 3 | -------------------------------------------------------------------------------- /packages/fynpo/stubs/xml2js.js: -------------------------------------------------------------------------------- 1 | throw new Error("xml2js module not bundled"); 2 | -------------------------------------------------------------------------------- /packages/create-fynpo/bin/create-fynpo.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | require("../dist"); -------------------------------------------------------------------------------- /packages/fyn/bin/node-gyp.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | require("./index").nodeGyp(); 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .nyc_output 3 | coverage 4 | *.log 5 | .tmp 6 | .vscode 7 | .fynpo 8 | -------------------------------------------------------------------------------- /docs/img/electrode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electrode-io/fynpo/HEAD/docs/img/electrode.png -------------------------------------------------------------------------------- /docs/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electrode-io/fynpo/HEAD/docs/img/favicon.png -------------------------------------------------------------------------------- /packages/create-fynpo/templates/_npmrc: -------------------------------------------------------------------------------- 1 | registry=https://npme.walmart.com/ 2 | strict-ssl=false 3 | -------------------------------------------------------------------------------- /packages/fyn/stubs/debug.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = () => () => undefined; 4 | -------------------------------------------------------------------------------- /packages/fynpo/stubs/debug.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = () => () => undefined; 4 | -------------------------------------------------------------------------------- /packages/fynpo/xrun-tasks.ts: -------------------------------------------------------------------------------- 1 | import { loadTasks } from "@xarc/module-dev"; 2 | loadTasks(); 3 | -------------------------------------------------------------------------------- /packages/create-fynpo/xrun-tasks.ts: -------------------------------------------------------------------------------- 1 | import { loadTasks } from "@xarc/module-dev"; 2 | loadTasks(); 3 | -------------------------------------------------------------------------------- /packages/fyn/bin/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = require(require("./bundle")); 4 | -------------------------------------------------------------------------------- /packages/fyn/lib/cli-logger.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = require("visual-logger"); 4 | -------------------------------------------------------------------------------- /packages/fyn/lib/util/defer.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = require("xaa").makeDefer; 4 | -------------------------------------------------------------------------------- /packages/fynpo-base/xrun-tasks.ts: -------------------------------------------------------------------------------- 1 | import { loadTasks } from "@xarc/module-dev"; 2 | loadTasks(); 3 | -------------------------------------------------------------------------------- /packages/fynpo-cli/README.md: -------------------------------------------------------------------------------- 1 | # fynpo-cli 2 | 3 | Install to npm global for the `fynpo` command. 4 | -------------------------------------------------------------------------------- /packages/fynpo-cli/xrun-tasks.ts: -------------------------------------------------------------------------------- 1 | import { loadTasks } from "@xarc/module-dev"; 2 | loadTasks(); 3 | -------------------------------------------------------------------------------- /packages/init-package/xrun-tasks.ts: -------------------------------------------------------------------------------- 1 | import { loadTasks } from "@xarc/module-dev"; 2 | loadTasks(); 3 | -------------------------------------------------------------------------------- /packages/fyn/lib/util/inflight.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = require("item-queue/lib/inflight"); 4 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mod-g/bin/bin1.js: -------------------------------------------------------------------------------- 1 | 2 | //# fynSourceMap=true 3 | //# sourceMappingURL=bin1.js.map 4 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mod-g/bin/bin2.js: -------------------------------------------------------------------------------- 1 | 2 | //# fynSourceMap=true 3 | //# sourceMappingURL=bin2.js.map 4 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mod-h/bin/bin1.js: -------------------------------------------------------------------------------- 1 | 2 | //# fynSourceMap=true 3 | //# sourceMappingURL=bin1.js.map 4 | -------------------------------------------------------------------------------- /packages/fyn/yarn/README.md: -------------------------------------------------------------------------------- 1 | Copy of yarn's lockfile parsing source code from https://github.com/yarnpkg/yarn 2 | -------------------------------------------------------------------------------- /testing/monorepo-test/packages/pkg-foo/src/index.ts: -------------------------------------------------------------------------------- 1 | export const foo = () => { 2 | return "foo"; 3 | }; 4 | -------------------------------------------------------------------------------- /docs/img/electrode-io-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electrode-io/fynpo/HEAD/docs/img/electrode-io-logo.png -------------------------------------------------------------------------------- /packages/fyn/images/fyn-demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electrode-io/fynpo/HEAD/packages/fyn/images/fyn-demo.gif -------------------------------------------------------------------------------- /docusaurus/static/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electrode-io/fynpo/HEAD/docusaurus/static/img/favicon.png -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/electrode/README.md: -------------------------------------------------------------------------------- 1 | The `package.json` files from http://github.com/electrode-io/electrode 2 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/sample/fynpo.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": ["packages/*", "test1/*", "tests/*"] 3 | } 4 | -------------------------------------------------------------------------------- /packages/fynpo/bin/fynpo.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const { fynpoMain } = require("../dist"); 4 | fynpoMain(); 5 | -------------------------------------------------------------------------------- /docusaurus/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [require.resolve('@docusaurus/core/lib/babel/preset')], 3 | }; 4 | -------------------------------------------------------------------------------- /docusaurus/static/img/electrode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electrode-io/fynpo/HEAD/docusaurus/static/img/electrode.png -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-major/step-01/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | title: "should install modules" 3 | }; 4 | -------------------------------------------------------------------------------- /packages/fynpo-base/README.md: -------------------------------------------------------------------------------- 1 | # @fynpo/base 2 | 3 | A zero setup monorepo manager for node.js - 4 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-major/step-02/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "mod-b": "^2.0.0" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /packages/fynpo-base/docs/assets/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electrode-io/fynpo/HEAD/packages/fynpo-base/docs/assets/icons.png -------------------------------------------------------------------------------- /docusaurus/static/img/electrode-io-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electrode-io/fynpo/HEAD/docusaurus/static/img/electrode-io-logo.png -------------------------------------------------------------------------------- /packages/create-fynpo/docs/assets/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electrode-io/fynpo/HEAD/packages/create-fynpo/docs/assets/icons.png -------------------------------------------------------------------------------- /packages/fyn/.eslintrc.js: -------------------------------------------------------------------------------- 1 | const { eslintRcNode } = require("@xarc/module-dev"); 2 | module.exports = { 3 | extends: eslintRcNode 4 | }; 5 | -------------------------------------------------------------------------------- /packages/fyn/es6-promisify/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "es6-promisify", 3 | "version": "5.0.0", 4 | "main": "es6-promisify.js" 5 | } 6 | -------------------------------------------------------------------------------- /packages/fyn/lib/logger.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const CliLogger = require("./cli-logger"); 4 | 5 | module.exports = new CliLogger(); 6 | -------------------------------------------------------------------------------- /packages/fyn/stubs/resolve-from.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = function(dir, id) { 4 | return `no-resolve-from/${id}`; 5 | }; 6 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/package-fyn/step-01/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | title: "Should use intermediate package-fyn.json" 3 | }; 4 | -------------------------------------------------------------------------------- /packages/fynpo-base/docs/assets/icons@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electrode-io/fynpo/HEAD/packages/fynpo-base/docs/assets/icons@2x.png -------------------------------------------------------------------------------- /packages/fynpo-base/docs/assets/widgets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electrode-io/fynpo/HEAD/packages/fynpo-base/docs/assets/widgets.png -------------------------------------------------------------------------------- /packages/create-fynpo/docs/assets/icons@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electrode-io/fynpo/HEAD/packages/create-fynpo/docs/assets/icons@2x.png -------------------------------------------------------------------------------- /packages/create-fynpo/docs/assets/widgets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electrode-io/fynpo/HEAD/packages/create-fynpo/docs/assets/widgets.png -------------------------------------------------------------------------------- /packages/fyn/test/.eslintrc.js: -------------------------------------------------------------------------------- 1 | const { eslintRcTest } = require("@xarc/module-dev"); 2 | module.exports = { 3 | extends: eslintRcTest 4 | }; 5 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mock-npm/pkg/mod-e/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "preinstall": "echo hello there from mod-e" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/package-fyn/mod-e/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mod-e", 3 | "version": "99.0.0", 4 | "dependencies": {} 5 | } 6 | -------------------------------------------------------------------------------- /packages/fynpo-base/docs/assets/widgets@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electrode-io/fynpo/HEAD/packages/fynpo-base/docs/assets/widgets@2x.png -------------------------------------------------------------------------------- /packages/fynpo/stubs/resolve-from.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = function(dir, id) { 4 | return `no-resolve-from/${id}`; 5 | }; 6 | -------------------------------------------------------------------------------- /packages/create-fynpo/docs/assets/widgets@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electrode-io/fynpo/HEAD/packages/create-fynpo/docs/assets/widgets@2x.png -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fynpo-sample/fynpo.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | packages: ["packages/*", "test1/*", "tests/*", "@scope/**"] 3 | }; 4 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/local-hard-linking/step-01/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | title: "should install and hard link local module" 3 | }; 4 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/local-hard-linking/step-02/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | title: "should re-install and hard link local module" 3 | }; 4 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/local-hard-linking/step-04/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | title: "should link a local package under own dir" 3 | }; 4 | -------------------------------------------------------------------------------- /packages/fyn/yarn/src/constants.js: -------------------------------------------------------------------------------- 1 | // lockfile version, bump whenever we make backwards incompatible changes 2 | export const LOCKFILE_VERSION = 1; 3 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-major/step-02/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | title: "should install new version and remove old ones" 3 | }; 4 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/local-hard-linking/e1/index.js: -------------------------------------------------------------------------------- 1 | // test 2 | console.log("test"); 3 | //# fynSourceMap=true 4 | //# sourceMappingURL=index.js.fyn.map 5 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/package-fyn/pkg-a/package-fyn.json: -------------------------------------------------------------------------------- 1 | { 2 | "fyn": { 3 | "dependencies": { 4 | "pkg-b": "../pkg-b" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/package-fyn/pkg-b/package-fyn.json: -------------------------------------------------------------------------------- 1 | { 2 | "fyn": { 3 | "dependencies": { 4 | "mod-e": "../mod-e" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/fynpo/test/sample/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## Packages 2 | 3 | - `pkg1@3.0.1` 4 | - `pkg2@2.0.0` 5 | 6 | ## Commits 7 | 8 | - `packages/pkg1` 9 | - `packages/pkg2` -------------------------------------------------------------------------------- /packages/create-fynpo/.eslintrc.js: -------------------------------------------------------------------------------- 1 | 2 | const { eslintRcTestTypeScript } = require("@xarc/module-dev"); 3 | module.exports = { extends: eslintRcTestTypeScript }; 4 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mock-npm/pkg/mod-err/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "preinstall": "echo failing preinstall for mod-err && exit 1" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /testing/monorepo-test/fynpo.json: -------------------------------------------------------------------------------- 1 | { 2 | "command": { 3 | "bootstrap": { 4 | "npmRunScripts": [["prepare", "prepublish", "build"]] 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/local-hard-linking/step-03/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | title: "should invalidate a hardlink local module that's no longer local" 3 | }; 4 | -------------------------------------------------------------------------------- /packages/fyn/yarn/.babelrc.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | presets: ["@babel/preset-flow", ["@babel/preset-env", { targets: { node: "8" } }]] 5 | }; 6 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/sample/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## Packages 2 | 3 | - `pkg1@3.0.1` 4 | - `pkg2@2.0.0` 5 | 6 | ## Commits 7 | 8 | - `packages/pkg1` 9 | - `packages/pkg2` -------------------------------------------------------------------------------- /packages/fyn/cli/fyn.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | if (require.main === module) { 4 | require("./main").run(); 5 | } else { 6 | module.exports = require("./main").run; 7 | } 8 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fynpo-sample/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## Packages 2 | 3 | - `pkg1@3.0.1` 4 | - `pkg2@2.0.0` 5 | 6 | ## Commits 7 | 8 | - `packages/pkg1` 9 | - `packages/pkg2` -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/package-fyn/pkg-b/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pkg-b", 3 | "version": "2.0.0", 4 | "dependencies": { 5 | "mod-e": "^1.0.0" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/fynpo-base/docs/.nojekyll: -------------------------------------------------------------------------------- 1 | TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. -------------------------------------------------------------------------------- /packages/create-fynpo/docs/.nojekyll: -------------------------------------------------------------------------------- 1 | TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. -------------------------------------------------------------------------------- /packages/fyn/lib/util/promise-queue.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const ItemQueue = require("item-queue"); 4 | ItemQueue.Promise = require("bluebird"); 5 | module.exports = ItemQueue; 6 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/platform-check-good/step-01/index.js: -------------------------------------------------------------------------------- 1 | const Fs = require("fs"); 2 | 3 | module.exports = { 4 | title: "allow package with good os/cpu check" 5 | }; 6 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/remote-url-semver/step-01/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | title: "should install pkg from github (requires clap bundle)", 3 | timeout: 20000 4 | }; 5 | -------------------------------------------------------------------------------- /packages/fyn/stubs/iconv-lite.js: -------------------------------------------------------------------------------- 1 | const poof = () => { 2 | throw new Error("iconv-lite is not bundled"); 3 | }; 4 | module.exports = { 5 | encode: poof, 6 | decode: poof 7 | }; 8 | -------------------------------------------------------------------------------- /packages/fynpo/stubs/iconv-lite.js: -------------------------------------------------------------------------------- 1 | const poof = () => { 2 | throw new Error("iconv-lite is not bundled"); 3 | }; 4 | module.exports = { 5 | encode: poof, 6 | decode: poof 7 | }; 8 | -------------------------------------------------------------------------------- /packages/create-fynpo/docs/assets/search.js: -------------------------------------------------------------------------------- 1 | window.searchData = {"kinds":{},"rows":[],"index":{"version":"2.3.9","fields":["name","parent"],"fieldVectors":[],"invertedIndex":[],"pipeline":[]}} -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-dedupe-2/step-01/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | title: "should install with locked version", 5 | copyLock: true 6 | }; 7 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-dedupe/step-01/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | title: "should install with locked version", 5 | copyLock: true 6 | }; 7 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-indirect/step-01/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | title: "should install with locked version", 5 | copyLock: true 6 | }; 7 | -------------------------------------------------------------------------------- /packages/create-fynpo/src/interfaces.ts: -------------------------------------------------------------------------------- 1 | export interface ParsedOpts { 2 | commitlint?: boolean; 3 | } 4 | export interface ParsedObj { 5 | [x: string]: any; 6 | opts: ParsedOpts; 7 | } 8 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/platform-check/step-01/index.js: -------------------------------------------------------------------------------- 1 | const Fs = require("fs"); 2 | 3 | module.exports = { 4 | title: "not download/install optional package where os not match" 5 | }; 6 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/platform-check/step-02/index.js: -------------------------------------------------------------------------------- 1 | const Fs = require("fs"); 2 | 3 | module.exports = { 4 | title: "not download/install optional package where cpu not match" 5 | }; 6 | -------------------------------------------------------------------------------- /packages/fyn/cli/fun.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | require("./main") 4 | .fun() 5 | .then(() => { 6 | process.exit(0); 7 | }) 8 | .catch(err => { 9 | process.exit(1); 10 | }); 11 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/local-hard-linking/e1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "e1", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "dependencies": { 6 | "mod-h": "^3.0.1" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-dedupe/step-02/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | title: "should dedupe an pkg's locked version if another dep indirectly changed it" 5 | }; 6 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-indirect/step-02/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | title: "should update indirect locked version due to changes in package.json" 5 | }; 6 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-dedupe-2/step-02/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | title: "should dedupe an pkg's locked version if another dep indirectly changed it" 5 | }; 6 | -------------------------------------------------------------------------------- /packages/fyn/yarn/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const parse = require("./lib/lockfile/parse").default; 4 | 5 | module.exports = { 6 | parseYarnLock: (str, filename) => parse(str, filename).object 7 | }; 8 | -------------------------------------------------------------------------------- /packages/fynpo-base/src/util.ts: -------------------------------------------------------------------------------- 1 | import Path from "path"; 2 | 3 | /** 4 | * ensure a path uses `/` for separator 5 | */ 6 | export const posixify = Path.sep === "/" ? (x) => x : (path) => path.replace(/\\/g, "/"); 7 | -------------------------------------------------------------------------------- /packages/fyn/es6-promisify/es6-promisify.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const Promise = require("bluebird"); 4 | 5 | module.exports = function promisify(func, context) { 6 | return Promise.promisify(func, { context }); 7 | }; 8 | -------------------------------------------------------------------------------- /packages/fyn/bin/fyn.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | require("./index") 4 | .run() 5 | .then(() => { 6 | process.exit(0); 7 | }) 8 | .catch(err => { 9 | console.log(err); 10 | process.exit(1); 11 | }); 12 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/missing-peer-dep/README.md: -------------------------------------------------------------------------------- 1 | # Scenario 2 | 3 | * A peer dep of a dep missing 4 | 5 | # Expect Behavior 6 | 7 | * peer dep should not be installed 8 | * Warn about missing peer but finish installing the rest 9 | -------------------------------------------------------------------------------- /packages/fyn/cli/default-rc.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const ci = require("ci-info"); 4 | 5 | module.exports = { 6 | registry: "https://registry.npmjs.org", 7 | targetDir: "node_modules", 8 | progress: ci.isCI ? "none" : "normal" 9 | }; 10 | -------------------------------------------------------------------------------- /packages/fyn/lib/util/sort-obj-keys.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = function _sortObjKeys(obj) { 4 | const sorted = {}; 5 | Object.keys(obj) 6 | .sort() 7 | .forEach(k => (sorted[k] = obj[k])); 8 | return sorted; 9 | }; 10 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/add-remove-pkg/step-01/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "add-pkg", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test" 9 | } 10 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/lifecycle-scripts/f3/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "f3", 3 | "version": "0.0.1", 4 | "config": { 5 | "test_c1": "foo-bar" 6 | }, 7 | "scripts": { 8 | "test": "echo $npm_package_config_test_c1" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/fyn/bin/fun.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | "use strict"; 4 | 5 | require("./index") 6 | .fun() 7 | .then(() => { 8 | process.exit(0); 9 | }) 10 | .catch(err => { 11 | console.error(err); 12 | process.exit(1); 13 | }); 14 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/stat-pkg/step-01/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Test retrieving pkg dist during resolving to load npm-shrinkwrap.json 3 | */ 4 | 5 | module.exports = { 6 | title: "should load npm-shrinkwrap from package's dist", 7 | timeout: 20000 8 | }; 9 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mock-npm/pkg/mod-h/2.0.0/package/npm-shrinkwrap.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "name": "mod-h", 4 | "lockfileVersion": 1, 5 | "dependencies": { 6 | "mod-a": { 7 | "version": "1.0.1" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/npm-shrinkwrap/step-01/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Test retrieving pkg dist during resolving to load npm-shrinkwrap.json 3 | */ 4 | 5 | module.exports = { 6 | title: "should load npm-shrinkwrap from package's dist", 7 | timeout: 20000 8 | }; 9 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/npm-shrinkwrap/step-02/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Test retrieving pkg dist during resolving to load npm-shrinkwrap.json 3 | */ 4 | 5 | module.exports = { 6 | title: "should load nested package's own npm-shrinkwrap", 7 | timeout: 20000 8 | }; 9 | -------------------------------------------------------------------------------- /packages/fynpo/src/logger.ts: -------------------------------------------------------------------------------- 1 | import VisualLogger from "visual-logger"; 2 | import { isCI } from "./is-ci"; 3 | 4 | export const logger = new VisualLogger(); 5 | 6 | if (isCI) { 7 | logger.info("CI env detected"); 8 | logger.setItemType("none"); 9 | } 10 | -------------------------------------------------------------------------------- /testing/monorepo-test/packages/pkg-bar/test/index.spec.js: -------------------------------------------------------------------------------- 1 | const { expect } = require("chai"); 2 | const { foo } = require("pkg-foo"); 3 | 4 | describe("bar", function () { 5 | it("should import foo", () => { 6 | expect(foo()).to.equal("foo"); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/package-fyn/pkg-a/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pkg-a", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | "pkg-b": "^1.0.0" 6 | }, 7 | "fyn": { 8 | "dependencies": { 9 | "pkg-b": "^3.0.0" 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/fynpo/stubs/util-types.js: -------------------------------------------------------------------------------- 1 | // undici fetch support node.js 16.5+ only and it uses "util/types" 2 | // but before 16, it's util.types, and wepback bundle fails on it 3 | // so stub it. we don't use undici fetch anyways. 4 | module.exports = require("util").types; 5 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/add-remove-pkg/step-02/index.js: -------------------------------------------------------------------------------- 1 | // 2 | 3 | module.exports = { 4 | title: "should remove a package from package.json", 5 | getArgs(options) { 6 | return [].concat(options.baseArgs).concat([`--layout=detail`, `remove`, `mod-g`]); 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/add-remove-pkg/step-03/index.js: -------------------------------------------------------------------------------- 1 | // 2 | 3 | module.exports = { 4 | title: "should remove a package from package.json", 5 | getArgs(options) { 6 | return [].concat(options.baseArgs).concat([`--layout=detail`, `remove`, `mod-a`, `mod-g`]); 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /docusaurus/src/components/HomepageFeatures.module.css: -------------------------------------------------------------------------------- 1 | /* stylelint-disable docusaurus/copyright-header */ 2 | 3 | .features { 4 | display: flex; 5 | align-items: center; 6 | padding: 2rem; 7 | width: 100%; 8 | } 9 | 10 | .featureSvg { 11 | height: 200px; 12 | width: 200px; 13 | } 14 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/e1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "e1", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "files": [ 6 | "dist" 7 | ], 8 | "scripts": { 9 | "install": "node index.js hello.js" 10 | }, 11 | "dependencies": { 12 | "mod-h": "^3.0.1" 13 | } 14 | } -------------------------------------------------------------------------------- /packages/init-package/test/test.ts: -------------------------------------------------------------------------------- 1 | import { runInitPackage } from "../src"; 2 | import { describe, it, expect } from "@jest/globals"; 3 | 4 | describe("init-package", function () { 5 | it("should have runInitPackage", () => { 6 | expect(runInitPackage).toBeInstanceOf(Function); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/nested-dep/step-02/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "netsted-dep", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "mod-a": null 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/fyn/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | /.vscode 3 | /coverage 4 | /.nyc* 5 | /*.swp 6 | /*.log* 7 | /tmp 8 | .tgz 9 | /.cache 10 | /xout 11 | .tmp* 12 | /*.tgz 13 | /dist 14 | .fyn 15 | package-fyn.* 16 | fyn-debug*.log 17 | package-lock.* 18 | yarn/lib 19 | gyp 20 | node-gyp-bin 21 | src 22 | addon.gypi -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/bin-linker/step-01/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bin-linker", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "mod-g": "^2.0.0" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/bin-linker/step-02/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bin-linker", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "mod-g": "3.0.0" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/bin-linker/step-03/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bin-linker", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "mod-g": "^4.0.0" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fyn-shrinkwrap/step-01/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Support looking at a _shrinkwrap field in package.json 3 | * Help with verifying fyn's dep resolve engine 4 | */ 5 | 6 | module.exports = { 7 | title: "should load _shrinkwrap from dep's package.json", 8 | timeout: 20000 9 | }; 10 | -------------------------------------------------------------------------------- /packages/fynpo/test/sample/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sample", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC" 12 | } 13 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fynpo-sample/step-01/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .f: 3 | .fyn.json: file 4 | _: 5 | pkg2: 6 | 1.0.0-fynlocal_h: 7 | pkg2: 8 | package.json: 9 | id: pkg2@1.0.0-fynlocal_h 10 | pkg2: "-> .f/_/pkg2/1.0.0-fynlocal_h/pkg2" 11 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/local-hard-linking/step-03/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "local-linking", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "mod-h": "^1.0.0" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/fynpo/.gitignore: -------------------------------------------------------------------------------- 1 | .nyc_output 2 | coverage 3 | dist 4 | node_modules 5 | # recommend avoid committing package-lock.* file because a module's CI 6 | # should use latest dep, as an app that consumes a module would have its 7 | # own lockfile, but remove this if you want to commit the package lock file. 8 | *-lock* 9 | -------------------------------------------------------------------------------- /packages/create-fynpo/.gitignore: -------------------------------------------------------------------------------- 1 | .nyc_output 2 | coverage 3 | dist 4 | node_modules 5 | # recommend avoid committing package-lock.* file because a module's CI 6 | # should use latest dep, as an app that consumes a module would have its 7 | # own lockfile, but remove this if you want to commit the package lock file. 8 | *-lock* 9 | -------------------------------------------------------------------------------- /packages/fynpo-base/.gitignore: -------------------------------------------------------------------------------- 1 | .nyc_output 2 | coverage 3 | dist 4 | node_modules 5 | # recommend avoid committing package-lock.* file because a module's CI 6 | # should use latest dep, as an app that consumes a module would have its 7 | # own lockfile, but remove this if you want to commit the package lock file. 8 | *-lock* 9 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/sample/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sample", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC" 12 | } 13 | -------------------------------------------------------------------------------- /packages/fynpo-cli/.gitignore: -------------------------------------------------------------------------------- 1 | .nyc_output 2 | coverage 3 | dist 4 | node_modules 5 | # recommend avoid committing package-lock.* file because a module's CI 6 | # should use latest dep, as an app that consumes a module would have its 7 | # own lockfile, but remove this if you want to commit the package lock file. 8 | *-lock* 9 | -------------------------------------------------------------------------------- /packages/init-package/.gitignore: -------------------------------------------------------------------------------- 1 | .nyc_output 2 | coverage 3 | dist 4 | node_modules 5 | # recommend avoid committing package-lock.* file because a module's CI 6 | # should use latest dep, as an app that consumes a module would have its 7 | # own lockfile, but remove this if you want to commit the package lock file. 8 | *-lock* 9 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/bin-linker/step-01/index.js: -------------------------------------------------------------------------------- 1 | const Fs = require("fs"); 2 | 3 | module.exports = { 4 | title: "should link bin", 5 | verify: () => { 6 | const modGPkg = JSON.parse(Fs.readFileSync(require.resolve("mod-g/package.json"))); 7 | expect(modGPkg.version).to.equal("2.0.1"); 8 | } 9 | }; 10 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-dedupe/step-01/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "locked-change-indirect", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "mod-i": "^1.0.0" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-indirect/README.md: -------------------------------------------------------------------------------- 1 | # Scenario 2 | 3 | - A secondary dep locked to a version (such as 1.0.1) 4 | - package.json adds the secondary dep and resolves to a newer version (such as 1.0.2) 5 | 6 | # Expect Behavior 7 | 8 | - Detect multiple versions resolving and partially refresh lock for a dep 9 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-dedupe-2/step-01/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "locked-change-indirect", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "mod-i": "^1.0.0" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-indirect/step-01/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "locked-change-indirect", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "mod-i": "^1.0.0" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/fynpo/.eslintrc.js: -------------------------------------------------------------------------------- 1 | const { eslintRcTestTypeScript } = require("@xarc/module-dev"); 2 | module.exports = { 3 | extends: eslintRcTestTypeScript, 4 | rules: { 5 | "@typescript-eslint/no-unused-vars": [ 6 | "warn", 7 | { 8 | argsIgnorePattern: "^_", 9 | }, 10 | ], 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fyn-central/step-01/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fyn-central", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "mod-a": "^1.0.0", 11 | "mod-h": "^2.0.0" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fynpo-sample/packages/pkg2-b/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pkg2", 3 | "version": "2.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC" 12 | } 13 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fynpo-sample/packages/pkg2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pkg2", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC" 12 | } 13 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/local-hard-linking/step-01/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "local-linking", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "mod-h": "file:../../fixtures/mod-h" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/local-hard-linking/step-02/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "local-linking", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "mod-h": "file:../../fixtures/mod-h" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/remote-url-semver/step-01/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "remote-url-semver", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "test-from-gh": "jchip/test-from-gh" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/stat-pkg/step-01/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "npm-shrinkwrap", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "mod-a": "^1.0.0", 11 | "mod-ns": "^1.0.0" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/fyn/lib/pkg-bin-linker.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | /* eslint-disable global-require */ 4 | 5 | /* istanbul ignore next */ 6 | if (process.platform === "win32") { 7 | /* istanbul ignore next */ 8 | module.exports = require("./pkg-bin-linker-win32"); 9 | } else { 10 | module.exports = require("./pkg-bin-linker-unix"); 11 | } 12 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/lifecycle-scripts/f1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "f1", 3 | "version": "1.0.0", 4 | "scripts": { 5 | "test": "echo hello", 6 | "test1": "echo hello; echo a; echo stderr foo 1>&2", 7 | "test2": "exit 0", 8 | "test3": "echo stderr blah 1>&2; boo", 9 | "test4": "echo \"\"" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/add-remove-pkg/step-01/index.js: -------------------------------------------------------------------------------- 1 | // 2 | 3 | module.exports = { 4 | title: "should add packages to package.json", 5 | getArgs(options) { 6 | return [] 7 | .concat(options.baseArgs) 8 | .concat([`--layout=detail`, `add`, `mod-a`, `--dev`, `mod-d`, `../../fixtures/mod-g`]); 9 | } 10 | }; 11 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fyn-shrinkwrap/step-01/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fyn-shrinkwrap", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "mod-a": "^1.0.0", 11 | "mod-h": "^2.0.0" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/npm-shrinkwrap/step-01/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "npm-shrinkwrap", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "mod-a": "^1.0.0", 11 | "mod-ns": "^1.0.0" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/npm-shrinkwrap/step-02/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "npm-shrinkwrap", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "mod-a": "^1.0.0", 11 | "mod-ns2": "^1.0.0" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/sample/node_modules/blah/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "blah", 3 | "version": "1.0.0", 4 | "description": "blah", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC" 12 | } 13 | -------------------------------------------------------------------------------- /docusaurus/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | /build 6 | 7 | # Generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # Misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | npm-debug.log* 19 | yarn-debug.log* 20 | yarn-error.log* 21 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/missing-peer-dep/step-01/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "missing-peer-dep", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "mod-a": "^1.0.0", 11 | "mod-b": "^1.0.0" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/fynpo/src/is-ci.ts: -------------------------------------------------------------------------------- 1 | const env = process.env; 2 | 3 | export const isCI = !!( 4 | env.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari 5 | env.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI 6 | env.BUILD_NUMBER || // Jenkins, TeamCity 7 | env.RUN_ID || // TaskCluster, dsari 8 | false 9 | ); 10 | -------------------------------------------------------------------------------- /packages/fynpo/src/utils/get-current-branch.ts: -------------------------------------------------------------------------------- 1 | import { logger } from "../logger"; 2 | import { execSync } from "../child-process"; 3 | 4 | export const getCurrentBranch = (opts) => { 5 | const branch = execSync("git", ["rev-parse", "--abbrev-ref", "HEAD"], opts); 6 | logger.info("currentBranch", branch); 7 | 8 | return branch; 9 | }; 10 | -------------------------------------------------------------------------------- /packages/fyn/cli/mypkg.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | /* 4 | * Avoid webpack bundling the whole package.json if doing require("../package.json") 5 | */ 6 | 7 | const Fs = require("fs"); 8 | const Path = require("path"); 9 | 10 | const myPkg = JSON.parse(Fs.readFileSync(Path.join(__dirname, "../package.json"))); 11 | 12 | module.exports = myPkg; 13 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-major/step-01/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "locked-change-major", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "mod-a": "^0.3.0", 11 | "mod-b": "^1.0.0" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/sample/packages/pkg2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pkg2", 3 | "version": "1.0.0", 4 | "description": "version 1.0.0 of pkg2", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC" 12 | } 13 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-dedupe-2/step-02/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "locked-change-indirect", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "mod-i": "^1.0.0", 11 | "mod-j": "^1.0.0" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-dedupe/step-02/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "locked-change-indirect", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "mod-a": "^0.5.0", 11 | "mod-i": "^1.0.0" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-indirect/step-02/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "locked-change-indirect", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "mod-i": "^1.0.0", 11 | "mod-g": "^3.0.11" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/sample/packages/pkg2-b/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pkg2", 3 | "version": "2.0.0", 4 | "description": "version 2.0.0 of pkg2", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC" 12 | } 13 | -------------------------------------------------------------------------------- /packages/fyn/lib/util/npm-config-env.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const { makeEnv } = require("npm-lifecycle"); 4 | 5 | /* 6 | * set all npmrc options into env with npm_config_ prefix 7 | */ 8 | 9 | function npmConfigEnv(data, config, env) { 10 | return makeEnv(data, { config: config }, undefined, env); 11 | } 12 | 13 | module.exports = npmConfigEnv; 14 | -------------------------------------------------------------------------------- /packages/fyn/lib/util/uniq-id.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | /* eslint-disable no-magic-numbers,prefer-template */ 4 | 5 | // generate a simple and fairly unique id 6 | 7 | module.exports = function() { 8 | return ( 9 | Math.random() 10 | .toString(36) 11 | .substr(2, 10) + 12 | "_" + 13 | Date.now().toString(36) 14 | ); 15 | }; 16 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/nested-dep/step-01/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "netsted-dep", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "mod-a": "^2.0.0", 11 | "mod-c": "^3.0.0", 12 | "mod-e": "^1.0.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/build-local/step-01/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "local-linking", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "e1": "../../fixtures/e1", 11 | "mod-h": "file:../../fixtures/mod-h" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/package-fyn/step-01/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-fyn", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "mod-a": "^1.0.0", 11 | "mod-g": "^2.0.0", 12 | "pkg-a": "./pkg-a" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/fyn/test/dep-on-pkg1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dep-on-pkg1", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "pkg1": "^1.0.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-major/README.md: -------------------------------------------------------------------------------- 1 | # Scenario 2 | 3 | * package.json dep has semver locked to version 4 | * package.json semver changes and locked version no longer satisfies it 5 | 6 | # Expect Behavior 7 | 8 | * Update version to the latest one that satisfies new semver 9 | * Update locked version 10 | * Install new version 11 | * Delete old version 12 | -------------------------------------------------------------------------------- /packages/fynpo/test/sample/packages/pkg1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pkg1", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "nix-clap": "*" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fynpo/test/sample/packages/pkg2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pkg2", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "nix-clap": "*" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/auto-deep-resolve/step-01/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "local-linking", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "optionalDependencies": { 10 | "mod-a": "^4.0.1" 11 | }, 12 | "devDependencies": { 13 | "mod-d": "^4.2.1" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/platform-check-good/step-01/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pkg-platform-check-good", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "mod-a": "^1.0.0", 11 | "mod-g": "^2.0.0", 12 | "mod-os-cpu": "^1.0.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/sample/test1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test1", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "pkg2": "^2.0.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/pkg-a/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pkg-a", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | "mod-a": "^1.1.0", 6 | "mod-c": "^1.0.0", 7 | "mod-d": "^3.0.0" 8 | }, 9 | "optionalDependencies": { 10 | "mod-e": "^2.0.0", 11 | "mod-err": "^4.0.0" 12 | }, 13 | 14 | "devDependencies": { 15 | "mod-b": "^1.0.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fynpo-sample/test1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test1", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "pkg2": "^2.0.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/sample/packages/pkg1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pkg1", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "pkg2": "^1.0.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/sample/tests/t2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tpkg2", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "tpkg1": "^1.0.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fynpo-sample/packages/pkg1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pkg1", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "pkg2": "^1.0.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fynpo-sample/step-01/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ignore-dot-dir", 3 | "version": "1.0.0", 4 | "description": "dir starts with . should be ignored", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": {} 13 | } 14 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fynpo-sample/tests/t2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tpkg2", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "tpkg1": "^1.0.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/electrode/packages/subapp-pkg-util/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "subapp-pkg-util", 3 | "version": "0.0.1", 4 | "description": "", 5 | "main": "xclap.js", 6 | "private": true, 7 | "keywords": [], 8 | "author": "Electrode", 9 | "license": "Apache-2.0", 10 | "dependencies": { 11 | "shcmd": "^0.8.4", 12 | "xclap": "^0.2.40" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/bin-linker/step-02/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const Path = require("path"); 4 | const Fs = require("fs"); 5 | 6 | module.exports = { 7 | title: "should link new bin and remove old ones when update dep", 8 | verify: cwd => { 9 | const link = Fs.readlinkSync(Path.join(cwd, "node_modules/mod-g")); 10 | expect(link).contains("3.0.0"); 11 | } 12 | }; 13 | -------------------------------------------------------------------------------- /packages/fyn/test/spec/util/uniq-id.spec.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const uniqId = require("../../../lib/util/uniq-id"); 4 | 5 | describe("uniq-id", function() { 6 | it("should generate random ids", () => { 7 | let last; 8 | let id; 9 | for (let i = 0; i < 100; i++) { 10 | id = uniqId(); 11 | expect(id).to.not.equal(last); 12 | last = id; 13 | } 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /packages/fyn/test/test-dist-fetch.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const Path = require("path"); 4 | const Fyn = require("../lib/fyn"); 5 | 6 | const fyn = new Fyn({ opts: { pkgFile: Path.join(__dirname, "fixtures/pkg.json") } }); 7 | const Fs = require("fs"); 8 | const Yaml = require("js-yaml"); 9 | 10 | const data = Yaml.load(Fs.readFileSync("fyn-data.yaml").toString()); 11 | fyn.fetchPackages(data); 12 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/sample/packages/cir1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cir1", 3 | "version": "1.0.0", 4 | "description": "circular dep 1", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "cir2": "^1.0.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/sample/packages/cir2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cir2", 3 | "version": "1.0.0", 4 | "description": "circular dep 2", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "cir1": "^1.0.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fynpo-sample/packages/cir1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cir1", 3 | "version": "1.0.0", 4 | "description": "circular dep 1", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "cir2": "^1.0.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fynpo-sample/packages/cir2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cir2", 3 | "version": "1.0.0", 4 | "description": "circular dep 2", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "cir1": "^1.0.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-dedupe/README.md: -------------------------------------------------------------------------------- 1 | # Scenario 2 | 3 | - scenario: 4 | 5 | `pkg A -> B@^1.0.0 and install B@1.0.0 in lockfile` 6 | 7 | - User add to `package.json` `Pkg X -> new B@^1.1.0` 8 | 9 | - Without dedupe, this cause B to have versions 1.0.0 and 1.1.0 installed 10 | 11 | # Expect Behavior 12 | 13 | Should detect indirect locked version got changed and dedupe versions 14 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-dedupe-2/README.md: -------------------------------------------------------------------------------- 1 | # Scenario 2 | 3 | - scenario: 4 | 5 | `pkg A -> B@^1.0.0 and install B@1.0.0 in lockfile` 6 | 7 | - User add to `package.json` `Pkg X -> new B@^1.1.0` 8 | 9 | - Without dedupe, this cause B to have versions 1.0.0 and 1.1.0 installed 10 | 11 | # Expect Behavior 12 | 13 | Should detect indirect locked version got changed and dedupe versions 14 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-npm-dedupe/step-01/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const Fs = require("fs"); 4 | const Path = require("path"); 5 | 6 | module.exports = { 7 | title: "should install with locked version", 8 | before(cwd) { 9 | const npmLock = Fs.readFileSync(Path.join(__dirname, "npm-lock.json")); 10 | Fs.writeFileSync(Path.join(cwd, "package-lock.json"), npmLock); 11 | } 12 | }; 13 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/sample/packages/icir1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "icir1", 3 | "version": "1.0.0", 4 | "description": "indirect circular dep 1", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "icir2": "^1.0.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/sample/packages/icir2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "icir2", 3 | "version": "1.0.0", 4 | "description": "indirect circular dep 2", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "icir3": "^1.0.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/sample/packages/icir3/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "icir3", 3 | "version": "1.0.0", 4 | "description": "indirect circular dep 3", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "icir1": "^1.0.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fynpo-sample/packages/icir1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "icir1", 3 | "version": "1.0.0", 4 | "description": "indirect circular dep 1", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "icir2": "^1.0.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fynpo-sample/packages/icir2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "icir2", 3 | "version": "1.0.0", 4 | "description": "indirect circular dep 2", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "icir3": "^1.0.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fynpo-sample/packages/icir3/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "icir3", 3 | "version": "1.0.0", 4 | "description": "indirect circular dep 3", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "icir1": "^1.0.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/local-hard-linking/step-03/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .bin: 3 | bin1: '-> ../.f/_/mod-h/1.0.0/mod-h/bin/bin1.js' 4 | bin2: '-> ../.f/_/mod-h/1.0.0/mod-h/bin/bin2.js' 5 | .f: 6 | .fyn.json: file 7 | _: 8 | mod-h: 9 | 1.0.0: 10 | mod-h: 11 | package.json: 12 | id: mod-h@1.0.0 13 | mod-h: '-> .f/_/mod-h/1.0.0/mod-h' 14 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/platform-check/step-01/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pkg-platform-check", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "mod-a": "^1.0.0", 11 | "mod-g": "^2.0.0" 12 | }, 13 | "optionalDependencies": { 14 | "mod-bad-os": "^1.0.0" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fynpo-sample/@scope/pkg-2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@scope/pkg-2", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "dep-on-pkg1": "../../../../dep-on-pkg1" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/local-hard-linking/step-04/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "local-linking", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "e1": "^1.0.0", 11 | "mod-h": "^1.0.0" 12 | }, 13 | "fyn": { 14 | "dependencies": { 15 | "e1": "./e1" 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/sample/.ignore-dir/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ignore-dot-dir", 3 | "version": "1.0.0", 4 | "description": "dir starts with . should be ignored", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "pkg1": "^1.0.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mock-npm/pkg/mod-ns2/1.0.0/package/npm-shrinkwrap.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "name": "mod-ns", 4 | "lockfileVersion": 1, 5 | "dependencies": { 6 | "mod-a": { 7 | "version": "1.0.0" 8 | }, 9 | "mod-ns": { 10 | "version": "1.0.0", 11 | "dependencies": { 12 | "mod-a": { 13 | "version": "1.1.0" 14 | } 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fynpo-sample/.ignore-dir/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ignore-dot-dir", 3 | "version": "1.0.0", 4 | "description": "dir starts with . should be ignored", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "pkg2": "^1.0.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mod-i/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mod-i", 3 | "version": "1.0.0", 4 | "description": "module for testing local linking", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "scripts": { 10 | "test": "echo test" 11 | }, 12 | "bin": { 13 | "bin1": "bin/bin1.js" 14 | }, 15 | "dependencies": { 16 | "mod-h": "sym:../mod-h" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/sample/packages/foo1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "foo1", 3 | "version": "1.0.0", 4 | "description": "test a package depending on a package that has circular", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "cir1": "^1.0.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fynpo-sample/packages/foo1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "foo1", 3 | "version": "1.0.0", 4 | "description": "test a package depending on a package that has circular", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "cir1": "^1.0.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-npm-dedupe/step-01/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "locked-change-indirect", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "mod-i": "^1.0.0", 11 | "mod-j": "^1.0.0" 12 | }, 13 | "optionalDependencies": { 14 | "mod-e": "^1.0.0", 15 | "mod-err": "^4.5.1" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/platform-check/step-02/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pkg-platform-check", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "mod-a": "^1.0.0", 11 | "mod-g": "^2.0.0" 12 | }, 13 | "optionalDependencies": { 14 | "mod-bad-cpu": "^1.0.0", 15 | "mod-bad-os": null 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/remote-url-semver/step-01/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .f: 3 | .fyn.json: file 4 | _: 5 | test-from-gh: 6 | 1.0.0: 7 | test-from-gh: 8 | README.md: file 9 | hello: file 10 | package.json: 11 | id: test-from-gh@1.0.0 12 | src: 13 | index.js: file 14 | test-from-gh: '-> .f/_/test-from-gh/1.0.0/test-from-gh' 15 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/sample/tests/t1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tpkg1", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "pkg1": "^1.0.0" 14 | }, 15 | "devDependencies": { 16 | "test1": "^1.0.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fynpo-sample/tests/t1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tpkg1", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "pkg1": "^1.0.0" 14 | }, 15 | "devDependencies": { 16 | "test1": "^1.0.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/platform-check/step-03/index.js: -------------------------------------------------------------------------------- 1 | const Fs = require("fs"); 2 | 3 | module.exports = { 4 | title: "fail install package where cpu not match", 5 | expectFailure: err => { 6 | const ix = err.message.indexOf( 7 | `platform check failed: your cpu/arch ${ 8 | process.arch 9 | } doesn't satisfy required cpu foo,bar,blah` 10 | ); 11 | if (ix < 0) { 12 | throw err; 13 | } 14 | } 15 | }; 16 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/sample/packages/ifoo1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ifoo1", 3 | "version": "1.0.0", 4 | "description": "test a package depending on a package that has indirect circular", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "icir1": "^1.0.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mock-npm/metas/mod-i.yml: -------------------------------------------------------------------------------- 1 | etag: mod-i-1 2 | name: mod-i 3 | versions: 4 | 1.0.0: 5 | name: mod-i 6 | description: test fixture mod-i 7 | version: 1.0.0 8 | dependencies: 9 | mod-g: ^3.0.0 10 | dist: 11 | shasum: '' 12 | tarball: 'http://localhost:4873/mod-i/-/mod-i-1.0.0.tgz' 13 | dist-tags: 14 | latest: 1.0.0 15 | _rev: 9-f5a60b1743717bf9 16 | readme: | 17 | #mod-i 18 | _attachments: {} 19 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mock-npm/metas/mod-j.yml: -------------------------------------------------------------------------------- 1 | etag: mod-j-1 2 | name: mod-j 3 | versions: 4 | 1.0.0: 5 | name: mod-j 6 | description: test fixture mod-j 7 | version: 1.0.0 8 | dependencies: 9 | mod-g: ^3.0.11 10 | dist: 11 | shasum: '' 12 | tarball: 'http://localhost:4873/mod-j/-/mod-j-1.0.0.tgz' 13 | dist-tags: 14 | latest: 1.0.0 15 | _rev: 9-f5a60b1743717bf9 16 | readme: | 17 | #mod-j 18 | _attachments: {} 19 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fynpo-sample/packages/ifoo1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ifoo1", 3 | "version": "1.0.0", 4 | "description": "test a package depending on a package that has indirect circular", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "icir1": "^1.0.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/optional-check/step-01/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "optional-check", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "optionalDependencies": { 10 | "mod-e": "^1.0.0", 11 | "mod-err": "^4.5.1", 12 | "mod-drop": "http://boieiroueorpqoweiracbad:19234/mod-drop-1.0.0.tgz", 13 | "mod-drop-tgz": "^1.0.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/sample/@scope/pkg-2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@scope/pkg-2", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "pkg1": "^1.0.0" 14 | }, 15 | "devDependencies": { 16 | "test1": "^1.0.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/bin-linker/step-03/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const xaa = require("xaa"); 4 | 5 | const Path = require("path"); 6 | const Fs = require("fs"); 7 | module.exports = { 8 | title: "should update link that changed", 9 | verify: async cwd => { 10 | await xaa.delay(100); 11 | debugger; 12 | // const link = Fs.readlinkSync(Path.join(cwd, "node_modules/mod-g")); 13 | // expect(link).contains("4.0.0"); 14 | } 15 | }; 16 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mod-g/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mod-g", 3 | "version": "2.1.0", 4 | "description": "module for testing local linking", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "scripts": { 10 | "test": "echo test" 11 | }, 12 | "files": [ 13 | "bin" 14 | ], 15 | "bin": { 16 | "bin1": "bin/bin1.js", 17 | "bin2": "bin/bin2.js" 18 | }, 19 | "dependencies": {} 20 | } 21 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/sample/tests/skip/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "skip", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "pkg1": "^1.0.0" 14 | }, 15 | "devDependencies": { 16 | "test1": "^1.0.0" 17 | }, 18 | "fynpo": false 19 | } 20 | -------------------------------------------------------------------------------- /packages/fyn/lib/util/file-ops.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const Promise = require("bluebird"); 4 | const opfs = require("opfs"); 5 | const lockfile = require("lockfile"); 6 | const win32Opfs = require("./file-ops-win32"); 7 | 8 | opfs._opfsSetPromise(Promise); 9 | 10 | opfs.$.acquireLock = Promise.promisify(lockfile.lock, { context: lockfile }); 11 | opfs.$.releaseLock = Promise.promisify(lockfile.unlock, { context: lockfile }); 12 | 13 | module.exports = win32Opfs(opfs); 14 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mod-g-v3/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mod-g", 3 | "version": "3.1.0", 4 | "description": "module for testing local linking", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "scripts": { 10 | "test": "echo test" 11 | }, 12 | "files": [ 13 | "bin" 14 | ], 15 | "bin": { 16 | "bin1": "bin/bin1.js", 17 | "bin2": "bin/bin2.js" 18 | }, 19 | "dependencies": {} 20 | } 21 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mod-h/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mod-h", 3 | "version": "1.0.0", 4 | "description": "module for testing local linking", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "scripts": { 10 | "test": "echo test" 11 | }, 12 | "bin": { 13 | "bin1": "bin/bin1.js" 14 | }, 15 | "files": [ 16 | "bin" 17 | ], 18 | "dependencies": { 19 | "mod-g": "^2.0.0" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fynpo-sample/tests/skip/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "skip", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "pkg1": "^1.0.0" 14 | }, 15 | "devDependencies": { 16 | "test1": "^1.0.0" 17 | }, 18 | "fynpo": false 19 | } 20 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/platform-check/step-03/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pkg-platform-check", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "dependencies": { 10 | "mod-a": "^1.0.0", 11 | "mod-bad-cpu": "^1.0.0", 12 | "mod-g": "^2.0.0" 13 | }, 14 | "optionalDependencies": { 15 | "mod-bad-cpu": null, 16 | "mod-bad-os": null 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /docs/blog/rss.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | fynpo Blog 5 | https://jchip.github.io/fynpo/blog 6 | fynpo Blog 7 | Sun, 25 Oct 2015 23:29:00 GMT 8 | https://validator.w3.org/feed/docs/rss2.html 9 | https://github.com/jpmonette/feed 10 | 11 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-dedupe-2/step-01/lock.yaml: -------------------------------------------------------------------------------- 1 | $fyn: 2 | layout: detail 3 | $pkg: 4 | dep: 5 | "mod-i": ^1.0.0 6 | mod-g: 7 | _latest: 3.0.11 8 | _: 9 | ^3.0.0: 3.0.0 10 | 3.0.0: 11 | _: "http://localhost:50549/mod-g/-/mod-g-3.0.0.tgz" 12 | mod-i: 13 | _latest: 1.0.0 14 | _: 15 | ^1.0.0: 1.0.0 16 | 1.0.0: 17 | top: 1 18 | _: "http://localhost:50387/mod-i/-/mod-i-1.0.0.tgz" 19 | dependencies: 20 | mod-g: ^3.0.0 21 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-dedupe/step-01/lock.yaml: -------------------------------------------------------------------------------- 1 | $fyn: 2 | layout: detail 3 | $pkg: 4 | dep: 5 | "mod-i": ^1.0.0 6 | mod-g: 7 | _latest: 3.0.11 8 | _: 9 | ^3.0.0: 3.0.0 10 | 3.0.0: 11 | _: "http://localhost:50549/mod-g/-/mod-g-3.0.0.tgz" 12 | mod-i: 13 | _latest: 1.0.0 14 | _: 15 | ^1.0.0: 1.0.0 16 | 1.0.0: 17 | top: 1 18 | _: "http://localhost:50387/mod-i/-/mod-i-1.0.0.tgz" 19 | dependencies: 20 | mod-g: ^3.0.0 21 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-indirect/step-01/lock.yaml: -------------------------------------------------------------------------------- 1 | $fyn: 2 | layout: detail 3 | $pkg: 4 | dep: 5 | "mod-i": ^1.0.0 6 | mod-g: 7 | _latest: 3.0.11 8 | _: 9 | ^3.0.0: 3.0.0 10 | 3.0.0: 11 | _: "http://localhost:50549/mod-g/-/mod-g-3.0.0.tgz" 12 | mod-i: 13 | _latest: 1.0.0 14 | _: 15 | ^1.0.0: 1.0.0 16 | 1.0.0: 17 | top: 1 18 | _: "http://localhost:50387/mod-i/-/mod-i-1.0.0.tgz" 19 | dependencies: 20 | mod-g: ^3.0.0 21 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-indirect/step-02/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .bin: {} 3 | .f: 4 | .fyn.json: file 5 | _: 6 | mod-g: 7 | 3.0.11: 8 | mod-g: 9 | package.json: 10 | id: mod-g@3.0.11 11 | mod-i: 12 | 1.0.0: 13 | mod-i: 14 | package.json: 15 | id: mod-i@1.0.0 16 | mod-g: '-> .f/_/mod-g/3.0.11/mod-g' 17 | mod-i: '-> .f/_/mod-i/1.0.0/mod-i' 18 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/bin-linker/step-03/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .bin: 3 | bin1: '-> ../.f/_/mod-g/4.0.0/mod-g/bin/bin1.js' 4 | binx: '-> ../.f/_/mod-g/4.0.0/mod-g/bin/x.js' 5 | .f: 6 | .fyn.json: file 7 | _: 8 | mod-g: 9 | 4.0.0: 10 | mod-g: 11 | bin: 12 | bin1.js: file 13 | x.js: file 14 | package.json: 15 | id: mod-g@4.0.0 16 | mod-g: '-> .f/_/mod-g/4.0.0/mod-g' 17 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/sample/tests/@scope/pkg1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@scope/pkg1", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "pkg1": "^1.0.0", 14 | "pkg2": "^3.0.0" 15 | }, 16 | "devDependencies": { 17 | "test1": "^1.0.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /docs/blog/atom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | https://jchip.github.io/fynpo/blog 4 | fynpo Blog 5 | 2015-10-25T23:29:00.000Z 6 | https://github.com/jpmonette/feed 7 | 8 | fynpo Blog 9 | https://jchip.github.io/fynpo/img/favicon.png 10 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mock-npm/pkg/mod-ns/1.0.0/package/npm-shrinkwrap.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "name": "mod-ns", 4 | "lockfileVersion": 1, 5 | "dependencies": { 6 | "mod-a": { 7 | "version": "1.0.1" 8 | }, 9 | "mod-c": { 10 | "version": "3.0.0", 11 | "dependencies": { 12 | "mod-a": { 13 | "version": "1.1.0" 14 | } 15 | } 16 | }, 17 | "mod-d": { 18 | "version": "3.0.1" 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/bin-linker/step-01/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .bin: 3 | bin1: '-> ../.f/_/mod-g/2.0.1/mod-g/bin/bin1.js' 4 | bin2: '-> ../.f/_/mod-g/2.0.1/mod-g/bin/bin2.js' 5 | .f: 6 | .fyn.json: file 7 | _: 8 | mod-g: 9 | 2.0.1: 10 | mod-g: 11 | bin: 12 | bin1.js: file 13 | bin2.js: file 14 | package.json: 15 | id: mod-g@2.0.1 16 | mod-g: '-> .f/_/mod-g/2.0.1/mod-g' 17 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/bin-linker/step-02/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .bin: 3 | bin2: '-> ../.f/_/mod-g/3.0.0/mod-g/bin/bin2.js' 4 | binx: '-> ../.f/_/mod-g/3.0.0/mod-g/bin/binx.js' 5 | .f: 6 | .fyn.json: file 7 | _: 8 | mod-g: 9 | 3.0.0: 10 | mod-g: 11 | bin: 12 | bin2.js: file 13 | binx.js: file 14 | package.json: 15 | id: mod-g@3.0.0 16 | mod-g: '-> .f/_/mod-g/3.0.0/mod-g' 17 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fynpo-sample/tests/@scope/pkg1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@scope/pkg1", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "pkg1": "^1.0.0", 14 | "pkg2": "^3.0.0" 15 | }, 16 | "devDependencies": { 17 | "test1": "^1.0.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/read-packages.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, it, expect } from "@jest/globals"; 2 | import { readFynpoPackages } from "../src/index"; 3 | import path from "path"; 4 | 5 | describe("read packages from repo", () => { 6 | it("should read packages", async () => { 7 | const packages: any = await readFynpoPackages({ cwd: path.join(__dirname, "sample") }); 8 | expect(packages).toHaveProperty("pkg1"); 9 | expect(packages).toHaveProperty("pkg2"); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mock-npm/metas/always-change.yml: -------------------------------------------------------------------------------- 1 | etag: always-change-1 2 | name: always-change 3 | versions: 4 | 3.0.11: 5 | name: always-change 6 | description: test fixture always-change 7 | version: 3.0.11 8 | dependencies: {} 9 | dist: 10 | shasum: '' 11 | tarball: 'http://localhost:4873/always-change/-/always-change-3.0.11.tgz' 12 | dist-tags: 13 | latest: 3.0.11 14 | _rev: 9-f5a60b1743717bf9 15 | readme: | 16 | #always-change 17 | _attachments: {} 18 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/add-remove-pkg/step-02/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "add-pkg", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "fyn": { 10 | "devDependencies": { 11 | "mod-g": "../../fixtures/mod-g" 12 | } 13 | }, 14 | "devDependencies": { 15 | "mod-d": "^1.0.0", 16 | "mod-g": "^2.1.0" 17 | }, 18 | "dependencies": { 19 | "mod-a": "^2.0.0" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/add-remove-pkg/step-03/pkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "add-pkg", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "repository": "test", 9 | "fyn": { 10 | "devDependencies": { 11 | "mod-g": "../../fixtures/mod-g" 12 | } 13 | }, 14 | "devDependencies": { 15 | "mod-d": "^1.0.0", 16 | "mod-g": "^2.1.0" 17 | }, 18 | "dependencies": { 19 | "mod-a": "^2.0.0" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/fyn/test/test-resolve.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const Fs = require("fs"); 4 | const Yaml = require("js-yaml"); 5 | const Path = require("path"); 6 | const Fyn = require("../lib/fyn"); 7 | const fyn = new Fyn({ 8 | opts: { 9 | registry: "http://localhost:4873/", 10 | pkgFile: Path.join(__dirname, "fixtures/pkg-a/package.json") 11 | } 12 | }); 13 | fyn.resolveDependencies().then(() => { 14 | Fs.writeFileSync(Path.resolve("fyn-data.yaml"), Yaml.dump(fyn._depResolver._data)); 15 | }); 16 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/missing-peer-dep/step-01/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const logger = require("../../../../lib/logger"); 4 | const stripAnsi = require("strip-ansi"); 5 | 6 | module.exports = { 7 | title: "should warn peer dep missing", 8 | verify: () => { 9 | const msg = "Warning: peer dependencies mod-a@^0.3.0 of mod-f@2.1.1 is missing"; 10 | const warning = logger.logData.map(x => stripAnsi(x)).find(x => x.indexOf(msg) > 0); 11 | expect(warning).contains(msg); 12 | } 13 | }; 14 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mock-npm/metas/mod-bad-os.yml: -------------------------------------------------------------------------------- 1 | etag: mod-bad-os-1 2 | name: mod-bad-os 3 | versions: 4 | 1.0.0: 5 | name: mod-bad-os 6 | description: test fixture mod-bad-os 7 | version: 1.0.0 8 | dist: 9 | shasum: '' 10 | tarball: 'http://localhost:4873/mod-bad-os/-/mod-bad-os-1.0.0.tgz' 11 | os: 12 | - foo 13 | - bar 14 | - blah 15 | dist-tags: 16 | latest: 1.0.0 17 | _rev: 9-f5a60b1743717bf9 18 | readme: | 19 | #mod-bad-os 20 | _attachments: {} 21 | -------------------------------------------------------------------------------- /testing/monorepo-test/packages/pkg-foo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pkg-foo", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "dist/index.js", 6 | "homepage": "", 7 | "license": "UNLICENSED", 8 | "scripts": { 9 | "build": "rm -rf dist; tsc" 10 | }, 11 | "author": "", 12 | "files": [ 13 | "dist" 14 | ], 15 | "keywords": [], 16 | "repository": { 17 | "type": "git", 18 | "url": "" 19 | }, 20 | "devDependencies": { 21 | "typescript": "^4.5.5" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/nested-dep/step-01/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | top: 3 | A: ^2 4 | E: ^1.0 5 | D: ^1.0 6 | A: ^2 7 | F: ^1 8 | A: ^1 || ^2 9 | C: ^3 10 | A: ^1 11 | 12 | Should resolve: 13 | A@2.0 14 | E@1.0 15 | C@3.0 16 | D@1.0 17 | F@1.0 18 | __fv_ 19 | A@1.0 <-- C's dep 20 | 21 | F's A --> A@2.0 22 | */ 23 | 24 | 25 | module.exports = { 26 | title: "should resolve top version for nested dep", 27 | timeout: 20000 28 | }; 29 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mock-npm/metas/mod-bad-cpu.yml: -------------------------------------------------------------------------------- 1 | etag: mod-bad-cpu-1 2 | name: mod-bad-cpu 3 | versions: 4 | 1.0.0: 5 | name: mod-bad-cpu 6 | description: test fixture mod-bad-cpu 7 | version: 1.0.0 8 | dist: 9 | shasum: '' 10 | tarball: 'http://localhost:4873/mod-bad-cpu/-/mod-bad-cpu-1.0.0.tgz' 11 | cpu: 12 | - foo 13 | - bar 14 | - blah 15 | dist-tags: 16 | latest: 1.0.0 17 | _rev: 9-f5a60b1743717bf9 18 | readme: | 19 | #mod-bad-cpu 20 | _attachments: {} 21 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fyn-central/step-01/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const Fs = require("fs"); 4 | const Path = require("path"); 5 | const assert = require("assert"); 6 | 7 | module.exports = { 8 | title: "should use a central storage", 9 | async before(cwd) { 10 | process.env.FYN_CENTRAL_DIR = Path.join(cwd, ".fyn", ".central"); 11 | }, 12 | after() { 13 | assert(Fs.existsSync(process.env.FYN_CENTRAL_DIR), "central storage not created"); 14 | delete process.env.FYN_CENTRAL_DIR; 15 | } 16 | }; 17 | -------------------------------------------------------------------------------- /packages/create-fynpo/src/initialize-git.ts: -------------------------------------------------------------------------------- 1 | import xsh from "xsh"; 2 | 3 | function _sh(command) { 4 | return xsh.exec( 5 | { 6 | silent: true, 7 | cwd: process.cwd(), 8 | env: Object.assign({}, process.env, { PWD: process.cwd() }), 9 | }, 10 | command 11 | ); 12 | } 13 | export function isGitInitialized() { 14 | return _sh(`git rev-parse --git-dir`) 15 | .then(() => true) 16 | .catch(() => false); 17 | } 18 | 19 | export function initializeGitRepo() { 20 | return _sh("git init"); 21 | } 22 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/electrode/packages/opt-archetype-check/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "opt-archetype-check", 3 | "version": "1.0.0", 4 | "description": "common code for electrode optional archetype checking", 5 | "main": "optional-check.js", 6 | "scripts": { 7 | "test": "node test/test1.js" 8 | }, 9 | "keywords": [], 10 | "author": "Electrode (http://www.electrode.io/)", 11 | "contributors": [ 12 | "Joel Chen " 13 | ], 14 | "license": "Apache-2.0", 15 | "private": true 16 | } 17 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/add-remove-pkg/step-03/lock.yaml: -------------------------------------------------------------------------------- 1 | $fyn: 2 | layout: detail 3 | $pkg: 4 | dev: 5 | mod-d: ^1.0.0 6 | mod-b: 7 | _latest: 2.0.0 8 | _: 9 | ^2.0.0: 2.0.0 10 | 2.0.0: 11 | $: sha1-08ELWBWzFomlG3x9hDQYJTU6I4I= 12 | _: 'https://registry.npmjs.org/mod-b/-/mod-b-2.0.0.tgz' 13 | mod-d: 14 | _latest: 1.0.0 15 | _: 16 | ^1.0.0: 1.0.0 17 | 1.0.0: 18 | top: 1 19 | $: sha1-VNntO9nFKWIr3Bh0ABEo6IiRRug= 20 | _: 'https://registry.npmjs.org/mod-d/-/mod-d-1.0.0.tgz' 21 | dependencies: 22 | mod-b: ^2.0.0 23 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mock-npm/metas/mod-err.yml: -------------------------------------------------------------------------------- 1 | etag: mod-err-1 2 | name: mod-err 3 | versions: 4 | 4.5.1: 5 | name: mod-err 6 | description: test fixture mod-err 7 | version: 4.5.1 8 | scripts: 9 | preinstall: echo failing preinstall for mod-err && exit 1 10 | dependencies: 11 | mod-a: ^3.0.0 12 | dist: 13 | shasum: '' 14 | tarball: 'http://localhost:4873/mod-err/-/mod-err-4.5.1.tgz' 15 | dist-tags: 16 | latest: 4.5.1 17 | _rev: 9-f5a60b1743717bf9 18 | readme: | 19 | #mod-err 20 | _attachments: {} 21 | -------------------------------------------------------------------------------- /docusaurus/src/pages/index.module.css: -------------------------------------------------------------------------------- 1 | /* stylelint-disable docusaurus/copyright-header */ 2 | 3 | /** 4 | * CSS files with the .module.css suffix will be treated as CSS modules 5 | * and scoped locally. 6 | */ 7 | 8 | .heroBanner { 9 | padding: 4rem 0; 10 | text-align: center; 11 | position: relative; 12 | overflow: hidden; 13 | } 14 | 15 | @media screen and (max-width: 966px) { 16 | .heroBanner { 17 | padding: 2rem; 18 | } 19 | } 20 | 21 | .buttons { 22 | display: flex; 23 | align-items: center; 24 | justify-content: center; 25 | } 26 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mock-npm/metas/mod-ns2.yml: -------------------------------------------------------------------------------- 1 | etag: mod-ns2-1 2 | name: mod-ns2 3 | versions: 4 | 1.0.0: 5 | name: mod-ns2 6 | description: test fixture mod-ns2 7 | version: 1.0.0 8 | _hasShrinkwrap: true 9 | dependencies: 10 | mod-ns: ^1.0.0 11 | mod-a: ^1.0.0 12 | dist: 13 | shasum: '' 14 | tarball: 'http://localhost:4873/mod-ns2/-/mod-ns2-1.0.0.tgz' 15 | dist-tags: 16 | latest: 1.0.0 17 | _rev: 9-f5a60b1743717bf9 18 | readme: | 19 | #mod-ns2 20 | for testing npm-shrinkwrap.json 21 | _attachments: {} 22 | -------------------------------------------------------------------------------- /testing/monorepo-test/packages/pkg-foo/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "dist", 4 | "lib": ["es2018"], 5 | "module": "CommonJS", 6 | "esModuleInterop": true, 7 | "importHelpers": true, 8 | "target": "ES2018", 9 | "preserveConstEnums": true, 10 | "sourceMap": true, 11 | "declaration": true, 12 | "types": [], 13 | "forceConsistentCasingInFileNames": true, 14 | "noImplicitReturns": true, 15 | "alwaysStrict": true, 16 | "strictFunctionTypes": true 17 | }, 18 | "include": ["src"] 19 | } 20 | -------------------------------------------------------------------------------- /docusaurus/sidebars.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | someSidebar: { 3 | Fynpo: ["intro", "packages"], 4 | "Getting Started": [ 5 | "getting-started/installation", 6 | "getting-started/configuration", 7 | "getting-started/commitlint", 8 | "getting-started/publish", 9 | "getting-started/debugging" 10 | ], 11 | Commands: [ 12 | "commands/bootstrap", 13 | "commands/run", 14 | "commands/updated", 15 | "commands/changelog", 16 | "commands/prepare", 17 | "commands/publish-cmd" 18 | ] 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: ci 2 | on: 3 | push: 4 | branches: ["main"] 5 | pull_request: 6 | branches: ["main"] 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | strategy: 11 | matrix: 12 | node: ["12", "14", "16"] 13 | steps: 14 | - uses: actions/checkout@v2 15 | - uses: actions/setup-node@v2 16 | with: 17 | node-version: ${{ matrix.node }} 18 | - run: npm i -g fyn 19 | - run: fyn install --no-fynlocal 20 | - run: npx fynpo bootstrap 21 | - run: npx fynpo run ci:check --stream 22 | -------------------------------------------------------------------------------- /packages/fyn/test/test-fetch.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const Fs = require("fs"); 4 | const Yaml = require("js-yaml"); 5 | const Path = require("path"); 6 | const Fyn = require("../lib/fyn"); 7 | const data = Yaml.safeLoad(Fs.readFileSync(Path.resolve("fyn-data.yaml").toString())); 8 | const fyn = new Fyn({ 9 | opts: { data, pkgFile: Path.join(__dirname, "fixtures/pkg-a/package.json") } 10 | }); 11 | 12 | fyn.fetchPackages().then(() => { 13 | console.log("done fetching packages"); 14 | Fs.writeFileSync(Path.resolve("fyn-fetch.yaml"), Yaml.dump(fyn._distFetcher._packages)); 15 | }); 16 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/add-remove-pkg/step-03/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .bin: {} 3 | .f: 4 | .fyn.json: file 5 | _: 6 | mod-b: 7 | 2.0.0: 8 | mod-b: 9 | LICENSE: file 10 | README.md: file 11 | package.json: 12 | id: mod-b@2.0.0 13 | mod-d: 14 | 1.0.0: 15 | mod-d: 16 | LICENSE: file 17 | README.md: file 18 | package.json: 19 | id: mod-d@1.0.0 20 | mod-b: "-> .f/_/mod-b/2.0.0/mod-b" 21 | mod-d: "-> .f/_/mod-d/1.0.0/mod-d" 22 | -------------------------------------------------------------------------------- /packages/fynpo/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "dist", 4 | "lib": ["es2018", "dom"], 5 | "module": "CommonJS", 6 | "esModuleInterop": true, 7 | "importHelpers": true, 8 | "target": "ES2018", 9 | "preserveConstEnums": true, 10 | "sourceMap": true, 11 | "declaration": true, 12 | "types": ["node", "jest"], 13 | "forceConsistentCasingInFileNames": true, 14 | "noImplicitReturns": true, 15 | "alwaysStrict": true, 16 | "strictFunctionTypes": true, 17 | "resolveJsonModule": true 18 | }, 19 | "include": ["src"] 20 | } 21 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mock-npm/metas/mod-drop-tgz.yml: -------------------------------------------------------------------------------- 1 | etag: mod-drop-tgz-1 2 | name: mod-drop-tgz 3 | versions: 4 | 1.0.1: 5 | name: mod-drop-tgz 6 | description: test fixture mod-drop-tgz 7 | version: 1.0.1 8 | scripts: 9 | preinstall: echo failing preinstall for mod-drop-tgz && exit 1 10 | dependencies: 11 | mod-a: ^3.0.0 12 | dist: 13 | shasum: '' 14 | tarball: 'http://localhost:4873/mod-drop-tgz/-/mod-drop-tgz-1.0.1.tgz' 15 | dist-tags: 16 | latest: 1.0.1 17 | _rev: 9-f5a60b1743717bf9 18 | readme: | 19 | #mod-drop-tgz 20 | _attachments: {} 21 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fynpo-sample/step-02/_fynpo-data.json: -------------------------------------------------------------------------------- 1 | { 2 | "indirects": { 3 | "@scope/pkg-2": [ 4 | { 5 | "fromPkg": { 6 | "name": "@scope/pkg-2", 7 | "version": "1.0.0", 8 | "path": "@scope/pkg-2" 9 | }, 10 | "onPkg": { 11 | "name": "pkg1", 12 | "version": "1.0.0", 13 | "path": "packages/pkg1" 14 | }, 15 | "depSection": "dep", 16 | "indirectSteps": ["@scope/pkg-2@1.0.0(pkg)", "dep-on-pkg1(dep)"] 17 | } 18 | ] 19 | }, 20 | "__timestamp": 1633445919728 21 | } 22 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/electrode/packages/electrode-cdn-file-loader/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electrode-cdn-file-loader", 3 | "version": "1.1.1", 4 | "description": "Webpack CDN file loader", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/electrode-io/electrode-cdn-file-loader.git" 12 | }, 13 | "keywords": [], 14 | "author": "", 15 | "license": "UNLICENSED", 16 | "dependencies": { 17 | "loader-utils": "^1.1.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mock-npm/metas/mod-ns.yml: -------------------------------------------------------------------------------- 1 | etag: mod-ns-1 2 | name: mod-ns 3 | versions: 4 | 1.0.0: 5 | name: mod-ns 6 | description: test fixture mod-ns 7 | version: 1.0.0 8 | _hasShrinkwrap: true 9 | dependencies: 10 | mod-a: ^1.0.0 11 | mod-b: ^1.0.0 12 | mod-d: ^3.0.0 13 | mod-c: ^3.0.0 14 | dist: 15 | shasum: '' 16 | tarball: 'http://localhost:4873/mod-ns/-/mod-ns-1.0.0.tgz' 17 | dist-tags: 18 | latest: 1.0.0 19 | _rev: 9-f5a60b1743717bf9 20 | readme: | 21 | #mod-ns 22 | for testing npm-shrinkwrap.json 23 | _attachments: {} 24 | -------------------------------------------------------------------------------- /packages/fynpo-cli/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "dist", 4 | "lib": [ 5 | "es2018" 6 | ], 7 | "module": "CommonJS", 8 | "esModuleInterop": true, 9 | "importHelpers": true, 10 | "target": "ES2018", 11 | "preserveConstEnums": true, 12 | "sourceMap": true, 13 | "declaration": true, 14 | "types": [ 15 | "node" 16 | ], 17 | "forceConsistentCasingInFileNames": true, 18 | "noImplicitReturns": true, 19 | "alwaysStrict": true, 20 | "strictFunctionTypes": true 21 | }, 22 | "include": [ 23 | "bin" 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /packages/create-fynpo/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "dist", 4 | "lib": [ 5 | "es2018" 6 | ], 7 | "module": "CommonJS", 8 | "esModuleInterop": true, 9 | "importHelpers": true, 10 | "target": "ES2018", 11 | "preserveConstEnums": true, 12 | "sourceMap": true, 13 | "declaration": true, 14 | "types": [ 15 | "node" 16 | ], 17 | "forceConsistentCasingInFileNames": true, 18 | "noImplicitReturns": true, 19 | "alwaysStrict": true, 20 | "strictFunctionTypes": true 21 | }, 22 | "include": [ 23 | "src" 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /packages/fyn/test/test-link.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const Fs = require("fs"); 4 | const Path = require("path"); 5 | const Fyn = require("../lib/fyn"); 6 | const fyn = new Fyn({ opts: { pkgFile: Path.join(__dirname, "fixtures/pkg.json") } }); 7 | const Yaml = require("js-yaml"); 8 | const DepData = require("../lib/dep-data"); 9 | // load data 10 | 11 | const dataStr = Fs.readFileSync("fyn-data.yaml").toString(); 12 | const data = new DepData(Yaml.safeLoad(dataStr)); 13 | 14 | const PkgDepLinker = require("../lib/pkg-dep-linker"); 15 | 16 | const linker = new PkgDepLinker({ data, fyn }); 17 | 18 | linker.link(); 19 | -------------------------------------------------------------------------------- /packages/fynpo-base/docs/assets/highlight.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --light-code-background: #FFFFFF; 3 | --dark-code-background: #1E1E1E; 4 | } 5 | 6 | @media (prefers-color-scheme: light) { :root { 7 | --code-background: var(--light-code-background); 8 | } } 9 | 10 | @media (prefers-color-scheme: dark) { :root { 11 | --code-background: var(--dark-code-background); 12 | } } 13 | 14 | body.light { 15 | --code-background: var(--light-code-background); 16 | } 17 | 18 | body.dark { 19 | --code-background: var(--dark-code-background); 20 | } 21 | 22 | pre, code { background: var(--code-background); } 23 | -------------------------------------------------------------------------------- /packages/fynpo-cli/bin/fynpo.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | import requireAt from "require-at"; 4 | 5 | try { 6 | requireAt(process.cwd(), "fynpo/dist/fynpo-cli"); 7 | } catch (err) { 8 | if (err.code === "MODULE_NOT_FOUND") { 9 | console.error(`ERROR: Unable to find the fynpo module from dir ${process.cwd()} 10 | 11 | Please make sure you are in a fynpo monorepo and you have installed fynpo 12 | at its top level. 13 | `); 14 | } else { 15 | console.error( 16 | `Fail to load fynpo for your monorepo from dir ${process.cwd()} 17 | `, 18 | err 19 | ); 20 | } 21 | process.exit(1); 22 | } 23 | -------------------------------------------------------------------------------- /testing/monorepo-test/packages/pkg-bar/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pkg-bar", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "homepage": "", 7 | "license": "UNLICENSED", 8 | "scripts": { 9 | "test": "mocha -c test" 10 | }, 11 | "author": "", 12 | "files": [ 13 | "src", 14 | "lib", 15 | "dist" 16 | ], 17 | "keywords": [], 18 | "repository": { 19 | "type": "git", 20 | "url": "" 21 | }, 22 | "dependencies": { 23 | "pkg-foo": "^1.0.0" 24 | }, 25 | "devDependencies": { 26 | "chai": "^4.3.6", 27 | "mocha": "^9.2.0" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /packages/fyn/test/spec/util/hard-link-dir.spec.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const Path = require("path"); 4 | const hardLinkDir = require("../../../lib/util/hard-link-dir"); 5 | const Fs = require("opfs"); 6 | 7 | describe("hard-link-dir", function() { 8 | it("should hard link a package directory", () => { 9 | const destPath = Path.join(__dirname, "hard_link_mog_g"); 10 | return Fs.mkdir(destPath) 11 | .catch(() => {}) 12 | .then(() => { 13 | return hardLinkDir.link(Path.join(__dirname, "../../fixtures/mod-g"), destPath); 14 | }) 15 | .finally(() => Fs.$.rimraf(destPath)); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /packages/fynpo-base/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "dist", 4 | "lib": [ 5 | "es2018" 6 | ], 7 | "module": "CommonJS", 8 | "esModuleInterop": true, 9 | "importHelpers": true, 10 | "target": "ES2018", 11 | "preserveConstEnums": true, 12 | "sourceMap": true, 13 | "declaration": true, 14 | "types": [ 15 | "node", 16 | "jest" 17 | ], 18 | "forceConsistentCasingInFileNames": true, 19 | "noImplicitReturns": true, 20 | "alwaysStrict": true, 21 | "strictFunctionTypes": true 22 | }, 23 | "include": [ 24 | "src" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /packages/init-package/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "dist", 4 | "lib": [ 5 | "es2018" 6 | ], 7 | "module": "CommonJS", 8 | "esModuleInterop": true, 9 | "importHelpers": true, 10 | "target": "ES2018", 11 | "preserveConstEnums": true, 12 | "sourceMap": true, 13 | "declaration": true, 14 | "types": [ 15 | "node", 16 | "jest" 17 | ], 18 | "forceConsistentCasingInFileNames": true, 19 | "noImplicitReturns": true, 20 | "alwaysStrict": true, 21 | "strictFunctionTypes": true 22 | }, 23 | "include": [ 24 | "src" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-dedupe-2/step-02/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .bin: {} 3 | .f: 4 | .fyn.json: file 5 | _: 6 | mod-g: 7 | 3.0.11: 8 | mod-g: 9 | package.json: 10 | id: mod-g@3.0.11 11 | mod-i: 12 | 1.0.0: 13 | mod-i: 14 | package.json: 15 | id: mod-i@1.0.0 16 | mod-j: 17 | 1.0.0: 18 | mod-j: 19 | package.json: 20 | id: mod-j@1.0.0 21 | mod-g: "-> .f/_/mod-g/3.0.11/mod-g" 22 | mod-i: "-> .f/_/mod-i/1.0.0/mod-i" 23 | mod-j: "-> .f/_/mod-j/1.0.0/mod-j" 24 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-dedupe/step-02/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .bin: {} 3 | .f: 4 | .fyn.json: file 5 | _: 6 | mod-a: 7 | 0.5.0: 8 | mod-a: 9 | package.json: 10 | id: mod-a@0.5.0 11 | mod-g: 12 | 3.0.11: 13 | mod-g: 14 | package.json: 15 | id: mod-g@3.0.11 16 | mod-i: 17 | 1.0.0: 18 | mod-i: 19 | package.json: 20 | id: mod-i@1.0.0 21 | mod-a: "-> .f/_/mod-a/0.5.0/mod-a" 22 | mod-g: "-> .f/_/mod-g/3.0.11/mod-g" 23 | mod-i: "-> .f/_/mod-i/1.0.0/mod-i" 24 | -------------------------------------------------------------------------------- /packages/fyn/yarn/src/util/map.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | type Return = T | Object; 4 | 5 | export default function nullify(obj?: Return = {}): Return { 6 | if (Array.isArray(obj)) { 7 | for (const item of obj) { 8 | nullify(item); 9 | } 10 | } else if ((obj !== null && typeof obj === "object") || typeof obj === "function") { 11 | Object.setPrototypeOf(obj, null); 12 | 13 | // for..in can only be applied to 'object', not 'function' 14 | if (typeof obj === "object") { 15 | for (const key in obj) { 16 | nullify(obj[key]); 17 | } 18 | } 19 | } 20 | 21 | return obj; 22 | } 23 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/e1/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | const rimraf = require("rimraf"); 3 | const Path = require("path"); 4 | // test 5 | const Fs = require("fs"); 6 | 7 | const distDir = Path.join(__dirname, "dist"); 8 | if (!Fs.existsSync(distDir)) { 9 | try { 10 | rimraf.sync(distDir); 11 | Fs.mkdirSync(distDir); 12 | } catch (err) { 13 | // 14 | } 15 | const fileName = process.argv[2]; 16 | Fs.writeFileSync( 17 | Path.join(distDir, fileName), 18 | `console.log("test"); 19 | ` 20 | ); 21 | } else { 22 | console.log("e1 dist already exist"); 23 | } 24 | //# fynSourceMap=true 25 | //# sourceMappingURL=index.js.map 26 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/platform-check/step-01/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .bin: 3 | bin1: '-> ../.f/_/mod-g/2.0.1/mod-g/bin/bin1.js' 4 | bin2: '-> ../.f/_/mod-g/2.0.1/mod-g/bin/bin2.js' 5 | .f: 6 | .fyn.json: file 7 | _: 8 | mod-a: 9 | 1.1.2: 10 | mod-a: 11 | package.json: 12 | id: mod-a@1.1.2 13 | mod-g: 14 | 2.0.1: 15 | mod-g: 16 | bin: 17 | bin1.js: file 18 | bin2.js: file 19 | package.json: 20 | id: mod-g@2.0.1 21 | mod-a: '-> .f/_/mod-a/1.1.2/mod-a' 22 | mod-g: '-> .f/_/mod-g/2.0.1/mod-g' 23 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/platform-check/step-02/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .bin: 3 | bin1: '-> ../.f/_/mod-g/2.0.1/mod-g/bin/bin1.js' 4 | bin2: '-> ../.f/_/mod-g/2.0.1/mod-g/bin/bin2.js' 5 | .f: 6 | .fyn.json: file 7 | _: 8 | mod-a: 9 | 1.1.2: 10 | mod-a: 11 | package.json: 12 | id: mod-a@1.1.2 13 | mod-g: 14 | 2.0.1: 15 | mod-g: 16 | bin: 17 | bin1.js: file 18 | bin2.js: file 19 | package.json: 20 | id: mod-g@2.0.1 21 | mod-a: '-> .f/_/mod-a/1.1.2/mod-a' 22 | mod-g: '-> .f/_/mod-g/2.0.1/mod-g' 23 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/platform-check/step-03/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .bin: 3 | bin1: '-> ../.f/_/mod-g/2.0.1/mod-g/bin/bin1.js' 4 | bin2: '-> ../.f/_/mod-g/2.0.1/mod-g/bin/bin2.js' 5 | .f: 6 | .fyn.json: file 7 | _: 8 | mod-a: 9 | 1.1.2: 10 | mod-a: 11 | package.json: 12 | id: mod-a@1.1.2 13 | mod-g: 14 | 2.0.1: 15 | mod-g: 16 | bin: 17 | bin1.js: file 18 | bin2.js: file 19 | package.json: 20 | id: mod-g@2.0.1 21 | mod-a: '-> .f/_/mod-a/1.1.2/mod-a' 22 | mod-g: '-> .f/_/mod-g/2.0.1/mod-g' 23 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-dedupe-2/step-01/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .bin: 3 | bin2: '-> ../.f/_/mod-g/3.0.0/mod-g/bin/bin2.js' 4 | binx: '-> ../.f/_/mod-g/3.0.0/mod-g/bin/binx.js' 5 | .f: 6 | .fyn.json: file 7 | _: 8 | mod-g: 9 | 3.0.0: 10 | mod-g: 11 | bin: 12 | bin2.js: file 13 | binx.js: file 14 | package.json: 15 | id: mod-g@3.0.0 16 | mod-i: 17 | 1.0.0: 18 | mod-i: 19 | package.json: 20 | id: mod-i@1.0.0 21 | mod-g: '-> .f/_/mod-g/3.0.0/mod-g' 22 | mod-i: '-> .f/_/mod-i/1.0.0/mod-i' 23 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-dedupe/step-01/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .bin: 3 | bin2: '-> ../.f/_/mod-g/3.0.0/mod-g/bin/bin2.js' 4 | binx: '-> ../.f/_/mod-g/3.0.0/mod-g/bin/binx.js' 5 | .f: 6 | .fyn.json: file 7 | _: 8 | mod-g: 9 | 3.0.0: 10 | mod-g: 11 | bin: 12 | bin2.js: file 13 | binx.js: file 14 | package.json: 15 | id: mod-g@3.0.0 16 | mod-i: 17 | 1.0.0: 18 | mod-i: 19 | package.json: 20 | id: mod-i@1.0.0 21 | mod-g: '-> .f/_/mod-g/3.0.0/mod-g' 22 | mod-i: '-> .f/_/mod-i/1.0.0/mod-i' 23 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-indirect/step-01/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .bin: 3 | bin2: '-> ../.f/_/mod-g/3.0.0/mod-g/bin/bin2.js' 4 | binx: '-> ../.f/_/mod-g/3.0.0/mod-g/bin/binx.js' 5 | .f: 6 | .fyn.json: file 7 | _: 8 | mod-g: 9 | 3.0.0: 10 | mod-g: 11 | bin: 12 | bin2.js: file 13 | binx.js: file 14 | package.json: 15 | id: mod-g@3.0.0 16 | mod-i: 17 | 1.0.0: 18 | mod-i: 19 | package.json: 20 | id: mod-i@1.0.0 21 | mod-g: '-> .f/_/mod-g/3.0.0/mod-g' 22 | mod-i: '-> .f/_/mod-i/1.0.0/mod-i' 23 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/build-local/step-01/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const Path = require("path"); 4 | const Fs = require("opfs"); 5 | const rimraf = require("rimraf"); 6 | 7 | module.exports = { 8 | title: "should run build on a local dep", 9 | buildLocal: true, 10 | async before() { 11 | const e1Dir = Path.join(__dirname, "../../../fixtures/e1"); 12 | const fileName = Path.join(e1Dir, "package.json"); 13 | const pkg = JSON.parse(await Fs.readFile(fileName)); 14 | pkg.scripts.install = "node index.js hello.js"; 15 | await Fs.writeFile(fileName, JSON.stringify(pkg, null, 2)); 16 | rimraf.sync(Path.join(e1Dir, "dist")); 17 | } 18 | }; 19 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fyn-central/step-01/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .f: 3 | .fyn.json: file 4 | _: 5 | mod-a: 6 | 1.0.1: 7 | mod-a: 8 | package.json: 9 | id: mod-a@1.0.1 10 | 1.1.2: 11 | mod-a: 12 | package.json: 13 | id: mod-a@1.1.2 14 | mod-h: 15 | 2.0.0: 16 | mod-h: 17 | node_modules: 18 | mod-a: '-> ../../../../mod-a/1.0.1/mod-a' 19 | npm-shrinkwrap.json: file 20 | package.json: 21 | id: mod-h@2.0.0 22 | mod-a: '-> .f/_/mod-a/1.1.2/mod-a' 23 | mod-h: '-> .f/_/mod-h/2.0.0/mod-h' 24 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-indirect/step-02/lock.yaml: -------------------------------------------------------------------------------- 1 | $fyn: 2 | layout: detail 3 | $pkg: 4 | dep: 5 | "mod-g": ^3.0.11 6 | "mod-i": ^1.0.0 7 | mod-g: 8 | _latest: 3.0.11 9 | _: 10 | "^3.0.0,^3.0.11": 3.0.11 11 | 3.0.11: 12 | top: 1 13 | $: sha1-5mts5SZu2UFQy6n2+KciagwG5ZI= 14 | _: "http://localhost:50652/mod-g/-/mod-g-3.0.11.tgz" 15 | mod-i: 16 | _latest: 1.0.0 17 | _: 18 | ^1.0.0: 1.0.0 19 | 1.0.0: 20 | top: 1 21 | $: sha512-yyR5B9PHiy+xmxLOWjOSkIKuakxWNlRROqGhrOWgEiIuZ6wHKlTVXrAkJV1w8URtmOVjh0r0w1jHgiPDgDEfwg== 22 | _: "http://localhost:50652/mod-i/-/mod-i-1.0.0.tgz" 23 | dependencies: 24 | mod-g: ^3.0.0 25 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fyn-shrinkwrap/step-01/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .f: 3 | .fyn.json: file 4 | _: 5 | mod-a: 6 | 1.0.1: 7 | mod-a: 8 | package.json: 9 | id: mod-a@1.0.1 10 | 1.1.2: 11 | mod-a: 12 | package.json: 13 | id: mod-a@1.1.2 14 | mod-h: 15 | 2.0.0: 16 | mod-h: 17 | node_modules: 18 | mod-a: '-> ../../../../mod-a/1.0.1/mod-a' 19 | npm-shrinkwrap.json: file 20 | package.json: 21 | id: mod-h@2.0.0 22 | mod-a: '-> .f/_/mod-a/1.1.2/mod-a' 23 | mod-h: '-> .f/_/mod-h/2.0.0/mod-h' 24 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/build-local/step-02/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const Fs = require("opfs"); 4 | const Path = require("path"); 5 | const xaa = require("xaa"); 6 | const assert = require("assert"); 7 | 8 | module.exports = { 9 | title: "should do nothing when no files changed", 10 | buildLocal: true, 11 | forceInstall: false, 12 | async before(cwd) { 13 | await xaa.delay(10); 14 | }, 15 | async verify(cwd) { 16 | const debugLog = (await Fs.readFile(Path.join(cwd, "fyn-debug-step-02.log"))).toString(); 17 | assert( 18 | debugLog.includes("nothing to be done"), 19 | "fyn-debug-step-02.log doesn't contain string 'nothing to be done'" 20 | ); 21 | } 22 | }; 23 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/local-hard-linking/step-04/lock.yaml: -------------------------------------------------------------------------------- 1 | $fyn: 2 | layout: detail 3 | "$pkg": 4 | "dep": 5 | "e1": "./e1" 6 | "mod-h": "^1.0.0" 7 | e1: 8 | _latest: 1.0.0-fynlocal_h 9 | _: 10 | ./e1: 1.0.0-fynlocal_h 11 | 1.0.0-fynlocal_h: 12 | top: 1 13 | $: local 14 | _: ./e1 15 | dependencies: 16 | mod-h: ^3.0.1 17 | mod-h: 18 | _latest: 3.0.11 19 | _: 20 | ^1.0.0: 1.0.0 21 | ^3.0.1: 3.0.11 22 | 3.0.11: 23 | $: sha1-XHuvtRIUoHiwBkicWGoXdo52gcE= 24 | _: "http://localhost:61718/mod-h/-/mod-h-3.0.11.tgz" 25 | 1.0.0: 26 | top: 1 27 | $: sha1-2XgFPvXrLn5q44pae51qVPkPu+I= 28 | _: "http://localhost:61718/mod-h/-/mod-h-1.0.0.tgz" 29 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mock-npm/metas/mod-os-cpu.yml: -------------------------------------------------------------------------------- 1 | etag: mod-os-cpu-1 2 | name: mod-os-cpu 3 | versions: 4 | 1.0.0: 5 | name: mod-os-cpu 6 | description: test fixture mod-os-cpu 7 | version: 1.0.0 8 | dist: 9 | shasum: '' 10 | tarball: 'http://localhost:4873/mod-os-cpu/-/mod-os-cpu-1.0.0.tgz' 11 | os: 12 | - '!foo' 13 | - mockOs 14 | - aix 15 | - darwin 16 | - linux 17 | - win32 18 | cpu: 19 | - '!bar' 20 | - mockCpu 21 | - arm 22 | - arm64 23 | - ia32 24 | - x32 25 | - x64 26 | dist-tags: 27 | latest: 1.0.0 28 | _rev: 9-f5a60b1743717bf9 29 | readme: | 30 | #mod-os-cpu 31 | _attachments: {} 32 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/build-local/step-03/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const Fs = require("opfs"); 4 | const Path = require("path"); 5 | const rimraf = require("rimraf"); 6 | 7 | module.exports = { 8 | title: "should install and run build when a local dep changed", 9 | buildLocal: true, 10 | forceInstall: false, 11 | async before() { 12 | const e1Dir = Path.join(__dirname, "../../../fixtures/e1"); 13 | const fileName = Path.join(e1Dir, "package.json"); 14 | const pkg = JSON.parse(await Fs.readFile(fileName)); 15 | pkg.scripts.install = "node index.js hello.js"; 16 | await Fs.writeFile(fileName, JSON.stringify(pkg, null, 2)); 17 | rimraf.sync(Path.join(e1Dir, "dist")); 18 | } 19 | }; 20 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fynpo-sample/step-02/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .f: 3 | .fyn.json: file 4 | _: 5 | dep-on-pkg1: 6 | 1.0.0-fynlocal_h: 7 | dep-on-pkg1: 8 | package.json: 9 | id: dep-on-pkg1@1.0.0-fynlocal_h 10 | pkg1: 11 | 1.0.0-fynlocal_h: 12 | pkg1: 13 | package.json: 14 | id: pkg1@1.0.0-fynlocal_h 15 | pkg2: 16 | 1.0.0-fynlocal_h: 17 | pkg2: 18 | package.json: 19 | id: pkg2@1.0.0-fynlocal_h 20 | dep-on-pkg1: "-> .f/_/dep-on-pkg1/1.0.0-fynlocal_h/dep-on-pkg1" 21 | pkg1: "-> .f/_/pkg1/1.0.0-fynlocal_h/pkg1" 22 | pkg2: "-> .f/_/pkg2/1.0.0-fynlocal_h/pkg2" 23 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/nested-dep/step-02/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | top: 3 | C: ^3 4 | A: ^1 5 | E: ^1.0 6 | D: ^1.0 7 | A: ^2 8 | F: ^1 9 | A: ^1 || ^2 10 | 11 | Should resolve: 12 | E@1.0 13 | C@3.0 14 | D@1.0 15 | A@1.0 <-- C's dep 16 | F@1.0 17 | __fv_ 18 | A@2.0 <-- D's dep 19 | 20 | TODO: F's A --> A@1.0, should've gotten A@2.0 from D's dep 21 | */ 22 | 23 | const rimraf = require("rimraf"); 24 | const Path = require("path"); 25 | 26 | module.exports = { 27 | title: "should resolve non-top parent's version for nested dep", 28 | timeout: 20000, 29 | before: cwd => { 30 | rimraf.sync(Path.join(cwd, "fyn-lock.yaml")); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /packages/fyn/lib/log-items.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const VisualLogger = require("visual-logger"); 4 | const FETCH_META = "fetch meta"; 5 | const FETCH_PACKAGE = "fetch package"; 6 | const LONG_WAIT_META = "meta still pending"; 7 | const LOAD_PACKAGE = "load package"; 8 | const LONG_WAIT_PACKAGE = "package pending fetch"; 9 | const INSTALL_PACKAGE = "install package"; 10 | const NETWORK_ERROR = "network error"; 11 | const OPTIONAL_RESOLVER = "optional resolver"; 12 | const spinner = VisualLogger.spinners[1]; 13 | 14 | module.exports = { 15 | FETCH_META, 16 | FETCH_PACKAGE, 17 | LONG_WAIT_META, 18 | LOAD_PACKAGE, 19 | LONG_WAIT_PACKAGE, 20 | INSTALL_PACKAGE, 21 | NETWORK_ERROR, 22 | OPTIONAL_RESOLVER, 23 | spinner 24 | }; 25 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mock-npm/metas/mod-f.yml: -------------------------------------------------------------------------------- 1 | etag: mod-f-1 2 | name: mod-f 3 | versions: 4 | 1.0.0: 5 | name: mod-f 6 | description: test fixture mod-f 7 | version: 1.0.0 8 | dependencies: 9 | mod-a: ^1.0.0 || ^2.0.0 10 | dist: 11 | shasum: '' 12 | tarball: 'http://localhost:4873/mod-f/-/mod-f-1.0.0.tgz' 13 | 2.1.1: 14 | name: mod-f 15 | description: test fixture mod-f 16 | version: 2.1.1 17 | dependencies: {} 18 | peerDependencies: 19 | mod-a: ^0.3.0 20 | dist: 21 | shasum: '' 22 | tarball: 'http://localhost:4873/mod-f/-/mod-f-2.1.1.tgz' 23 | dist-tags: 24 | latest: 2.1.1 25 | _rev: 9-f5a60b1743717bf9 26 | readme: | 27 | #mod-f 28 | _attachments: {} 29 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fynpo-sample/step-02/index.js: -------------------------------------------------------------------------------- 1 | const Fs = require("fs"); 2 | const Path = require("path"); 3 | const { expect } = require("chai"); 4 | 5 | module.exports = { 6 | title: "should handle a fynpo monorepo", 7 | pkgDir: "@scope/pkg-2", 8 | timeout: 10000, 9 | async before(cwd, scenarioDir) { 10 | try { 11 | Fs.unlinkSync(Path.join(scenarioDir, ".fynpo-data.json")); 12 | } catch (_err) { 13 | // 14 | } 15 | }, 16 | async verify(cwd, scenarioDir) { 17 | const fynData = JSON.parse(Fs.readFileSync(Path.join(scenarioDir, ".fynpo-data.json"))); 18 | const eData = JSON.parse(Fs.readFileSync(Path.join(__dirname, "_fynpo-data.json"))); 19 | expect(fynData.indirects).to.deep.equal(eData.indirects); 20 | } 21 | }; 22 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/optional-check/step-01/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .f: 3 | .fyn.json: file 4 | _: 5 | mod-a: 6 | 2.0.0: 7 | mod-a: 8 | package.json: 9 | id: mod-a@2.0.0 10 | mod-d: 11 | 1.0.1: 12 | mod-d: 13 | package.json: 14 | id: mod-d@1.0.1 15 | mod-e: 16 | 1.0.0: 17 | mod-e: 18 | package.json: 19 | id: mod-e@1.0.0 20 | mod-f: 21 | 1.0.0: 22 | mod-f: 23 | package.json: 24 | id: mod-f@1.0.0 25 | mod-a: '-> .f/_/mod-a/2.0.0/mod-a' 26 | mod-d: '-> .f/_/mod-d/1.0.1/mod-d' 27 | mod-e: '-> .f/_/mod-e/1.0.0/mod-e' 28 | mod-f: '-> .f/_/mod-f/1.0.0/mod-f' 29 | -------------------------------------------------------------------------------- /testing/monorepo-test/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "monorepo-test", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "homepage": "", 7 | "license": "UNLICENSED", 8 | "private": true, 9 | "scripts": { 10 | "test": "node ../../packages/fyn/cli/fyn --no-build-local && fynpo && fynpo run test --stream", 11 | "clean-test": "npm run clean && npm run test", 12 | "clean": "rm -rf .fynpo node_modules */*/node_modules */*/dist */*/fyn-lock.* fyn-lock.*", 13 | "prepublishOnly": "exit 1" 14 | }, 15 | "author": "", 16 | "files": [], 17 | "keywords": [], 18 | "repository": { 19 | "type": "git", 20 | "url": "" 21 | }, 22 | "dependencies": { 23 | "fynpo": "../../packages/fynpo", 24 | "fyn": "../../packages/fyn" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /packages/fyn/bin/bundle.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var maj = parseInt(process.versions.node.split(".")[0], 10); 4 | 5 | if (maj >= 8) { 6 | try { 7 | require("../dist/v8-compile-cache"); 8 | } catch (err) { 9 | if ( 10 | // is error caused by module not found? 11 | (err.code && 12 | err.code !== "MODULE_NOT_FOUND" && 13 | err.message.indexOf("Cannot find module") < 0) || 14 | // is the not found module the one we are trying to require? 15 | err.message.indexOf("v8-compile-cache") < 0 16 | ) { 17 | console.log(`Failed loading v8-compile-cache`, err); 18 | } 19 | } 20 | module.exports = "../dist/fyn.js"; 21 | } else { 22 | console.log("Sorry, fyn does not support node version below 8. Your version is", maj); 23 | process.exit(1); 24 | } 25 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/add-remove-pkg/step-02/lock.yaml: -------------------------------------------------------------------------------- 1 | $fyn: 2 | layout: detail 3 | $pkg: 4 | dep: 5 | mod-a: ^2.0.0 6 | dev: 7 | mod-d: ^1.0.0 8 | mod-a: 9 | _latest: 2.0.0 10 | _: 11 | ^2.0.0: 2.0.0 12 | 2.0.0: 13 | top: 1 14 | $: sha1-A14kUd8F5xnolX2Pq2UBNeUUd94= 15 | _: 'https://registry.npmjs.org/mod-a/-/mod-a-2.0.0.tgz' 16 | dependencies: 17 | mod-b: ^2.0.0 18 | mod-b: 19 | _latest: 2.0.0 20 | _: 21 | ^2.0.0: 2.0.0 22 | 2.0.0: 23 | $: sha1-08ELWBWzFomlG3x9hDQYJTU6I4I= 24 | _: 'https://registry.npmjs.org/mod-b/-/mod-b-2.0.0.tgz' 25 | mod-d: 26 | _latest: 1.0.0 27 | _: 28 | ^1.0.0: 1.0.0 29 | 1.0.0: 30 | top: 1 31 | $: sha1-VNntO9nFKWIr3Bh0ABEo6IiRRug= 32 | _: 'https://registry.npmjs.org/mod-d/-/mod-d-1.0.0.tgz' 33 | dependencies: 34 | mod-b: ^2.0.0 35 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-dedupe/step-02/lock.yaml: -------------------------------------------------------------------------------- 1 | $fyn: 2 | layout: detail 3 | $pkg: 4 | dep: 5 | mod-a: ^0.5.0 6 | mod-i: ^1.0.0 7 | mod-a: 8 | _latest: 2.0.0 9 | _: 10 | ^0.5.0: 0.5.0 11 | 0.5.0: 12 | top: 1 13 | $: sha1-FaSOf8CE8w8hsTkOCl3SnvMXkPs= 14 | _: "http://localhost:64493/mod-a/-/mod-a-0.5.0.tgz" 15 | dependencies: 16 | mod-g: ^3.0.11 17 | mod-g: 18 | _latest: 3.0.11 19 | _: 20 | "^3.0.0,^3.0.11": 3.0.11 21 | 3.0.11: 22 | $: sha1-unYPh4siki2HKK5qe4jHTZgcxUI= 23 | _: "http://localhost:64493/mod-g/-/mod-g-3.0.11.tgz" 24 | mod-i: 25 | _latest: 1.0.0 26 | _: 27 | ^1.0.0: 1.0.0 28 | 1.0.0: 29 | top: 1 30 | $: 0 31 | _: "http://localhost:50387/mod-i/-/mod-i-1.0.0.tgz" 32 | dependencies: 33 | mod-g: ^3.0.0 34 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-major/step-02/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .f: 3 | .fyn.json: file 4 | _: 5 | mod-a: 6 | 0.3.2: 7 | mod-a: 8 | package.json: 9 | id: mod-a@0.3.2 10 | 2.0.0: 11 | mod-a: 12 | package.json: 13 | id: mod-a@2.0.0 14 | mod-b: 15 | 2.0.0: 16 | mod-b: 17 | node_modules: 18 | mod-a: '-> ../../../../mod-a/2.0.0/mod-a' 19 | package.json: 20 | id: mod-b@2.0.0 21 | mod-g: 22 | 3.0.11: 23 | mod-g: 24 | package.json: 25 | id: mod-g@3.0.11 26 | mod-a: '-> .f/_/mod-a/0.3.2/mod-a' 27 | mod-b: '-> .f/_/mod-b/2.0.0/mod-b' 28 | mod-g: '-> .f/_/mod-g/3.0.11/mod-g' 29 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/fynpo-sample/step-01/index.js: -------------------------------------------------------------------------------- 1 | const Fs = require("fs"); 2 | const Path = require("path"); 3 | const { expect } = require("chai"); 4 | 5 | module.exports = { 6 | title: "should add a package from fynpo monorepo", 7 | pkgDir: ".ignore-dir", 8 | timeout: 10000, 9 | getArgs(options) { 10 | return [].concat(options.baseArgs).concat([`--layout=detail`, `add`, `../packages/pkg2`]); 11 | }, 12 | async before(cwd, scenarioDir) { 13 | try { 14 | Fs.unlinkSync(Path.join(scenarioDir, ".fynpo-data.json")); 15 | } catch (_err) { 16 | // 17 | } 18 | }, 19 | async verify(cwd, scenarioDir) { 20 | expect( 21 | Fs.existsSync(Path.join(scenarioDir, ".fynpo-data.json")), 22 | ".fynpo-data.json should not exist" 23 | ).equal(false); 24 | } 25 | }; 26 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-dedupe-2/step-02/lock.yaml: -------------------------------------------------------------------------------- 1 | $fyn: 2 | layout: detail 3 | $pkg: 4 | dep: 5 | mod-i: ^1.0.0 6 | mod-j: ^1.0.0 7 | mod-g: 8 | _latest: 3.0.11 9 | _: 10 | "^3.0.0,^3.0.11": 3.0.11 11 | 3.0.11: 12 | $: sha1-unYPh4siki2HKK5qe4jHTZgcxUI= 13 | _: "http://localhost:64549/mod-g/-/mod-g-3.0.11.tgz" 14 | mod-i: 15 | _latest: 1.0.0 16 | _: 17 | ^1.0.0: 1.0.0 18 | 1.0.0: 19 | top: 1 20 | $: 0 21 | _: "http://localhost:50387/mod-i/-/mod-i-1.0.0.tgz" 22 | dependencies: 23 | mod-g: ^3.0.0 24 | mod-j: 25 | _latest: 1.0.0 26 | _: 27 | ^1.0.0: 1.0.0 28 | 1.0.0: 29 | top: 1 30 | $: sha1-vlkRZcmQbJGsRvz18HUBoQJMvDw= 31 | _: "http://localhost:64549/mod-j/-/mod-j-1.0.0.tgz" 32 | dependencies: 33 | mod-g: ^3.0.11 34 | -------------------------------------------------------------------------------- /packages/fyn/lib/util/base-util.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | /* eslint-disable max-params, no-param-reassign */ 4 | 5 | const _ = require("lodash"); 6 | const Promise = require("bluebird"); 7 | 8 | exports.isWin32 = process.platform === "win32"; 9 | 10 | exports.retry = function retry(func, checks, tries, wait) { 11 | let p = Promise.try(func); 12 | 13 | if (!_.isEmpty(checks) && tries > 0 && wait > 0) { 14 | p = p.catch(err => { 15 | if (tries <= 0) throw err; 16 | tries--; 17 | return Promise.try(() => 18 | Array.isArray(checks) ? checks.indexOf(err.code) >= 0 : checks(err) 19 | ).then(canRetry => { 20 | if (!canRetry) throw err; 21 | return Promise.delay(wait).then(() => retry(func, checks, tries, wait)); 22 | }); 23 | }); 24 | } 25 | 26 | return p; 27 | }; 28 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-npm-dedupe/README.md: -------------------------------------------------------------------------------- 1 | # Scenario 2 | 3 | - scenario: 4 | 5 | `pkg A -> B@^1.0.0 and install B@1.0.0 in lockfile` 6 | 7 | - User add to `package.json` `Pkg X -> new B@^1.1.0` 8 | 9 | - Without dedupe, this cause B to have versions 1.0.0 and 1.1.0 installed 10 | 11 | - This scenario uses package-lock.json that npm created with the above duplication 12 | 13 | # Expect Behavior 14 | 15 | Should detect indirect locked version got changed and de-dupe versions from npm lock data 16 | 17 | # package-lock.json 18 | 19 | npm's package-lock.json is generated: 20 | 21 | 1. make sure `mod-g` having only `3.0.0` 22 | 2. install with `mod-i@^1.0.0` as dependencies 23 | 3. add `mod-g` version `3.0.11` 24 | 4. `npm install mod-j@^1.0.0` which depends on `mod-g@^3.0.11` 25 | 26 | > npm version used: 6.14.10 27 | -------------------------------------------------------------------------------- /packages/fynpo/src/npm-run-script.ts: -------------------------------------------------------------------------------- 1 | /* copied from https://github.com/lerna/lerna/blob/main/utils/npm-run-script/npm-run-script.js */ 2 | import { spawnStreaming, exec } from "./child-process"; 3 | 4 | const makeOpts = (pkg, reject) => { 5 | return { 6 | cwd: pkg.path, 7 | reject, 8 | pkg, 9 | }; 10 | }; 11 | 12 | export const npmRunScript = (script, { args, npmClient, pkg, reject = true }) => { 13 | const argv = ["run", script, ...args]; 14 | const opts = makeOpts(pkg, reject); 15 | 16 | return exec(npmClient, argv, opts); 17 | }; 18 | 19 | export const npmRunScriptStreaming = (script, { args, npmClient, pkg, prefix, reject = true }) => { 20 | const argv = ["run", script, ...args]; 21 | const opts = makeOpts(pkg, reject); 22 | 23 | return spawnStreaming(npmClient, argv, opts, prefix && pkg.name); 24 | }; 25 | -------------------------------------------------------------------------------- /packages/fynpo/templates/fynpo.config.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | changeLogMarkers: ["## Packages", "## Commits"], 5 | command: { publish: { tags: {}, versionTagging: {} } }, 6 | commitlint: { 7 | extends: ["@commitlint/config-conventional"], 8 | parserPreset: { 9 | parserOpts: { 10 | headerPattern: /^\[([^\]]+)\] ?(\[[^\]]+\])? +(.+)$/, 11 | headerCorrespondence: ["type", "scope", "subject"], 12 | }, 13 | }, 14 | rules: { "type-enum": [2, "always", ["patch", "minor", "major", "chore"]] }, 15 | ignores: [ 16 | (commit) => 17 | commit.startsWith("[Publish]") || commit.includes("Update changelog"), 18 | ], 19 | defaultIgnores: true, 20 | helpUrl: 21 | "https://github.com/conventional-changelog/commitlint/#what-is-commitlint", 22 | }, 23 | }; 24 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/add-remove-pkg/step-02/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .bin: {} 3 | .f: 4 | .fyn.json: file 5 | _: 6 | mod-a: 7 | 2.0.0: 8 | mod-a: 9 | .npmignore: file 10 | LICENSE: file 11 | README.md: file 12 | package.json: 13 | id: mod-a@2.0.0 14 | mod-b: 15 | 2.0.0: 16 | mod-b: 17 | LICENSE: file 18 | README.md: file 19 | package.json: 20 | id: mod-b@2.0.0 21 | mod-d: 22 | 1.0.0: 23 | mod-d: 24 | LICENSE: file 25 | README.md: file 26 | package.json: 27 | id: mod-d@1.0.0 28 | mod-a: "-> .f/_/mod-a/2.0.0/mod-a" 29 | mod-b: "-> .f/_/mod-b/2.0.0/mod-b" 30 | mod-d: "-> .f/_/mod-d/1.0.0/mod-d" 31 | -------------------------------------------------------------------------------- /packages/create-fynpo/templates/fynpo.config.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | changeLogMarkers: ["## Packages", "## Commits"], 5 | command: { publish: { tags: {}, versionTagging: {} } }, 6 | commitlint: { 7 | extends: ["@commitlint/config-conventional"], 8 | parserPreset: { 9 | parserOpts: { 10 | headerPattern: /^\[([^\]]+)\] ?(\[[^\]]+\])? +(.+)$/, 11 | headerCorrespondence: ["type", "scope", "subject"], 12 | }, 13 | }, 14 | rules: { "type-enum": [2, "always", ["patch", "minor", "major", "chore"]] }, 15 | ignores: [ 16 | (commit) => 17 | commit.startsWith("[Publish]") || commit.includes("Update changelog"), 18 | ], 19 | defaultIgnores: true, 20 | helpUrl: 21 | "https://github.com/conventional-changelog/commitlint/#what-is-commitlint", 22 | }, 23 | }; 24 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/platform-check-good/step-01/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .bin: 3 | bin1: '-> ../.f/_/mod-g/2.0.1/mod-g/bin/bin1.js' 4 | bin2: '-> ../.f/_/mod-g/2.0.1/mod-g/bin/bin2.js' 5 | .f: 6 | .fyn.json: file 7 | _: 8 | mod-a: 9 | 1.1.2: 10 | mod-a: 11 | package.json: 12 | id: mod-a@1.1.2 13 | mod-g: 14 | 2.0.1: 15 | mod-g: 16 | bin: 17 | bin1.js: file 18 | bin2.js: file 19 | package.json: 20 | id: mod-g@2.0.1 21 | mod-os-cpu: 22 | 1.0.0: 23 | mod-os-cpu: 24 | package.json: 25 | id: mod-os-cpu@1.0.0 26 | mod-a: '-> .f/_/mod-a/1.1.2/mod-a' 27 | mod-g: '-> .f/_/mod-g/2.0.1/mod-g' 28 | mod-os-cpu: '-> .f/_/mod-os-cpu/1.0.0/mod-os-cpu' 29 | -------------------------------------------------------------------------------- /docusaurus/docs/commands/prepare.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: prepare 3 | title: fynpo prepare 4 | --- 5 | 6 | :::note 7 | Install [fynpo-cli](/docs/packages#fynpo-cli) for global access of fynpo command 8 | ::: 9 | 10 | ## Usage 11 | 12 | ``` 13 | fynpo prepare 14 | ``` 15 | 16 | Read changed packages and their versions from `CHANGELOG.md`, modify package metadata to reflect new release, commit and tag the changes. 17 | 18 | ## Options 19 | 20 | **`--no-commit`** 21 | 22 | By default, `fynpo prepare` will commit the changes to packages with the commit message `[Publish]...`. Pass `--no-commit` to disable this behavior. 23 | 24 | ``` 25 | fynpo prepare --no-commit 26 | ``` 27 | 28 | **`--tag`** 29 | 30 | If `--tag` option is passed, `prepare` will create individual tags for each changed packages. 31 | 32 | ``` 33 | fynpo prepare --tag 34 | ``` 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/local-hard-linking/step-04/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .bin: 3 | bin1: "-> ../.f/_/mod-h/1.0.0/mod-h/bin/bin1.js" 4 | bin2: "-> ../.f/_/mod-h/1.0.0/mod-h/bin/bin2.js" 5 | .f: 6 | .fyn.json: file 7 | _: 8 | e1: 9 | 1.0.0-fynlocal_h: 10 | e1: 11 | index.js: file 12 | index.js.fyn.map: file 13 | node_modules: 14 | mod-h: "-> ../../../../mod-h/3.0.11/mod-h" 15 | package.json: 16 | id: e1@1.0.0-fynlocal_h 17 | mod-h: 18 | 1.0.0: 19 | mod-h: 20 | package.json: 21 | id: mod-h@1.0.0 22 | 3.0.11: 23 | mod-h: 24 | package.json: 25 | id: mod-h@3.0.11 26 | e1: "-> .f/_/e1/1.0.0-fynlocal_h/e1" 27 | mod-h: "-> .f/_/mod-h/1.0.0/mod-h" 28 | -------------------------------------------------------------------------------- /packages/fyn/lib/constants.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = { 4 | MARK_URL_SPEC: "~url-spec~", 5 | // FYN_IGNORE_FILE: "__fyn_ignore__", 6 | // to be deprecated: no longer use the flat module setup 7 | // /*deprecated*/ FYN_RESOLUTIONS_JSON: "__fyn_resolutions__.json", 8 | // /*deprecated*/ FYN_LINK_JSON: "__fyn_link__.json", 9 | PACKAGE_FYN_JSON: "package-fyn.json", 10 | // 11 | // Save a config file to output dir (node_modules) to remember the 12 | // config used to do install. Mainly added to remember central store 13 | // dir because if user run install on an exist node_modules that 14 | // used central store without specifying the flag again, we still 15 | // need to run install with central store pointing to the original dir. 16 | // 17 | FYN_INSTALL_CONFIG_FILE: ".fyn.json", 18 | FV_DIR: ".f", 19 | FYN_LOCK_FILE: "fyn-lock.yaml" 20 | }; 21 | -------------------------------------------------------------------------------- /docs/assets/js/1.ffc6cf64.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. 3 | 4 | Permission to use, copy, modify, and/or distribute this software for any 5 | purpose with or without fee is hereby granted. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 8 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 9 | AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 10 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 11 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 12 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 13 | PERFORMANCE OF THIS SOFTWARE. 14 | ***************************************************************************** */ 15 | -------------------------------------------------------------------------------- /packages/fyn/lib/util/path-up-each.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | /* eslint-disable no-param-reassign */ 4 | 5 | const Path = require("path"); 6 | 7 | /* 8 | * Take a path and do "cd .." on it, pushing each new dir 9 | * into an array, until either: 10 | * 11 | * 1. Can't "cd .."" anymore 12 | * 2. The array stopping contains Path.basename(dir) 13 | * 14 | * stopping can also be a callback that returns true to 15 | * stop the process. 16 | */ 17 | 18 | module.exports = function pathUpEach(path, stopping) { 19 | const found = []; 20 | 21 | if (Array.isArray(stopping)) { 22 | const arr = stopping; 23 | stopping = x => arr.indexOf(Path.basename(x)) >= 0; 24 | } 25 | 26 | while (path && path !== "." && !stopping(path)) { 27 | found.push(path); 28 | const tmp = Path.join(path, ".."); 29 | if (tmp === path) break; 30 | path = tmp; 31 | } 32 | 33 | return found; 34 | }; 35 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/auto-deep-resolve/step-01/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .f: 3 | _: 4 | mod-a: 5 | 4.0.1: 6 | mod-a: 7 | package.json: 8 | id: mod-a@4.0.1 9 | mod-b: 10 | 3.0.0: 11 | mod-b: 12 | package.json: 13 | id: mod-b@3.0.0 14 | mod-c: 15 | 4.0.0: 16 | mod-c: 17 | package.json: 18 | id: mod-c@4.0.0 19 | mod-d: 20 | 4.2.1: 21 | mod-d: 22 | package.json: 23 | id: mod-d@4.2.1 24 | mod-e: 25 | 3.0.0: 26 | mod-e: 27 | package.json: 28 | id: mod-e@3.0.0 29 | mod-a: '-> .f/_/mod-a/4.0.1/mod-a' 30 | mod-b: '-> .f/_/mod-b/3.0.0/mod-b' 31 | mod-c: '-> .f/_/mod-c/4.0.0/mod-c' 32 | mod-d: '-> .f/_/mod-d/4.2.1/mod-d' 33 | mod-e: '-> .f/_/mod-e/3.0.0/mod-e' 34 | -------------------------------------------------------------------------------- /packages/fyn/yarn/src/errors.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | export class MessageError extends Error { 4 | constructor(msg: string, code?: string) { 5 | super(msg); 6 | this.code = code; 7 | } 8 | 9 | code: ?string; 10 | } 11 | 12 | export class ProcessSpawnError extends MessageError { 13 | constructor(msg: string, code?: string, process?: string) { 14 | super(msg, code); 15 | this.process = process; 16 | } 17 | 18 | process: ?string; 19 | } 20 | 21 | export class SecurityError extends MessageError {} 22 | 23 | export class ProcessTermError extends MessageError { 24 | EXIT_CODE: ?number; 25 | EXIT_SIGNAL: ?string; 26 | } 27 | 28 | export class ResponseError extends Error { 29 | constructor(msg: string, responseCode: number) { 30 | super(msg); 31 | this.responseCode = responseCode; 32 | } 33 | 34 | responseCode: number; 35 | } 36 | 37 | export class OneTimePasswordError extends Error {} 38 | -------------------------------------------------------------------------------- /packages/create-fynpo/templates/_gitignore: -------------------------------------------------------------------------------- 1 | ### OSX ### 2 | .DS_Store 3 | .AppleDouble 4 | .LSOverride 5 | 6 | # Thumbnails 7 | ._* 8 | 9 | # Files that might appear in the root of a volume 10 | .DocumentRevisions-V100 11 | .fseventsd 12 | .Spotlight-V100 13 | .TemporaryItems 14 | .Trashes 15 | .VolumeIcon.icns 16 | 17 | # Directories potentially created on remote AFP share 18 | .AppleDB 19 | .AppleDesktop 20 | Network Trash Folder 21 | Temporary Items 22 | .apdisk 23 | 24 | ### Node ### 25 | # Logs 26 | logs 27 | *.log 28 | npm-debug.log* 29 | fynpo-debug.log* 30 | 31 | # Runtime data 32 | pids 33 | *.pid 34 | *.seed 35 | 36 | # Coverage directory used by tools like istanbul 37 | coverage 38 | 39 | # nyc test coverage 40 | .nyc_output 41 | 42 | # Dependency directories 43 | node_modules/ 44 | 45 | # Output directory of typescript compilation 46 | lib 47 | **/lib/* 48 | 49 | .tmp 50 | .fynpo 51 | *-lock.* 52 | **.tsbuildinfo 53 | -------------------------------------------------------------------------------- /docs/assets/js/22.8d440061.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[22],{105:function(e,t,a){"use strict";a.r(t);var n=a(0),o=a.n(n),l=a(102),r=a(96);t.default=function(){return o.a.createElement(l.a,{title:"Page Not Found"},o.a.createElement("main",{className:"container margin-vert--xl"},o.a.createElement("div",{className:"row"},o.a.createElement("div",{className:"col col--6 col--offset-3"},o.a.createElement("h1",{className:"hero__title"},o.a.createElement(r.a,{id:"theme.NotFound.title",description:"The title of the 404 page"},"Page Not Found")),o.a.createElement("p",null,o.a.createElement(r.a,{id:"theme.NotFound.p1",description:"The first paragraph of the 404 page"},"We could not find what you were looking for.")),o.a.createElement("p",null,o.a.createElement(r.a,{id:"theme.NotFound.p2",description:"The 2nd paragraph of the 404 page"},"Please contact the owner of the site that linked you to the original URL and let them know their link is broken."))))))}}}]); -------------------------------------------------------------------------------- /packages/fynpo/__tests__/fynpo.test.ts: -------------------------------------------------------------------------------- 1 | import shcmd from "shcmd"; 2 | import { describe, it, expect } from "@jest/globals"; 3 | 4 | const execBootstrap = () => { 5 | const command = "node --require ts-node/register ../../src/fynpo"; 6 | shcmd.pushd("-q", "test/sample"); 7 | shcmd.exec(command); 8 | }; 9 | 10 | const clearPackages = () => { 11 | shcmd.cd("packages/pkg1"); 12 | shcmd.rm("-rf", "node_modules"); 13 | 14 | shcmd.cd("../pkg2"); 15 | shcmd.rm("-rf", "node_modules"); 16 | 17 | shcmd.popd("-q"); 18 | }; 19 | 20 | describe("test bootstrap command", () => { 21 | it("exec bootstrap", () => { 22 | execBootstrap(); 23 | 24 | shcmd.cd("packages/pkg1"); 25 | let files = shcmd.ls(); 26 | expect(files).toContain("node_modules"); 27 | 28 | shcmd.cd("../pkg2"); 29 | files = shcmd.ls(); 30 | expect(files).toContain("node_modules"); 31 | 32 | shcmd.cd("../.."); 33 | clearPackages(); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /packages/fyn/npm-behavior.md: -------------------------------------------------------------------------------- 1 | # Record npm behaviors tested 2 | 3 | ## Resolve of `^` semver to `~`. 4 | 5 | `package.json` dependencies layout: 6 | 7 | ```yml 8 | top: 9 | foo-xa: 10 | bar: "~1.4.0" 11 | foo-xb: 12 | bar: "^1.4.0" 13 | ``` 14 | 15 | While `bar` has: 16 | 17 | ``` 18 | 1.4.1 19 | 1.4.2 20 | 1.4.3 21 | 1.5.0 22 | 1.5.1 23 | 1.5.2 24 | 1.6.0 25 | 1.6.1 26 | ``` 27 | 28 | - `"~1.4.0"` can only resolve up to `1.4.3` 29 | - `"^1.4.0"` can resolve up to `1.6.1` 30 | 31 | ### npm behavior 32 | 33 | Tested with `npm@5.6.0` and `npm@6.4.1`. Same results: 34 | 35 | With both `foo-xa` and `foo-xb`: 36 | 37 | - `"~1.4.0"` is encountered first and resolve to `1.4.3` 38 | - `"^1.4.0"` will resolve to the same `1.4.3` 39 | - However, `npm` automatically sorts dependencies, because after moving `foo-xb` before `foo-xa`, `npm` still resolves both to `1.4.3`. 40 | 41 | With `foo-xb` only: 42 | 43 | - `"^1.4.0"` will resolve to the latest `1.6.1` 44 | -------------------------------------------------------------------------------- /packages/create-fynpo/src/index.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires*/ 2 | import { create } from "./create"; 3 | const NixClap = require("nix-clap"); 4 | 5 | const nixClap = new NixClap({ 6 | usage: "$0 [command] [options]", 7 | }).init( 8 | { 9 | commitlint: { 10 | type: "boolean", 11 | default: true, 12 | desc: "no-commitlint to skip commitlint configuration", 13 | }, 14 | }, 15 | { 16 | fynpo: { 17 | exec: create, 18 | args: "[dir]", 19 | desc: "Create a new fynpo monorepo", 20 | }, 21 | } 22 | ); 23 | 24 | function start() { 25 | if (process.argv.length > 2) { 26 | // if command is not recognize, then default to fynpo and use it as dir arg 27 | if (!["fynpo"].includes(process.argv[2])) { 28 | const argv = [].concat(process.argv.slice(0, 2), "fynpo", process.argv.slice(2)); 29 | return nixClap.parse(argv, 2); 30 | } 31 | } 32 | return nixClap.parse(); 33 | } 34 | 35 | start(); 36 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-change-major/step-02/lock.yaml: -------------------------------------------------------------------------------- 1 | $fyn: 2 | layout: detail 3 | "$pkg": 4 | "dep": 5 | "mod-a": "^0.3.0" 6 | "mod-b": "^2.0.0" 7 | mod-a: 8 | _latest: 2.0.0 9 | _: 10 | ^0.3.0: 0.3.2 11 | ^2.0.0: 2.0.0 12 | 2.0.0: 13 | $: sha1-nHVYBin65fhw+wwca7MeEkklAfc= 14 | _: "http://localhost:62754/mod-a/-/mod-a-2.0.0.tgz" 15 | 0.3.2: 16 | top: 1 17 | $: sha1-Q930PUFp8TdbWK49tGxVd9u8uYs= 18 | _: "http://localhost:62754/mod-a/-/mod-a-0.3.2.tgz" 19 | dependencies: 20 | mod-g: ^3.0.0 21 | mod-b: 22 | _latest: 1.0.0 23 | _: 24 | ^2.0.0: 2.0.0 25 | 2.0.0: 26 | top: 1 27 | $: sha1-Mj4Zoc/nmhG1VxLpjxpd7oIPQiY= 28 | _: "http://localhost:62754/mod-b/-/mod-b-2.0.0.tgz" 29 | dependencies: 30 | mod-a: ^2.0.0 31 | mod-g: 32 | _latest: 3.0.11 33 | _: 34 | ^3.0.0: 3.0.11 35 | 3.0.11: 36 | $: sha1-z5VvulYGMO/e58GbzDaYmKoVmbI= 37 | _: "http://localhost:62754/mod-g/-/mod-g-3.0.11.tgz" 38 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mock-npm/metas/mod-d.yml: -------------------------------------------------------------------------------- 1 | etag: mod-d-1 2 | name: mod-d 3 | versions: 4 | 1.0.1: 5 | name: mod-d 6 | description: test fixture mod-d 7 | version: 1.0.1 8 | dependencies: 9 | mod-a: ^2.0.0 10 | mod-f: ^1.0.0 11 | dist: 12 | shasum: '' 13 | tarball: 'http://localhost:4873/mod-d/-/mod-d-1.0.1.tgz' 14 | 3.0.1: 15 | name: mod-d 16 | description: test fixture mod-d 17 | version: 3.0.1 18 | dependencies: 19 | mod-a: ^1.0.1 20 | mod-b: ^1.0.0 21 | dist: 22 | shasum: '' 23 | tarball: 'http://localhost:4873/mod-d/-/mod-d-3.0.1.tgz' 24 | 4.2.1: 25 | name: mod-d 26 | description: test fixture mod-d 27 | version: 4.2.1 28 | dependencies: 29 | mod-e: ^3.0.0 30 | dist: 31 | shasum: '' 32 | tarball: 'http://localhost:4873/mod-d/-/mod-d-4.2.1.tgz' 33 | dist-tags: 34 | latest: 3.0.1 35 | _rev: 9-f5a60b1743717bf9 36 | readme: | 37 | #mod-c 38 | _attachments: {} 39 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/add-remove-pkg/step-01/lock.yaml: -------------------------------------------------------------------------------- 1 | $fyn: 2 | layout: detail 3 | $pkg: 4 | dep: 5 | mod-a: ^2.0.0 6 | dev: 7 | mod-d: ^1.0.0 8 | mod-g: ../../fixtures/mod-g 9 | mod-a: 10 | _latest: 2.0.0 11 | _: 12 | ^2.0.0: 2.0.0 13 | 2.0.0: 14 | top: 1 15 | $: sha1-A14kUd8F5xnolX2Pq2UBNeUUd94= 16 | _: 'https://registry.npmjs.org/mod-a/-/mod-a-2.0.0.tgz' 17 | dependencies: 18 | mod-b: ^2.0.0 19 | mod-b: 20 | _latest: 2.0.0 21 | _: 22 | ^2.0.0: 2.0.0 23 | 2.0.0: 24 | $: sha1-08ELWBWzFomlG3x9hDQYJTU6I4I= 25 | _: 'https://registry.npmjs.org/mod-b/-/mod-b-2.0.0.tgz' 26 | mod-d: 27 | _latest: 1.0.0 28 | _: 29 | ^1.0.0: 1.0.0 30 | 1.0.0: 31 | top: 1 32 | $: sha1-VNntO9nFKWIr3Bh0ABEo6IiRRug= 33 | _: 'https://registry.npmjs.org/mod-d/-/mod-d-1.0.0.tgz' 34 | dependencies: 35 | mod-b: ^2.0.0 36 | mod-g: 37 | _latest: 2.1.0-fynlocal_h 38 | _: 39 | ../../fixtures/mod-g: 2.1.0-fynlocal_h 40 | 2.1.0-fynlocal_h: 41 | top: 1 42 | $: local 43 | _: ../../fixtures/mod-g 44 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mock-npm/metas/mod-b.yml: -------------------------------------------------------------------------------- 1 | etag: mod-b-1 2 | name: mod-b 3 | versions: 4 | 1.0.0: 5 | name: mod-b 6 | description: test fixture mod-b 7 | version: 1.0.0 8 | dependencies: 9 | mod-a: ^0.2.0 10 | mod-d: ^3.0.0 11 | optionalDependencies: 12 | mod-e: ^2.0.0 13 | dist: 14 | shasum: '' 15 | tarball: 'http://localhost:4873/mod-b/-/mod-b-1.0.0.tgz' 16 | 2.0.0: 17 | name: mod-b 18 | description: test fixture mod-b 19 | version: 2.0.0 20 | dependencies: 21 | mod-a: ^2.0.0 22 | dist: 23 | shasum: '' 24 | tarball: 'http://localhost:4873/mod-b/-/mod-b-2.0.0.tgz' 25 | 3.0.0: 26 | name: mod-b 27 | description: test fixture mod-b 28 | version: 3.0.0 29 | dependencies: 30 | mod-c: ^4.0.0 31 | dist: 32 | shasum: '' 33 | tarball: 'http://localhost:4873/mod-b/-/mod-b-3.0.0.tgz' 34 | dist-tags: 35 | latest: 1.0.0 36 | _rev: 9-f5a60b1743717bf9 37 | readme: | 38 | #mod-b 39 | _attachments: {} 40 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/local-hard-linking/step-01/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .bin: 3 | bin1: "-> ../.f/_/mod-h/1.0.0-fynlocal_h/mod-h/bin/bin1.js" 4 | bin2: "-> ../.f/_/mod-g/2.0.1/mod-g/bin/bin2.js" 5 | .f: 6 | .fyn.json: file 7 | _: 8 | mod-g: 9 | 2.0.1: 10 | mod-g: 11 | bin: 12 | bin1.js: file 13 | bin2.js: file 14 | node_modules: 15 | .bin: 16 | bin1: "-> ../../bin/bin1.js" 17 | package.json: 18 | id: mod-g@2.0.1 19 | mod-h: 20 | 1.0.0-fynlocal_h: 21 | mod-h: 22 | bin: 23 | bin1.js: file 24 | bin1.js.fyn.map: file 25 | node_modules: 26 | .bin: 27 | bin1: "-> ../../../../../mod-g/2.0.1/mod-g/bin/bin1.js" 28 | package.json: 29 | id: mod-h@1.0.0-fynlocal_h 30 | mod-g: "-> .f/_/mod-g/2.0.1/mod-g" 31 | mod-h: "-> .f/_/mod-h/1.0.0-fynlocal_h/mod-h" 32 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/local-hard-linking/step-02/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .bin: 3 | bin1: "-> ../.f/_/mod-h/1.0.0-fynlocal_h/mod-h/bin/bin1.js" 4 | bin2: "-> ../.f/_/mod-g/2.0.1/mod-g/bin/bin2.js" 5 | .f: 6 | .fyn.json: file 7 | _: 8 | mod-g: 9 | 2.0.1: 10 | mod-g: 11 | bin: 12 | bin1.js: file 13 | bin2.js: file 14 | node_modules: 15 | .bin: 16 | bin1: "-> ../../bin/bin1.js" 17 | package.json: 18 | id: mod-g@2.0.1 19 | mod-h: 20 | 1.0.0-fynlocal_h: 21 | mod-h: 22 | bin: 23 | bin1.js: file 24 | bin1.js.fyn.map: file 25 | node_modules: 26 | .bin: 27 | bin1: "-> ../../../../../mod-g/2.0.1/mod-g/bin/bin1.js" 28 | package.json: 29 | id: mod-h@1.0.0-fynlocal_h 30 | mod-g: "-> .f/_/mod-g/2.0.1/mod-g" 31 | mod-h: "-> .f/_/mod-h/1.0.0-fynlocal_h/mod-h" 32 | -------------------------------------------------------------------------------- /packages/fynpo/src/read-changelog-versions.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable prefer-template, no-magic-numbers */ 2 | 3 | import Fs from "fs"; 4 | import Path from "path"; 5 | 6 | export function readChangelogVersions(dir, packages, markers) { 7 | const tags = []; 8 | const versions = {}; 9 | 10 | const check = (l) => { 11 | for (const name in packages) { 12 | const regex = new RegExp("[ `]" + name + "@([0-9]+.[0-9]+.[0-9]+)([^ `]*)[ `]"); 13 | const m = l.match(regex); 14 | if (m) { 15 | tags.push(m[0].trim().replace(/`/g, "")); 16 | versions[name] = m.slice(1, 3).join("").trim().replace(/`/g, ""); 17 | } 18 | } 19 | }; 20 | 21 | const clLines = Fs.readFileSync(Path.join(dir, "CHANGELOG.md")).toString().split("\n"); 22 | 23 | const ix1 = clLines.indexOf(markers[0]); 24 | const ix2 = clLines.indexOf(markers[1]); 25 | 26 | if (ix1 >= 0 && ix2 > ix1) { 27 | const lines = clLines.slice(ix1, ix2); 28 | lines.forEach(check); 29 | } 30 | 31 | return { tags, versions }; 32 | } 33 | -------------------------------------------------------------------------------- /packages/create-fynpo/templates/_package.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | module.exports = (base, merge) => { 4 | const pkg = { 5 | name: "root", 6 | version: "0.0.1", 7 | private: true, 8 | description: "", 9 | homepage: "", 10 | scripts: { 11 | bootstrap: "fynpo", 12 | build: "fynpo run build", 13 | test: "fynpo run test", 14 | clean: "npm run nuke && npm run nuke-packages", 15 | nuke: "rm -rf node_modules fynpo-debug.log fyn-lock.yaml", 16 | "nuke-packages": 17 | "rm -rf packages/*/node_modules packages/*/fyn-lock.yaml", 18 | }, 19 | author: { 20 | name: "", 21 | email: "", 22 | url: "", 23 | }, 24 | contributors: [], 25 | repository: { 26 | type: "git", 27 | url: "", 28 | }, 29 | license: "UNLICENSED", 30 | devDependencies: { 31 | fynpo: "^0.3.0", 32 | prettier: "^2.2.1", 33 | }, 34 | prettier: { 35 | printWidth: 100, 36 | }, 37 | }; 38 | 39 | return merge({}, pkg, base); 40 | }; 41 | -------------------------------------------------------------------------------- /docusaurus/docs/commands/publish.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: publish-cmd 3 | title: fynpo publish 4 | --- 5 | 6 | :::note 7 | Install [fynpo-cli](/docs/packages#fynpo-cli) for global access of fynpo command 8 | ::: 9 | 10 | ## Usage 11 | 12 | ``` 13 | fynpo publish 14 | ``` 15 | 16 | Publish updated packages since last release and add release tag. 17 | 18 | ## Options 19 | 20 | **`--dist-tag`** 21 | 22 | When run with this option, `fynpo publish` will publish to npm with the given npm dist-tag (defaults to latest). 23 | 24 | ``` 25 | fynpo publish --dist-tag next 26 | ``` 27 | 28 | **`--dry-run`** 29 | 30 | When run with this option, `fynpo publish` does everything publish would do except actually publishing to the registry. Reports the details of what would have been published. 31 | 32 | ``` 33 | fynpo publish --dry-run 34 | ``` 35 | 36 | **`--no-push`** 37 | 38 | By default, `fynpo publish` will push the release tag to git remote. Pass `--no-push` to disable this behavior. 39 | 40 | ``` 41 | fynpo publish --no-push 42 | ``` 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /packages/fyn/lib/symbols.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const LOCK_RSEMVERS = Symbol("lock rsemvers"); // resolved semvers from lock 4 | const SEMVER = Symbol("semver"); // depInfo semver 5 | const RSEMVERS = Symbol("rsemvers"); // resolved semvers 6 | const LOCK_SORTED_VERSIONS = Symbol("lock sorted versions"); 7 | const LATEST_TAG_VERSION = Symbol("latest tag version"); 8 | const LATEST_VERSION_TIME = Symbol("latest version time"); 9 | const SORTED_VERSIONS = Symbol("sorted versions"); 10 | const LATEST_SORTED_VERSIONS = Symbol("latest sorted versions"); 11 | const LOCAL_VERSION_MAPS = Symbol("local version maps"); 12 | const RESOLVE_ORDER = Symbol("resolve order"); 13 | const PACKAGE_RAW_INFO = Symbol("package.json raw info"); 14 | const DEP_ITEM = Symbol("dep item"); 15 | 16 | module.exports = { 17 | SEMVER, 18 | RSEMVERS, 19 | LOCK_RSEMVERS, 20 | SORTED_VERSIONS, 21 | LATEST_VERSION_TIME, 22 | LATEST_SORTED_VERSIONS, 23 | LOCK_SORTED_VERSIONS, 24 | LATEST_TAG_VERSION, 25 | LOCAL_VERSION_MAPS, 26 | RESOLVE_ORDER, 27 | PACKAGE_RAW_INFO, 28 | DEP_ITEM 29 | }; 30 | -------------------------------------------------------------------------------- /packages/fynpo/__tests__/bootstrap.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, it, expect, beforeAll } from "@jest/globals"; 2 | import { Bootstrap } from "../src/bootstrap"; 3 | import path from "path"; 4 | import { FynpoDepGraph } from "@fynpo/base"; 5 | import * as xaa from "xaa"; 6 | 7 | describe("fynpo bootstrap", () => { 8 | const dir = path.join(__dirname, "sample"); 9 | const parsed = { 10 | name: "bootstrap", 11 | opts: { 12 | cwd: dir, 13 | deps: 10, 14 | saveLog: false, 15 | tag: true, 16 | build: true, 17 | concurrency: 3, 18 | }, 19 | args: {}, 20 | argList: [], 21 | }; 22 | 23 | let bootstrap; 24 | beforeAll(async () => { 25 | const graph = new FynpoDepGraph({ cwd: path.join(__dirname, "../test/sample") }); 26 | await graph.resolve(); 27 | bootstrap = new Bootstrap(graph, parsed.opts); 28 | }); 29 | 30 | it("should initialize bootstrap class", async () => { 31 | await xaa.delay(500); 32 | expect(bootstrap._opts).toStrictEqual(parsed.opts); 33 | expect(bootstrap.failed).toEqual(0); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /packages/fyn/lib/fyn-config.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const _ = require("lodash"); 4 | const Path = require("path"); 5 | const xenvConfig = require("xenv-config"); 6 | 7 | const spec = { 8 | registry: { env: "FYN_REGISTRY", default: "http://localhost:4873" }, 9 | pkgFile: { env: "FYN_PACKAGE_FILE", default: "package.json" }, 10 | targetDir: { env: "FYN_TARGET_DIR", default: "xout" }, 11 | fynDir: { 12 | env: ["FYN_DIR", "USERPROFILE", "HOME"], 13 | default: process.cwd(), 14 | post: (v, t) => { 15 | if ((t.src === "env" && t.name !== "FYN_DIR") || t.src === "default") { 16 | return Path.join(v, ".fyn"); 17 | } 18 | return v; 19 | } 20 | } 21 | }; 22 | 23 | module.exports = function fynConfig(override) { 24 | const configKeys = Object.keys(spec); 25 | const userConfig = _.pick(override, configKeys); 26 | const config = xenvConfig(spec, userConfig, { sources: ["option", "env"] }); 27 | config.fynCacheDir = Path.join(config.fynDir, "_cacache"); 28 | config.lockfile = true; 29 | 30 | return Object.assign(config, _.omit(override, configKeys)); 31 | }; 32 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/electrode/packages/electrode-node-resolver/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electrode-node-resolver", 3 | "version": "2.0.2", 4 | "description": "Offers Node module resolvers for tools", 5 | "homepage": "http://www.electrode.io", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/electrode-io/electrode.git" 9 | }, 10 | "bugs": { 11 | "url": "https://github.com/electrode-io/electrode/issues" 12 | }, 13 | "files": [ 14 | "lib" 15 | ], 16 | "author": "Electrode (http://www.electrode.io/)", 17 | "contributors": [ 18 | "Joel Chen " 19 | ], 20 | "license": "Apache-2.0", 21 | "scripts": { 22 | "test": "", 23 | "format": "prettier --write --print-width 100 *.{js,jsx} `find . -type d -d 1 -exec echo '{}/**/*.{js,jsx}' \\; | egrep -v '(/node_modules/|/dist/|/coverage/)'`" 24 | }, 25 | "dependencies": { 26 | "require-at": "^1.0.6" 27 | }, 28 | "devDependencies": { 29 | "prettier": "^1.4.4" 30 | }, 31 | "engines": { 32 | "node": ">= 8", 33 | "npm": ">= 5" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /docusaurus/src/css/custom.css: -------------------------------------------------------------------------------- 1 | /* stylelint-disable docusaurus/copyright-header */ 2 | /** 3 | * Any CSS included here will be global. The classic template 4 | * bundles Infima by default. Infima is a CSS framework designed to 5 | * work well for content-centric websites. 6 | */ 7 | 8 | /* You can override the default Infima variables here. */ 9 | :root { 10 | --ifm-color-primary: #243858; 11 | --ifm-color-primary-dark: #20324f; 12 | --ifm-color-primary-darker: #1f304b; 13 | --ifm-color-primary-darkest: #19273e; 14 | --ifm-color-primary-light: #283e61; 15 | --ifm-color-primary-lighter: #294065; 16 | --ifm-color-primary-lightest: #2f4972; 17 | } 18 | 19 | .docusaurus-highlight-code-line { 20 | background-color: rgb(72, 77, 91); 21 | display: block; 22 | margin: 0 calc(-1 * var(--ifm-pre-padding)); 23 | padding: 0 var(--ifm-pre-padding); 24 | } 25 | 26 | .footer--dark { 27 | --ifm-footer-background-color: rgb(36 56 88); 28 | --ifm-footer-color: var(--ifm-footer-link-color); 29 | --ifm-footer-link-color: var(--ifm-color-secondary); 30 | --ifm-footer-title-color: var(--ifm-color-white); 31 | } 32 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/nested-dep/step-01/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .f: 3 | .fyn.json: file 4 | _: 5 | mod-a: 6 | 1.1.2: 7 | mod-a: 8 | package.json: 9 | id: mod-a@1.1.2 10 | 2.0.0: 11 | mod-a: 12 | package.json: 13 | id: mod-a@2.0.0 14 | mod-c: 15 | 3.0.0: 16 | mod-c: 17 | node_modules: 18 | mod-a: '-> ../../../../mod-a/1.1.2/mod-a' 19 | package.json: 20 | id: mod-c@3.0.0 21 | mod-d: 22 | 1.0.1: 23 | mod-d: 24 | package.json: 25 | id: mod-d@1.0.1 26 | mod-e: 27 | 1.0.0: 28 | mod-e: 29 | package.json: 30 | id: mod-e@1.0.0 31 | mod-f: 32 | 1.0.0: 33 | mod-f: 34 | package.json: 35 | id: mod-f@1.0.0 36 | mod-a: '-> .f/_/mod-a/2.0.0/mod-a' 37 | mod-c: '-> .f/_/mod-c/3.0.0/mod-c' 38 | mod-d: '-> .f/_/mod-d/1.0.1/mod-d' 39 | mod-e: '-> .f/_/mod-e/1.0.0/mod-e' 40 | mod-f: '-> .f/_/mod-f/1.0.0/mod-f' 41 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/auto-deep-resolve/step-01/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * opt A: 3 | * B: 4 | * C 5 | * D: 6 | * E: 7 | * B: 8 | * C 9 | * 10 | * Resolving A->B->C makes C known, so when it's seen thru D->E->B->C, it's not 11 | * resolved but used exist one directly, and C would only know about A->B->C path. 12 | * 13 | * Most of the time this is OK, but because A is optional, it could be removed 14 | * due to failures, and affects the DEBC path. 15 | * 16 | * So any known package that has only optional paths need to auto do deep resolve. 17 | */ 18 | 19 | // 20 | // this test works by making C install fail and the outcome should fail 21 | // instead of success without auto deep resolve because it would only see 22 | // the A->B->C path which is optional. 23 | // 24 | 25 | module.exports = { 26 | expectFailure: err => { 27 | if ( 28 | !err.message.includes( 29 | "exit AggregateError: Failed running npm script 'install' for package mod-c@4.0.0" 30 | ) 31 | ) { 32 | throw err; 33 | } 34 | }, 35 | title: "should auto deep resolve deps that has optional only" 36 | }; 37 | -------------------------------------------------------------------------------- /packages/fyn/test/spec/util/path-up-each.spec.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const pathUpEach = require("../../../lib/util/path-up-each"); 4 | 5 | describe("path-up-each", function() { 6 | it("should return empty if path immediately triggers stop", () => { 7 | const found = pathUpEach("/test/foo", ["foo"]); 8 | expect(found).to.deep.equal([]); 9 | }); 10 | 11 | it("should find one if stopping triggers on first up", () => { 12 | const found = pathUpEach("/test/foo/blah", ["foo"]); 13 | expect(found).to.deep.equal(["/test/foo/blah"]); 14 | }); 15 | 16 | it("should take callback for stopping", () => { 17 | const found = pathUpEach("/test/foo/bar", x => x === "/test"); 18 | expect(found).to.deep.equal(["/test/foo/bar", "/test/foo"]); 19 | }); 20 | 21 | it("should stop if can't cd .. further", () => { 22 | let found = pathUpEach("", ["foo"]); 23 | expect(found).to.deep.equal([]); 24 | found = pathUpEach("/foo/test", []); 25 | expect(found).to.deep.equal(["/foo/test", "/foo", "/"]); 26 | found = pathUpEach("foo/test", []); 27 | expect(found).to.deep.equal(["foo/test", "foo"]); 28 | }); 29 | }); 30 | -------------------------------------------------------------------------------- /packages/fynpo/__tests__/utils.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, it, expect, afterAll } from "@jest/globals"; 2 | import { loadConfig } from "../src/utils"; 3 | import path from "path"; 4 | import fs from "fs"; 5 | import shcmd from "shcmd"; 6 | 7 | describe("loadConfig", () => { 8 | const dir = path.join(__dirname, "../test/sample"); 9 | 10 | afterAll(() => { 11 | shcmd.rm("-f", path.join(dir, "fynpo.json")); 12 | }); 13 | 14 | const makeConfigFile = (fileName, data) => { 15 | const filePath = path.join(dir, fileName); 16 | fs.writeFileSync(filePath, JSON.stringify(data)); 17 | }; 18 | 19 | it("should load lerna config", () => { 20 | makeConfigFile("lerna.json", { fynpo: true }); 21 | 22 | const config: any = loadConfig(dir); 23 | expect(config.fynpoRc).toHaveProperty("fynpo"); 24 | expect(config.fynpoRc.fynpo).toEqual(true); 25 | }); 26 | 27 | it("should load fynpo config", () => { 28 | makeConfigFile("fynpo.json", { test: "123" }); 29 | 30 | const config: any = loadConfig(dir); 31 | expect(config.fynpoRc).toHaveProperty("test"); 32 | expect(config.fynpoRc.test).toEqual("123"); 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /packages/fynpo/__tests__/topo-runner.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, it, expect, beforeAll } from "@jest/globals"; 2 | import { TopoRunner } from "../src/topo-runner"; 3 | import path from "path"; 4 | import { FynpoDepGraph } from "@fynpo/base"; 5 | 6 | describe("fynpo topo-runner", () => { 7 | const dir = path.join(__dirname, "sample"); 8 | const parsed = { 9 | name: "test", 10 | opts: { 11 | cwd: dir, 12 | deps: 10, 13 | saveLog: false, 14 | tag: true, 15 | build: true, 16 | concurrency: 3, 17 | }, 18 | args: {}, 19 | argList: [], 20 | }; 21 | 22 | let runner; 23 | beforeAll(async () => { 24 | const graph = new FynpoDepGraph({ cwd: path.join(__dirname, "../test/sample") }); 25 | await graph.resolve(); 26 | runner = new TopoRunner(graph.getTopoSortPackages(), parsed.opts); 27 | }); 28 | 29 | it("should not add packages with pending dependencies", () => { 30 | const queue = runner.getMore(); 31 | expect(queue).toHaveLength(2); 32 | expect(queue[0].depData.pkgInfo.name).toStrictEqual("pkg2"); 33 | expect(queue[1].depData.pkgInfo.name).toStrictEqual("pkg1"); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /docusaurus/docs/getting-started/publish.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: publish 3 | title: Publish Flow 4 | --- 5 | 6 | 1. Run `fynpo changelog` to detect changed packages and determine version bumps. 7 | 8 | - Identifies the package that have been changed since last release 9 | - Determine version bumps based on the commit message 10 | - Add tags to versions, if enabled (command.publish.tags) 11 | - Update CHANGELOG.md file 12 | - Commits changes to CHANGELOG.md file 13 | 14 | 2. Run `fynpo prepare` to modify package metadata to reflect new release. 15 | 16 | - Read changed packages and their versions from CHANGELOG.md 17 | - Update `package.json` with new versions 18 | - Update npm tag in package.json, if enabled (command.publish.tags, command.publish.versionTagging) 19 | - Update versions of changed local dependencies 20 | - Commit the changes and tag the commits, if enabled 21 | 22 | 3. Run `fynpo publish` to publish packages updated since last release. 23 | 24 | - Detect the packages changed in `prepare` step 25 | - Publish the packages to the specified npm registry 26 | - tag the commit with release tag 27 | - push the tag to git remote 28 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/electrode/packages/electrode-archetype-webpack-dll/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electrode-archetype-webpack-dll", 3 | "version": "2.0.2", 4 | "description": "Electrode Archetype to build webpack DLLs", 5 | "main": "arch-clap-tasks.js", 6 | "scripts": {}, 7 | "keywords": [], 8 | "files": [ 9 | "config", 10 | "arch-clap-tasks.js" 11 | ], 12 | "author": "Joel Chen ", 13 | "license": "Apache-2.0", 14 | "devDependencies": { 15 | "electrode-archetype-njs-module-dev": "^3.0.3", 16 | "electrode-archetype-webpack-dll-dev": "../electrode-archetype-webpack-dll-dev", 17 | "xsh": "^0.4.4" 18 | }, 19 | "dependencies": { 20 | "optional-require": "^1.1.6" 21 | }, 22 | "nyc": { 23 | "all": true, 24 | "reporter": [ 25 | "lcov", 26 | "text", 27 | "text-summary" 28 | ], 29 | "exclude": [ 30 | "coverage", 31 | "*clap.js", 32 | "gulpfile.js", 33 | "dist", 34 | "test" 35 | ], 36 | "check-coverage": true, 37 | "statements": 66, 38 | "branches": 57, 39 | "functions": 45, 40 | "lines": 66, 41 | "cache": true 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /packages/create-fynpo/src/prep-fynpo-dir.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-console, no-process-exit */ 2 | 3 | import Fs from "opfs"; 4 | import Path from "path"; 5 | import prompts from "prompts"; 6 | 7 | export async function prepareFynpoDir(appDirName) { 8 | if (appDirName === ".") { 9 | const dirName = Path.basename(process.cwd()); 10 | console.log(`Using current directory '${dirName}' to create app`); 11 | return dirName; 12 | } 13 | 14 | try { 15 | await Fs.mkdir(appDirName); 16 | } catch (err) { 17 | if (err.code !== "EEXIST") { 18 | console.log(`Failed to create app directory '${appDirName}'`); 19 | process.exit(1); 20 | } 21 | } 22 | 23 | process.chdir(appDirName); 24 | 25 | return appDirName; 26 | } 27 | 28 | export async function checkDir(dirName?: string): Promise { 29 | const existDirFiles = await Fs.readdir(process.cwd()); 30 | if (existDirFiles.length > 0) { 31 | const response = await prompts({ 32 | type: "confirm", 33 | name: "overwrite", 34 | message: `Your directory '${dirName}' is not empty, write to it?`, 35 | }); 36 | 37 | return response.overwrite; 38 | } 39 | 40 | return true; 41 | } 42 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mock-npm/metas/mod-e.yml: -------------------------------------------------------------------------------- 1 | etag: mod-e-1 2 | name: mod-e 3 | versions: 4 | 1.0.0: 5 | name: mod-e 6 | description: test fixture mod-e 7 | version: 1.0.0 8 | scripts: 9 | preinstall: echo hello there from mod-e 10 | dependencies: 11 | mod-d: ^1.0.0 12 | dist: 13 | shasum: '' 14 | tarball: 'http://localhost:4873/mod-e/-/mod-e-1.0.0.tgz' 15 | 2.1.1: 16 | name: mod-e 17 | description: test fixture mod-e 18 | version: 2.1.1 19 | scripts: 20 | preinstall: echo hello there from mod-e 21 | dependencies: 22 | mod-f: ^2.0.0 23 | optionalDependencies: 24 | mod-a: ^0.4.0 25 | dist: 26 | shasum: '' 27 | tarball: 'http://localhost:4873/mod-e/-/mod-e-2.1.1.tgz' 28 | 3.0.0: 29 | name: mod-e 30 | description: test fixture mod-e 31 | version: 3.0.0 32 | scripts: 33 | preinstall: echo hello there from mod-e 34 | dependencies: 35 | mod-b: ^3.0.0 36 | dist: 37 | shasum: '' 38 | tarball: 'http://localhost:4873/mod-e/-/mod-e-3.0.0.tgz' 39 | dist-tags: 40 | latest: 2.1.1 41 | _rev: 9-f5a60b1743717bf9 42 | readme: | 43 | #mod-e 44 | _attachments: {} 45 | -------------------------------------------------------------------------------- /docusaurus/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fynpo-docs", 3 | "version": "0.0.1", 4 | "description": "Fynpo: A node.js JavaScript monorepo manager", 5 | "scripts": { 6 | "docusaurus": "docusaurus", 7 | "start": "docusaurus start", 8 | "build": "docusaurus build", 9 | "swizzle": "docusaurus swizzle", 10 | "deploy": "docusaurus build && touch build/.nojekyll && rm -rf ../docs && cp -r build ../docs", 11 | "clear": "docusaurus clear", 12 | "serve": "docusaurus build --out-dir build/fynpo && docusaurus serve", 13 | "write-translations": "docusaurus write-translations", 14 | "write-heading-ids": "docusaurus write-heading-ids" 15 | }, 16 | "dependencies": { 17 | "@docusaurus/core": "2.0.0-alpha.74", 18 | "@docusaurus/preset-classic": "2.0.0-alpha.74", 19 | "@mdx-js/react": "^1.6.21", 20 | "clsx": "^1.1.1", 21 | "react": "^17.0.1", 22 | "react-dom": "^17.0.1" 23 | }, 24 | "browserslist": { 25 | "production": [ 26 | ">0.5%", 27 | "not dead", 28 | "not op_mini all" 29 | ], 30 | "development": [ 31 | "last 1 chrome version", 32 | "last 1 firefox version", 33 | "last 1 safari version" 34 | ] 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/add-remove-pkg/step-01/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .bin: 3 | bin1: "-> ../.f/_/mod-g/2.1.0-fynlocal_h/mod-g/bin/bin1.js" 4 | bin2: "-> ../.f/_/mod-g/2.1.0-fynlocal_h/mod-g/bin/bin2.js" 5 | .f: 6 | .fyn.json: file 7 | _: 8 | mod-a: 9 | 2.0.0: 10 | mod-a: 11 | .npmignore: file 12 | LICENSE: file 13 | README.md: file 14 | package.json: 15 | id: mod-a@2.0.0 16 | mod-b: 17 | 2.0.0: 18 | mod-b: 19 | LICENSE: file 20 | README.md: file 21 | package.json: 22 | id: mod-b@2.0.0 23 | mod-d: 24 | 1.0.0: 25 | mod-d: 26 | LICENSE: file 27 | README.md: file 28 | package.json: 29 | id: mod-d@1.0.0 30 | mod-g: 31 | 2.1.0-fynlocal_h: 32 | mod-g: 33 | bin: 34 | bin1.js: file 35 | bin2.js: file 36 | package.json: 37 | id: mod-g@2.1.0-fynlocal_h 38 | mod-a: "-> .f/_/mod-a/2.0.0/mod-a" 39 | mod-b: "-> .f/_/mod-b/2.0.0/mod-b" 40 | mod-d: "-> .f/_/mod-d/1.0.0/mod-d" 41 | mod-g: "-> .f/_/mod-g/2.1.0-fynlocal_h/mod-g" 42 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fynpo", 3 | "version": "1.0.0", 4 | "description": "A node.js JavaScript monorepo manager", 5 | "main": "index.js", 6 | "homepage": "https://www.electrode.io/fynpo/", 7 | "private": true, 8 | "scripts": { 9 | "test": "fynpo run test --stream", 10 | "ci:check": "fynpo run ci:check --stream", 11 | "coverage": "fynpo run coverage --stream", 12 | "lint": "fynpo run lint --stream", 13 | "bootstrap": "fynpo", 14 | "install": "fynpo", 15 | "testing": "cd testing/monorepo-test && npm run clean-test", 16 | "prepublishOnly": "npm run testing" 17 | }, 18 | "files": [ 19 | "packages", 20 | "docs" 21 | ], 22 | "repository": { 23 | "type": "git", 24 | "url": "https://github.com/electrode-io/fynpo.git" 25 | }, 26 | "keywords": [ 27 | "monorepo" 28 | ], 29 | "author": "Walmart GTP.js Team and Contributors", 30 | "license": "Apache-2.0", 31 | "bugs": { 32 | "url": "https://github.com/electrode-io/fynpo/issues" 33 | }, 34 | "devDependencies": { 35 | "fynpo": "^1.1.35" 36 | }, 37 | "fyn": { 38 | "devDependencies": { 39 | "@fynpo/base": "--no-fyn-local", 40 | "fyn": "--no-fyn-local", 41 | "fynpo": "--no-fyn-local" 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mock-npm/metas/mod-c.yml: -------------------------------------------------------------------------------- 1 | etag: mod-c-1 2 | name: mod-c 3 | versions: 4 | 1.2.0: 5 | name: mod-c 6 | description: test fixture mod-c 7 | version: 1.2.0 8 | dependencies: 9 | mod-a: latest 10 | mod-b: ^1.0.0 11 | dist: 12 | shasum: '' 13 | tarball: 'http://localhost:4873/mod-c/-/mod-c-1.2.0.tgz' 14 | 2.0.0: 15 | name: mod-c 16 | description: test fixture mod-c 17 | version: 2.0.0 18 | dependencies: 19 | mod-a: latest 20 | mod-b: ^1.0.0 21 | dist: 22 | shasum: '' 23 | tarball: 'http://localhost:4873/mod-c/-/mod-c-2.0.0.tgz' 24 | 3.0.0: 25 | name: mod-c 26 | description: test fixture mod-c 27 | version: 3.0.0 28 | dependencies: 29 | mod-a: ^1.0.0 30 | dist: 31 | shasum: '' 32 | tarball: 'http://localhost:4873/mod-c/-/mod-c-3.0.0.tgz' 33 | 4.0.0: 34 | name: mod-c 35 | description: test fixture mod-c (scenario auto-deep-resolve) 36 | version: 4.0.0 37 | scripts: 38 | install: exit 1 39 | dist: 40 | shasum: '' 41 | tarball: 'http://localhost:4873/mod-c/-/mod-c-4.0.0.tgz' 42 | dist-tags: 43 | latest: 1.2.0 44 | _rev: 9-f5a60b1743717bf9 45 | readme: | 46 | #mod-c 47 | _attachments: {} 48 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/locked-npm-dedupe/step-01/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .f: 3 | .fyn.json: file 4 | _: 5 | mod-a: 6 | 2.0.0: 7 | mod-a: 8 | package.json: 9 | id: mod-a@2.0.0 10 | mod-d: 11 | 1.0.1: 12 | mod-d: 13 | package.json: 14 | id: mod-d@1.0.1 15 | mod-e: 16 | 1.0.0: 17 | mod-e: 18 | package.json: 19 | id: mod-e@1.0.0 20 | mod-f: 21 | 1.0.0: 22 | mod-f: 23 | package.json: 24 | id: mod-f@1.0.0 25 | mod-g: 26 | 3.0.11: 27 | mod-g: 28 | package.json: 29 | id: mod-g@3.0.11 30 | mod-i: 31 | 1.0.0: 32 | mod-i: 33 | package.json: 34 | id: mod-i@1.0.0 35 | mod-j: 36 | 1.0.0: 37 | mod-j: 38 | package.json: 39 | id: mod-j@1.0.0 40 | mod-a: "-> .f/_/mod-a/2.0.0/mod-a" 41 | mod-d: "-> .f/_/mod-d/1.0.1/mod-d" 42 | mod-e: "-> .f/_/mod-e/1.0.0/mod-e" 43 | mod-f: "-> .f/_/mod-f/1.0.0/mod-f" 44 | mod-g: "-> .f/_/mod-g/3.0.11/mod-g" 45 | mod-i: "-> .f/_/mod-i/1.0.0/mod-i" 46 | mod-j: "-> .f/_/mod-j/1.0.0/mod-j" 47 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/nested-dep/step-02/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .f: 3 | .fyn.json: file 4 | _: 5 | mod-a: 6 | 1.1.2: 7 | mod-a: 8 | package.json: 9 | id: mod-a@1.1.2 10 | 2.0.0: 11 | mod-a: 12 | package.json: 13 | id: mod-a@2.0.0 14 | mod-c: 15 | 3.0.0: 16 | mod-c: 17 | node_modules: 18 | mod-a: "-> ../../../../mod-a/1.1.2/mod-a" 19 | package.json: 20 | id: mod-c@3.0.0 21 | mod-d: 22 | 1.0.1: 23 | mod-d: 24 | node_modules: 25 | mod-a: "-> ../../../../mod-a/2.0.0/mod-a" 26 | package.json: 27 | id: mod-d@1.0.1 28 | mod-e: 29 | 1.0.0: 30 | mod-e: 31 | package.json: 32 | id: mod-e@1.0.0 33 | mod-f: 34 | 1.0.0: 35 | mod-f: 36 | node_modules: 37 | mod-a: "-> ../../../../mod-a/2.0.0/mod-a" 38 | package.json: 39 | id: mod-f@1.0.0 40 | mod-a: "-> .f/_/mod-a/1.1.2/mod-a" 41 | mod-c: "-> .f/_/mod-c/3.0.0/mod-c" 42 | mod-d: "-> .f/_/mod-d/1.0.1/mod-d" 43 | mod-e: "-> .f/_/mod-e/1.0.0/mod-e" 44 | mod-f: "-> .f/_/mod-f/1.0.0/mod-f" 45 | -------------------------------------------------------------------------------- /packages/fyn/test/fixtures/mock-npm/metas/mod-g.yml: -------------------------------------------------------------------------------- 1 | etag: mod-g-1 2 | name: mod-g 3 | versions: 4 | 2.0.1: 5 | name: mod-g 6 | description: test fixture mod-g 7 | version: 2.0.1 8 | bin: 9 | bin1: bin/bin1.js 10 | bin2: bin/bin2.js 11 | dependencies: {} 12 | dist: 13 | shasum: '' 14 | tarball: 'http://localhost:4873/mod-g/-/mod-g-2.0.1.tgz' 15 | 3.0.0: 16 | name: mod-g 17 | description: test fixture mod-g 18 | version: 3.0.0 19 | bin: 20 | binx: bin/binx.js 21 | bin2: bin/bin2.js 22 | dependencies: {} 23 | dist: 24 | shasum: '' 25 | tarball: 'http://localhost:4873/mod-g/-/mod-g-3.0.0.tgz' 26 | 3.0.11: 27 | name: mod-g 28 | description: test fixture mod-g 29 | version: 3.0.11 30 | dependencies: {} 31 | dist: 32 | shasum: '' 33 | tarball: 'http://localhost:4873/mod-g/-/mod-g-3.0.11.tgz' 34 | 4.0.0: 35 | name: mod-g 36 | description: test fixture mod-g 37 | version: 4.0.0 38 | bin: 39 | binx: bin/x.js 40 | bin1: bin/bin1.js 41 | dependencies: {} 42 | dist: 43 | shasum: '' 44 | tarball: 'http://localhost:4873/mod-g/-/mod-g-4.0.0.tgz' 45 | dist-tags: 46 | latest: 3.0.11 47 | _rev: 9-f5a60b1743717bf9 48 | readme: | 49 | #mod-g 50 | _attachments: {} 51 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/package-fyn/step-01/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .bin: 3 | bin1: '-> ../.f/_/mod-g/2.0.1/mod-g/bin/bin1.js' 4 | bin2: '-> ../.f/_/mod-g/2.0.1/mod-g/bin/bin2.js' 5 | .f: 6 | .fyn.json: file 7 | _: 8 | mod-a: 9 | 1.1.2: 10 | mod-a: 11 | package.json: 12 | id: mod-a@1.1.2 13 | mod-e: 14 | 99.0.0-fynlocal_h: 15 | mod-e: 16 | package.json: 17 | id: mod-e@99.0.0-fynlocal_h 18 | mod-g: 19 | 2.0.1: 20 | mod-g: 21 | bin: 22 | bin1.js: file 23 | bin2.js: file 24 | package.json: 25 | id: mod-g@2.0.1 26 | pkg-a: 27 | 1.0.0-fynlocal_h: 28 | pkg-a: 29 | package-fyn.json: file 30 | package.json: 31 | id: pkg-a@1.0.0-fynlocal_h 32 | pkg-b: 33 | 2.0.0-fynlocal_h: 34 | pkg-b: 35 | package-fyn.json: file 36 | package.json: 37 | id: pkg-b@2.0.0-fynlocal_h 38 | mod-a: '-> .f/_/mod-a/1.1.2/mod-a' 39 | mod-e: '-> .f/_/mod-e/99.0.0-fynlocal_h/mod-e' 40 | mod-g: '-> .f/_/mod-g/2.0.1/mod-g' 41 | pkg-a: '-> .f/_/pkg-a/1.0.0-fynlocal_h/pkg-a' 42 | pkg-b: '-> .f/_/pkg-b/2.0.0-fynlocal_h/pkg-b' 43 | -------------------------------------------------------------------------------- /packages/fyn/test/scenarios/missing-peer-dep/step-01/nm-tree.yaml: -------------------------------------------------------------------------------- 1 | node_modules: 2 | .f: 3 | .fyn.json: file 4 | _: 5 | mod-a: 6 | 0.2.0: 7 | mod-a: 8 | package.json: 9 | id: mod-a@0.2.0 10 | 0.4.5: 11 | mod-a: 12 | package.json: 13 | id: mod-a@0.4.5 14 | 1.1.2: 15 | mod-a: 16 | package.json: 17 | id: mod-a@1.1.2 18 | mod-b: 19 | 1.0.0: 20 | mod-b: 21 | node_modules: 22 | mod-a: '-> ../../../../mod-a/0.2.0/mod-a' 23 | package.json: 24 | id: mod-b@1.0.0 25 | mod-d: 26 | 3.0.1: 27 | mod-d: 28 | package.json: 29 | id: mod-d@3.0.1 30 | mod-e: 31 | 2.1.1: 32 | mod-e: 33 | node_modules: 34 | mod-a: '-> ../../../../mod-a/0.4.5/mod-a' 35 | package.json: 36 | id: mod-e@2.1.1 37 | mod-f: 38 | 2.1.1: 39 | mod-f: 40 | package.json: 41 | id: mod-f@2.1.1 42 | mod-a: '-> .f/_/mod-a/1.1.2/mod-a' 43 | mod-b: '-> .f/_/mod-b/1.0.0/mod-b' 44 | mod-d: '-> .f/_/mod-d/3.0.1/mod-d' 45 | mod-e: '-> .f/_/mod-e/2.1.1/mod-e' 46 | mod-f: '-> .f/_/mod-f/2.1.1/mod-f' 47 | -------------------------------------------------------------------------------- /packages/fyn/test/spec/fyn-config.spec.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | /* eslint-disable prefer-spread */ 4 | 5 | const mockRequire = require("mock-require"); 6 | 7 | describe("fyn-config", function() { 8 | describe("fynDir", () => { 9 | let xenvStub; 10 | before(() => { 11 | delete require.cache[require.resolve("../../lib/fyn-config")]; 12 | delete require.cache[require.resolve("xenv-config")]; 13 | mockRequire("xenv-config", function() { 14 | return xenvStub.apply(null, Array.prototype.slice.apply(arguments)); 15 | }); 16 | }); 17 | 18 | after(() => { 19 | mockRequire.stopAll(); 20 | }); 21 | 22 | it("should have post processor", () => { 23 | let spec; 24 | xenvStub = x => { 25 | spec = x; 26 | return { fynDir: "test" }; 27 | }; 28 | const fynConfig = require("../../lib/fyn-config"); 29 | fynConfig({}); 30 | expect(spec).to.exist; 31 | expect(spec.fynDir.post).to.exist; 32 | expect( 33 | spec.fynDir.post("test", { src: "env", name: "HOME" }), 34 | "should append .fyn to user HOME dir for fynDir" 35 | ).to.equal("test/.fyn"); 36 | 37 | expect( 38 | spec.fynDir.post("test", { src: "default" }), 39 | "should append .fyn to default dir for fynDir" 40 | ).to.equal("test/.fyn"); 41 | }); 42 | }); 43 | }); 44 | -------------------------------------------------------------------------------- /docusaurus/docs/commands/updated.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: updated 3 | title: fynpo updated 4 | --- 5 | 6 | :::note 7 | Install [fynpo-cli](/docs/packages#fynpo-cli) for global access of fynpo command 8 | ::: 9 | 10 | ## Usage 11 | 12 | ``` 13 | fynpo updated 14 | ``` 15 | 16 | Return the list the packages that have been changed since last release. The returned list will be the subjects of the next `fynpo changelog` execution. 17 | 18 | Similar to [lerna changed](https://github.com/lerna/lerna/tree/main/commands/changed#readme) command. 19 | 20 | ## Options 21 | 22 | **`--force-publish`** 23 | 24 | specify the list of packages to be force published or use `*` for all packages. 25 | 26 | ``` 27 | fynpo updated --force-publish pkg1 pkg3 28 | fynpo updated --force-publish * 29 | ``` 30 | 31 | May also be configured in `fynpo.json` or `fynpo.config.js`. 32 | 33 | ```javascript 34 | { 35 | forcePublish: ["*"] 36 | } 37 | ``` 38 | 39 | ```javascript 40 | { 41 | forcePublish: ["pkg1", "pkg2"] 42 | } 43 | ``` 44 | 45 | **`--ignore-changes`** 46 | 47 | Ignore changes in files matched by glob(s) when detecting changed packages. 48 | 49 | ``` 50 | fynpo updated --ignore-changes '**/*.md' '**/__tests__/**' 51 | ``` 52 | 53 | May also be configured in `fynpo.json` or `fynpo.config.js`. 54 | 55 | ```javascript 56 | { 57 | "ignoreChanges": ["**/__tests__/**", "**/*.md"] 58 | } 59 | ``` 60 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/electrode/packages/subapp-util/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "subapp-util", 3 | "version": "1.1.2", 4 | "description": "Util for Electrode SubApp", 5 | "main": "lib/index.js", 6 | "scripts": { 7 | "test": "clap check", 8 | "coverage": "clap coverage", 9 | "check": "clap check" 10 | }, 11 | "keywords": [ 12 | "web", 13 | "react", 14 | "subapp" 15 | ], 16 | "author": "Electrode (http://www.electrode.io/)", 17 | "contributors": [ 18 | "Joel Chen " 19 | ], 20 | "license": "Apache-2.0", 21 | "files": [ 22 | "lib" 23 | ], 24 | "dependencies": { 25 | "filter-scan-dir": "^1.0.9", 26 | "optional-require": "^1.1.6" 27 | }, 28 | "devDependencies": { 29 | "electrode-archetype-njs-module-dev": "^3.0.3" 30 | }, 31 | "nyc": { 32 | "all": true, 33 | "reporter": [ 34 | "lcov", 35 | "text", 36 | "text-summary" 37 | ], 38 | "exclude": [ 39 | "coverage", 40 | "*clap.js", 41 | "gulpfile.js", 42 | "dist", 43 | "test" 44 | ], 45 | "check-coverage": true, 46 | "statements": 0, 47 | "branches": 0, 48 | "functions": 0, 49 | "lines": 0, 50 | "cache": true 51 | }, 52 | "prettier": { 53 | "printWidth": 100, 54 | "trailingComma": "none", 55 | "arrowParens": "avoid" 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /docusaurus/src/pages/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import clsx from "clsx"; 3 | import Layout from "@theme/Layout"; 4 | import Link from "@docusaurus/Link"; 5 | import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; 6 | import styles from "./index.module.css"; 7 | import HomepageFeatures from "../components/HomepageFeatures"; 8 | 9 | function HomepageHeader() { 10 | const { siteConfig } = useDocusaurusContext(); 11 | return ( 12 | 13 | 14 | {siteConfig.title} 15 | {siteConfig.tagline} 16 | 17 | 21 | Get Started 22 | 23 | 24 | 25 | 26 | ); 27 | } 28 | 29 | export default function Home() { 30 | const { siteConfig } = useDocusaurusContext(); 31 | return ( 32 | 36 | 37 | 38 | 39 | 40 | 41 | ); 42 | } 43 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/electrode/packages/xarc-opt-sass/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@xarc/opt-sass", 3 | "version": "1.0.1", 4 | "description": "Electrode sass addon", 5 | "main": "xarc-opt-check.js", 6 | "homepage": "http://www.electrode.io", 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/electrode-io/electrode.git" 10 | }, 11 | "bugs": { 12 | "url": "https://github.com/electrode-io/electrode/issues" 13 | }, 14 | "files": [ 15 | "xarc-opt-check.js" 16 | ], 17 | "publishConfig": { 18 | "registry": "https://registry.npmjs.com/", 19 | "access": "public" 20 | }, 21 | "author": "Electrode (http://www.electrode.io/)", 22 | "contributors": [ 23 | "Joel Chen " 24 | ], 25 | "license": "Apache-2.0", 26 | "scripts": { 27 | "test": "echo OK", 28 | "coverage": "echo OK", 29 | "preinstall": "node xarc-opt-check.js", 30 | "prepare": "shx cp node_modules/opt-archetype-check/xarc-opt-check.js ." 31 | }, 32 | "dependencies": { 33 | "node-sass": "^4.9.3", 34 | "sass-loader": "^6.0.6" 35 | }, 36 | "devDependencies": { 37 | "opt-archetype-check": "../opt-archetype-check", 38 | "shx": "^0.3.2" 39 | }, 40 | "xarcOptCheck": { 41 | "optionalTagName": "sass", 42 | "expectTag": true, 43 | "devOnly": true, 44 | "onlyOneOf": [ 45 | "@xarc/opt-sass", 46 | "electrode-archetype-opt-sass" 47 | ] 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /packages/fynpo-base/__test__/electrode/packages/xarc-opt-less/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@xarc/opt-less", 3 | "version": "1.0.1", 4 | "description": "Electrode less styling addon", 5 | "main": "xarc-opt-check.js", 6 | "homepage": "http://www.electrode.io", 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/electrode-io/electrode.git" 10 | }, 11 | "bugs": { 12 | "url": "https://github.com/electrode-io/electrode/issues" 13 | }, 14 | "files": [ 15 | "xarc-opt-check.js" 16 | ], 17 | "publishConfig": { 18 | "registry": "https://registry.npmjs.com/", 19 | "access": "public" 20 | }, 21 | "author": "Electrode (http://www.electrode.io/)", 22 | "contributors": [ 23 | "Joel Chen " 24 | ], 25 | "license": "Apache-2.0", 26 | "scripts": { 27 | "test": "echo OK", 28 | "coverage": "echo OK", 29 | "preinstall": "node xarc-opt-check.js", 30 | "prepare": "shx cp node_modules/opt-archetype-check/xarc-opt-check.js ." 31 | }, 32 | "dependencies": { 33 | "less": "^3.9.0", 34 | "less-loader": "^4.1.0" 35 | }, 36 | "devDependencies": { 37 | "opt-archetype-check": "../opt-archetype-check", 38 | "shx": "^0.3.2" 39 | }, 40 | "xarcOptCheck": { 41 | "optionalTagName": "less", 42 | "expectTag": true, 43 | "devOnly": true, 44 | "onlyOneOf": [ 45 | "@xarc/opt-less", 46 | "electrode-archetype-opt-less" 47 | ] 48 | } 49 | } 50 | --------------------------------------------------------------------------------
{siteConfig.tagline}