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

Combine editor into core #517

Merged
merged 61 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
7f86301
first cut
kfarr May 15, 2024
a0d2248
moving things around
kfarr May 16, 2024
ac4440d
barely working
kfarr May 16, 2024
3cc2567
rename to MainWrapper.js
kfarr May 16, 2024
279e1ca
updating github workflow
kfarr May 16, 2024
90d9fe9
move storybook
kfarr May 16, 2024
573fd75
master > main
kfarr May 16, 2024
3e072f5
move config
kfarr May 16, 2024
789cf5e
remove editor examples
kfarr May 16, 2024
a25be80
move babel
kfarr May 16, 2024
6f69a75
move editorconfig
kfarr May 16, 2024
0c6e82b
remove eslintignore and move eslintrc
kfarr May 16, 2024
9173423
move prettier to src/editor/
kfarr May 16, 2024
e257b4c
merge license, remove style lint
kfarr May 16, 2024
3139755
remove favicon
kfarr May 16, 2024
d4a4100
replace core package.json with editor; add eslintignore
kfarr May 16, 2024
467cb66
merge webpack config from editor to core
kfarr May 17, 2024
2cd2ef5
move public directory
kfarr May 17, 2024
a696391
combine ui assets into 1 directory
kfarr May 17, 2024
5f12338
update webpack versions, update prod webpack to match
kfarr May 17, 2024
2f36f8e
fix import paths
kfarr May 17, 2024
8499401
remove unused dependencies
kfarr May 17, 2024
c0e99e7
fix dist dist paths
kfarr May 17, 2024
6ffc560
remove unneeded dependencies
kfarr May 17, 2024
cc06b9b
move eslint config out of package.json
kfarr May 18, 2024
0444562
wow it's working!
kfarr May 18, 2024
7643364
fix running storybook
vincentfretin May 18, 2024
a203b22
formatting
vincentfretin May 18, 2024
f85ce16
remove clean-webpack-plugin dependency, webpack has an option clean:t…
vincentfretin May 18, 2024
1f9a3ea
npm run dist was actually doing the prod build twice, simplify it
vincentfretin May 18, 2024
fddeeb6
update some build dependencies
vincentfretin May 18, 2024
50b5717
update tests dependencies
vincentfretin May 18, 2024
a9c92fe
run tests on GitHub CI
vincentfretin May 18, 2024
75aad96
changes in .eslintignore and .eslintrc to make most errors go away
vincentfretin May 18, 2024
7cdd187
sort alphabetically
vincentfretin May 18, 2024
e9ed7e7
no need for file-loader, we can use asset/resource type, although it …
vincentfretin May 18, 2024
9741482
postcss-loader did nothing here
vincentfretin May 18, 2024
1fef632
don't include sass sourcemap in production js bundle
vincentfretin May 18, 2024
0a603ba
add empty public/ui_assets
vincentfretin May 18, 2024
34f625e
prefirebase command, copy ui_assets instead of favicon.ico
vincentfretin May 18, 2024
db261b4
set max size for bundle to 1.4 MiB, give an error if above to avoid r…
vincentfretin May 18, 2024
45cb4d3
MiniCssExtractPlugin is not actually used because of bad configuratio…
vincentfretin May 18, 2024
9bbf771
remove mini-css-extract-plugin html-webpack-plugin we don't use
vincentfretin May 18, 2024
54cbe31
fix start:prod command serving public directory and using copy-webpac…
vincentfretin May 18, 2024
7429e16
don't lint json files, only js and jsx
vincentfretin May 18, 2024
ab29062
disable more eslint rules that would be fixed just by reformating wit…
vincentfretin May 18, 2024
64d59d9
changes for .prettierignore .eslintignore
vincentfretin May 18, 2024
e6a1243
move .prettierrc.json at the root
vincentfretin May 18, 2024
ae01afd
don't format json files, only js and jsx
vincentfretin May 18, 2024
8dece37
update prettier
vincentfretin May 18, 2024
3881a2f
execute eslint on commit
vincentfretin May 18, 2024
28dceff
enable pre-commit hook
vincentfretin May 18, 2024
cbd9ff3
remove src/editor/lib/aframe-loader-3dtiles-component.min.js
vincentfretin May 18, 2024
869e1c7
fix loading aframe-loader-3dtiles-component.min.js
vincentfretin May 18, 2024
423f9e9
add eslint-plugin-react-hooks
vincentfretin May 18, 2024
b6dd24d
fresh package-lock.json and ran npm audit fix
vincentfretin May 18, 2024
c4e490b
Merge pull request #518 from vincentfretin/combine-editor-into-core-v…
kfarr May 19, 2024
e41c417
reformat with prettier
kfarr May 20, 2024
27ad58a
remove old legacy dist folder
kfarr May 20, 2024
2826a0a
fix pre-commit on github desktop
kfarr May 20, 2024
a356e5a
ignore node modules in static server
kfarr May 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-env", ["@babel/preset-react", {"runtime": "automatic"}]]
}
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
; http://editorconfig.org

root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
src/editor/lib/TransformControls.js
src/lib/
48 changes: 48 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"extends": ["eslint:recommended", "plugin:react/recommended", "plugin:react/jsx-runtime", "plugin:react-hooks/recommended", "standard", "plugin:storybook/recommended"],
"rules": {
"dot-notation": "off",
"indent": "off",
"multiline-ternary": "off",
"no-console": "off",
"no-lone-blocks": "off",
"no-mixed-spaces-and-tabs": "off",
"no-tabs": "off",
"no-useless-return": "off",
"no-var": "off",
"object-curly-newline": "off",
"object-shorthand": "off",
"prefer-const": "off",
"quotes": "off",
"react/jsx-indent-props": [2, 2],
"react/prop-types": "off",
"semi": [2, "always"],
"space-before-function-paren": "off"
},
"env": {
"browser": true,
"es2021": true,
"node": true
},
"globals": {
"AFRAME": true,
"STREET": true,
"THREE": true
},
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"react"
],
"settings": {
"react": {
"version": "detect"
}
}
}
25 changes: 0 additions & 25 deletions .github/workflows/ci-script.yaml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Test Cases
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
test:
name: Test Cases
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['22.x']
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix['node-version'] }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix['node-version'] }}
cache: 'npm'
cache-dependency-path: 'package-lock.json'

- name: Install dependencies
run: npm install

- name: Check Lint
run: npm run lint

- name: Check Build
run: npm run dist

- name: Tests
run: npm run test
12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
.DS_Store
node_modules
coverage
.nyc_output
.nyc_output
.cache
gh-pages/
npm-debug.log*
build/
*.sw[pomn]
# That's /src/lib/aframe-loader-3dtiles-component.min.js
dist/48406973e3ad4d65cbdd.js*
dist/aframe-mapbox-component.min.js
dist/notyf.min.css
dist/viewer-styles.css
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

./node_modules/.bin/lint-staged
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
**
src/editor/lib/TransformControls.js
src/lib/
5 changes: 5 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"printWidth": 80,
"singleQuote": true,
"trailingComma": "none"
}
74 changes: 74 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/** @type { import('@storybook/react-webpack5').StorybookConfig } */
const config = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-onboarding',
'@storybook/addon-interactions',
'@storybook/addon-styling-webpack',
{
name: '@storybook/addon-styling-webpack',
options: {
rules: [
{
test: /\.css$/,
sideEffects: true,
use: [
require.resolve('style-loader'),
{
loader: require.resolve('css-loader'),
options: {
// Want to add more CSS Modules options? Read more here: https://github.com/webpack-contrib/css-loader#modules
modules: {
auto: true
}
}
}
]
},
{
test: /\.s[ac]ss$/,
sideEffects: true,
use: [
require.resolve('style-loader'),
{
loader: require.resolve('css-loader'),
options: {
// Want to add more CSS Modules options? Read more here: https://github.com/webpack-contrib/css-loader#modules
modules: {
auto: true
},
importLoaders: 2
}
},
require.resolve('resolve-url-loader'),
{
loader: require.resolve('sass-loader'),
options: {
// Want to add more Sass options? Read more here: https://webpack.js.org/loaders/sass-loader/#options
implementation: require.resolve('sass'),
sourceMap: true,
sassOptions: {}
}
}
]
}
]
}
}
],
framework: {
name: '@storybook/react-webpack5',
options: {
builder: {
useSWC: true
}
}
},
docs: {
autodocs: 'tag'
}
};

export default config;
16 changes: 16 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import '../src/editor/style/index.scss';
/** @type { import('@storybook/react').Preview } */

const preview = {
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i
}
}
}
};

export default preview;
3 changes: 3 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
The original A-Frame Inspector code is Copyright © 2018 A-Frame authors.
Proprietary 3DStreet code modifications are Copyright 2022 3DStreet LLC under the GNU AGPL 3.0 License as follows.

GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007

Expand Down
7 changes: 7 additions & 0 deletions config/.env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FIREBASE_API_KEY =
FIREBASE_AUTH_DOMAIN =
FIREBASE_PROJECT_ID =
FIREBASE_STORAGE_BUCKET =
FIREBASE_MESSAGING_SENDER_ID =
FIREBASE_APP_ID =
FIREBASE_MEASUREMENT_ID =
2 changes: 2 additions & 0 deletions config/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.env.development
.env.production
9 changes: 9 additions & 0 deletions config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
For development you'll need a file `.env.development` in this directory.

For production deployment you'll need a file `.env.production` in this directory.

These files should NOT be committed to the repo and will be git ignored.

You have 2 options to generate these files:
* use .env.template to create your own .env.development and .env.production with GCP / Firebase keys generated on your own
* or copy these .env files from GCP Secrets for the appropriate project / environment
19 changes: 3 additions & 16 deletions dist/aframe-street-component.js

Large diffs are not rendered by default.

Loading
Loading