Skip to content

Commit efd1109

Browse files
committed
Update docs to remove 'lib' references.
1 parent 89bb6e5 commit efd1109

2 files changed

Lines changed: 10 additions & 31 deletions

File tree

docs/api.html

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -629,15 +629,15 @@ <h3><a name="packages">Loading Modules from Packages</a><span class="sectionMark
629629
<ul>
630630
<li><strong>name</strong>: The name of the package (used for the module name/prefix mapping)</li>
631631
<li><strong>location</strong>: The location on disk. Locations are relative to the baseUrl configuration value, unless they contain a protocol or start with a front slash (/).</li>
632-
<li><strong>lib</strong>: The name of the directory inside the package folder that contains modules. The default value is "lib", so no need to specify it unless it is different than the default.</li>
633-
<li><strong>main</strong>: The name of the module inside the package that should be used when someone does a require for "packageName". The default value is "lib/main", so only specify it if it differs from the default. The value is relative to the package folder.</li>
632+
<li><strong>main</strong>: The name of the module inside the package that should be used when someone does a require for "packageName". The default value is "main", so only specify it if it differs from the default. The value is relative to the package folder.</li>
634633
</ul></li>
635634
</ul>
636635

637636
<p><strong>IMPORTANT NOTES</strong></p>
638637

639638
<ul>
640639
<li>While the packages can have the CommonJS directory layout, the modules themselves should be in a module format that RequireJS can understand. Exception to the rule: if you are using the r.js Node adapter, the modules can be in the traditional CommonJS module format. You can use the <a href="commonjs.html#autoconversion">CommonJS converter tool</a> if you need to convert traditional CommonJS modules into the async module format that RequireJS uses.</li>
640+
<li>The <strong>lib</strong> directory option that may be used in packages is not supported. It causes some confusing path issues.</li>
641641
<li>Only one version of a package can be used in a project context at a time. You can use RequireJS <a href="#multiversion">multiversion support</a> to load two different module contexts, but if you want to use Package A and B in one context and they depend on different versions of Package C, then that will be a problem. This may change in the future.</li>
642642
</ul>
643643

@@ -671,34 +671,22 @@ <h3><a name="packages">Loading Modules from Packages</a><span class="sectionMark
671671
<ul>
672672
<li>alpha/
673673
<ul>
674-
<li>lib/
675-
<ul>
676674
<li>main.js</li>
677675
</ul></li>
678-
</ul></li>
679676
<li>omega/
680677
<ul>
681-
<li>lib/
682-
<ul>
683678
<li>main.js</li>
684679
</ul></li>
685680
</ul></li>
686-
</ul></li>
687681
<li>cart/
688682
<ul>
689-
<li>lib/
690-
<ul>
691683
<li>main.js</li>
692684
</ul></li>
693-
</ul></li>
694685
<li>store/
695686
<ul>
696-
<li>lib/
697-
<ul>
698687
<li>main.js</li>
699688
<li>util.js</li>
700689
</ul></li>
701-
</ul></li>
702690
<li>main.js</li>
703691
<li>package.json</li>
704692
<li>require.js</li>
@@ -738,9 +726,9 @@ <h3><a name="packages">Loading Modules from Packages</a><span class="sectionMark
738726
});
739727
</code></pre>
740728

741-
<p>A require of "alpha" means that it will be loaded from <strong>scripts/.packages/alpha/lib/main.js</strong>, since "lib" and "main" are the default lib directory and main module settings supported by RequireJS. A require of "store/util" will be loaded from <strong>scripts/store/lib/util.js</strong>.</p>
729+
<p>A require of "alpha" means that it will be loaded from <strong>scripts/.packages/alpha/main.js</strong>, since "main" is the default main module setting supported by RequireJS. A require of "store/util" will be loaded from <strong>scripts/store/util.js</strong>.</p>
742730

743-
<p>If the "alpha" and "store" packages did not follow the "lib" and "main.js" conventions, and looked more like this:</p>
731+
<p>If the "alpha" and "store" packages did not follow the "main.js" convention, and looked more like this:</p>
744732

745733
<ul>
746734
<li>project-directory/
@@ -753,26 +741,17 @@ <h3><a name="packages">Loading Modules from Packages</a><span class="sectionMark
753741
<ul>
754742
<li>alpha/
755743
<ul>
756-
<li>scripts/
757-
<ul>
758744
<li>index.js</li>
759745
</ul></li>
760-
</ul></li>
761746
<li>omega/
762747
<ul>
763-
<li>lib/
764-
<ul>
765748
<li>main.js</li>
766749
</ul></li>
767750
</ul></li>
768-
</ul></li>
769751
<li>cart/
770752
<ul>
771-
<li>lib/
772-
<ul>
773753
<li>main.js</li>
774754
</ul></li>
775-
</ul></li>
776755
<li>store/
777756
<ul>
778757
<li>store.js</li>
@@ -792,7 +771,6 @@ <h3><a name="packages">Loading Modules from Packages</a><span class="sectionMark
792771
".packages": [
793772
{
794773
name: "alpha",
795-
lib: "scripts",
796774
main: "index"
797775
},
798776
"omega"
@@ -802,7 +780,6 @@ <h3><a name="packages">Loading Modules from Packages</a><span class="sectionMark
802780
"cart",
803781
{
804782
name: "store",
805-
lib: ".",
806783
main: "store"
807784
}
808785
]
@@ -816,7 +793,6 @@ <h3><a name="packages">Loading Modules from Packages</a><span class="sectionMark
816793
{
817794
name: "alpha",
818795
location: ".packages/alpha",
819-
lib: "scripts",
820796
main: "index"
821797
},
822798
{
@@ -826,14 +802,13 @@ <h3><a name="packages">Loading Modules from Packages</a><span class="sectionMark
826802
"cart",
827803
{
828804
name: "store",
829-
lib: ".",
830805
main: "store"
831806
}
832807
]
833808
});
834809
</code></pre>
835810

836-
<p>To avoid verbosity, it is strongly suggested to always use packages that use the "lib" and "main" conventions in their structure, and use packagePaths for third party packages.</p>
811+
<p>To avoid verbosity, it is strongly suggested to always use packages that use "main" convention in their structure, and use packagePaths for third party packages.</p>
837812

838813
<p>To make fetching and configuring packages easier, there are designs for a command line package tool in the works.</p>
839814

tasks.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ Release Notes
99
Next release
1010
--------------
1111

12-
- relative modules IDs? remove lib?
12+
- relative modules IDs?
13+
- excludeShallow not excluding files loaded with the text plugin: email thread. Exclusions.
14+
15+
- Remove nameToUrl use in plugins/public code.
16+
- Make sure it is not in the docs
1317

1418
- text plugins after a build load xdomain?
1519
- Why can't plugins have dependencies? It is because the dependency is not fully evaluated.

0 commit comments

Comments
 (0)