def register_goals(): NodeResolve.register_resolver_for_type(ScalaJSBinary, ScalaJSPlatform) # NB: These task/goal assignments are pretty nuts, but are necessary in order to # prevent product-graph cycles between the JVM and node.js. # see https://github.com/pantsbuild/pants/labels/engine task(name='scala-js-compile', action=ScalaJSZincCompile).install('resolve') task(name='scala-js-link', action=ScalaJSLink).install('resolve')
def register_options(cls, register): super(NpmResolver, cls).register_options(register) register('--install-optional', type=bool, default=False, fingerprint=True, help='If enabled, install optional dependencies.') NodeResolve.register_resolver_for_type(NodeModule, cls)
def register_options(cls, register): register( '--fetch-timeout-secs', type=int, advanced=True, default=10, help= 'Timeout the fetch if the connection is idle for longer than this value.' ) super(NodePreinstalledModuleResolver, cls).register_options(register) NodeResolve.register_resolver_for_type(NodePreinstalledModule, cls)
def test_register_resolver_for_type(self): NodeResolve._clear_resolvers() self.assertIsNone(NodeResolve._resolver_for_target(NodePreinstalledModule)) self.assertIsNone(NodeResolve._resolver_for_target(NodeModule)) node_preinstalled__module_target = self.make_target( spec=":empty_fake_node_preinstalled_module_target", target_type=NodePreinstalledModule ) NodeResolve.register_resolver_for_type(NodePreinstalledModule, NodePreinstalledModuleResolver) self.assertEqual( NodePreinstalledModuleResolver, NodeResolve._resolver_for_target(node_preinstalled__module_target) ) node_module_target = self.make_target(spec=":empty_fake_node_module_target", target_type=NodeModule) NodeResolve.register_resolver_for_type(NodeModule, NpmResolver) self.assertEqual(NpmResolver, NodeResolve._resolver_for_target(node_module_target))
def test_register_resolver_for_type(self): NodeResolve._clear_resolvers() self.assertIsNone(NodeResolve._resolver_for_target(NodePreinstalledModule)) self.assertIsNone(NodeResolve._resolver_for_target(NodeModule)) node_preinstalled__module_target = self.make_target( spec=':empty_fake_node_preinstalled_module_target', target_type=NodePreinstalledModule) NodeResolve.register_resolver_for_type(NodePreinstalledModule, NodePreinstalledModuleResolver) self.assertEqual(NodePreinstalledModuleResolver, NodeResolve._resolver_for_target(node_preinstalled__module_target)) node_module_target = self.make_target(spec=':empty_fake_node_module_target', target_type=NodeModule) NodeResolve.register_resolver_for_type(NodeModule, NpmResolver) self.assertEqual(NpmResolver, NodeResolve._resolver_for_target(node_module_target))
def register_options(cls, register): super().register_options(register) register( "--install-optional", type=bool, default=False, fingerprint=True, help="If enabled, install optional dependencies.", ) register( "--install-production", type=bool, default=False, fingerprint=True, help="If enabled, do not install devDependencies.", ) register( "--force", type=bool, default=False, fingerprint=True, help="If enabled, refetch and resolve dependencies even if they are already built.", ) register( "--frozen-lockfile", type=bool, default=True, fingerprint=True, help="If enabled, disallow automatic update of lock files.", ) # There are cases where passed through options does not override hard-coded options. # One example is for node-install, --frozen-lockfile=False is the dominate configuration # as it allows the user to modify dependencies and generate a new lockfile. # By turning on --force-option-override, the user accepts full responsibilities. register( "--force-option-override", type=bool, default=False, fingerprint=True, advanced=True, help="If enabled, options will override hard-coded values. Be aware of default values.", ) NodeResolve.register_resolver_for_type(NodeModule, cls)
def register_options(cls, register): super(NpmResolver, cls).register_options(register) register( '--install-optional', type=bool, default=False, fingerprint=True, help='If enabled, install optional dependencies.') register( '--install-production', type=bool, default=False, fingerprint=True, help='If enabled, do not install devDependencies.') register( '--force', type=bool, default=False, fingerprint=True, help='If enabled, refetch and resolve dependencies even if they are already built.') register( '--frozen-lockfile', type=bool, default=True, fingerprint=True, help='If enabled, disallow automatic update of lock files.') # There are cases where passed through options does not override hard-coded options. # One example is for node-install, --frozen-lockfile=False is the dominate configuration # as it allows the user to modify dependencies and generate a new lockfile. # By turning on --force-option-override, the user accepts full responsibilities. register( '--force-option-override', type=bool, default=False, fingerprint=True, advanced=True, help='If enabled, options will override hard-coded values. Be aware of default values.') NodeResolve.register_resolver_for_type(NodeModule, cls)
def test_product_types(self): self.assertEqual([NodePaths], NodeResolve.product_types())
def tearDown(self): super(NodeResolveSourceDepsTest, self).tearDown() NodeResolve._clear_resolvers()
def setUp(self): super(NodeResolveSourceDepsTest, self).setUp() NodeResolve.register_resolver_for_type(NodePreinstalledModule, NodePreinstalledModuleResolver) NodeResolve.register_resolver_for_type(NodeModule, NpmResolver)
def register_options(cls, register): NodeResolve.register_resolver_for_type(WebPackModule, cls) NodeResolve.register_resolver_for_type(NpmResource, cls) super(WebPackResolver, cls).register_options(register)
def register_options(cls, register): super(NpmResolver, cls).register_options(register) register( '--install-optional', type=bool, default=False, fingerprint=True, help='If enabled, install optional dependencies.') NodeResolve.register_resolver_for_type(NodeModule, cls)
def setUp(self): super(NodeTestTest, self).setUp() NodeResolve.register_resolver_for_type(NodeModule, NpmResolver)
def tearDown(self): super().tearDown() NodeResolve._clear_resolvers()
def register_options(cls, register): super(NodePreinstalledModuleResolver, cls).register_options(register) NodeResolve.register_resolver_for_type(NodePreinstalledModule, cls)
def tearDown(self): super(NodeTestTest, self).tearDown() NodeResolve._clear_resolvers()
def setUp(self): super().setUp() NodeResolve.register_resolver_for_type(NodePreinstalledModule, NodePreinstalledModuleResolver) NodeResolve.register_resolver_for_type(NodeModule, NpmResolver)
def register_options(cls, register): super(NpmResolver, cls).register_options(register) NodeResolve.register_resolver_for_type(NodeModule, cls)
def register_options(cls, register): register('--fetch-timeout-secs', type=int, advanced=True, default=10, help='Timeout the fetch if the connection is idle for longer than this value.') super(NodePreinstalledModuleResolver, cls).register_options(register) NodeResolve.register_resolver_for_type(NodePreinstalledModule, cls)