Skip to content
This repository was archived by the owner on Nov 26, 2024. It is now read-only.

Commit b60fa27

Browse files
chris-cooperkatrin.schmid
authored and
katrin.schmid
committed
All propeller changes in a single commit
types
1 parent ea8ba5e commit b60fa27

33 files changed

+24376
-38
lines changed

.github/dependabot.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Dependabot config file. Enables updates for internal packages and schedules checks outside of office hours.
2+
# https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates
3+
4+
version: 2
5+
registries:
6+
npm-npmjs: # Define registry for private access
7+
type: npm-registry
8+
url: https://registry.npmjs.org
9+
token: ${{secrets.NPM_TOKEN}}
10+
11+
updates:
12+
# Keep npm dependencies up to date
13+
- package-ecosystem: "npm"
14+
directory: "/"
15+
# Allow version updates for dependencies in these registries
16+
registries:
17+
- npm-npmjs
18+
# Check the npm registry for updates on Sunday 7pm UTC / Monday 5am AEST. This should be out of
19+
# office hours so as to not block CI but not too long before people wake up, in case the updates
20+
# cause issues.
21+
schedule:
22+
interval: "weekly"
23+
day: "sunday"
24+
time: "19:00"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Automatically merge dependabot PRs that upgrade to patch or minor versions. Adapted from:
2+
# https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/automating-dependabot-with-github-actions#enable-auto-merge-on-a-pull-request
3+
name: dependabot-auto-merge
4+
on: pull_request
5+
6+
permissions:
7+
pull-requests: write
8+
contents: write
9+
10+
jobs:
11+
auto-merge-dependabot-pr:
12+
runs-on: ubuntu-latest
13+
if: ${{ github.actor == 'dependabot[bot]' }}
14+
steps:
15+
- name: Get Dependabot metadata
16+
id: metadata
17+
uses: dependabot/fetch-metadata@v1.3.3
18+
with:
19+
github-token: "${{ secrets.GITHUB_TOKEN }}"
20+
21+
- name: Approve PR
22+
run: gh pr review --approve "$PR_URL"
23+
env:
24+
PR_URL: ${{github.event.pull_request.html_url}}
25+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
26+
27+
- name: Auto-merge Dependabot PR
28+
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
29+
run: gh pr merge --auto --merge "$PR_URL"
30+
env:
31+
PR_URL: ${{github.event.pull_request.html_url}}
32+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Automatically creates a Product Release PR when anything is committed to main.
2+
name: production-release-pr
3+
4+
on:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
create-draft-release-pr:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
14+
- uses: actions/checkout@v2
15+
16+
- name: auto-create-pr-action
17+
uses: PropellerAero/auto-create-pr-action@master
18+
env:
19+
BRANCH_PREFIX: "main"
20+
BASE_BRANCH: "main"
21+
PULL_REQUEST_TITLE: "[Production Release]"
22+
PULL_REQUEST_DRAFT: "false"
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

+9-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
.DS_Store
88
Thumbs.db
99
.eslintcache
10+
.env
1011

1112
/Apps/CesiumViewer/Gallery/gallery-index.js
1213

@@ -27,12 +28,19 @@ Thumbs.db
2728
/Tools/jsdoc/cesium_template/static/styles/prism.css
2829

2930
/node_modules
31+
/engine/node_modules/
32+
/widgets/node_modules/
33+
/packages/engine/node_modules
34+
/packages/widgets/node_modules
3035
npm-debug.log
3136
npm-debug.log.*
3237
package-lock.json
33-
yarn.lock
3438

3539
# WebStorm user-specific
3640
.idea/workspace.xml
3741
.idea/tasks.xml
3842
.idea/shelf
43+
44+
# Codeship
45+
deployment/secrets
46+
*.aes

.npmignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@
3636
/ThirdParty
3737
/Tools
3838
/web.config
39-
39+
/deployment
4040
Thumbs.db

README-PROPELLER.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
git add # Updating the Propeller fork of Cesium
2+
3+
"The best way in my eyes is, to rebase because that fetches the latest changes of the upstream branch and replay your work on top of that." - [Stefan Bauer](https://stefanbauer.me/articles/how-to-keep-your-git-fork-up-to-date)
4+
5+
The ideal git history should have all Propeller modifications in a single most recent commit, followed by the full history from upstream CesiumGS.
6+
7+
e.g.
8+
9+
```
10+
commit c6fc9cb205e387781c5269b95e350f61a8815d08
11+
Author: Chris Cooper <chris@propelleraero.com>
12+
Date: Mon Sep 21 15:19:02 2020 +1000
13+
14+
All the Propeller mods in a single commit
15+
16+
commit da4ddc58830606d89f762dc7d79b3dfe4103c6d1
17+
Merge: 9c61508 6c0a0f8
18+
Author: Kevin Ring <kevin@kotachrome.com>
19+
Date: Tue Sep 1 15:47:38 2020 +1000
20+
21+
Updates for 1.73 release
22+
23+
...
24+
```
25+
26+
To maintain this going forward, use a `git rebase`.
27+
28+
```
29+
# Make sure your main branch is up to date
30+
git checkout main
31+
git pull
32+
33+
# Fetch the upstream tags
34+
git fetch upstream --tags
35+
36+
# Interactive rebase to the CesiumGS release tag
37+
# Squash all propeller commits into a single commit
38+
git rebase -i 1.74
39+
40+
# Fix all the broken stuff :)
41+
42+
# You've just re-written the history so you'll have to force
43+
git push origin main --force
44+
```

Specs/TypeScript/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ import {
9999
WebMapServiceImageryProvider,
100100
WebMapTileServiceImageryProvider,
101101
writeTextToCanvas,
102-
} from "cesium";
102+
} from "@propelleraero/cesium-engine";
103+
//PROPELLER HACK
103104

104105
// Verify ImageryProvider instances conform to the expected interface
105106
let imageryProvider: ImageryProvider;

ThirdParty.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"license": [
3737
"Apache-2.0"
3838
],
39-
"version": "3.0.3",
39+
"version": "2.3.10",
4040
"url": "https://www.npmjs.com/package/dompurify",
4141
"notes": "dompurify is available as both MPL-2.0 OR Apache-2.0"
4242
},
@@ -45,7 +45,7 @@
4545
"license": [
4646
"Apache-2.0"
4747
],
48-
"version": "1.5.6",
48+
"version": "1.5.3",
4949
"url": "https://www.npmjs.com/package/draco3d"
5050
},
5151
{

build.js

+17-7
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ import { mkdirp } from "mkdirp";
2222

2323
// Determines the scope of the workspace packages. If the scope is set to cesium, the workspaces should be @cesium/engine.
2424
// This should match the scope of the dependencies of the root level package.json.
25-
const scope = "cesium";
25+
//PROPELLER HACK
26+
const scope = "propelleraero";
2627

2728
const require = createRequire(import.meta.url);
2829
const packageJson = require("./package.json");
@@ -262,14 +263,18 @@ const workspaceSourceFiles = {
262263
*/
263264
function generateDeclaration(workspace, file) {
264265
let assignmentName = path.basename(file, path.extname(file));
265-
266266
let moduleId = file;
267267
moduleId = filePathToModuleId(moduleId);
268268

269269
if (moduleId.indexOf("Source/Shaders") > -1) {
270270
assignmentName = `_shaders${assignmentName}`;
271271
}
272272
assignmentName = assignmentName.replace(/(\.|-)/g, "_");
273+
//PROPELLER HACK
274+
if (workspace === "engine" || workspace === "widgets") {
275+
return `export { ${assignmentName} } from '@${scope}/cesium-${workspace}';`;
276+
}
277+
273278
return `export { ${assignmentName} } from '@${scope}/${workspace}';`;
274279
}
275280

@@ -283,6 +288,7 @@ export async function createCesiumJs() {
283288
// Iterate over each workspace and generate declarations for each file.
284289
for (const workspace of Object.keys(workspaceSourceFiles)) {
285290
const files = await globby(workspaceSourceFiles[workspace]);
291+
//PROPELLER HACK
286292
const declarations = files.map((file) =>
287293
generateDeclaration(workspace, file)
288294
);
@@ -305,7 +311,6 @@ const workspaceSpecFiles = {
305311
*/
306312
export async function createCombinedSpecList() {
307313
let contents = `export const VERSION = '${version}';\n`;
308-
309314
for (const workspace of Object.keys(workspaceSpecFiles)) {
310315
const files = await globby(workspaceSpecFiles[workspace]);
311316
for (const file of files) {
@@ -608,7 +613,8 @@ const externalResolvePlugin = {
608613
};
609614
});
610615

611-
build.onResolve({ filter: /@cesium/ }, () => {
616+
// PROPELLER HACK
617+
build.onResolve({ filter: /@propelleraero/ }, () => {
612618
return {
613619
path: "Cesium",
614620
namespace: "external-cesium",
@@ -621,7 +627,10 @@ const externalResolvePlugin = {
621627
namespace: "external-cesium",
622628
},
623629
() => {
624-
const contents = `module.exports = Cesium`;
630+
//PROPELLER HACK
631+
//const contents = `module.exports = Cesium`;
632+
const contents = `module.exports = "@propelleraero/cesium"`;
633+
625634
return {
626635
contents,
627636
};
@@ -864,6 +873,7 @@ export async function createIndexJs(workspace) {
864873

865874
const files = await globby(workspaceSources);
866875
files.forEach(function (file) {
876+
//PROPELLER HACK
867877
file = path.relative(`packages/${workspace}`, file);
868878

869879
let moduleId = file;
@@ -879,6 +889,7 @@ export async function createIndexJs(workspace) {
879889
contents += `export { default as ${assignmentName} } from './${moduleId}.js';${EOL}`;
880890
});
881891

892+
//PROPELLER HACK
882893
await writeFile(`packages/${workspace}/index.js`, contents, {
883894
encoding: "utf-8",
884895
});
@@ -1048,7 +1059,7 @@ export const buildWidgets = async (options) => {
10481059
// Generate Build folder to place build artifacts.
10491060
mkdirp.sync("packages/widgets/Build");
10501061

1051-
// Create index.js
1062+
//PROPELLER HACK
10521063
await createIndexJs("widgets");
10531064

10541065
// Create SpecList.js
@@ -1168,7 +1179,6 @@ export async function buildCesium(options) {
11681179
await copyWidgetsAssets(path.join(outputDirectory, "Widgets"));
11691180

11701181
// Copy static assets to Source folder.
1171-
11721182
await copyEngineAssets("Source");
11731183
await copyFiles(
11741184
["packages/engine/Source/ThirdParty/**/*.js"],

codeship-services.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
builder:
2+
encrypted_env_file: deployment/encrypted/build_args.sec
3+
volumes:
4+
- ./Build:/build/Build
5+
- ./Source:/build/Source
6+
build:
7+
dockerfile: deployment/Dockerfile
8+
encrypted_args_file: deployment/encrypted/build_args.sec
9+
10+
11+
dockercfg-production:
12+
image: codeship/aws-ecr-dockercfg-generator
13+
add_docker: true
14+
encrypted_dockercfg_path: deployment/encrypted/dockerhub_dockercfg.sec
15+
encrypted_env_file: deployment/encrypted/deploy_creds_production.sec
16+
17+
publisher:
18+
image: 621673481476.dkr.ecr.us-east-1.amazonaws.com/deploy-tools
19+
volumes:
20+
- .:/code-to-deploy
21+
cached: true
22+
encrypted_env_file: deployment/encrypted/deploy_creds_production.sec

codeship-steps.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
- name: Test
2+
service: builder
3+
encrypted_dockercfg_path: deployment/encrypted/dockerhub_dockercfg.sec
4+
command: yarn test
5+
6+
- name: Build
7+
service: builder
8+
encrypted_dockercfg_path: deployment/encrypted/dockerhub_dockercfg.sec
9+
command: yarn release
10+
11+
- name: Publish/Deploy
12+
type: parallel
13+
steps:
14+
- name: Publish top level
15+
tag: main
16+
service: publisher
17+
dockercfg_service: dockercfg-production
18+
command: publish-javascript-package --code-dir . --git-tag-prefix propeller
19+
20+
- name: Publish engine
21+
tag: main
22+
service: publisher
23+
dockercfg_service: dockercfg-production
24+
command: publish-javascript-package --code-dir /packages/engine
25+
26+
- name: Publish widget
27+
tag: main
28+
service: publisher
29+
dockercfg_service: dockercfg-production
30+
command: publish-javascript-package --code-dir /packages/widgets

deployment/Dockerfile

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM node:14 AS Builder
2+
3+
ARG NPM_TOKEN
4+
5+
# Configure git to use our custom credential helper that can use the $GITHUB_KEY env var
6+
# This allows us to use the github token without writing it to disk. The sleep is required
7+
# to avoid a race condition on some systems.
8+
# https://git-scm.com/docs/api-credentials#_credential_helpers
9+
10+
ARG GITHUB_KEY
11+
12+
RUN git config --global credential.helper "!f() { sleep 0.1; echo 'username=${GITHUB_KEY}\npassword=x-oauth-basic'; }; f" && git config --global url."https://github.com/".insteadOf "git@github.com:"
13+
14+
WORKDIR /build
15+
16+
# Move the package into the container
17+
COPY . /build
18+
19+
# Configure yarn to use NPM registry
20+
RUN yarn config set registry "https://registry.npmjs.org"
21+
22+
# Set authToken for access to @propelleraero/* packages.
23+
RUN npm config set "//registry.npmjs.org/:_authToken" ${NPM_TOKEN}
24+
25+
# Dependencies
26+
RUN yarn install

0 commit comments

Comments
 (0)