@financial-times/n-myft-ui 33.1.0 → 34.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. package/.circleci/config.yml +109 -179
  2. package/.pa11yci.js +1 -0
  3. package/.toolkitrc.yml +32 -0
  4. package/.toolkitstate/ci.json +6 -0
  5. package/README.md +29 -4
  6. package/components/jsx/preferences-modal/index.js +0 -14
  7. package/components/unread-articles-indicator/initialise-feed-start-time.js +1 -1
  8. package/karma.conf.js +4 -1
  9. package/package.json +24 -9
  10. package/scripts/build-demo.sh +53 -0
  11. package/scripts/deploy-gh-pages.sh +5 -2
  12. package/scripts/make-static-demo.sh +6 -2
  13. package/scripts/transpile-jsx.sh +3 -0
  14. package/toolkit/demoScripts/.toolkitrc.yml +0 -0
  15. package/toolkit/demoScripts/index.js +77 -0
  16. package/toolkit/karma/.toolkitrc.yml +0 -0
  17. package/toolkit/karma/index.js +16 -0
  18. package/.circleci/shared-helpers/.github/settings.yml +0 -1
  19. package/.circleci/shared-helpers/CODEOWNERS +0 -3
  20. package/.circleci/shared-helpers/Makefile +0 -5
  21. package/.circleci/shared-helpers/README.md +0 -72
  22. package/.circleci/shared-helpers/helper-check-service-ready +0 -37
  23. package/.circleci/shared-helpers/helper-configure-awscli +0 -20
  24. package/.circleci/shared-helpers/helper-generate-build-state-artifacts +0 -29
  25. package/.circleci/shared-helpers/helper-install-awscli +0 -14
  26. package/.circleci/shared-helpers/helper-install-puppeteer-deps +0 -25
  27. package/.circleci/shared-helpers/helper-npm-install-peer-deps +0 -40
  28. package/.circleci/shared-helpers/helper-npm-store-auth-token +0 -14
  29. package/.circleci/shared-helpers/helper-npm-update +0 -26
  30. package/.circleci/shared-helpers/helper-npm-version-and-publish-public +0 -19
  31. package/.circleci/shared-helpers/helper-publish-github-pages +0 -43
  32. package/.circleci/shared-helpers/helper-setup-heroku-cli +0 -46
  33. package/.circleci/shared-helpers/helper-setup-s3-upload +0 -17
  34. package/.circleci/shared-helpers/helper-upload-assets-to-s3 +0 -69
  35. package/.circleci/shared-helpers/helper.example +0 -13
  36. package/.circleci/shared-helpers/secret-squirrel.js +0 -25
  37. package/Makefile +0 -48
  38. package/build-state/npm-shrinkwrap.json +0 -52417
@@ -1,213 +1,143 @@
1
- # generator: n-circle2-cli
2
- # template: component
3
-
4
- references:
5
- container_config_node: &container_config_node
6
- working_directory: ~/project/build
7
- docker:
8
- - image: cimg/node:<< parameters.node-version >>-browsers
9
- parameters:
10
- node-version:
11
- default: "18.18"
12
- type: string
13
-
14
- workspace_root: &workspace_root ~/project
15
-
16
- attach_workspace: &attach_workspace
17
- attach_workspace:
18
- at: *workspace_root
19
-
20
- npm_cache_keys: &npm_cache_keys
21
- keys:
22
- - v8-dependency-npm-{{ checksum "package-lock.json" }}-
23
- - v8-dependency-npm-{{ checksum "package-lock.json" }}
24
- - v8-dependency-npm-
25
-
26
- cache_npm_cache: &cache_npm_cache
27
- save_cache:
28
- key: v8-dependency-npm-{{ checksum "package-lock.json" }}-{{ epoch }}
29
- paths:
30
- - ./node_modules/
31
-
32
- restore_npm_cache: &restore_npm_cache
33
- restore_cache:
34
- <<: *npm_cache_keys
35
-
36
- filters_ignore_gh_pages: &filters_ignore_gh_pages
37
- branches:
38
- ignore: gh_pages
39
-
40
- filters_only_main: &filters_only_main
41
- branches:
42
- only: main
43
-
44
- filters_ignore_main: &filters_ignore_main
45
- branches:
46
- ignore: main
47
-
48
- filters_ignore_tags: &filters_ignore_tags
49
- tags:
50
- ignore: /.*/
51
-
52
- filters_version_tag: &filters_version_tag
53
- tags:
54
- only:
55
- - /^v?\d+\.\d+\.\d+(?:-beta\.\d+)?$/
56
- branches:
57
- ignore: /.*/
58
-
59
1
  version: 2.1
60
-
61
2
  orbs:
62
- node: circleci/node@4.6.0
63
-
3
+ tool-kit: financial-times/dotcom-tool-kit@5
4
+ executors:
5
+ node:
6
+ docker:
7
+ - image: cimg/node:18.16-browsers
8
+ working_directory: /home/circleci/project/node_workspace
9
+ node16_20-browsers:
10
+ docker:
11
+ - image: cimg/node:16.20-browsers
12
+ working_directory: /home/circleci/project/node16_workspace
64
13
  jobs:
65
- build:
66
- <<: *container_config_node
67
- steps:
68
- - checkout
69
- - node/install-npm:
70
- version: "^7"
71
- - run:
72
- name: Checkout next-ci-shared-helpers
73
- command: git clone --depth 1
74
- git@github.com:Financial-Times/next-ci-shared-helpers.git --branch
75
- unpin-heroku .circleci/shared-helpers
76
- - *restore_npm_cache
77
- - run:
78
- name: Install project dependencies
79
- command: make install
80
- - run:
81
- name: Transpile JSX to JS
82
- command: make transpile-jsx
83
- - run:
84
- name: shared-helper / generate-build-state-artifacts
85
- command: .circleci/shared-helpers/helper-generate-build-state-artifacts
86
- when: always
87
- - *cache_npm_cache
88
- - store_artifacts:
89
- path: build-state
90
- destination: build-state
91
- - persist_to_workspace:
92
- root: *workspace_root
93
- paths:
94
- - build
95
-
96
- test:
97
- <<: *container_config_node
98
- parallelism: 1
99
- steps:
100
- - *attach_workspace
101
- - run:
102
- name: Run tests
103
- command: make test
104
- environment:
105
- JEST_JUNIT_OUTPUT: test-results/jest/results.xml
106
- MOCHA_FILE: test-results/mocha/results.xml
107
- - store_test_results:
108
- path: test-results
109
- - store_artifacts:
110
- path: test-results
111
- destination: test-results
112
-
113
- publish:
114
- <<: *container_config_node
115
- steps:
116
- - *attach_workspace
117
- - run:
118
- name: shared-helper / npm-store-auth-token
119
- command: .circleci/shared-helpers/helper-npm-store-auth-token
120
- - run: npx snyk monitor --org=customer-products
121
- --project-name=Financial-Times/n-myft-ui
122
- - run:
123
- name: shared-helper / npm-version-and-publish-public
124
- command: .circleci/shared-helpers/helper-npm-version-and-publish-public
125
-
126
- deploy:
127
- <<: *container_config_node
14
+ deploy-gh-pages:
15
+ docker:
16
+ - image: cimg/base:stable
128
17
  steps:
129
- - *attach_workspace
18
+ - tool-kit/attach-workspace
130
19
  - add_ssh_keys:
131
20
  fingerprints:
132
21
  - "83:b5:09:e4:e5:2e:74:35:c1:1b:99:73:e3:dc:b8:6f"
133
22
  - run:
134
23
  name: Publish GitHub Pages
135
24
  command: ./scripts/deploy-gh-pages.sh
136
-
25
+ checkout:
26
+ docker:
27
+ - image: cimg/base:stable
28
+ steps:
29
+ - checkout
30
+ - tool-kit/persist-workspace:
31
+ path: .
137
32
  workflows:
138
- version: 2
139
- build-test-deploy:
33
+ tool-kit:
34
+ when:
35
+ not:
36
+ equal:
37
+ - scheduled_pipeline
38
+ - << pipeline.trigger_source >>
140
39
  jobs:
141
- - build:
40
+ - deploy-gh-pages:
41
+ requires:
42
+ - tool-kit/test-node
142
43
  filters:
143
- <<: *filters_ignore_tags
144
- <<: *filters_ignore_gh_pages
145
- name: build-v<< matrix.node-version >>
146
- matrix:
147
- parameters:
148
- node-version: [ "16.20", "18.18" ]
149
- - test:
44
+ tags:
45
+ only: /^v\d+\.\d+\.\d+(-.+)?/
46
+ branches:
47
+ ignore: /.*/
48
+ - checkout:
150
49
  filters:
151
- <<: *filters_ignore_tags
50
+ tags:
51
+ only: /^v\d+\.\d+\.\d+(-.+)?/
52
+ - waiting-for-approval:
53
+ type: approval
54
+ filters:
55
+ branches:
56
+ only: /(^renovate-.*|^nori/.*)/
57
+ - tool-kit/setup:
58
+ name: tool-kit/setup-<< matrix.executor >>
152
59
  requires:
153
- - build-v<< matrix.node-version >>
154
- name: test-v<< matrix.node-version >>
60
+ - checkout
61
+ - waiting-for-approval
155
62
  matrix:
156
63
  parameters:
157
- node-version: [ "16.20", "18.18" ]
158
- - deploy:
64
+ executor:
65
+ - node
66
+ - node16_20-browsers
159
67
  filters:
160
- <<: *filters_only_main
68
+ tags:
69
+ only: /^v\d+\.\d+\.\d+(-.+)?/
70
+ - tool-kit/build:
71
+ name: tool-kit/build-<< matrix.executor >>
161
72
  requires:
162
- - build-v18.18
163
- build-test-publish:
164
- jobs:
165
- - build:
166
- filters:
167
- <<: *filters_version_tag
168
- <<: *filters_ignore_gh_pages
169
- name: build-v<< matrix.node-version >>
73
+ - tool-kit/setup-<< matrix.executor >>
170
74
  matrix:
171
75
  parameters:
172
- node-version: [ "16.20", "18.18" ]
173
- - test:
76
+ executor:
77
+ - node
78
+ - node16_20-browsers
174
79
  filters:
175
- <<: *filters_version_tag
80
+ tags:
81
+ only: /^v\d+\.\d+\.\d+(-.+)?/
82
+ - tool-kit/test:
83
+ name: tool-kit/test-<< matrix.executor >>
176
84
  requires:
177
- - build-v<< matrix.node-version >>
178
- name: test-v<< matrix.node-version >>
85
+ - tool-kit/build-<< matrix.executor >>
179
86
  matrix:
180
87
  parameters:
181
- node-version: [ "16.20", "18.18" ]
182
- - publish:
183
- context: npm-publish-token
88
+ executor:
89
+ - node
90
+ - node16_20-browsers
184
91
  filters:
185
- <<: *filters_version_tag
92
+ tags:
93
+ only: /^v\d+\.\d+\.\d+(-.+)?/
94
+ - tool-kit/publish-tag:
186
95
  requires:
187
- - test-v18.18
188
-
189
- nightly:
190
- triggers:
191
- - schedule:
192
- cron: "0 0 * * *"
96
+ - deploy-gh-pages
97
+ - tool-kit/test-node
98
+ name: tool-kit/publish-tag-node
99
+ executor: node
193
100
  filters:
194
- <<: *filters_only_main
101
+ tags:
102
+ only: /^v\d+\.\d+\.\d+(-.+)?/
103
+ branches:
104
+ ignore: /.*/
105
+ context: npm-publish-token
106
+ nightly:
107
+ when:
108
+ and:
109
+ - equal:
110
+ - scheduled_pipeline
111
+ - << pipeline.trigger_source >>
112
+ - equal:
113
+ - nightly
114
+ - << pipeline.schedule.name >>
195
115
  jobs:
196
- - build:
197
- context: next-nightly-build
198
- name: build-v<< matrix.node-version >>
116
+ - checkout
117
+ - tool-kit/setup:
118
+ name: tool-kit/setup-<< matrix.executor >>
119
+ requires:
120
+ - checkout
121
+ matrix:
122
+ parameters:
123
+ executor:
124
+ - node
125
+ - node16_20-browsers
126
+ - tool-kit/build:
127
+ name: tool-kit/build-<< matrix.executor >>
128
+ requires:
129
+ - tool-kit/setup-<< matrix.executor >>
199
130
  matrix:
200
131
  parameters:
201
- node-version: [ "16.20", "18.18" ]
202
- - test:
132
+ executor:
133
+ - node
134
+ - node16_20-browsers
135
+ - tool-kit/test:
136
+ name: tool-kit/test-<< matrix.executor >>
203
137
  requires:
204
- - build-v<< matrix.node-version >>
205
- context: next-nightly-build
206
- name: test-v<< matrix.node-version >>
138
+ - tool-kit/build-<< matrix.executor >>
207
139
  matrix:
208
140
  parameters:
209
- node-version: [ "16.20", "18.18" ]
210
-
211
- notify:
212
- webhooks:
213
- - url: https://ft-next-webhooks.herokuapp.com/circleci2-workflow
141
+ executor:
142
+ - node
143
+ - node16_20-browsers
package/.pa11yci.js CHANGED
@@ -18,6 +18,7 @@ const urls = [
18
18
  ];
19
19
 
20
20
  const config = {
21
+ exitCode: 0,
21
22
  defaults: {
22
23
  headers: {
23
24
  'Cookie': 'next-flags=ads:off,cookieMessage:off; secure=true'
package/.toolkitrc.yml ADDED
@@ -0,0 +1,32 @@
1
+ plugins:
2
+ - "@dotcom-tool-kit/component"
3
+ - "@dotcom-tool-kit/mocha"
4
+ - "@dotcom-tool-kit/eslint"
5
+ - "@dotcom-tool-kit/pa11y"
6
+ - "@dotcom-tool-kit/lint-staged-npm"
7
+ - "./toolkit/karma"
8
+ - "./toolkit/demoScripts"
9
+ hooks:
10
+ build:local:
11
+ - TranspileJsx
12
+ build:ci:
13
+ - TranspileJsx
14
+ build:demo:
15
+ - DemoBuilder
16
+ test:local:
17
+ - Eslint
18
+ - Karma
19
+ test:ci:
20
+ - Karma
21
+ - DemoBuilder
22
+ - RunPa11yCi
23
+ options:
24
+ "@dotcom-tool-kit/circleci":
25
+ nodeVersion:
26
+ - '18.16-browsers'
27
+ - '16.20-browsers'
28
+ "@dotcom-tool-kit/eslint": {
29
+ files: "{,!(public)/**/}*.js"
30
+ }
31
+ '@dotcom-tool-kit/doppler':
32
+ project: n-myft-ui
@@ -0,0 +1,6 @@
1
+ {
2
+ "branch": "",
3
+ "repo": "n-myft-ui",
4
+ "version": "520d67f507b714cb2a488922cdf6573bc738800d",
5
+ "tag": "v34.0.0"
6
+ }
package/README.md CHANGED
@@ -32,14 +32,39 @@ If you are making a major change, you will need to update the package.json files
32
32
  ## Running locally
33
33
 
34
34
  ```
35
- make install
36
- make build
37
- make transpile-jsx
38
- make demo
35
+ npm install
36
+ npm run build
37
+ npm run demo
39
38
  ```
40
39
 
41
40
  View the demo on `localhost:5005`
42
41
 
42
+
43
+ ## Demo tasks
44
+ ```
45
+ npm run demo-build
46
+ ```
47
+ This task will build the demo and place it in the `demo/dist` folder.
48
+ ```
49
+ npm run demo
50
+ ```
51
+ This task will run a express server on localhost:5005 serving the builded demo.(it calls demo-build internally).
52
+ ```
53
+ npm run static-demo
54
+ ```
55
+ This tasks will start a Node.js application located in the "demos/app" directory as a background process,
56
+ waits for 10 seconds, fetches content from "http://localhost:5005", adjusts the links in the retrieved content,
57
+ saves it as "index.html" in the "public" directory, moves all files from the "public" directory to the current directory,
58
+ and finally terminates the Node.js process.
59
+ This is to prepare it to be uploaded to gh static page.
60
+
43
61
  ## Unstable versions
44
62
 
45
63
  v24, v25, v26 has JSX migration code. They are not stable therefore v27 is released. It is to remove JSX and rollback to handlebars. Please use ^v27.
64
+
65
+ # RunPa11yCi task
66
+ The default Pa11y plugin is configured to run against a deployed review app on heroku.
67
+ In cases where the project is an npm component without a deployed environment like this project, this task allows for local server setup prior to running Pa11y tests.
68
+ The RunPa11yCi task is a custom task class designed to automate the process of running Pa11y accessibility tests against a local server instance that runs the demo. It utilizes Node.js child processes to manage both the server and Pa11y processes,
69
+ ensuring proper execution and cleanup.
70
+
@@ -144,20 +144,6 @@ const getAlertsPreferences = async ({ event, preferencesModal }) => {
144
144
  });
145
145
 
146
146
  preferencesList.innerHTML = getAlertsPreferenceText(addedTextBuffer);
147
-
148
- try {
149
- // We need the service worker registration to check for a subscription
150
- const serviceWorkerRegistration = await navigator.serviceWorker.ready;
151
- const subscription = await serviceWorkerRegistration.pushManager.getSubscription();
152
- if (subscription) {
153
- addedTextBuffer.push('browser');
154
- }
155
- } catch (error) {
156
- // eslint-disable-next-line no-console
157
- console.warn('There was an error fetching the browser notification preferences', error);
158
- }
159
-
160
- preferencesList.innerHTML = getAlertsPreferenceText(addedTextBuffer);
161
147
  };
162
148
 
163
149
  const setCheckboxForAlertConcept = ({ event, preferencesModal }) => {
@@ -31,7 +31,7 @@ const determineFeedStartTime = (userId, now, previousFeedStartTime) => {
31
31
 
32
32
  return fetchUserLastVisitedAt(userId)
33
33
  .then((userLastVisitedAt) =>
34
- isToday(userLastVisitedAt) ? userLastVisitedAt : Promise.reject()
34
+ isToday(userLastVisitedAt) ? userLastVisitedAt : Promise.reject(new Error('No last visited user data today'))
35
35
  )
36
36
  .catch(() => startOfDay(now));
37
37
  };
package/karma.conf.js CHANGED
@@ -1,5 +1,7 @@
1
1
  // Karma configuration
2
2
  // Generated on Fri Apr 18 2014 18:19:03 GMT+0100 (BST)
3
+ const majorVersion = process.version.split('.')[0].slice(1);
4
+ const port = majorVersion === '18' ? 9877 : 9876;
3
5
  module.exports = function (karma) {
4
6
 
5
7
 
@@ -39,6 +41,7 @@ module.exports = function (karma) {
39
41
  'test/**/*.spec.js': ['webpack', 'sourcemap']
40
42
  },
41
43
  webpack: {
44
+ mode: 'development',
42
45
  resolve: {
43
46
  modules: ['node_modules'],
44
47
  descriptionFiles: ['package.json'],
@@ -81,7 +84,7 @@ module.exports = function (karma) {
81
84
 
82
85
 
83
86
  // web server port
84
- port: 9876,
87
+ port: port,
85
88
 
86
89
 
87
90
  // enable / disable colors in the output (reporters and logs)
package/package.json CHANGED
@@ -1,12 +1,19 @@
1
1
  {
2
2
  "name": "@financial-times/n-myft-ui",
3
- "version": "33.1.0",
3
+ "version": "34.0.0",
4
4
  "description": "Client side component for interaction with myft",
5
5
  "main": "server.js",
6
6
  "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1",
7
+ "sass": "sass demos/src/demo.scss public/main.css --load-path node_modules",
8
+ "test": "dotcom-tool-kit test:local",
8
9
  "commit": "commit-wizard",
9
- "prepare": "npx snyk protect || npx snyk protect -d || true"
10
+ "prepare": "npx snyk protect || npx snyk protect -d || true",
11
+ "build": "dotcom-tool-kit build:local",
12
+ "start": "dotcom-tool-kit run:local",
13
+ "demo-build": "dotcom-tool-kit build:demo -- demo-build",
14
+ "demo": "dotcom-tool-kit build:demo -- demo",
15
+ "static-demo": "dotcom-tool-kit build:demo -- static-demo",
16
+ "deploy-gh": "dotcom-tool-kit deploy:gh-pages"
10
17
  },
11
18
  "repository": {
12
19
  "type": "git",
@@ -19,13 +26,19 @@
19
26
  },
20
27
  "homepage": "https://github.com/Financial-Times/n-myft-ui#readme",
21
28
  "devDependencies": {
29
+ "@dotcom-tool-kit/component": "^4.1.2",
30
+ "@dotcom-tool-kit/doppler": "^1.1.0",
31
+ "@dotcom-tool-kit/eslint": "^3.2.0",
32
+ "@dotcom-tool-kit/lint-staged-npm": "^3.2.0",
33
+ "@dotcom-tool-kit/mocha": "^3.2.0",
34
+ "@dotcom-tool-kit/pa11y": "^0.5.2",
22
35
  "@financial-times/dotcom-build-base": "^8.2.1",
23
36
  "@financial-times/dotcom-build-code-splitting": "^8.2.1",
24
37
  "@financial-times/dotcom-build-js": "^8.2.1",
25
38
  "@financial-times/dotcom-build-sass": "^8.2.1",
26
39
  "@financial-times/dotcom-server-handlebars": "^8.2.1",
40
+ "@financial-times/eslint-config-next": "^7.1.0",
27
41
  "@financial-times/n-express": "^28.0.3",
28
- "@financial-times/n-gage": "^9.0.1",
29
42
  "ascii-table": "0.0.9",
30
43
  "autoprefixer": "9.7.0",
31
44
  "aws-sdk-mock": "4.5.0",
@@ -47,7 +60,7 @@
47
60
  "check-engine": "^1.12.0",
48
61
  "css-loader": "^0.23.1",
49
62
  "denodeify": "^1.2.1",
50
- "eslint": "6.5.1",
63
+ "dotcom-tool-kit": "^3.4.4",
51
64
  "eslint-plugin-react": "^7.33.2",
52
65
  "extract-css-block-webpack-plugin": "^1.3.0",
53
66
  "fetch-mock": "^5.0.3",
@@ -58,7 +71,7 @@
58
71
  "imports-loader": "0.8.0",
59
72
  "inject-loader": "^4.0.1",
60
73
  "karma": "4.4.1",
61
- "karma-browserstack-launcher": "1.6.0",
74
+ "karma-browserstack-launcher": "^1.6.0",
62
75
  "karma-chai": "^0.1.0",
63
76
  "karma-chrome-launcher": "3.2.0",
64
77
  "karma-firefox-launcher": "^1.0.0",
@@ -131,9 +144,11 @@
131
144
  },
132
145
  "husky": {
133
146
  "hooks": {
134
- "commit-msg": "node_modules/.bin/secret-squirrel-commitmsg",
135
- "pre-commit": "node_modules/.bin/secret-squirrel",
136
- "pre-push": "make verify -j3"
147
+ "commit-msg": "dotcom-tool-kit git:commitmsg",
148
+ "pre-commit": "dotcom-tool-kit git:precommit"
137
149
  }
150
+ },
151
+ "lint-staged": {
152
+ "**/*.js": "dotcom-tool-kit format:staged test:staged --"
138
153
  }
139
154
  }
@@ -0,0 +1,53 @@
1
+ #!/bin/bash
2
+
3
+ chmod +x $0
4
+
5
+ # Define the demo-build function
6
+ demo-build() {
7
+ # Remove existing directory
8
+ rm -rf node_modules/@financial-times/n-myft-ui
9
+ # Create necessary directories
10
+ mkdir -p node_modules/@financial-times/n-myft-ui/myft
11
+ # Copy components to the corresponding directory
12
+ cp -r components node_modules/@financial-times/n-myft-ui/components/
13
+ # Compile SCSS file to CSS
14
+ sass demos/src/demo.scss public/main.css --load-path node_modules
15
+ # Indicate that build is complete
16
+ echo "Demo build completed."
17
+ }
18
+
19
+ # Define the demo function
20
+ demo() {
21
+ # Build the demo
22
+ demo-build
23
+ # Run the Node.js application
24
+ node demos/app
25
+ }
26
+
27
+ # Define the static-demo function
28
+ static-demo() {
29
+ # Build the demo
30
+ demo-build
31
+ # Execute the shell script to generate the static demo
32
+ scripts/make-static-demo.sh
33
+ }
34
+
35
+ # Check the first argument passed to the script
36
+ case "$1" in
37
+ demo-build)
38
+ demo-build
39
+ ;;
40
+ demo)
41
+ demo
42
+ ;;
43
+ static-demo)
44
+ static-demo
45
+ ;;
46
+ *)
47
+ # If the argument does not match any of the above options, display an error message
48
+ echo "Usage: $0 {demo-build|demo|static-demo}"
49
+ exit 1
50
+ ;;
51
+ esac
52
+
53
+ exit 0
@@ -1,13 +1,16 @@
1
1
  git config --global user.email "$GITHUB_EMAIL"
2
2
  git config --global user.name "$GITHUB_NAME"
3
3
 
4
+ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
5
+ echo "script dir: $SCRIPT_DIR"
6
+
4
7
  # hackily remove all identities, and later force the specific identity
5
8
  # otherwise git keeps using the wrong boi
6
9
  ssh-add -D
7
10
 
8
11
  git --version
9
12
 
10
- export GIT_SSH="`pwd`/scripts/ssh.sh"
13
+ export GIT_SSH="$SCRIPT_DIR/ssh.sh"
11
14
 
12
15
  git clone $CIRCLE_REPOSITORY_URL honk --single-branch
13
16
 
@@ -18,7 +21,7 @@ git checkout -b gh-pages
18
21
  mv ../node_modules .
19
22
  cp ../scripts/* scripts/
20
23
 
21
- make static-demo
24
+ ./make-static-demo.sh
22
25
 
23
26
  git add -A .
24
27
 
@@ -1,6 +1,10 @@
1
1
  #!/bin/sh
2
2
 
3
- node demos/app &
3
+ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
4
+ PUBLIC_DIR="$SCRIPT_DIR/../public"
5
+
6
+
7
+ node "$SCRIPT_DIR/../demos/app" &
4
8
 
5
9
  pid="$!"
6
10
 
@@ -8,6 +12,6 @@ sleep 10
8
12
 
9
13
  curl http://localhost:5005 | sed 's#/public/main.css#main.css#' | sed 's#href="/"#href="index.html"#' > public/index.html
10
14
 
11
- mv public/* .
15
+ mv "$PUBLIC_DIR"/* .
12
16
 
13
17
  kill $pid
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+ chmod +x "$0"
3
+ npx cross-env BABEL_ENV=custom babel components/jsx --out-dir dist --extensions .jsx
File without changes