maplibre / maplibre-style-spec

MapLibre Style Specification & Utilities
https://maplibre.org/maplibre-style-spec/
Other
59 stars 52 forks source link

missing dist/index.d.ts #669

Closed smellman closed 1 month ago

smellman commented 1 month ago

Describe the bug npm run build doesn't build dist/index.d.ts.

To Reproduce Steps to reproduce the behavior:

  1. git clone git@github.com:maplibre/maplibre-style-spec.git
  2. cd maplibre-style-spec
  3. npm install
  4. npm run build
  5. npm run test-build
  6. See following error:
❯ npm run test-build

> @maplibre/maplibre-gl-style-spec@20.2.0 test-build
> jest --selectProjects=build

Running one project: build
 FAIL   build  test/build/style-spec.test.ts
  @maplibre/maplibre-gl-style-spec npm package
    ✕ files build (3 ms)
    ✓ exports components directly, not behind `default` - https://github.com/mapbox/mapbox-gl-js/issues/6601 (5 ms)
    ✓ trims reference.json fields (1 ms)

  ● @maplibre/maplibre-gl-style-spec npm package › files build

    expect(received).toContain(expected) // indexOf

    Expected value: "index.d.ts"
    Received array: ["gl-style-format.cjs", "gl-style-format.cjs.map", "gl-style-format.mjs", "gl-style-format.mjs.map", "gl-style-migrate.cjs", "gl-style-migrate.cjs.map", "gl-style-migrate.mjs", "gl-style-migrate.mjs.map", "gl-style-validate.cjs", "gl-style-validate.cjs.map", …]

      22 |         expect(dirContents).toContain('index.cjs');
      23 |         expect(dirContents).toContain('index.cjs.map');
    > 24 |         expect(dirContents).toContain('index.d.ts');
         |                             ^
      25 |         expect(dirContents).toContain('index.mjs');
      26 |         expect(dirContents).toContain('index.mjs.map');
      27 |         expect(dirContents).toContain('latest.json');

      at Object.<anonymous> (test/build/style-spec.test.ts:24:29)

Test Suites: 1 failed, 1 total
Tests:       1 failed, 2 passed, 3 total
Snapshots:   0 total
Time:        0.146 s, estimated 1 s
Ran all test suites.

Expected behavior Generate dist/index.d.ts or remove test for index.d.ts.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

HarelM commented 1 month ago

Run generate-typings to create that file.

smellman commented 1 month ago

Thanks!