@openedx/frontend-base 2.0.0-alpha.5 → 2.0.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -28,6 +28,8 @@ Once the change matures, we recommend moving over to the pre-configured [npm wor
28
28
 
29
29
  To do so, check this repository out into the site's `packages/` directory. Then, run `npm run dev:packages` from the site's root directory: this will watch-build any workspace check-outs and start the dev server, picking up changes automatically. If any apps (such as `frontend-app-instructor-dashboard`) require corresponding changes, you can check them out into the `packages/` directory as siblings to `frontend-base`. See [Local development with workspaces](https://github.com/openedx/frontend-template-site#local-development-with-workspaces) for full setup details.
30
30
 
31
+ Checkouts in `packages/` are excluded from an app's Jest crawl, so running the app's test suite there behaves the same as it does against a published `frontend-base`.
32
+
31
33
  ### Continuous integration
32
34
 
33
35
  In addition to running lint and the test suite, Github CI builds the included `test-site` against a packed tarball of `frontend-base`. This verifies that the library still works end-to-end as a real dependency of a consuming site.
@@ -4,8 +4,8 @@ module.exports = {
4
4
  '<rootDir>/setupTest.js',
5
5
  ],
6
6
  moduleNameMapper: {
7
- '\\.svg$': '<rootDir>/__mocks__/svg.js',
8
- '\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir/__mocks__/file.js',
7
+ '\\.svg$': '<rootDir>/testMocks/svg.js',
8
+ '\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/testMocks/file.js',
9
9
  '\\.(css|scss)$': require.resolve('identity-obj-proxy'),
10
10
  'site.config': '<rootDir>/site.config.test.tsx',
11
11
  },
@@ -1 +1 @@
1
- {"version":3,"file":"jest.config.js","sourceRoot":"","sources":["../../runtime/jest.config.js"],"names":[],"mappings":";AAAA,MAAM,CAAC,OAAO,GAAG;IACf,kBAAkB,EAAE;QAClB,wBAAwB;KACzB;IACD,gBAAgB,EAAE;QAChB,SAAS,EAAE,4BAA4B;QACvC,iFAAiF,EAAE,4BAA4B;QAC/G,gBAAgB,EAAE,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC;QACvD,aAAa,EAAE,gCAAgC;KAChD;IACD,eAAe,EAAE,OAAO;IACxB,sBAAsB,EAAE;QACtB,GAAG,EAAE,mBAAmB;KACzB;IACD,mBAAmB,EAAE;QACnB,gCAAgC;KACjC;IACD,0BAA0B,EAAE;QAC1B,wBAAwB;KACzB;IACD,uBAAuB,EAAE;QACvB,4EAA4E;KAC7E;IACD,wBAAwB,EAAE;QACxB,QAAQ;KACT;IACD,sBAAsB,EAAE;QACtB,uBAAuB;QACvB,gBAAgB;QAChB,QAAQ;KACT;CACF,CAAC","sourcesContent":["module.exports = {\n setupFilesAfterEnv: [\n '<rootDir>/setupTest.js',\n ],\n moduleNameMapper: {\n '\\\\.svg$': '<rootDir>/__mocks__/svg.js',\n '\\\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir/__mocks__/file.js',\n '\\\\.(css|scss)$': require.resolve('identity-obj-proxy'),\n 'site.config': '<rootDir>/site.config.test.tsx',\n },\n testEnvironment: 'jsdom',\n testEnvironmentOptions: {\n url: 'http://localhost/',\n },\n collectCoverageFrom: [\n '<rootDir>/**/*.{js,jsx,ts,tsx}',\n ],\n coveragePathIgnorePatterns: [\n '<rootDir>/setupTest.js',\n ],\n transformIgnorePatterns: [\n '/node_modules/(?!(@openedx|@edx|react-intl|@formatjs|intl-messageformat)/)',\n ],\n modulePathIgnorePatterns: [\n '/dist/',\n ],\n testPathIgnorePatterns: [\n '/site.config.test.tsx',\n '/node_modules/',\n '/dist/',\n ],\n};\n"]}
1
+ {"version":3,"file":"jest.config.js","sourceRoot":"","sources":["../../runtime/jest.config.js"],"names":[],"mappings":";AAAA,MAAM,CAAC,OAAO,GAAG;IACf,kBAAkB,EAAE;QAClB,wBAAwB;KACzB;IACD,gBAAgB,EAAE;QAChB,SAAS,EAAE,4BAA4B;QACvC,iFAAiF,EAAE,6BAA6B;QAChH,gBAAgB,EAAE,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC;QACvD,aAAa,EAAE,gCAAgC;KAChD;IACD,eAAe,EAAE,OAAO;IACxB,sBAAsB,EAAE;QACtB,GAAG,EAAE,mBAAmB;KACzB;IACD,mBAAmB,EAAE;QACnB,gCAAgC;KACjC;IACD,0BAA0B,EAAE;QAC1B,wBAAwB;KACzB;IACD,uBAAuB,EAAE;QACvB,4EAA4E;KAC7E;IACD,wBAAwB,EAAE;QACxB,QAAQ;KACT;IACD,sBAAsB,EAAE;QACtB,uBAAuB;QACvB,gBAAgB;QAChB,QAAQ;KACT;CACF,CAAC","sourcesContent":["module.exports = {\n setupFilesAfterEnv: [\n '<rootDir>/setupTest.js',\n ],\n moduleNameMapper: {\n '\\\\.svg$': '<rootDir>/testMocks/svg.js',\n '\\\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/testMocks/file.js',\n '\\\\.(css|scss)$': require.resolve('identity-obj-proxy'),\n 'site.config': '<rootDir>/site.config.test.tsx',\n },\n testEnvironment: 'jsdom',\n testEnvironmentOptions: {\n url: 'http://localhost/',\n },\n collectCoverageFrom: [\n '<rootDir>/**/*.{js,jsx,ts,tsx}',\n ],\n coveragePathIgnorePatterns: [\n '<rootDir>/setupTest.js',\n ],\n transformIgnorePatterns: [\n '/node_modules/(?!(@openedx|@edx|react-intl|@formatjs|intl-messageformat)/)',\n ],\n modulePathIgnorePatterns: [\n '/dist/',\n ],\n testPathIgnorePatterns: [\n '/site.config.test.tsx',\n '/node_modules/',\n '/dist/',\n ],\n};\n"]}
@@ -4,8 +4,8 @@ module.exports = {
4
4
  './setupTest.js',
5
5
  ],
6
6
  moduleNameMapper: {
7
- '\\.svg$': '<rootDir>/__mocks__/svg.js',
8
- '\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/__mocks__/file.js',
7
+ '\\.svg$': '<rootDir>/testMocks/svg.js',
8
+ '\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/testMocks/file.js',
9
9
  '\\.(css|scss)$': require.resolve('identity-obj-proxy'),
10
10
  'site.config': '<rootDir>/site.config.test.tsx',
11
11
  },
@@ -1 +1 @@
1
- {"version":3,"file":"jest.config.js","sourceRoot":"","sources":["../../shell/jest.config.js"],"names":[],"mappings":";AAAA,MAAM,CAAC,OAAO,GAAG;IACf,kBAAkB,EAAE;QAClB,gBAAgB;KACjB;IACD,gBAAgB,EAAE;QAChB,SAAS,EAAE,4BAA4B;QACvC,iFAAiF,EAAE,6BAA6B;QAChH,gBAAgB,EAAE,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC;QACvD,aAAa,EAAE,gCAAgC;KAChD;IACD,eAAe,EAAE,OAAO;IACxB,sBAAsB,EAAE;QACtB,GAAG,EAAE,mBAAmB;KACzB;IACD,mBAAmB,EAAE;QACnB,gCAAgC;KACjC;IACD,0BAA0B,EAAE;QAC1B,gBAAgB;QAChB,cAAc;KACf;IACD,uBAAuB,EAAE;QACvB,4EAA4E;KAC7E;IACD,sBAAsB,EAAE;QACtB,uBAAuB;QACvB,gBAAgB;QAChB,QAAQ;KACT;CACF,CAAC","sourcesContent":["module.exports = {\n setupFilesAfterEnv: [\n './setupTest.js',\n ],\n moduleNameMapper: {\n '\\\\.svg$': '<rootDir>/__mocks__/svg.js',\n '\\\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/__mocks__/file.js',\n '\\\\.(css|scss)$': require.resolve('identity-obj-proxy'),\n 'site.config': '<rootDir>/site.config.test.tsx',\n },\n testEnvironment: 'jsdom',\n testEnvironmentOptions: {\n url: 'http://localhost/',\n },\n collectCoverageFrom: [\n '<rootDir>/**/*.{js,jsx,ts,tsx}',\n ],\n coveragePathIgnorePatterns: [\n '/node_modules/',\n 'setupTest.js',\n ],\n transformIgnorePatterns: [\n '/node_modules/(?!(@openedx|@edx|react-intl|@formatjs|intl-messageformat)/)',\n ],\n testPathIgnorePatterns: [\n '/site.config.test.tsx',\n '/node_modules/',\n '/dist/',\n ],\n};\n"]}
1
+ {"version":3,"file":"jest.config.js","sourceRoot":"","sources":["../../shell/jest.config.js"],"names":[],"mappings":";AAAA,MAAM,CAAC,OAAO,GAAG;IACf,kBAAkB,EAAE;QAClB,gBAAgB;KACjB;IACD,gBAAgB,EAAE;QAChB,SAAS,EAAE,4BAA4B;QACvC,iFAAiF,EAAE,6BAA6B;QAChH,gBAAgB,EAAE,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC;QACvD,aAAa,EAAE,gCAAgC;KAChD;IACD,eAAe,EAAE,OAAO;IACxB,sBAAsB,EAAE;QACtB,GAAG,EAAE,mBAAmB;KACzB;IACD,mBAAmB,EAAE;QACnB,gCAAgC;KACjC;IACD,0BAA0B,EAAE;QAC1B,gBAAgB;QAChB,cAAc;KACf;IACD,uBAAuB,EAAE;QACvB,4EAA4E;KAC7E;IACD,sBAAsB,EAAE;QACtB,uBAAuB;QACvB,gBAAgB;QAChB,QAAQ;KACT;CACF,CAAC","sourcesContent":["module.exports = {\n setupFilesAfterEnv: [\n './setupTest.js',\n ],\n moduleNameMapper: {\n '\\\\.svg$': '<rootDir>/testMocks/svg.js',\n '\\\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/testMocks/file.js',\n '\\\\.(css|scss)$': require.resolve('identity-obj-proxy'),\n 'site.config': '<rootDir>/site.config.test.tsx',\n },\n testEnvironment: 'jsdom',\n testEnvironmentOptions: {\n url: 'http://localhost/',\n },\n collectCoverageFrom: [\n '<rootDir>/**/*.{js,jsx,ts,tsx}',\n ],\n coveragePathIgnorePatterns: [\n '/node_modules/',\n 'setupTest.js',\n ],\n transformIgnorePatterns: [\n '/node_modules/(?!(@openedx|@edx|react-intl|@formatjs|intl-messageformat)/)',\n ],\n testPathIgnorePatterns: [\n '/site.config.test.tsx',\n '/node_modules/',\n '/dist/',\n ],\n};\n"]}
@@ -16,6 +16,7 @@ module.exports = tseslint.config(eslint.configs.recommended, ...tseslint.configs
16
16
  'dist/*',
17
17
  'node_modules/*',
18
18
  '**/__mocks__/*',
19
+ '**/testMocks/*',
19
20
  '**/__snapshots__/*',
20
21
  ],
21
22
  }, {
@@ -19,12 +19,20 @@ module.exports = {
19
19
  transformIgnorePatterns: [
20
20
  '/node_modules/(?!(@openedx|@edx|react-intl|@formatjs|intl-messageformat)/)',
21
21
  ],
22
+ /*
23
+ * 'packages/' holds gitignored, bind-mounted checkouts used for local
24
+ * development. Excluding it here keeps jest-haste-map from crawling those
25
+ * checkouts, which would otherwise register their manual mocks and collect
26
+ * their test suites as if they belonged to this app.
27
+ */
22
28
  modulePathIgnorePatterns: [
23
29
  '/dist/',
30
+ '<rootDir>/packages/',
24
31
  ],
25
32
  testPathIgnorePatterns: [
26
33
  '/site.config.test.tsx',
27
34
  '/node_modules/',
28
35
  '/dist/',
36
+ '<rootDir>/packages/',
29
37
  ],
30
38
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openedx/frontend-base",
3
- "version": "2.0.0-alpha.5",
3
+ "version": "2.0.0-alpha.7",
4
4
  "description": "Build tools, setup and config for frontend apps",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -30,8 +30,8 @@
30
30
  "clean": "make clean",
31
31
  "dev": "npm run build && node ./dist/tools/cli/openedx.js dev:shell",
32
32
  "docs": "jsdoc -c jsdoc.json",
33
- "lint": "eslint .; npm run lint:tools; npm --prefix ./test-site run lint",
34
- "lint:fix": "eslint . --fix; npm run lint:fix:tools",
33
+ "lint": "eslint . && npm run lint:tools && npm --prefix ./test-site run lint",
34
+ "lint:fix": "eslint . --fix && npm run lint:fix:tools",
35
35
  "lint:tools": "cd ./tools && eslint . && cd ..",
36
36
  "lint:fix:tools": "cd ./tools && eslint . --fix && cd ..",
37
37
  "pack": "mkdir -p pack && npm pack --silent --pack-destination pack >/dev/null && mv \"$(ls -t pack/*.tgz | head -n 1)\" pack/openedx-frontend-base.tgz",