Code Monkey home page Code Monkey logo

Comments (7)

emezeske avatar emezeske commented on August 23, 2024

In your CLJS code, what does the (ns) form look like where the basil.test.test-macros namespace is :required or :used? The goog.require error makes me think that maybe you used :require or :use instead of :require-macros or :use-macros.

from lein-cljsbuild.

kumarshantanu avatar kumarshantanu commented on August 23, 2024

The CLJS code that uses basil.test.test-macros is a CLJ file (softlinked as a CLJS) and has the following:

(ns basil.test.core
  (:require [basil.types :as types]
            [basil.core  :as core]
            [basil.util  :as util])
  (:use;*CLJSBUILD-REMOVE*;-macros
    [basil.test.test-macros :only [deftest is is-thrown testing slot-compiler
                                   ;*CLJSBUILD-REMOVE*;RuntimeException
                                   ]]))

from lein-cljsbuild.

emezeske avatar emezeske commented on August 23, 2024

Hmm, when you say softlinked, do you mean literally a symbolic link to the file?

from lein-cljsbuild.

kumarshantanu avatar kumarshantanu commented on August 23, 2024

Sorry, it was another file that is symlinked – the test_macros.clj file was never symlinked. I have now renamed this file so that they are different namespaces now – macros for Clojure and macros-cljs for CLJS, controlled as follows (in file basil/test/core.clj that is also symlinked as basil/test/core.cljs in another directory).

(:use;*CLJSBUILD-REMOVE*;-macros
  [basil.test.macros;*CLJSBUILD-REMOVE*;-cljs
   :only [deftest is is-thrown testing slot-compiler
          ;*CLJSBUILD-REMOVE*;RuntimeException
          ]])

However, the error message still persists:
goog.require could not find: basil.test.macros

from lein-cljsbuild.

emezeske avatar emezeske commented on August 23, 2024

Hmm, without seeing the source for the project, it's hard for me to tell exactly what's going wrong. I can mention a few guidelines, though, that I think might help track down the problem:

  1. The crossover setup should not include any symbolic links at all.
  2. None of the sources for the crossover namespaces should exist in the :cljsbuild/:source-path directory in a clean checkout of your project.
  3. The *.clj file providing the macros should be referred to by the same name in both clj and cljs code.

Other than that, you might try changing the :crossovers config in the advanced example to use finer granularity. If you can reproduce the problem there, I'll be better able to help track down the cause.

from lein-cljsbuild.

kumarshantanu avatar kumarshantanu commented on August 23, 2024

I followed your guidelines and the issue is resolved. Thanks!

I also realized that I need to build one JS file for distribution, and one for testing. The testing JS file needs to include extra .cljs files, hence it may be useful to have :src-cljs accept a vector of directory locations instead of just one location. Please let me know if there is already a solution for that, or else I will file an issue requesting that feature.

from lein-cljsbuild.

emezeske avatar emezeske commented on August 23, 2024

I'm glad you have things working!

I don't think there's a good way to do that right now. The 0.1.0 release that I'm working on, though, has built-in support for running tests, and I'm working on adding an example of this to the advanced project right now. I think this new feature should allow you do do what you want (although perhaps in a somewhat different manner).

I hope to get 0.1.0 released in the next 1-3 days.

from lein-cljsbuild.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.