forked from adobe/react-spectrum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
126 lines (94 loc) · 4.63 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
.PHONY: clean test lint build
SHELL := /bin/bash
PATH := ./node_modules/.bin:$(PATH)
all: node_modules
node_modules: package.json
yarn install
touch $@
run_chromatic:
NODE_ENV=storybook start-storybook -p 9004 --ci -c ".chromatic"
clean:
yarn clean:icons
rm -rf dist public src/dist
clean_all:
$(MAKE) clean
$(MAKE) clean_node_modules
$(MAKE) clean_dist
$(MAKE) clean_parcel
clean_node_modules:
rm -rf node_modules
rm -rf packages/*/*/node_modules
rm -rf examples/*/node_modules
clean_dist:
rm -rf packages/*/*/dist
rm -rf packages/{react-aria,react-aria-components,react-stately}/dist
clean_parcel:
rm -rf .parcel-cache
packages/@spectrum-icons/workflow/src: packages/@spectrum-icons/workflow/package.json
yarn workspace @spectrum-icons/workflow make-icons
touch $@
packages/@spectrum-icons/workflow/%.js: packages/@spectrum-icons/workflow/src/%.tsx
yarn workspace @spectrum-icons/workflow build-icons
touch $@
workflow-icons: $(addprefix packages/@spectrum-icons/workflow/, $(notdir $(addsuffix .js, $(basename $(wildcard packages/@spectrum-icons/workflow/src/*.tsx)))))
packages/@spectrum-icons/color/src: packages/@spectrum-icons/color/package.json
yarn workspace @spectrum-icons/color make-icons
packages/@spectrum-icons/color/%.js: packages/@spectrum-icons/color/src/%.tsx
yarn workspace @spectrum-icons/color build-icons
color-icons: $(addprefix packages/@spectrum-icons/color/, $(notdir $(addsuffix .js, $(basename $(wildcard packages/@spectrum-icons/color/src/*.tsx)))))
packages/@spectrum-icons/ui/src: packages/@spectrum-icons/ui/package.json
yarn workspace @spectrum-icons/ui make-icons
touch $@
packages/@spectrum-icons/ui/%.js: packages/@spectrum-icons/ui/src/%.tsx
yarn workspace @spectrum-icons/ui build-icons
ui-icons: packages/@spectrum-icons/ui/src $(addprefix packages/@spectrum-icons/ui/, $(notdir $(addsuffix .js, $(basename $(wildcard packages/@spectrum-icons/ui/src/*.tsx)))))
packages/@spectrum-icons/illustrations/%.js: packages/@spectrum-icons/illustrations/src/%.tsx
yarn workspace @spectrum-icons/illustrations build-icons
illustrations: packages/@spectrum-icons/illustrations/src $(addprefix packages/@spectrum-icons/illustrations/, $(notdir $(addsuffix .js, $(basename $(wildcard packages/@spectrum-icons/illustrations/src/*.tsx)))))
icons: packages/@spectrum-icons/workflow/src packages/@spectrum-icons/color/src packages/@spectrum-icons/ui/src packages/@spectrum-icons/illustrations/src
@$(MAKE) workflow-icons
@$(MAKE) color-icons
@$(MAKE) ui-icons
@$(MAKE) illustrations
storybook:
NODE_ENV=production yarn build:storybook
storybook-16:
yarn build:storybook-16
storybook-17:
yarn build:storybook-17
# for now doesn't have deploy since v3 doesn't have a place for docs and stuff yet
ci:
$(MAKE) publish
publish: build
yarn publish
publish-nightly: build
yarn publish:nightly
build:
parcel build packages/@react-{spectrum,aria,stately}/*/ packages/@internationalized/{message,string,date,number}/ packages/react-aria-components --no-optimize --config .parcelrc-build
yarn lerna run prepublishOnly
for pkg in packages/@react-{spectrum,aria,stately}/*/ packages/@internationalized/{message,string,date,number}/ packages/@adobe/react-spectrum/ packages/react-aria/ packages/react-stately/ packages/react-aria-components/; \
do node scripts/buildEsm.js $$pkg; \
done
sed -i.bak s/\.js/\.mjs/ packages/@react-aria/i18n/dist/import.mjs
sed -i.bak 's/@react-aria\/i18n/.\/real-main.js/' packages/@react-aria/i18n/dist/useMessageFormatter.js
sed -i.bak 's/@react-aria\/i18n/.\/real-module.js/' packages/@react-aria/i18n/dist/useMessageFormatter.module.js
sed -i.bak 's/@react-aria\/i18n/.\/real-module.mjs/' packages/@react-aria/i18n/dist/useMessageFormatter.module.mjs
rm packages/@react-aria/i18n/dist/import.mjs.bak
rm packages/@react-aria/i18n/dist/useMessageFormatter.js.bak
rm packages/@react-aria/i18n/dist/useMessageFormatter.module.js.bak
rm packages/@react-aria/i18n/dist/useMessageFormatter.module.mjs.bak
node scripts/buildI18n.js
website:
yarn build:docs --public-url /reactspectrum/$$(git rev-parse HEAD)/docs --dist-dir dist/$$(git rev-parse HEAD)/docs
website-production:
node scripts/buildWebsite.js $$PUBLIC_URL
cp packages/dev/docs/pages/robots.txt dist/production/docs/robots.txt
$(MAKE) starter
cd starters/docs && zip -r react-aria-starter.zip . -x .gitignore .DS_Store "node_modules/*" "storybook-static/*"
mv starters/docs/react-aria-starter.zip dist/production/docs/react-aria-starter.$$(git rev-parse --short HEAD).zip
check-examples:
node scripts/extractExamples.mjs
yarn tsc --project dist/docs-examples/tsconfig.json
starter:
node scripts/extractStarter.mjs
cd starters/docs && yarn && yarn tsc