[gjs/esm/static-imports] gjs/lib -> gjs/modules/internal



commit 0183a3974c178c3137d04362f910828f327cb060
Author: Evan Welsh <contact evanwelsh com>
Date:   Sat Jan 2 10:38:03 2021 -0800

    gjs/lib -> gjs/modules/internal

 gjs/context.cpp                               |  5 +++--
 gjs/internal.cpp                              | 10 +++++-----
 js.gresource.xml                              | 10 +++++-----
 {lib => modules/internal}/.eslintrc.yml       |  0
 {lib => modules/internal}/bootstrap/module.js |  0
 {lib => modules/internal}/entry.js            |  0
 {lib => modules/internal}/jsconfig.json       |  0
 {lib => modules/internal}/modules/esm.js      |  0
 {lib => modules/internal}/modules/gi.js       |  0
 {lib => modules/internal}/types.d.ts          |  0
 10 files changed, 13 insertions(+), 12 deletions(-)
---
diff --git a/gjs/context.cpp b/gjs/context.cpp
index ef94f38e..66d2e03f 100644
--- a/gjs/context.cpp
+++ b/gjs/context.cpp
@@ -562,8 +562,9 @@ GjsContextPrivate::GjsContextPrivate(JSContext* cx, GjsContext* public_context)
     }
 
     JS::RootedObject entry(
-        cx, gjs_module_load(cx, "resource:///org/gnome/gjs/lib/entry.js",
-                            "resource:///org/gnome/gjs/lib/entry.js"));
+        cx, gjs_module_load(
+                cx, "resource:///org/gnome/gjs/modules/internal/entry.js",
+                "resource:///org/gnome/gjs/modules/internal/entry.js"));
 
     if (!entry) {
         gjs_log_exception(cx);
diff --git a/gjs/internal.cpp b/gjs/internal.cpp
index 0c14af7e..6bf047b9 100644
--- a/gjs/internal.cpp
+++ b/gjs/internal.cpp
@@ -56,9 +56,9 @@ using GjsAutoFile = GjsAutoUnref<GFile>;
  * gjs_load_internal_module:
  *
  * @brief Loads a module source from an internal resource,
- * resource:///org/gnome/gjs/lib/{#identifier}.js, registers it in the internal
- * global's module registry, and proceeds to compile, initialize, and evaluate
- * the module.
+ * resource:///org/gnome/gjs/modules/internal/{#identifier}.js, registers it in
+ * the internal global's module registry, and proceeds to compile, initialize,
+ * and evaluate the module.
  *
  * @param cx the current JSContext
  * @param identifier the identifier of the internal module
@@ -66,8 +66,8 @@ using GjsAutoFile = GjsAutoUnref<GFile>;
  * @returns whether an error occurred while loading or evaluating the module.
  */
 bool gjs_load_internal_module(JSContext* cx, const char* identifier) {
-    GjsAutoChar full_path(
-        g_strdup_printf("resource:///org/gnome/gjs/lib/%s.js", identifier));
+    GjsAutoChar full_path(g_strdup_printf(
+        "resource:///org/gnome/gjs/modules/internal/%s.js", identifier));
 
     char* script;
     size_t script_len;
diff --git a/js.gresource.xml b/js.gresource.xml
index 674717ba..120b7304 100644
--- a/js.gresource.xml
+++ b/js.gresource.xml
@@ -3,11 +3,11 @@
 <!-- SPDX-FileCopyrightText: 2014 Red Hat, Inc. -->
 <gresources>
   <gresource prefix="/org/gnome/gjs">
-    <!-- Internal scripts -->
-    <file>lib/bootstrap/module.js</file>
-    <file>lib/modules/esm.js</file>
-    <file>lib/modules/gi.js</file>
-    <file>lib/entry.js</file>
+    <!-- Internal modules -->
+    <file>modules/internal/bootstrap/module.js</file>
+    <file>modules/internal/modules/esm.js</file>
+    <file>modules/internal/modules/gi.js</file>
+    <file>modules/internal/entry.js</file>
 
     <!-- ESM-based modules -->
     <file>modules/esm/cairo.js</file>
diff --git a/lib/.eslintrc.yml b/modules/internal/.eslintrc.yml
similarity index 100%
rename from lib/.eslintrc.yml
rename to modules/internal/.eslintrc.yml
diff --git a/lib/bootstrap/module.js b/modules/internal/bootstrap/module.js
similarity index 100%
rename from lib/bootstrap/module.js
rename to modules/internal/bootstrap/module.js
diff --git a/lib/entry.js b/modules/internal/entry.js
similarity index 100%
rename from lib/entry.js
rename to modules/internal/entry.js
diff --git a/lib/jsconfig.json b/modules/internal/jsconfig.json
similarity index 100%
rename from lib/jsconfig.json
rename to modules/internal/jsconfig.json
diff --git a/lib/modules/esm.js b/modules/internal/modules/esm.js
similarity index 100%
rename from lib/modules/esm.js
rename to modules/internal/modules/esm.js
diff --git a/lib/modules/gi.js b/modules/internal/modules/gi.js
similarity index 100%
rename from lib/modules/gi.js
rename to modules/internal/modules/gi.js
diff --git a/lib/types.d.ts b/modules/internal/types.d.ts
similarity index 100%
rename from lib/types.d.ts
rename to modules/internal/types.d.ts


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]