Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question Would you Accept a PR that changes Package Structures #5460

Open
frank-dspeed opened this issue Jan 21, 2020 · 6 comments
Open

Question Would you Accept a PR that changes Package Structures #5460

frank-dspeed opened this issue Jan 21, 2020 · 6 comments

Comments

@frank-dspeed
Copy link
Contributor

frank-dspeed commented Jan 21, 2020

I Would love when all package-name/package.json files would be valid that means

  • main points to src/file not none existing dist
  • for dist a extra package.json gets written on RELEASE inside dist only dist and needed files get published to npm while github src stays useable directly.
  • Translate all name/name require calls to name/name.js so that it will be even load able via node resolve and other tooling?
@frank-dspeed
Copy link
Contributor Author

The current package structure on github works like a copy protection :) i know what i am talking about i was many years active in the warez scene :) as i was young your Package Structure at present beats the most copy protections of modern games :)

@justinbmeyer
Copy link
Contributor

To make this change, we’d need to change how canjs/canjs works. We run integration tests that currently depend on packages including test files. We’d need to change canjs/canjs to install using tagged hit releases instead.

@frank-dspeed
Copy link
Contributor Author

@justinbmeyer i can refactor that tests to use the github repos that will offer tests as usal its only a change to drop steal my main goal is to get all that build and loaded without steal in es6 at present i have code mods for that and a rollup plugin that don't uses package json to resolve canjs packages.

i could resolve canjs packages then also via github src npm install canjs/can-type will use github the package.json will point to src all will work the tests are there everything is there.

we could even let the package.json inside of the repo reference other github packages canjs/can-name and the dist/package.json will use the package name without canjs/ this will work really well and will fix a lot of my problems

@frank-dspeed
Copy link
Contributor Author

and i would love 2 fix at last 2 packages file naming

              //special case by can-define-lazy-value
              `${PackagePath}${file}/${file.split('can-')[1]}.js`, 
              //special can observeable mixin
              `${PackagePath}${file}/src/mixins.js`,

and maybe if you allow i would love to apply the naming convetion can-package/can-package.js or can-package/src/can-package.js to all repos some reference index.js

@frank-dspeed
Copy link
Contributor Author

this is my current can- indipendent resolve algorythm :D for your require statments

          const tryResolv = file => {
            return [
              `${PackagePath}${file}.js`, //=> packages/file.js most time wrong right if can-assign/map/map
              `${PackagePath}${file}/${file}.js`, //=> right if can-assign packages/can-assign/can-assign.js
              `${PackagePath}${file}/src/${file}.js`, //=> right if can-assign packages/can-assign/can-assign.js
              `${PackagePath}${file}/index.js`, //=> right if can-assign packages/can-assign/index.js
              `${PackagePath}${file}/src/index.js`, //=> right if can-assign packages/can-assign/index.js
              //special case by can-define-lazy-value
              `${PackagePath}${file}/${file.split('can-')[1]}.js`, 
              //special can observeable mixin
              `${PackagePath}${file}/src/mixins.js`,
            ]
          }

@frank-dspeed
Copy link
Contributor Author

by the way i got qunit working without steal with my ES6 code the qunit tests all pass and run blazing fast

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants