Commit Graph

205 Commits

Author SHA1 Message Date
Nacho Codoñer
cfc6c8a665 support meteor project config to be modified by env variable 2024-07-31 17:05:36 +02:00
Gabriel Grubba
f1aed3aada reverted fde161c108 2023-06-29 10:27:24 -03:00
Gabriel Grubba
fde161c108 chore: updated to not repeat the same 2023-06-28 11:08:38 -03:00
matheusccastro
fb16d6abcb Remove projectContext.init since it doesn't need to be async anymore because archinfo.host is sync - also adding missing awaits to runners. 2023-06-01 19:53:55 -03:00
zodern
6f5bd9b25b Add isobuild:top-level-await 2023-05-05 15:34:39 -05:00
denihs
1da83a800c - fix test: bundler-assets 2023-04-03 15:58:03 -04:00
denihs
9fd401b7d5 - creating the function Console.yield() 2023-03-14 15:55:55 -04:00
Gabriel Grubba
2c12bd1292 Revert "Revert "added async await in isopack to have better tracing""
This reverts commit 79572c5f1b.
2023-02-15 11:59:48 -03:00
Gabriel Grubba
79572c5f1b Revert "added async await in isopack to have better tracing"
This reverts commit 280ab55352.
2023-02-15 11:57:31 -03:00
Gabriel Grubba
280ab55352 added async await in isopack to have better tracing 2023-02-15 11:56:40 -03:00
Gabriel Grubba
bada9add03 chore: added async in project context 2023-02-14 11:33:07 -03:00
zodern
1e718277fb Remove await's for archinfo.host 2023-01-30 13:55:30 -06:00
Gabriel Grubba
7465846403 docs: updated project context jsdocs 2023-01-18 13:55:38 -03:00
Matheus Castro
cb01f7cc4a Remove Fibers from meteor-tools:
- Make add, remove and list commands work.
2022-12-29 12:13:23 -03:00
Matheus Castro
4c27996f4e Remove Fibers from meteor-tools:
- Removing Fibers from catalog and tropohouse.
2022-12-28 17:28:37 -03:00
Matheus Castro
0a898137e7 Remove Fibers from meteor-tools:
- Started working on test-packages command.
2022-12-23 11:01:06 -03:00
Matheus Castro
170e5d3f6d Remove Fibers from meteor-tools:
- Adapt forkJoin and other files functions to correctly be awaited.
2022-12-22 14:09:27 -03:00
Matheus Castro
53c24bbf6f Remove Fibers from meteor-tools:
- Fixing package stats issues and setting global.asyncLocalStorage when needed.
2022-12-20 17:16:18 -03:00
Matheus Castro
4021b54c25 Remove Fibers for Meteor Tools:
- Fix issue with constraint solver.
2022-12-16 12:02:50 -03:00
Matheus Castro
a76c30693f Remove Fibers for Meteor Tools:
- Start changing the meteor run command now. It's throwing errors when trying to check constraints/package-versions.
2022-12-14 21:48:59 -03:00
Matheus Castro
17a8a59b2e Remove Fibers for Meteor Tools:
- Fixing issues with create component - fixing remote catalog.
2022-12-10 00:00:22 -03:00
Matheus Castro
568c5f05f6 Merge remote-tracking branch 'origin/fibers-optional-no-tla-pkgs' into fibers-optional-no-tla-pkgs
# Conflicts:
#	tools/isobuild/bundler.js
#	tools/meteor-services/service-connection.js
#	tools/utils/buildmessage.js
2022-12-05 17:25:07 -03:00
Matheus Castro
b1a6cc0761 Remove Fibers for meteor tools: turns out the package building is still not done. Still need to check why it's failing to require node_modules when evaluating/loading the plugin. 2022-12-04 00:27:50 -03:00
Edimar Cardoso
de04cfe676 Update Node Version, NPM Version and tools to work without Fibers
- Update node version to 18.12.1
- Update npm version to 7.24.2 (last before 8)
- Update commands to use async

---
NPM 8 break changes

Error: The programmatic API was removed in npm v8.0.0
https://github.com/npm/cli/blob/latest/index.js
2022-12-01 10:43:48 -03:00
Matheus Castro
022a7e9303 Remove Fibers for meteor tools:
- Changing package/compile steps to use async/await.
2022-11-25 20:15:37 -03:00
zodern
eb5ea5964e Fix handling string value for recompile option 2022-04-29 16:53:50 -05:00
zodern
9840956d22 Fix recompiling npm packages for web arch 2022-04-29 16:45:09 -05:00
zodern
6bd370c8ff Use recursive watchers 2021-10-15 11:13:52 -05:00
Jan Dvorak
b6e127cfc9 Minor tools update
Replace underscore where easy and feasible & other minor modernization that I came across.
2021-06-25 00:36:03 +02:00
Renan Castro
31e7cf96fb Inline KNOWN_ISOBUILD_FEATURE_PACKAGES constant. On node 14, we faced an issue while importing this constant, probably related to changes on ES6 implementation in this version. See the changelog here: https://nodejs.org/en/blog/release/v14.0.0/#notable-changes - documentation to avoid errors 2021-05-19 18:28:17 -03:00
Renan Castro
d6aeaf391d Inline KNOWN_ISOBUILD_FEATURE_PACKAGES constant. On node 14, we faced an issue while importing this constant, probably related to changes on ES6 implementation in this version. See the changelog here: https://nodejs.org/en/blog/release/v14.0.0/#notable-changes 2021-05-19 17:56:38 -03:00
Renan Castro
685e321fac User commonjs export 2021-05-19 11:01:00 -03:00
filipenevola
bb42fa8137 Adds the option to cache the build on deploy 2020-07-27 11:23:38 -04:00
Ben Newman
37b1683fbc Centralize legacy arch logic in tools/utils/archinfo.ts. 2019-11-08 11:15:23 -05:00
Paulo Mogollón
2ae2690f3a Convert tools/utils/archinfo.js to TypeScript. (#10624)
* Updated code to use modern JS
* Added types
* Stopped using 2 underscore functions (1 remaining)
2019-07-21 12:01:24 -04:00
Ben Newman
4334fd4ceb Convert tools/isobuild/resolver.js to TypeScript. 🎉 2019-07-10 12:53:28 -04:00
Ben Newman
769337551e Convert tools/tool-env/profile.js to TypeScript.
Unfortunately, this conversion triggered an error due to one of the
shortcomings of the Babel implementation of TypeScript:

SyntaxError: /tools/tool-env/profile.ts: Namespace not marked type-only declare. Non-declarative namespaces are only supported experimentally in Babel. To enable and review caveats see: https://babeljs.io/docs/en/babel-plugin-transform-typescript
  278 | }
  279 |
> 280 | export namespace Profile {
      |                  ^
  281 |   export let enabled = !! process.env.METEOR_PROFILE;
  282 |
  283 |   export function time<TResult>(bucket: string, f: () => TResult) {
    at File.buildCodeFrameError (/Users/ben/meteor/dev_bundle/lib/node_modules/@babel/core/lib/transformation/file/file.js:261:12)
    at transpileNamespace (/Users/ben/meteor/dev_bundle/lib/node_modules/@babel/plugin-transform-typescript/lib/namespace.js:25:25)
    at PluginPass.TSModuleDeclaration (/Users/ben/meteor/dev_bundle/lib/node_modules/@babel/plugin-transform-typescript/lib/index.js:271:32)
    at newFn (/Users/ben/meteor/dev_bundle/lib/node_modules/@babel/traverse/lib/visitors.js:193:21)
    at NodePath._call (/Users/ben/meteor/dev_bundle/lib/node_modules/@babel/traverse/lib/path/context.js:53:20)
    at NodePath.call (/Users/ben/meteor/dev_bundle/lib/node_modules/@babel/traverse/lib/path/context.js:40:17)
    at NodePath.visit (/Users/ben/meteor/dev_bundle/lib/node_modules/@babel/traverse/lib/path/context.js:88:12)
    at TraversalContext.visitQueue (/Users/ben/meteor/dev_bundle/lib/node_modules/@babel/traverse/lib/context.js:118:16)
    at TraversalContext.visitMultiple (/Users/ben/meteor/dev_bundle/lib/node_modules/@babel/traverse/lib/context.js:85:17)
    at TraversalContext.visit (/Users/ben/meteor/dev_bundle/lib/node_modules/@babel/traverse/lib/context.js:144:19)
2019-07-06 09:18:35 -04:00
Ben Newman
8958cbc5e9 Convert tools/fs/watch.js to TypeScript. 2019-07-05 17:50:20 -04:00
Ben Newman
528b549460 Convert tools/fs/optimistic.js to TypeScript. 2019-07-05 12:29:19 -04:00
Ben Newman
5ed64fb1db Remove explicit .js extension from tools/fs/files imports. 2019-07-04 10:32:09 -04:00
Ben Newman
f61ba60326 Support meteor.nodeModules.recompile package.json configuration option.
Example:

  "meteor": {
    "mainModule": ...,
    "testModule": ...,
    "nodeModules": {
      "recompile": {
        "very-modern-package": ["client", "server"],
        "alternate-notation-for-client-and-server": true,
        "somewhat-modern-package": "legacy",
        "another-package": ["legacy", "server"]
      }
    }
  }

The keys of the meteor.nodeModules.recompile configuration object are npm
package names, and the values specify for which bundles those packages
should be recompiled using the Meteor compiler plugins system, as if the
packages were part of the Meteor application.

For example, if an npm package uses const/let syntax or arrow functions,
that's fine for modern and server code, but you would probably want to
recompile the package when building the legacy bundle. To accomplish this,
specify "legacy" or ["legacy"] as the value of the package's property,
similar to somewhat-modern-package above. These strings and arrays of
strings have the same meaning as the second argument to
api.addFiles(files, where) in a package.js file.

This configuration serves pretty much the same purpose as symlinking an
application directory into node_modules, but without any symlinking:
https://forums.meteor.com/t/litelement-import-litelement-html/45042/8?u=benjamn

The meteor.nodeModules.recompile configuration currently applies to the
application node_modules directory only (not to Npm.depends dependencies
in Meteor packages). Recompiled packages must be direct dependencies of
the application.
2019-07-01 09:15:28 -04:00
Ben Newman
c96278700d Fix compiler plugins self-tests by waiting for lazy compilation to finish. 2018-10-31 10:41:31 -04:00
Ben Newman
4a70b12edd Allow package-name@x.y.z! override syntax in .meteor/packages.
With this commit, if a top-level package version constraint in
.meteor/packages ends with a '!' character, any other (non-!) constraints
on that package elsewhere in the application will be weakened to accept
any version of the package that is not less than the constraint,
regardless of whether the major/minor versions actually match.

This functionality is extremely useful in cases where an unmaintained
package was last published with api.versionsFrom(<some ancient version>),
thus constraining the major version of any Meteor core package it depended
on, but you really want to upgrade that core package anyway. Just put a
'!' after the core package's version constraint in your .meteor/packages
file, and you will almost certainly get your way. The fact that minimum
versions are still enforced is good/fine because the constraints you want
to override are typically ancient, so they easily match any recent version
of the package.

Your only recourse before this @x.y.z! syntax was to find a replacement
for the unmaintained package, or fork and modify it locally, or somehow
persuade the package author to publish a new version with a more
reasonable api.versionsFrom. None of these options were easy.

Many thanks to @GeoffreyBooth, long-time maintainer of the `coffeescript`
package, for originally suggesting a ! syntax similar to this one:
https://github.com/meteor/meteor-feature-requests/issues/208#issuecomment-400154209

The limitation of this syntax to .meteor/packages is deliberate, since
overriding package version constraints is a power-tool that should be used
sparingly by application developers, and never abused by package authors.
Also, limiting the scope of this syntax reduces the risk of an arms race
between overrides, a la the infamous CSS !important modifier.
2018-08-14 20:27:23 -04:00
Ben Newman
aade180d46 Build web.browser.legacy bundle after startup on rebuilds. 2018-07-04 12:26:23 -04:00
Ben Newman
7baaf19020 Report an error when meteor.mainModule cannot be resolved.
https://github.com/meteor/meteor/pull/9826#issuecomment-387172568
2018-05-07 18:48:38 -04:00
Ben Newman
f14d50538e Merge branch 'devel' into release-1.6.2 2018-03-01 18:02:08 -05:00
Ben Newman
a212d9f515 Also support meteor.testModule to configure test entry points.
Setting meteor.testModule is a great way to specify test entry points
explicitly, rather than relying on Meteor's isTestFilePath heuristics:
https://github.com/meteor/meteor/blob/devel/tools/isobuild/test-files.js

The syntax is identical to meteor.mainModule, so you can set an explicit
meteor.testModule.{client,server,...} for each platform. If a testModule
is not specified for a platform, then Meteor's existing rules about test
file paths apply for that platform, as before.

If a testModule is specified, that module will always be loaded eagerly
when running `meteor test`, in addition to any other modules that load
eagerly because of meteor.mainModule or other rules regarding module
loading. If you run `meteor test` without the `--full-app` option, then no
application JS modules other than the testModule (and any modules imported
by it) will be loaded eagerly.
2018-03-01 14:27:30 -05:00
Ben Newman
8dd2402f76 Allow meteor.mainModule.{client,server} === false for no entry point.
If meteor.mainModule.{client,server,...} === false, no modules will be
loaded eagerly for that architecture. This is useful if you have an app
with no special app/{client,server} directory structure and you want to
specify an entry point for just the client (or just the server), without
accidentally loading everything on the other architecture.
2018-03-01 14:27:30 -05:00
Ben Newman
c28d813745 Merge branch 'devel' into release-1.6.2 2018-02-23 18:39:06 -05:00
Ben Newman
31c39f0e6f Resolve mainModule strings using Node module resolution rules. 2018-02-23 12:45:24 -05:00