Skip to content
Closed
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Scratch-web dynamic variables
# See the README.md for more information on how they get injected into the app

# The base URL of Keycloak's public interface, used for authentication calls
SCRATCH_WEB_AUTH_BASE_URL=http://localhost:4002
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,7 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# There shouldn't be package-lock files in the packages. If there are - someone ran `npm install`
# in the wrong directory
packages/*/package-lock.json
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"

npx lint-staged
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.16.0
149 changes: 149 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
package.json

packages/*
!packages/scratch-web
!packages/scratch-web-shared

##
# The ignores below are copied from .gitignore - please keep them in sync
##

# build-monorepo.sh
/monorepo.out
/monorepo.tmp
/monorepo.cache

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# There shouldn't be package-lock files in the packages. If there are - someone ran `npm install`
# in the wrong directory
packages/*/package-lock.json
15 changes: 15 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
semi: true,
arrowParens: 'avoid',
bracketSameLine: true,
bracketSpacing: true,
singleQuote: true,
trailingComma: 'all',

plugins: [
require.resolve('@trivago/prettier-plugin-sort-imports'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😎

'prettier-plugin-tailwindcss',
],
importOrder: ['^@', '^[./]'],
importOrderSeparation: false,
};
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["bradlc.vscode-tailwindcss", "esbenp.prettier-vscode"]
}
27 changes: 27 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "never"
},

"files.associations": {
"*.css": "postcss"
},

"[css][typescript][javascript][javascriptreact][typescriptreact][html][json][markdown]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},

// Allows constants ending with `Styles` to be recognized by the intellisense as Tailwind strings
"tailwindCSS.classAttributes": [
"class",
"className",
".*className",
".*Styles",
".*Style",
"classes"
],

"typescript.preferences.importModuleSpecifierEnding": "minimal"
}
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# scratch-editor

Scratch editor mono-repo
Scratch editor mono-repo.

It includes both packages like scratch-gui that are utilized in the current Scratch system and the NextGen one, and NextGen specific ones.

## Index of Packages

### scratch-web

This is the front-end application for the NextGen platform. It's built on React, TypeScript and uses Vite as a build tool.
Please review [packages/scratch-web/README.md] for further detail.

### scratch-web-shared

A library for React components and utilities shared between Scratch front-end projects. Currently only scratch-web uses them.

## Tooling

The NextGen projects use eslint and prettier. These are run automatically on commit.
If you're using VSCode, we recommend having the eslint, prettier and tailwindcss extensions installed (see [.vscode/extensions.json]).
Loading