Skip to content

Commit

Permalink
[devops]: Remove references to internal/vendor packages (#12010)
Browse files Browse the repository at this point in the history
### Related Ticket(s)

Closes #12008 

### Description

Adjusts all `internal/vendor` imports to use the package imports instead.

### Changelog

**Changed**

- All imports of the form `[...]/internal/vendor/@carbon/[package][rest]` changed to `@carbon/[package]/es[rest]`

**Removed**

- vendor build steps

<!-- React and Web Component deploy previews are enabled by default. -->
<!-- To enable additional available deploy previews, apply the following -->
<!-- labels for the corresponding package: -->
<!-- *** "test: e2e": Codesandbox examples and e2e integration tests -->
<!-- *** "package: services": Services -->
<!-- *** "package: utilities": Utilities -->
<!-- *** "RTL": React / Web Components (RTL) -->
<!-- *** "feature flag": React / Web Components (experimental) -->
  • Loading branch information
m4olivei authored Sep 26, 2024
1 parent 65f8a3d commit cf0b033
Show file tree
Hide file tree
Showing 323 changed files with 771 additions and 965 deletions.
69 changes: 0 additions & 69 deletions packages/services/gulp-tasks/config.js

This file was deleted.

51 changes: 0 additions & 51 deletions packages/services/gulp-tasks/vendor.js

This file was deleted.

17 changes: 0 additions & 17 deletions packages/services/gulpfile.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/services/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"access": "public"
},
"scripts": {
"build": "yarn clean && gulp vendor && node scripts/build.js",
"build": "yarn clean && node scripts/build.js",
"ci-check": "yarn build && yarn test",
"clean": "rimraf es lib umd",
"contributors:add": "all-contributors add",
Expand Down
4 changes: 2 additions & 2 deletions packages/services/src/services/DDO/DDO.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
* Copyright IBM Corp. 2020, 2023
* Copyright IBM Corp. 2020, 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

import settings from '../../internal/vendor/@carbon/ibmdotcom-utilities/utilities/settings/settings';
import settings from '@carbon/ibmdotcom-utilities/es/utilities/settings/settings.js';
import root from 'window-or-global';

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/services/src/services/DDO/__tests__/DDO.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright IBM Corp. 2020, 2023
* Copyright IBM Corp. 2020, 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
Expand All @@ -10,7 +10,7 @@ import digitalDataResponse from './data/response.json';
import root from 'window-or-global';

jest.mock(
'../../../internal/vendor/@carbon/ibmdotcom-utilities/utilities/settings/settings',
'@carbon/ibmdotcom-utilities/lib/utilities/settings/settings.js',
() => ({
version: 'cds.v1.0.0',
})
Expand Down
2 changes: 1 addition & 1 deletion packages/services/src/services/Locale/Locale.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import axios from 'axios';
import { DDOAPI } from '../DDO';
import ipcinfoCookie from '../../internal/vendor/@carbon/ibmdotcom-utilities/utilities/ipcinfoCookie/ipcinfoCookie';
import ipcinfoCookie from '@carbon/ibmdotcom-utilities/es/utilities/ipcinfoCookie/ipcinfoCookie.js';
import root from 'window-or-global';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import ipcinfoCookie from '../../../internal/vendor/@carbon/ibmdotcom-utilities/utilities/ipcinfoCookie/ipcinfoCookie';
import ipcinfoCookie from '@carbon/ibmdotcom-utilities/es/utilities/ipcinfoCookie/ipcinfoCookie.js';
import LocaleAPI from '../Locale';
import { DDOAPI } from '../../DDO';
import mockAxios from 'axios';
Expand All @@ -16,7 +16,7 @@ import oldSession from './data/timestamp_response.json';
const mockDigitalDataResponse = digitalDataResponse;

jest.mock(
'../../../internal/vendor/@carbon/ibmdotcom-utilities/utilities/ipcinfoCookie/ipcinfoCookie'
'@carbon/ibmdotcom-utilities/lib/utilities/ipcinfoCookie/ipcinfoCookie.js'
);
jest.mock('../../DDO');

Expand Down
4 changes: 2 additions & 2 deletions packages/services/src/services/VideoPlayer/VideoPlayer.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
* Copyright IBM Corp. 2020, 2023
* Copyright IBM Corp. 2020, 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

import deprecate from '../../internal/vendor/@carbon/ibmdotcom-utilities/utilities/deprecate/deprecate';
import deprecate from '@carbon/ibmdotcom-utilities/es/utilities/deprecate/deprecate.js';
import KalturaPlayerAPI from '../KalturaPlayer/KalturaPlayer';

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/services/src/services/global/global.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
* Copyright IBM Corp. 2020, 2023
* Copyright IBM Corp. 2020, 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

import { AnalyticsAPI } from '../Analytics';
import { DDOAPI } from '../DDO';
import loadNonLatinPlex from '../../internal/vendor/@carbon/ibmdotcom-utilities/utilities/loadNonLatinPlex/loadNonLatinPlex';
import loadNonLatinPlex from '@carbon/ibmdotcom-utilities/es/utilities/loadNonLatinPlex/loadNonLatinPlex.js';
import { LocaleAPI } from '../Locale';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright IBM Corp. 2016, 2023
* Copyright IBM Corp. 2016, 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright IBM Corp. 2020, 2023
// Copyright IBM Corp. 2020, 2024
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
Expand Down
2 changes: 1 addition & 1 deletion packages/web-components/.storybook/react/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license
*
* Copyright IBM Corp. 2020, 2023
* Copyright IBM Corp. 2020, 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
Expand Down
27 changes: 5 additions & 22 deletions packages/web-components/IMPLEMENTATION_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,6 @@ Connecting to `@carbon/ibmdotcom-services-store` is done with
[`ConnectMixin`](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/blob/v1.13.0/packages/web-components/src/globals/mixins/connect.ts)
that has a similar feature set to [`react-redux`](https://react-redux.js.org).

> 💡 `import`s of `@carbon/ibmdotcom-services-store` are slightly different from
> other NPM packages. See [vendor directory](#vendor-directory) section for more
> details.
Similar to `react-redux`, `ConnectMixin` uses two callbacks:

| Callback | Description |
Expand Down Expand Up @@ -553,30 +549,17 @@ procedure can be found
## Vendor directory
The `@carbon/ibmdotcom-services-store` package is a private package that is not
published to NPM. Adding it to `package.json` will break application because it
won't be found.
published to NPM. Adding it to `package.json` will break your application
because it won't be found.
To solve this problem, the
[build process](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/blob/v1.15.0/packages/web-components/gulp-tasks/vendor.js)
of `@carbon/ibmdotcom-web-components` copies build artifacts of
`@carbon/ibmdotcom-services-store` to
`packages/web-components/src/internal/vendor/@carbon/ibmdotcom-services-store`
as well as to
`packages/web-components/es/internal/vendor/@carbon/ibmdotcom-services-store`.
The former is used for our development, while the latter is for the application,
being part of the
[`@carbon/ibmdotcom-web-components` package](https://unpkg.com/browse/@carbon/[email protected]/es/internal/vendor/@carbon/ibmdotcom-services-store/).
The `import`s of `@carbon/ibmdotcom-services-store` in
`@carbon/ibmdotcom-web-components` refer to those copies, rather than the
`@carbon/ibmdotcom-services-store` package:
```javascript
import {
loadLanguage,
setLanguage,
} from '../../internal/vendor/@carbon/ibmdotcom-services-store/actions/localeAPI';
```
This is for your application, being part of the
[`@carbon/ibmdotcom-web-components` package](https://unpkg.com/browse/@carbon/[email protected]/es/internal/vendor/@carbon/ibmdotcom-services-store/),
they are available should you need them.
## Rollup bundle for Dotcom shell
Expand Down
2 changes: 1 addition & 1 deletion packages/web-components/gulp-tasks/build.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license
*
* Copyright IBM Corp. 2020, 2022
* Copyright IBM Corp. 2020, 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
Expand Down
2 changes: 1 addition & 1 deletion packages/web-components/gulp-tasks/build/components.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license
*
* Copyright IBM Corp. 2020, 2022
* Copyright IBM Corp. 2020, 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
Expand Down
13 changes: 9 additions & 4 deletions packages/web-components/gulp-tasks/build/modules/icons.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license
*
* Copyright IBM Corp. 2020, 2023
* Copyright IBM Corp. 2020, 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
Expand Down Expand Up @@ -32,7 +32,10 @@ const promisifyStream = promisify(asyncDone);
* @returns {Promise<void>} Gulp stream
*/
async function icons() {
const banner = await readFileAsync(path.resolve(__dirname, '../../../../../tasks/license.js'), 'utf8');
const banner = await readFileAsync(
path.resolve(__dirname, '../../../../../tasks/license.js'),
'utf8'
);
await promisifyStream(() =>
gulp
.src([`${config.iconsDir}/**/*.svg`])
Expand All @@ -42,14 +45,16 @@ async function icons() {
file.contents = Buffer.from(`
import { svg } from 'lit';
import spread from '@carbon/web-components/es/globals/directives/spread.js';
const svgResultIBMdotcomIcon = ${createSVGResultFromIconDescriptor(descriptor)};
const svgResultIBMdotcomIcon = ${createSVGResultFromIconDescriptor(
descriptor
)};
export default svgResultIBMdotcomIcon;
`);
done(null, file);
})
)
.pipe(
rename(filePath => {
rename((filePath) => {
filePath.extname = '.js';
})
)
Expand Down
3 changes: 1 addition & 2 deletions packages/web-components/gulp-tasks/clean.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license
*
* Copyright IBM Corp. 2020, 2023
* Copyright IBM Corp. 2020, 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
Expand All @@ -25,7 +25,6 @@ function _clean() {
del(config.cjsDestDir),
del(config.jsDestDir),
del(config.sassDestDir),
del(config.vendorSrcDirBase),
del('custom-elements.json'),
del('storybook-static'),
]);
Expand Down
Loading

0 comments on commit cf0b033

Please sign in to comment.