Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 4 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
}]
],
"plugins": [
["module-resolver", { "root": ["./src"] } ],
["module-resolver", {
"cwd": "packagejson",
"root": ["./packages/Main/src"]
}],
["babel-plugin-inline-import", {
"extensions": [
".json",
Expand Down
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
examples/libs/
examples/layers/
src/ThreeExtended/
packages/Main/src/ThreeExtended/
test/hooks.js
dist/
node_modules/
Expand Down
4 changes: 3 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const path = require('path');

module.exports = {
root: true,
extends: [
Expand All @@ -14,7 +16,7 @@ module.exports = {
settings: {
'import/resolver': {
webpack: {
config: './webpack.config.cjs',
config: path.resolve(__dirname, './webpack.config.cjs'),
},
},
},
Expand Down
47 changes: 35 additions & 12 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: integration


on:
push:
branches:
Expand All @@ -9,7 +10,6 @@ on:
- master
workflow_dispatch: {}


jobs:

# Build bundle, doc and check linter
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
with:
name: dist-itowns
path: |
dist/**/*.js
packages/Main/dist/**/*.js
examples
buildDocs

Expand All @@ -81,6 +81,13 @@ jobs:
name: Unit and coverage tests
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
include:
- package: "@itowns/geodesy"
path: "Geodesy"
- package: "itowns"
path: "Main"
steps:

# Use specific Node.js version
Expand All @@ -95,17 +102,33 @@ jobs:
- name: Install packages
run: npm ci

- name: Run unit tests
run: npm run test-with-coverage_lcov
# Transpile
- name: transpile packages
run: npm run transpile

# Code coverage
- name: Coveralls
if: ${{ success() }}
uses: coverallsapp/github-action@master
- name: Test ${{ matrix.package }}
run: npm run test-with-coverage_lcov --workspace ${{ matrix.package}}
- name: Coveralls Parallel
uses: coverallsapp/github-action@v2
with:
format: lcov
base-path: ./packages/${{ matrix.path }}
path-to-lcov: ./packages/${{ matrix.path }}/coverage/lcov.info
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run-${{ matrix.package }}
parallel: true


# Final Code coverage
finish-coverage:
name: finish parallel test unit
needs: unit-and-coverage-tests
runs-on: ubuntu-latest
steps:
- name: Close parallel build
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
github-token: ${{ secrets.GITHUB_TOKEN }}
# Functional tests
functional-tests:
name: Functional tests
Expand Down Expand Up @@ -139,7 +162,7 @@ jobs:
publish:
name: Publish NPM package
if: ${{ github.ref == 'refs/heads/master' }}
needs: [unit-and-coverage-tests, functional-tests, check-commit-message]
needs: [finish-coverage, functional-tests]
runs-on: ubuntu-latest
permissions:
# id-token: write permission is required for npm provenance:
Expand Down Expand Up @@ -196,7 +219,7 @@ jobs:
deploy:
name: Deploy to itowns.github.io
if: ${{ github.ref == 'refs/heads/master' }}
needs: [unit-and-coverage-tests, functional-tests, check-commit-message]
needs: [finish-coverage, functional-tests, check-commit-message]
runs-on: ubuntu-latest
steps:

Expand Down Expand Up @@ -257,7 +280,7 @@ jobs:
release:
name: Release GitHub
if: ${{ github.ref == 'refs/heads/master' && startsWith( github.event.head_commit.message, 'release v' ) }}
needs: [unit-and-coverage-tests, functional-tests, check-commit-message]
needs: [finish-coverage, functional-tests, check-commit-message]
runs-on: ubuntu-latest
steps:

Expand Down
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
# See https://github.com/github/gitignore/tree/master/Global for a list of global ignore rules.

/node_modules/
/dist/
/packages/Main/dist/
/potree/
potree
/lib/
packages/**/lib/
/docs/out/
coverage
packages/**/coverage
.nyc_output/
/src/ThreeExtended/
**/src/ThreeExtended/
2 changes: 1 addition & 1 deletion Gruntfile.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = (grunt) => {
pkg: grunt.file.readJSON('package.json'),
bump: {
options: {
files: ['package.json', 'package-lock.json', 'src/Main.js'],
files: ['package.json', 'package-lock.json', 'src/Main.js', 'packages/**/package.json'],
updateConfigs: [],
commit: true,
commitMessage: 'release v%VERSION%',
Expand Down
7 changes: 7 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"babelrcRoots": [
".",
"./packages/Geodesy",
"./packages/Main"
]
}
12 changes: 12 additions & 0 deletions config/concurrently.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import concurrently from 'concurrently';

import fs from 'fs';

const pck = JSON.parse(fs.readFileSync('package.json', 'utf8'));
const script = process.argv[2];

concurrently(pck.workspaces.map(workspace => ({
command: `npm run ${script} -w ${workspace} --if-present`,
name: `${workspace}`,
})));

4 changes: 2 additions & 2 deletions config/threeExamples.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default {
patchedPath: './src/ThreeExtended/',
patchedPath: './packages/Main/src/ThreeExtended/',
filesExamples: [
'./loaders/GLTFLoader.js',
'./loaders/DRACOLoader.js',
Expand All @@ -9,6 +9,6 @@ export default {
'./utils/WorkerPool.js',
'./capabilities/WebGL.js',
'./libs/ktx-parse.module.js',
'./libs/zstddec.module.js'
'./libs/zstddec.module.js',
],
};
5 changes: 3 additions & 2 deletions docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,9 @@
}
},
"source": {
"include": [ "src", "examples/js/plugins" ],
"exclude": [ "src/ThreeExtended" ]
"include": [ "examples/js/plugins", "packages" ],
"exclude": [ "src/ThreeExtended" ],
"excludePattern": "(^|\\/|\\\\)lib"
},
"plugins": ["plugins/markdown"]
}
Loading