Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CJS to ESM #7311

Merged
merged 15 commits into from
Dec 8, 2024
2 changes: 1 addition & 1 deletion buildprocess/ci-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ yarn add -W request@2.83.0

# Clone and build TerriaMap, using this version of TerriaJS
TERRIAJS_COMMIT_HASH=$(git rev-parse HEAD)
git clone -b main https://github.com/TerriaJS/TerriaMap.git
git clone -b cjs-to-esm https://github.com/TerriaJS/TerriaMap.git
cd TerriaMap
TERRIAMAP_COMMIT_HASH=$(git rev-parse HEAD)
sed -i -e 's@"terriajs": ".*"@"terriajs": "'$GITHUB_REPOSITORY'#'${GITHUB_BRANCH}'"@g' package.json
Expand Down
4 changes: 2 additions & 2 deletions lib/CopyrightModule.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @license
* Copyright(c) 2012-2014 National ICT Australia Limited (NICTA).
* Copyright(c) 2014-2024 Terria Pty Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,4 +15,4 @@
* limitations under the License.
*
*/
module.exports = {};
export default {};
6 changes: 3 additions & 3 deletions lib/Core/ConsoleAnalytics.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var defined = require("terriajs-cesium/Source/Core/defined").default;
const i18next = require("i18next").default;
import defined from "terriajs-cesium/Source/Core/defined";
import i18next from "i18next";
na9da marked this conversation as resolved.
Show resolved Hide resolved

var ConsoleAnalytics = function () {
const ConsoleAnalytics = function () {
// either set enableConsoleAnalytics here to true,
// or pass true in `configParameters.enableConsoleAnalytics` for verbose app analytics
this.enableConsoleAnalytics = false;
Expand Down
2 changes: 0 additions & 2 deletions lib/Core/GoogleAnalytics.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"use strict";

import i18next from "i18next";
import ReactGA from "react-ga4";
import { Analytics, ConfigParameters } from "../Models/Terria";
Expand Down
8 changes: 4 additions & 4 deletions lib/Core/ServerConfig.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const i18next = require("i18next").default;
var defaultValue = require("terriajs-cesium/Source/Core/defaultValue").default;
var loadJson = require("./loadJson").default;
import i18next from "i18next";
import defaultValue from "terriajs-cesium/Source/Core/defaultValue";
import loadJson from "./loadJson";

var DEFAULT_URL = "serverconfig/";
const DEFAULT_URL = "serverconfig/";
/**
* Provides information about the configuration of the Terria server, by querying /serverconfig
*/
Expand Down
2 changes: 0 additions & 2 deletions lib/Core/TerriaError.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"use strict";

import i18next from "i18next";
import { observable, makeObservable } from "mobx";
import RequestErrorEvent from "terriajs-cesium/Source/Core/RequestErrorEvent";
Expand Down
41 changes: 0 additions & 41 deletions lib/Core/arrayProduct.js

This file was deleted.

18 changes: 0 additions & 18 deletions lib/Core/closeWhenEscapeIsPressed.js

This file was deleted.

61 changes: 0 additions & 61 deletions lib/Core/combineData.js

This file was deleted.

54 changes: 0 additions & 54 deletions lib/Core/combineFilters.js

This file was deleted.

15 changes: 0 additions & 15 deletions lib/Core/createFragmentFromTemplate.js

This file was deleted.

2 changes: 0 additions & 2 deletions lib/Core/flatten.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"use strict";

/**
* Flattens an array of arrays, into an array, eg. [[0, 1], [2, 3], [4, 5]] => [0, 1, 2, 3, 4, 5].
* Based on the example at
Expand Down
2 changes: 0 additions & 2 deletions lib/Core/flattenNested.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"use strict";

type NestedArray<T> = NestedArray<T>[] | T[];

/**
Expand Down
10 changes: 0 additions & 10 deletions lib/Core/inherit.js

This file was deleted.

22 changes: 0 additions & 22 deletions lib/Core/isBrowserCompatible.js

This file was deleted.

18 changes: 0 additions & 18 deletions lib/Core/isCommonMobilePlatform.js

This file was deleted.

5 changes: 2 additions & 3 deletions lib/Core/loadWithXhr.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const defaultValue =
require("terriajs-cesium/Source/Core/defaultValue").default;
const Resource = require("terriajs-cesium/Source/Core/Resource").default;
import defaultValue from "terriajs-cesium/Source/Core/defaultValue";
import Resource from "terriajs-cesium/Source/Core/Resource";

function loadWithXhr(options) {
// Take advantage that most parameters are the same
Expand Down
2 changes: 1 addition & 1 deletion lib/Core/polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ function polyfill(callback) {
callback();
}

module.exports = polyfill;
export default polyfill;
Loading
Loading