Skip to content
Snippets Groups Projects
Commit 924e7973 authored by Bruno Michel's avatar Bruno Michel
Browse files

Move JS tools to scripts/

parent d8d8c2f6
Branches
Tags
No related merge requests found
......@@ -6,8 +6,7 @@
/cozy-stack*
/debian
/debug-assets
/node_modules
/package-lock.json
node_modules
/scripts/cozy-stack*
/storage
/tests/integration/tmp
......
......@@ -16,7 +16,7 @@ run:
@go run . serve --mailhog
.PHONY: run
## instance: create an instance for cozy.tools:8080
## instance: create an instance for local development
instance:
@cozy-stack instances add cozy.tools:8080 --passphrase cozy --apps home,store,drive,photos,settings,contacts,notes --email claude@cozy.tools --locale fr --public-name Claude --context-name dev
......@@ -29,26 +29,30 @@ bin/golangci-lint: Makefile
@curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.39.0
## jslint: enforce a consistent code style for Js code
jslint: ./node_modules/.bin/eslint
@./node_modules/.bin/eslint "assets/scripts/**" tests/integration/konnector/*.js
jslint: scripts/node_modules
@scripts/node_modules/.bin/eslint "assets/scripts/**" tests/integration/konnector/*.js
.PHONY: jslint
./node_modules/.bin/eslint: Makefile
@npm install prettier@2.1.2 eslint-plugin-prettier@3.1.4 eslint-config-cozy-app@2.0.0
## pretty: make the assets more prettier
pretty:
@if ! [ -x "$$(command -v prettier)" ]; then echo "Install prettier with 'npm install -g prettier'"; exit 1; fi
@prettier --write --no-semi --single-quote assets/*/*.js
@prettier --write assets/*/*.css
## pretty: make the assets prettier
pretty: scripts/node_modules
@scripts/node_modules/.bin/prettier --write --no-semi --single-quote assets/*/*.js
@scripts/node_modules/.bin/prettier --write assets/*/*.css
.PHONY: pretty
scripts/node_modules: Makefile scripts/package.json scripts/yarn.lock
@cd scripts && yarn
## assets: package the assets as go code
assets: web/statik/statik.go
@if ! [ -x "$$(command -v statik)" ]; then go get github.com/cozy/cozy-stack/pkg/statik; fi
@scripts/build.sh assets
.PHONY: assets
## assets-fast: package the assets with the fastest level of compression
assets-fast:
@env BROTLI_LEVEL=0 ./scripts/build.sh assets
.PHONY: assets-fast
## cli: builds the CLI documentation and shell completions
cli:
@if ! [ -x "$$(command -v cozy-stack)" ]; then make build; fi
......@@ -72,7 +76,7 @@ integration-tests:
## clean: clean the generated files and directories
clean:
@rm -rf bin
@rm -rf bin scripts/node_modules
@go clean
.PHONY: clean
......
{
"name": "cozy-stack",
"version": "1.0.0",
"repository": "github.com/cozy/cozy-stack.git",
"author": "Cozy Cloud <contact@cozycloud.cc>",
"license": "AGPLv3",
"dependencies": {
"eslint-config-cozy-app": "2.1.0",
"eslint-plugin-prettier": "3.4.0",
"prettier": "2.3.0"
}
}
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment