Skip to content
This repository was archived by the owner on Oct 9, 2020. It is now read-only.

chore(build): update build process#38

Merged
guybedford merged 1 commit intosystemjs:masterfrom
douglasduteil:chore-build-update-build-process
May 29, 2016
Merged

chore(build): update build process#38
guybedford merged 1 commit intosystemjs:masterfrom
douglasduteil:chore-build-update-build-process

Conversation

@douglasduteil
Copy link
Copy Markdown
Contributor

Hi @guybedford

It way harder than expected to update babel (#34).
I tried to run your build.sh script but it fails with :

./build.sh: 2: ./build.sh: jspm: not found
./build.sh: 3: ./build.sh: jspm: not found
./build.sh: 4: ./build.sh: jspm: not found
./build.sh: 5: ./build.sh: jspm: not found
./build.sh: 6: ./build.sh: jspm: not found
cat: jspm_packages/github/facebook/regenerator@0.8.42/runtime.js: No such file or directory

So given what you wrote I try to make a standalone build script with less environnement descendances. This PR is the state of this experiment.

However, I end up with a strange error from babel-types@6.8.1 :

err        throw new Error('Module ' + name + ' not declared as a dependency of ' + entry.name);
        ^
  Error: Module ./definitions/init not declared as a dependency of /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-types@6.8.1/lib/index.js
      at Object.<anonymous> (/home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-types@6.8.1/lib/index.js:329:25)
      at /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-types@6.8.1/lib/index.js:864:4
      at /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-types@6.8.1/lib/index.js:865:3
      at Object.exports.runInThisContext (vm.js:54:17)
      at Object.<anonymous> (/home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-traverse@6.8.0/lib/path/lib/virtual-types.js:6:43)
      at /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-traverse@6.8.0/lib/path/lib/virtual-types.js:144:4
      at /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-traverse@6.8.0/lib/path/lib/virtual-types.js:145:3
      at Object.exports.runInThisContext (vm.js:54:17)
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-types@6.8.1/lib/index.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-traverse@6.8.0/lib/path/lib/virtual-types.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-traverse@6.8.0/lib/path/index.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-traverse@6.8.0/lib/index.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-template@6.8.0/lib/index.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-helpers@6.8.0/lib/helpers.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-helpers@6.8.0/lib/index.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-core@6.8.0/lib/transformation/file/index.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-core@6.8.0/lib/api/node.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-core@6.8.0/index.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/systemjs-build-modular-babel-helpers.js
  Error loading /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/systemjs-build-modular-babel-helpers.js

Do you have any idea where it comes from ?
Thanks


##


Full output:

$ ./build.sh                                         
#!/bin/bash -xv

NODE_CWD=./node_modules/.bin
+ NODE_CWD=./node_modules/.bin

JSPM_CMD=${NODE_CWD}/jspm
+ JSPM_CMD=./node_modules/.bin/jspm

JSPM_VERSION=beta
+ JSPM_VERSION=beta
REGENERATOR_VERSION=0.8.0
+ REGENERATOR_VERSION=0.8.0

#

cd build-babel
+ cd build-babel

npm install jspm@${JSPM_VERSION} --cache-min=Infinity
+ npm install jspm@beta --cache-min=Infinity
/home/x/zzz/github/douglasduteil/plugin-babel/build-babel
└── jspm@0.17.0-beta.14  extraneous

npm WARN build-babel No description
npm WARN build-babel No repository field.
npm WARN build-babel No license field.
${JSPM_CMD} install --quick --log err
+ ./node_modules/.bin/jspm install --quick --log err

cp -r jspm_packages_override jspm_packages
+ cp -r jspm_packages_override jspm_packages

${JSPM_CMD} build systemjs-babel.js ../systemjs-babel-browser.js --format amd --skip-source-maps --minify --log ok
+ ./node_modules/.bin/jspm build systemjs-babel.js ../systemjs-babel-browser.js --format amd --skip-source-maps --minify --log ok
ok   Built into ../systemjs-babel-browser.js, minified, mangled as amd.

${JSPM_CMD} build systemjs-babel.js ../systemjs-babel-node.js --format amd --node --skip-source-maps --log ok
+ ./node_modules/.bin/jspm build systemjs-babel.js ../systemjs-babel-node.js --format amd --node --skip-source-maps --log ok
ok   Built into ../systemjs-babel-node.js, unminified as amd.

${JSPM_CMD} run systemjs-build-babel-helpers.js > ../babel-helpers.js
+ ./node_modules/.bin/jspm run systemjs-build-babel-helpers.js

err        throw new Error('Module ' + name + ' not declared as a dependency of ' + entry.name);
        ^
  Error: Module ./definitions/init not declared as a dependency of /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-types@6.8.1/lib/index.js
      at Object.<anonymous> (/home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-types@6.8.1/lib/index.js:329:25)
      at /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-types@6.8.1/lib/index.js:864:4
      at /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-types@6.8.1/lib/index.js:865:3
      at Object.exports.runInThisContext (vm.js:54:17)
      at Object.<anonymous> (/home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-traverse@6.8.0/lib/path/lib/virtual-types.js:6:43)
      at /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-traverse@6.8.0/lib/path/lib/virtual-types.js:144:4
      at /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-traverse@6.8.0/lib/path/lib/virtual-types.js:145:3
      at Object.exports.runInThisContext (vm.js:54:17)
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-types@6.8.1/lib/index.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-traverse@6.8.0/lib/path/lib/virtual-types.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-traverse@6.8.0/lib/path/index.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-traverse@6.8.0/lib/index.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-template@6.8.0/lib/index.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-helpers@6.8.0/lib/helpers.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-helpers@6.8.0/lib/index.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-core@6.8.0/lib/transformation/file/index.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-core@6.8.0/lib/api/node.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-core@6.8.0/index.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/systemjs-build-babel-helpers.js
  Error loading /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/systemjs-build-babel-helpers.js
${JSPM_CMD} run systemjs-build-modular-babel-helpers.js
+ ./node_modules/.bin/jspm run systemjs-build-modular-babel-helpers.js

err        throw new Error('Module ' + name + ' not declared as a dependency of ' + entry.name);
        ^
  Error: Module ./definitions/init not declared as a dependency of /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-types@6.8.1/lib/index.js
      at Object.<anonymous> (/home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-types@6.8.1/lib/index.js:329:25)
      at /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-types@6.8.1/lib/index.js:864:4
      at /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-types@6.8.1/lib/index.js:865:3
      at Object.exports.runInThisContext (vm.js:54:17)
      at Object.<anonymous> (/home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-traverse@6.8.0/lib/path/lib/virtual-types.js:6:43)
      at /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-traverse@6.8.0/lib/path/lib/virtual-types.js:144:4
      at /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-traverse@6.8.0/lib/path/lib/virtual-types.js:145:3
      at Object.exports.runInThisContext (vm.js:54:17)
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-types@6.8.1/lib/index.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-traverse@6.8.0/lib/path/lib/virtual-types.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-traverse@6.8.0/lib/path/index.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-traverse@6.8.0/lib/index.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-template@6.8.0/lib/index.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-helpers@6.8.0/lib/helpers.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-helpers@6.8.0/lib/index.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-core@6.8.0/lib/transformation/file/index.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-core@6.8.0/lib/api/node.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/jspm_packages/npm/babel-core@6.8.0/index.js
  Evaluating /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/systemjs-build-modular-babel-helpers.js
  Error loading /home/x/zzz/github/douglasduteil/plugin-babel/build-babel/systemjs-build-modular-babel-helpers.js

(
  echo "export default (function(module) {" ;
  cat jspm_packages/github/facebook/regenerator@${REGENERATOR_VERSION}/runtime.js
  echo "return module.exports; })({exports:{}});"
) > ../regenerator-runtime.js
+ echo 'export default (function(module) {'
+ cat jspm_packages/github/facebook/regenerator@0.8.0/runtime.js
+ echo 'return module.exports; })({exports:{}});'
cd ..
+ cd ..

Comment thread build-babel/jspm.config.js Outdated
"babel-preset-stage-3": "npm:babel-preset-stage-3@6.5.0",
"core-js": "npm:core-js@1.2.6",
"regenerator": "github:facebook/regenerator@0.8.42",
"regenerator": "github:facebook/regenerator@0.8.0",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might explain why regenerator@0.8.42 was not found!?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right

@guybedford
Copy link
Copy Markdown
Member

I've actually just been working on some updates to this build, and it is worth noting that the build is created with the latest jspm beta. Once I've posted out this release today, that should work here as expected I think?

@douglasduteil douglasduteil force-pushed the chore-build-update-build-process branch from a6d5c40 to 956cd69 Compare May 26, 2016 00:37
@douglasduteil
Copy link
Copy Markdown
Contributor Author

Yes ! Way better :)

@douglasduteil
Copy link
Copy Markdown
Contributor Author

I rebased my PR.
Adding a regenerator version guessing script :

npm v regenerator@^0.8.42 version | tail -n 1 | awk '{print $2}' | tr -d "'"

@@ -87,7 +87,7 @@ exports.visitor = {
bodyBlockPath.node.body = innerBody;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file can be removed from the commit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

@douglasduteil douglasduteil force-pushed the chore-build-update-build-process branch 2 times, most recently from 7f048fc to 90721ad Compare May 27, 2016 23:27
@douglasduteil
Copy link
Copy Markdown
Contributor Author

douglasduteil commented May 27, 2016

🆙

I

  • make it run smoothly with the latest regenerator-runtime. So I removed regenerator
  • renamed the jspm_packages/npm/babel-plugin-transform-regenerator to jspm_packages_override/npm/babel-plugin-transform-regenerator
  • I enforce correct copy of those jspm_packages_override files
  • Removed the jspm symlink to use npm i jspm@beta
  • Ignore built files. And a npm scripts auto build before publish.

@douglasduteil
Copy link
Copy Markdown
Contributor Author

I coded #41 on top of thie PR.
And It works perfectly 🎉

}

var outerFnExpr = getOuterFnExpr(path, state);
var outerFnExpr = getOuterFnExpr(path);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these , state argument are needed here actually.

@guybedford
Copy link
Copy Markdown
Member

👍

@douglasduteil douglasduteil force-pushed the chore-build-update-build-process branch 2 times, most recently from 48b78f2 to 278f9de Compare May 29, 2016 18:20
@douglasduteil douglasduteil force-pushed the chore-build-update-build-process branch from 278f9de to 6198624 Compare May 29, 2016 18:40
@douglasduteil
Copy link
Copy Markdown
Contributor Author

🆙

I didn't commit the generated files so you can do it at will ;)

@guybedford guybedford merged commit 65b7f9a into systemjs:master May 29, 2016
@guybedford
Copy link
Copy Markdown
Member

Where would these workflows be without you @douglasduteil..

@douglasduteil douglasduteil deleted the chore-build-update-build-process branch May 29, 2016 20:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants