gergo/yarn (#753)
* yarn first go * fix frontend build cache loader * yarn workspaces built server Docker * build(yarn): add workspaces plugin config * chore(package defs): clean package*.json -s * chore(gitignore): ignore yarn error log * build(yarn): update yarn lock * build(preview-service webpack): add extra resolved path to preview service webpack config because of yarn package hoisting, there are no package level node_modules folder anymore. * build(docker): update dockerignore with yarn specific configs * build(docker): update Dockerfiles for yarn workspaces utilization * ci(circleci): update server test job to yarn * ci(circle): disable cache restore * ci(circleci): trying the node orb yarn-run * ci(circleci): yarn-run again * ci(circleci): disable node orb * ci(circleci): change base node image for tests * ci(circleci): add yarn cache * ci(circleci): remove node install step * ci(circleci): add server specific cache archives * ci(circleci): test build and publish * ci(circleci): change npm auth method to suit yarn * ci(circleci): trying new builder image * ci(circleci): another base image, maybe this works * ci(circleci): force a specific docker engine version * ci(circleci): add yarn version plugin and its changes * ci(circleci): cleanup and remove temp branch config * chore(package defs): moving from npm run to yarn * explicitly specifying webpack4 as a frontend dep * chore(package defs): replace npm with yarn everywhere * docs(root readme): update with some yarn specific docs * chore(root workspace): update dev scripts and package lock * ci(circleci): enable package publish step with yarn Co-authored-by: Fabians <fabis94@live.com>
This commit is contained in:
+69
-29
@@ -1,8 +1,5 @@
|
||||
version: 2.1
|
||||
|
||||
orbs:
|
||||
node: circleci/node@5.0.1
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
|
||||
@@ -20,6 +17,7 @@ workflows:
|
||||
branches:
|
||||
only:
|
||||
- main
|
||||
|
||||
- docker-build-and-publish-server:
|
||||
filters: *filters-build
|
||||
context: &docker-hub-context
|
||||
@@ -81,16 +79,16 @@ workflows:
|
||||
- docker-build-and-publish-monitor-container
|
||||
- docker-build-and-publish-test-container
|
||||
|
||||
# - publish-npm:
|
||||
# filters:
|
||||
# tags:
|
||||
# only: *filters-tag
|
||||
# branches:
|
||||
# ignore: /.*/
|
||||
# context:
|
||||
# - npm-registry
|
||||
# requires:
|
||||
# - get-version
|
||||
- publish-npm:
|
||||
filters:
|
||||
tags:
|
||||
only: *filters-tag
|
||||
branches:
|
||||
ignore: /.*/
|
||||
context:
|
||||
- npm-registry
|
||||
requires:
|
||||
- get-version
|
||||
|
||||
jobs:
|
||||
get-version:
|
||||
@@ -115,7 +113,7 @@ jobs:
|
||||
|
||||
test-server:
|
||||
docker:
|
||||
- image: cimg/node:lts
|
||||
- image: cimg/node:16.15
|
||||
- image: cimg/redis:6.2.6
|
||||
- image: 'cimg/postgres:12.8'
|
||||
environment:
|
||||
@@ -132,8 +130,22 @@ jobs:
|
||||
CANONICAL_URL: 'http://localhost:3000'
|
||||
steps:
|
||||
- checkout
|
||||
- node/install-packages:
|
||||
app-dir: ~/project/packages/server
|
||||
- restore_cache:
|
||||
name: Restore Yarn Package Cache
|
||||
keys:
|
||||
- yarn-packages-server-{{ checksum "yarn.lock" }}
|
||||
- run:
|
||||
name: Install Dependencies
|
||||
command: yarn workspaces focus
|
||||
working_directory: 'packages/server'
|
||||
|
||||
- save_cache:
|
||||
name: Save Yarn Package Cache
|
||||
key: yarn-packages-server-{{ checksum "yarn.lock" }}
|
||||
paths:
|
||||
- .yarn/cache
|
||||
- .yarn/unplugged
|
||||
|
||||
- run: 'dockerize -wait tcp://localhost:5432 -timeout 1m'
|
||||
|
||||
- run:
|
||||
@@ -141,7 +153,7 @@ jobs:
|
||||
working_directory: 'packages/server'
|
||||
|
||||
- run:
|
||||
command: npm run test:report
|
||||
command: yarn test:report
|
||||
working_directory: 'packages/server'
|
||||
|
||||
- run:
|
||||
@@ -157,7 +169,7 @@ jobs:
|
||||
|
||||
docker-build-and-publish: &docker-job
|
||||
docker: &docker-image
|
||||
- image: cimg/python:3.9-node
|
||||
- image: cimg/node:16.15
|
||||
working_directory: *work-dir
|
||||
steps:
|
||||
- checkout
|
||||
@@ -165,6 +177,9 @@ jobs:
|
||||
at: /tmp/ci/workspace
|
||||
- run: cat workspace/env-vars >> $BASH_ENV
|
||||
- setup_remote_docker:
|
||||
# a weird issue with yarn installing packages throwing EPERM errors
|
||||
# this fixes it
|
||||
version: 20.10.12
|
||||
docker_layer_caching: true
|
||||
- run:
|
||||
name: Build and Publish
|
||||
@@ -215,25 +230,50 @@ jobs:
|
||||
- attach_workspace:
|
||||
at: /tmp/ci/workspace
|
||||
- run: cat workspace/env-vars >> $BASH_ENV
|
||||
|
||||
- restore_cache:
|
||||
name: Restore Yarn Package Cache
|
||||
keys:
|
||||
- yarn-packages-{{ checksum "yarn.lock" }}
|
||||
- run:
|
||||
name: restore packages
|
||||
command: |
|
||||
npm i
|
||||
npx lerna bootstrap
|
||||
# this has to be after lerna bootstrap
|
||||
# otherwise the auth workflow of lerna is borked...
|
||||
name: Install Dependencies
|
||||
command: yarn
|
||||
|
||||
- save_cache:
|
||||
name: Save Yarn Package Cache
|
||||
key: yarn-packages-{{ checksum "yarn.lock" }}
|
||||
paths:
|
||||
- .yarn/cache
|
||||
- .yarn/unplugged
|
||||
|
||||
- run:
|
||||
name: auth to npm as Speckle
|
||||
command: |
|
||||
echo "@speckle:registry=https://registry.npmjs.org" >> .npmrc
|
||||
echo "registry=http://registry.npmjs.org/" >> .npmrc
|
||||
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc
|
||||
echo "npmRegistryServer: https://registry.npmjs.org/" >> .yarnrc.yml
|
||||
echo "npmAuthToken: ${NPM_TOKEN}" >> .yarnrc.yml
|
||||
- run:
|
||||
name: try login to npm
|
||||
command: npm whoami
|
||||
command: yarn npm whoami
|
||||
|
||||
- run:
|
||||
name: build public packages
|
||||
command: yarn workspaces foreach -ptv --no-private run build
|
||||
- run:
|
||||
name: bump all versions
|
||||
# bump all versions in dependency tree order but not in parallel
|
||||
command: yarn workspaces foreach -tv version $IMAGE_VERSION_TAG
|
||||
|
||||
- run:
|
||||
name: publish to npm
|
||||
command: npx lerna publish $IMAGE_VERSION_TAG -y --no-git-tag-version --no-push
|
||||
command: 'yarn workspaces foreach -pv --no-private npm publish --access public --tag next'
|
||||
|
||||
# - run:
|
||||
# name: commit changes
|
||||
# command: |
|
||||
# yarn prettier:fix
|
||||
# git add .
|
||||
# git commit -m '[ci skip] bump version to $IMAGE_VERSION_TAG'
|
||||
# git push
|
||||
|
||||
publish-helm-chart:
|
||||
docker: *docker-image
|
||||
|
||||
+9
-1
@@ -6,9 +6,17 @@ test-queries
|
||||
.editorconfig
|
||||
Contributing.md
|
||||
ISSUE_TEMPLATE.md
|
||||
lerna.json
|
||||
**/.env
|
||||
.env.example
|
||||
.eslintrc.json
|
||||
.mocharc.js
|
||||
readme.md
|
||||
**/Dockerfile
|
||||
|
||||
.pnp.*
|
||||
.yarn/*
|
||||
!.yarn/patches
|
||||
!.yarn/plugins
|
||||
!.yarn/releases
|
||||
!.yarn/sdks
|
||||
!.yarn/versions
|
||||
|
||||
+11
-1
@@ -29,4 +29,14 @@ packages/server/reports*
|
||||
events.json
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
.eslintcache
|
||||
|
||||
.pnp.*
|
||||
.yarn/*
|
||||
!.yarn/patches
|
||||
!.yarn/plugins
|
||||
!.yarn/releases
|
||||
!.yarn/sdks
|
||||
!.yarn/versions
|
||||
|
||||
*yarn-error.log
|
||||
+550
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+785
File diff suppressed because one or more lines are too long
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
undecided:
|
||||
- '@speckle/fileimport-service'
|
||||
- '@speckle/frontend'
|
||||
- '@speckle/objectloader'
|
||||
- '@speckle/preview-service'
|
||||
- '@speckle/server'
|
||||
- '@speckle/viewer'
|
||||
- '@speckle/viewer-sandbox'
|
||||
@@ -0,0 +1,9 @@
|
||||
nodeLinker: node-modules
|
||||
|
||||
plugins:
|
||||
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
|
||||
spec: '@yarnpkg/plugin-workspace-tools'
|
||||
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
|
||||
spec: '@yarnpkg/plugin-version'
|
||||
|
||||
yarnPath: .yarn/releases/yarn-3.2.0.cjs
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"packages": ["packages/*"],
|
||||
"version": "independent",
|
||||
"command": {
|
||||
"version": {
|
||||
"message": "chore(release): publish to npm\n[skip ci]"
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
-20661
File diff suppressed because it is too large
Load Diff
+13
-5
@@ -1,33 +1,41 @@
|
||||
{
|
||||
"packageManager": "yarn@3.2.0",
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
"name": "root",
|
||||
"private": true,
|
||||
"engines": {
|
||||
"node": ">=14.0.0 <17.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "yarn workspaces foreach -ptv run build",
|
||||
"build:public": "yarn workspaces foreach -ptv --no-private run build",
|
||||
"lint": "eslint . --ext .js,.ts,.vue --max-warnings=0",
|
||||
"prettier:check": "prettier --check .",
|
||||
"prettier:fix": "prettier --write .",
|
||||
"docker:deps:up": "docker-compose -f ./docker-compose-deps.yml up -d",
|
||||
"docker:deps:down": "docker-compose -f ./docker-compose-deps.yml down",
|
||||
"dev": "lerna run dev --parallel",
|
||||
"dev:no-server": "npm run dev -- --ignore @speckle/server",
|
||||
"dev": "yarn workspaces foreach -piv -j unlimited run dev",
|
||||
"dev:no-server": "yarn workspaces foreach --exclude @speckle/server -piv -j unlimited run dev",
|
||||
"dev:minimal": "yarn workspaces foreach -piv -j unlimited --include '{@speckle/server,@speckle/frontend}' run dev",
|
||||
"prepare": "husky install",
|
||||
"postinstall": "husky install"
|
||||
"postinstall": "husky install",
|
||||
"cm": "cz"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/eslint": "^8.4.1",
|
||||
"commitizen": "^4.2.4",
|
||||
"cz-conventional-changelog": "^3.3.0",
|
||||
"eslint": "^8.11.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"husky": "^7.0.4",
|
||||
"lerna": "^3.22.1",
|
||||
"lint-staged": "^12.3.7",
|
||||
"prettier": "^2.5.1"
|
||||
},
|
||||
"config": {
|
||||
"commitizen": {
|
||||
"path": "./node_modules/cz-conventional-changelog"
|
||||
"path": "cz-conventional-changelog"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
|
||||
@@ -12,14 +12,19 @@ RUN chmod +x /wait
|
||||
ARG NODE_ENV=production
|
||||
ENV NODE_ENV=${NODE_ENV}
|
||||
|
||||
WORKDIR /app
|
||||
WORKDIR /speckle-server
|
||||
|
||||
COPY packages/fileimport-service/package*.json ./
|
||||
RUN npm ci
|
||||
COPY .yarnrc.yml .
|
||||
COPY .yarn ./.yarn
|
||||
COPY package.json yarn.lock ./
|
||||
|
||||
WORKDIR /speckle-server/packages/fileimport-service
|
||||
COPY packages/fileimport-service/package.json ./
|
||||
RUN yarn workspaces focus --production
|
||||
|
||||
COPY packages/fileimport-service/requirements.txt ./
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
COPY packages/fileimport-service .
|
||||
|
||||
CMD ["node", "src/daemon.js"]
|
||||
CMD ["yarn", "node", "src/daemon.js"]
|
||||
|
||||
-4990
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@speckle/fileimport-service",
|
||||
"private": true,
|
||||
"version": "2.3.17-alpha.2889",
|
||||
"version": "2.5.4",
|
||||
"description": "Parse and import files of various types into a stream",
|
||||
"author": "Dimitrie Stefanescu <didimitrie@gmail.com>",
|
||||
"homepage": "https://github.com/specklesystems/speckle-server#readme",
|
||||
|
||||
@@ -1,41 +1,31 @@
|
||||
# NOTE: Docker context should be set to git root directory, to include the viewer
|
||||
|
||||
# build stage
|
||||
FROM node:16.13-bullseye-slim as deps-build
|
||||
|
||||
WORKDIR /opt/objectloader
|
||||
COPY packages/objectloader /opt/objectloader
|
||||
RUN npm install
|
||||
RUN npm run build
|
||||
# this whole thing is required cause npm 6.* doesn't allow for pack output dir specification
|
||||
RUN mkdir /packages
|
||||
# invoke npm pack and move its result to the packages folder when done
|
||||
RUN npm pack --pack-destination=/packages/
|
||||
|
||||
WORKDIR /opt/viewer
|
||||
COPY packages/viewer/package*.json ./
|
||||
# this installs objectloader from a tarball
|
||||
RUN npm i $(find /packages -type f -name "speckle*.tgz")
|
||||
RUN npm install
|
||||
COPY packages/viewer .
|
||||
RUN npm run build
|
||||
RUN npm pack --pack-destination=/packages/
|
||||
|
||||
FROM node:16.13-bullseye-slim as build-stage
|
||||
|
||||
WORKDIR /opt/frontend
|
||||
COPY --from=deps-build /packages /packages
|
||||
COPY packages/frontend/package*.json ./
|
||||
# RUN npm install ../viewer
|
||||
RUN npm i $(find /packages -type f -name "speckle*.tgz")
|
||||
RUN npm ci
|
||||
COPY packages/frontend .
|
||||
RUN npm run build
|
||||
WORKDIR /speckle-server
|
||||
COPY .yarnrc.yml .
|
||||
COPY .yarn ./.yarn
|
||||
COPY package.json yarn.lock ./
|
||||
|
||||
# Onyl copy in the relevant package.json files for the dependencies
|
||||
COPY packages/frontend/package.json ./packages/frontend/
|
||||
COPY packages/viewer/package.json ./packages/viewer/
|
||||
COPY packages/objectloader/package.json ./packages/objectloader/
|
||||
|
||||
RUN yarn workspaces focus -A
|
||||
|
||||
# Onyl copy in the relevant source files for the dependencies
|
||||
COPY packages/objectloader ./packages/objectloader/
|
||||
COPY packages/viewer ./packages/viewer/
|
||||
COPY packages/frontend ./packages/frontend/
|
||||
|
||||
# This way the foreach only builds the frontend and its deps
|
||||
RUN yarn workspaces foreach -pt run build
|
||||
|
||||
# production stage
|
||||
FROM openresty/openresty:1.19.9.1-bullseye as production-stage
|
||||
COPY --from=build-stage /opt/frontend/dist /usr/share/nginx/html
|
||||
COPY --from=build-stage /speckle-server/packages/frontend/dist /usr/share/nginx/html
|
||||
RUN rm /etc/nginx/conf.d/default.conf
|
||||
COPY packages/frontend/nginx/nginx.conf /etc/nginx/conf.d
|
||||
EXPOSE 80
|
||||
|
||||
@@ -10,7 +10,7 @@ Note that this package contains two vue apps, the main frontend (located under @
|
||||
|
||||
Notes:
|
||||
|
||||
- In **development** mode, the Speckle Server will proxy the frontend from `localhost:3000` to `localhost:8080`. If you don't see anything, ensure you've run `npm run serve` in the frontend package.
|
||||
- In **development** mode, the Speckle Server will proxy the frontend from `localhost:3000` to `localhost:8080`. If you don't see anything, ensure you've run `yarn serve` in the frontend package.
|
||||
|
||||
- In **production** mode, the Speckle Frontend will be statically served by nginx (see the Dockerfile in the current directory).
|
||||
|
||||
@@ -22,18 +22,12 @@ Comprehensive developer and user documentation can be found in our:
|
||||
|
||||
## Project setup
|
||||
|
||||
The frontend now includes the viewer. Until we get to publish it as a separate module, there's a few extra steps:
|
||||
|
||||
- make sure you build the [Speckle Viewer](../viewer)
|
||||
- afterwards, run
|
||||
```
|
||||
lerna bootstrap
|
||||
```
|
||||
Make sure you follow the Developing and Debugging section in the project root readme.
|
||||
|
||||
### Compiles and hot-reloads for development
|
||||
|
||||
```
|
||||
npm run serve
|
||||
yarn serve
|
||||
```
|
||||
|
||||
### Packaging for production
|
||||
|
||||
@@ -18,7 +18,7 @@ function plugin(api) {
|
||||
// Add caching config
|
||||
jsRule
|
||||
.use('cache-loader')
|
||||
.loader(require.resolve('cache-loader'))
|
||||
.loader('cache-loader')
|
||||
.options(
|
||||
api.genCacheConfig('js-esbuild-loader', {
|
||||
target,
|
||||
|
||||
Generated
-42642
File diff suppressed because it is too large
Load Diff
@@ -1,14 +1,14 @@
|
||||
{
|
||||
"name": "@speckle/frontend",
|
||||
"version": "2.3.17-alpha.2889",
|
||||
"version": "2.5.4",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vue-cli-service serve --mode development",
|
||||
"serve": "ws -p 8080 -d dist -r '/embed(.*) -> /embedApp.html' '/([a-zA-Z0-9-_/]*)(\\?.*)? -> /app.html' ",
|
||||
"build": "vue-cli-service build --mode production --silent",
|
||||
"build:dev": "vue-cli-service build --mode development --silent",
|
||||
"build:profile": "npm run build -- --profile",
|
||||
"build:dev:profile": "npm run build:dev -- --profile",
|
||||
"build:profile": "yarn build -- --profile",
|
||||
"build:dev:profile": "yarn build:dev -- --profile",
|
||||
"inspect": "vue-cli-service inspect --mode production",
|
||||
"inspect:dev": "vue-cli-service inspect --mode development",
|
||||
"lint": "eslint . --ext .js,.ts,.vue"
|
||||
@@ -17,7 +17,7 @@
|
||||
"node": "^16.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@speckle/viewer": "^2.4.2",
|
||||
"@speckle/viewer": "workspace:^",
|
||||
"@tryghost/content-api": "^1.5.12",
|
||||
"@vuejs-community/vue-filter-date-format": "^1.6.3",
|
||||
"@vuejs-community/vue-filter-date-parse": "^1.1.6",
|
||||
@@ -71,6 +71,7 @@
|
||||
"vue-cli-plugin-vuetify": "^2.0.8",
|
||||
"vue-template-compiler": "^2.6.12",
|
||||
"vuetify-loader": "^1.6.0",
|
||||
"webpack": "^4.46.0",
|
||||
"webpack-bundle-analyzer": "^4.5.0"
|
||||
},
|
||||
"vuePlugins": {
|
||||
|
||||
Generated
-7402
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@speckle/objectloader",
|
||||
"version": "2.4.2",
|
||||
"version": "2.5.4",
|
||||
"description": "Simple API helper to stream in objects from the Speckle Server.",
|
||||
"main": "dist/objectloader.js",
|
||||
"module": "dist/objectloader.esm.js",
|
||||
@@ -17,6 +17,7 @@
|
||||
"lint": "eslint . --ext .js,.ts",
|
||||
"build:dev": "rollup --config",
|
||||
"build": "NODE_ENV=production rollup --config",
|
||||
"prepack": "yarn build",
|
||||
"dev": "rollup --config --watch",
|
||||
"example": "EXAMPLE_BUILD=1 rollup --config && http-server ./examples/browser -p 3031 -o"
|
||||
},
|
||||
|
||||
@@ -14,7 +14,7 @@ This is a small utility class that helps you stream an object and all its sub-co
|
||||
|
||||
### Examples
|
||||
|
||||
If you've got this repo checked out locally, you can run `npm run example` to run an example web page running ObjectLoader in the browser at 'http://127.0.0.1:3031/'. This will run the example HTML found under ./examples/browser/'.
|
||||
If you've got this repo checked out locally, you can run `yarn example` to run an example web page running ObjectLoader in the browser at 'http://127.0.0.1:3031/'. This will run the example HTML found under ./examples/browser/'.
|
||||
|
||||
To test ObjectLoader in a node environment, just run `node ./examples/node/script.mjs`
|
||||
|
||||
@@ -80,7 +80,8 @@ let loader = new ObjectLoader({
|
||||
|
||||
## Development
|
||||
|
||||
Run `npm run build` to build prod release, run `npm run build:dev` to build dev release. Or run `npm run dev` to run the build in `watch` mode.
|
||||
Run `yarn build` to build prod release, run `yarn build:dev` to build dev release.
|
||||
Or run `yarn dev` to run the build in `watch` mode.
|
||||
|
||||
## Community
|
||||
|
||||
|
||||
@@ -2,41 +2,34 @@
|
||||
|
||||
|
||||
# build stage
|
||||
FROM node:14.16-buster-slim as deps-build
|
||||
FROM node:14.16-buster-slim as build-stage
|
||||
|
||||
ARG NODE_ENV=production
|
||||
ENV NODE_ENV=${NODE_ENV}
|
||||
|
||||
WORKDIR /opt/objectloader
|
||||
COPY packages/objectloader/package*.json ./
|
||||
RUN npm install --production=false
|
||||
COPY packages/objectloader .
|
||||
RUN npm run build
|
||||
# this whole thing is required cause npm 6.* doesn't allow for pack output dir specification
|
||||
RUN mkdir /packages
|
||||
# invoke npm pack and move its result to the packages folder when done
|
||||
RUN mv $(npm pack) /packages/
|
||||
|
||||
WORKDIR /opt/viewer
|
||||
COPY packages/viewer/package*.json ./
|
||||
# this installs objectloader from a tarball
|
||||
RUN npm i $(find /packages -type f -name "speckle*.tgz")
|
||||
# Install dependencies and devDependencies
|
||||
RUN npm install --production=false
|
||||
COPY packages/viewer .
|
||||
RUN npm run build
|
||||
RUN mv $(npm pack) /packages/
|
||||
WORKDIR /speckle-server
|
||||
COPY .yarnrc.yml .
|
||||
COPY .yarn ./.yarn
|
||||
COPY package.json yarn.lock ./
|
||||
|
||||
# Onyl copy in the relevant package.json files for the dependencies
|
||||
COPY packages/preview-service/package.json ./packages/preview-service/
|
||||
COPY packages/viewer/package.json ./packages/viewer/
|
||||
COPY packages/objectloader/package.json ./packages/objectloader/
|
||||
|
||||
RUN yarn workspaces focus -A
|
||||
RUN yarn
|
||||
|
||||
# Onyl copy in the relevant source files for the dependencies
|
||||
COPY packages/objectloader ./packages/objectloader/
|
||||
COPY packages/viewer ./packages/viewer/
|
||||
COPY packages/preview-service ./packages/preview-service/
|
||||
|
||||
# This way the foreach only builds the frontend and its deps
|
||||
RUN yarn workspaces foreach -pt run build
|
||||
|
||||
FROM node:14.16-buster-slim as build-stage
|
||||
|
||||
WORKDIR /opt/preview-service
|
||||
COPY --from=deps-build /packages /packages
|
||||
COPY packages/preview-service/package*.json ./
|
||||
# this installs viewer and objectloader from a tarball
|
||||
RUN npm i $(find /packages -type f -name "speckle*.tgz")
|
||||
RUN npm ci --production=false
|
||||
COPY packages/preview-service .
|
||||
RUN npm run build-fe
|
||||
|
||||
FROM node:14.16-buster-slim as node
|
||||
|
||||
@@ -55,9 +48,20 @@ RUN chmod +x /wait
|
||||
ARG NODE_ENV=production
|
||||
ENV NODE_ENV=${NODE_ENV}
|
||||
|
||||
COPY --from=build-stage /opt/preview-service /opt/preview-service
|
||||
WORKDIR /speckle-server
|
||||
COPY .yarnrc.yml .
|
||||
COPY .yarn ./.yarn
|
||||
COPY package.json yarn.lock ./
|
||||
|
||||
WORKDIR /opt/preview-service
|
||||
RUN yarn plugin import workspace-tools
|
||||
|
||||
# Onyl copy in the relevant package.json files for the dependencies
|
||||
COPY packages/preview-service/package.json ./packages/preview-service/
|
||||
|
||||
WORKDIR /speckle-server/packages/preview-service
|
||||
|
||||
RUN yarn workspaces focus --production
|
||||
COPY --from=build-stage /speckle-server/packages/preview-service ./
|
||||
|
||||
ENTRYPOINT [ "tini", "--" ]
|
||||
CMD ["node", "bin/www"]
|
||||
CMD ["yarn", "node", "bin/www"]
|
||||
|
||||
-13590
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@speckle/preview-service",
|
||||
"private": true,
|
||||
"version": "2.4.2",
|
||||
"version": "2.5.4",
|
||||
"description": "Generate PNG previews of Speckle objects by using a headless viewer",
|
||||
"main": "index.js",
|
||||
"homepage": "https://speckle.systems",
|
||||
@@ -15,7 +15,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "DEBUG='preview-service:*' nodemon --trace-deprecation ./bin/www",
|
||||
"build-fe": "webpack --env dev --config webpack.config.render_page.js && webpack --env build --config webpack.config.render_page.js",
|
||||
"build": "webpack --env dev --config webpack.config.render_page.js && webpack --env build --config webpack.config.render_page.js",
|
||||
"lint": "eslint . --ext .js,.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -13,7 +13,7 @@ This is an overview of this service:
|
||||
With an updated viewer installed in the current directory, you should first build the frontend-part of the preview service: The simple webpage with the viewer that will be accessed with Puppeteer to generate the preview:
|
||||
|
||||
```
|
||||
npm run build-fe
|
||||
yarn build
|
||||
```
|
||||
|
||||
This should be rerun whenever you make changes to the viewer (if you make local viewer changes, don't forget to build the viewer module before running this)
|
||||
@@ -21,7 +21,7 @@ This should be rerun whenever you make changes to the viewer (if you make local
|
||||
After the viewer web page is up to date, run the preview service with:
|
||||
|
||||
```
|
||||
npm run dev
|
||||
yarn dev
|
||||
```
|
||||
|
||||
This will use the default dev DB connection of `postgres://speckle:speckle@localhost/speckle`. You can pass the environment variable `PG_CONNECTION_STRING` to change this to a different DB.
|
||||
|
||||
@@ -45,7 +45,11 @@ const config = {
|
||||
})
|
||||
],
|
||||
resolve: {
|
||||
modules: [path.resolve('./node_modules'), path.resolve('.render_page/src')],
|
||||
modules: [
|
||||
path.resolve('../../node_modules'),
|
||||
path.resolve('./node_modules'),
|
||||
path.resolve('.render_page/src')
|
||||
],
|
||||
extensions: ['.json', '.js']
|
||||
},
|
||||
devServer: {
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
FROM node:16.13-bullseye-slim as node
|
||||
ARG NODE_ENV=production
|
||||
ENV NODE_ENV=${NODE_ENV}
|
||||
ARG SPECKLE_SERVER_VERSION=custom
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
tini \
|
||||
@@ -8,16 +11,17 @@ RUN apt-get update && apt-get install -y \
|
||||
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.8.0/wait /wait
|
||||
RUN chmod +x /wait
|
||||
|
||||
ARG NODE_ENV=production
|
||||
ENV NODE_ENV=${NODE_ENV}
|
||||
WORKDIR /speckle-server
|
||||
|
||||
ARG SPECKLE_SERVER_VERSION=custom
|
||||
ENV SPECKLE_SERVER_VERSION=${SPECKLE_SERVER_VERSION}
|
||||
WORKDIR /app
|
||||
COPY .yarnrc.yml .
|
||||
COPY .yarn ./.yarn
|
||||
COPY package.json yarn.lock ./
|
||||
|
||||
COPY packages/server/package*.json ./
|
||||
RUN npm ci
|
||||
WORKDIR /speckle-server/packages/server
|
||||
COPY packages/server/package.json .
|
||||
RUN yarn workspaces focus --production
|
||||
|
||||
COPY packages/server .
|
||||
|
||||
CMD ["node", "bin/www"]
|
||||
ENV SPECKLE_SERVER_VERSION=${SPECKLE_SERVER_VERSION}
|
||||
CMD ["yarn", "node", "bin/www"]
|
||||
|
||||
Generated
-40943
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@speckle/server",
|
||||
"version": "2.3.17-alpha.2889",
|
||||
"version": "2.5.4",
|
||||
"private": true,
|
||||
"description": "",
|
||||
"homepage": "https://github.com/specklesystems/server",
|
||||
@@ -19,7 +19,7 @@
|
||||
"dev:server:test": "cross-env NODE_ENV=test DEBUG=speckle:* node ./bin/www",
|
||||
"test": "cross-env NODE_ENV=test mocha",
|
||||
"test:coverage": "cross-env NODE_ENV=test nyc --reporter lcov mocha",
|
||||
"test:report": "npm run test:coverage -- --reporter mocha-junit-reporter --reporter-options mochaFile=reports/test-results.xml",
|
||||
"test:report": "yarn test:coverage -- --reporter mocha-junit-reporter --reporter-options mochaFile=reports/test-results.xml",
|
||||
"lint": "eslint . --ext .js,.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
@@ -35,6 +35,7 @@
|
||||
"busboy": "^1.4.0",
|
||||
"compression": "^1.7.4",
|
||||
"connect-redis": "^6.1.1",
|
||||
"cors": "^2.8.5",
|
||||
"crypto-random-string": "^3.2.0",
|
||||
"dataloader": "^2.0.0",
|
||||
"debug": "^4.3.1",
|
||||
@@ -42,9 +43,10 @@
|
||||
"express": "^4.17.3",
|
||||
"express-async-errors": "^3.1.1",
|
||||
"express-session": "^1.17.1",
|
||||
"graphql": "^15.8.0",
|
||||
"graphql": "^15",
|
||||
"graphql-redis-subscriptions": "^2.2.2",
|
||||
"graphql-scalars": "^1.6.1",
|
||||
"graphql-subscriptions": "^2.0.0",
|
||||
"graphql-tag": "^2.11.0",
|
||||
"graphql-tools": "^4.0.7",
|
||||
"ioredis": "^4.19.4",
|
||||
@@ -68,12 +70,12 @@
|
||||
"sanitize-html": "^2.4.0",
|
||||
"sharp": "^0.29.3",
|
||||
"string-pixel-width": "^1.10.0",
|
||||
"subscriptions-transport-ws": "0.9.0",
|
||||
"verror": "^1.10.1",
|
||||
"xml-escape": "^1.1.0",
|
||||
"zxcvbn": "^4.4.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@apollo/client": "^3.5.9",
|
||||
"@types/lodash": "^4.14.180",
|
||||
"@types/mocha": "^7.0.2",
|
||||
"@types/module-alias": "^2.0.1",
|
||||
@@ -92,7 +94,6 @@
|
||||
"eslint": "^8.11.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"http-proxy-middleware": "^1.0.6",
|
||||
"lerna": "^3.22.1",
|
||||
"mocha": "^7.2.0",
|
||||
"mocha-junit-reporter": "^2.0.2",
|
||||
"nodemon": "^2.0.6",
|
||||
|
||||
@@ -30,8 +30,8 @@ After you have PostgreSQL and Redis running, in the `packages/server` folder:
|
||||
- copy the `.env-example` file to `.env`,
|
||||
- (if you plan to run tests) copy the `.env.test-example` file to `.env.test`
|
||||
- If you have a custom setup, open and edit the `.env` & `.env.test` files, filling in the required variables,
|
||||
- run `npm install`,
|
||||
- finally `npm run dev`,
|
||||
- run `yarn install`,
|
||||
- finally `yarn dev`,
|
||||
- check `localhost:3000/graphql` out!
|
||||
|
||||
## Developing
|
||||
@@ -45,7 +45,8 @@ The server consists of several semi-related components, or modules. These can be
|
||||
|
||||
### Frontend
|
||||
|
||||
- In **development** mode, the Speckle Server will proxy the frontend from `localhost:3000` to `localhost:8080`. If you don't see anything, ensure you've run `npm run dev` in the frontend package.
|
||||
- In **development** mode, the Speckle Server will proxy the frontend from `localhost:3000` to `localhost:8080`.
|
||||
If you don't see anything, ensure you've run `yarn dev` in the frontend package.
|
||||
|
||||
- In **production** mode, the frontend is served by an `nginx` container that proxy server requests to the server (depending on the requested path). For more information about making a production deployment, check out [our detailed guide](https://speckle.guide/dev/server-setup.html)
|
||||
|
||||
@@ -59,7 +60,10 @@ For non-authenticated api exploration, you can use the Graphql Playground which
|
||||
|
||||
## Testing
|
||||
|
||||
To run all tests, simply run `npm run test`. To run specific tests, use the `mocha --grep @subset` syntax. For example:
|
||||
To run all tests, simply run `yarn test`.
|
||||
The recommended extensions for the workspace include a test explorer, that can run individual tests.
|
||||
|
||||
If you really want to run specific tests from a terminal, use the `mocha --grep @subset` syntax. For example:
|
||||
|
||||
- `mocha --grep @auth --watch` to run tests pertaning to the auth module only in watch mode.
|
||||
- `mocha --grep @core-streams --watch` to run tests pertaining to stream related services.
|
||||
|
||||
-3409
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@speckle/viewer-sandbox",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"version": "2.5.4",
|
||||
"description": "Sandbox for testing, debugging & developing the viewer package",
|
||||
"homepage": "https://speckle.systems",
|
||||
"repository": {
|
||||
@@ -19,7 +19,7 @@
|
||||
"lint:tsc": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@speckle/viewer": "^2.4.2",
|
||||
"@speckle/viewer": "workspace:^",
|
||||
"tweakpane": "^3.0.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -10,10 +10,10 @@ Sandbox for testing, debugging & developing the viewer package
|
||||
|
||||
### Instructions
|
||||
|
||||
- `npm install` in this package
|
||||
- `npx lerna bootstrap` in repo root to set up symlink with viewer package
|
||||
- `npm run dev` to run the sandbox, it's available at `localhost:3033`
|
||||
- `yarn` in the repo root to configure project dependencies
|
||||
- `yarn build` in repo root to build all dependencies
|
||||
- `yarn dev` to run the sandbox, it's available at `localhost:3033`
|
||||
|
||||
## Linting
|
||||
|
||||
Use `npm run lint` to run ESLint and you can also run `npm run lint:tsc` to lint with the TypeScript compiler
|
||||
Use `yarn lint` to run ESLint and you can also run `yarn lint:tsc` to lint with the TypeScript compiler
|
||||
|
||||
Generated
-17108
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@speckle/viewer",
|
||||
"version": "2.4.2",
|
||||
"version": "2.5.4",
|
||||
"description": "A 3d viewer for Speckle, based on threejs.",
|
||||
"homepage": "https://speckle.systems",
|
||||
"repository": {
|
||||
@@ -22,7 +22,7 @@
|
||||
"build:dev": "rollup --config",
|
||||
"dev": "rollup --config --watch",
|
||||
"example": "EXAMPLE_BUILD=1 rollup --config && http-server ./example -p 3032 -o",
|
||||
"prepublishOnly": "npm run build",
|
||||
"prepack": "yarn build",
|
||||
"lint": "eslint . --ext .js,.ts"
|
||||
},
|
||||
"author": "AEC Systems",
|
||||
@@ -35,7 +35,7 @@
|
||||
"threejs"
|
||||
],
|
||||
"dependencies": {
|
||||
"@speckle/objectloader": "^2.4.2",
|
||||
"@speckle/objectloader": "workspace:^",
|
||||
"camera-controls": "^1.33.1",
|
||||
"core-js": "^3.21.1",
|
||||
"hold-event": "^0.1.0",
|
||||
|
||||
@@ -27,9 +27,9 @@ const v = new Viewer({
|
||||
|
||||
### Development
|
||||
|
||||
For testing purposes you can see viewer in action by running `npm run example`, which will run an example server at 'http://127.0.0.1:3002'.
|
||||
For testing purposes you can see viewer in action by running `yarn example`, which will run an example server at 'http://127.0.0.1:3002'.
|
||||
|
||||
To build the library run `npm run build`, to build a dev (unminified w/ sourcemaps) build run `npm run build:dev` and to run a dev build in watch mode run `npm run dev`.
|
||||
To build the library run `yarn build`, to build a dev (unminified w/ sourcemaps) build run `yarn build:dev` and to run a dev build in watch mode run `yarn dev`.
|
||||
|
||||
## API
|
||||
|
||||
|
||||
@@ -10,11 +10,16 @@ RUN chmod +x /wait
|
||||
ARG NODE_ENV=production
|
||||
ENV NODE_ENV=${NODE_ENV}
|
||||
|
||||
WORKDIR /app
|
||||
WORKDIR /speckle-server
|
||||
|
||||
COPY packages/webhook-service/package*.json ./
|
||||
RUN npm ci
|
||||
COPY .yarnrc.yml .
|
||||
COPY .yarn ./.yarn
|
||||
COPY package.json yarn.lock ./
|
||||
|
||||
WORKDIR /speckle-server/packages/webhook-service
|
||||
COPY packages/webhook-service/package.json .
|
||||
RUN yarn workspaces focus --production
|
||||
|
||||
COPY packages/webhook-service/src .
|
||||
|
||||
CMD ["node", "main.js"]
|
||||
CMD ["yarn", "node", "main.js"]
|
||||
|
||||
-2397
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@speckle/webhook-service",
|
||||
"private": true,
|
||||
"version": "2.3.17-alpha.2889",
|
||||
"version": "2.5.4",
|
||||
"description": "Component to handle calling external webhooks",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
|
||||
@@ -82,6 +82,19 @@ Have you checked our [dev docs](https://speckle.guide/dev/)?
|
||||
|
||||
We have a detailed section on [deploying a Speckle server](https://speckle.guide/dev/server-setup.html). To get started developing locally, you can see the [Local development environment](https://speckle.guide/dev/server-local-dev.html) page.
|
||||
|
||||
### TL;DR;
|
||||
|
||||
We're using yarn and its workspaces functionalities to manage the monorepo.
|
||||
Make sure you are using nodejs 16+.
|
||||
To get started, run:
|
||||
|
||||
`$ corepack enable`
|
||||
`$ yarn`
|
||||
`$ yarn build`
|
||||
|
||||
After this, you can use the scripts in the individual packages or run all in dev mode:
|
||||
`$ yarn dev`
|
||||
|
||||
### IDE
|
||||
|
||||
The suggested IDE for working in this repo is VSCode, because the repo has special configs to improve the DX there (auto-format & auto-lint, recommended extensions etc.).
|
||||
@@ -94,9 +107,9 @@ Please make sure you read the [contribution guidelines](https://github.com/speck
|
||||
|
||||
When pushing commits to this repo, please follow the following guidelines:
|
||||
|
||||
- Install [commitizen](https://www.npmjs.com/package/commitizen#commitizen-for-contributors) globally (`npm i -g commitizen`).
|
||||
- When ready to commit, `git cz` & follow the prompts.
|
||||
- Please use either `server` or `frontend` as the scope of your commit.
|
||||
- Before commiting, make sure `$ yarn lint` and `$ yarn prettier:check` checks pass, othewise the pre-commit hook fails.
|
||||
- When ready to commit, `$ yarn cz` & follow the prompts.
|
||||
- Please use the name of the package as the scope of your commit.
|
||||
|
||||
### Security
|
||||
|
||||
|
||||
Reference in New Issue
Block a user