@smartimpact-it/shopify-disable-features
v0.2.4
Published
Disabled-features engine, analyzer, config helpers, and schema tools for Shopify themes.
Downloads
1,301
Keywords
Readme
@smartimpact-it/shopify-disable-features
Shared disabled-features engine, unused-features analyzer, config helpers, derived-state helpers, schema generator, and webpack plugins for Shopify themes.
Installation
Install from the public npm registry:
npm install @smartimpact-it/shopify-disable-featuresConsumer usage
Example in a theme repo:
{
"dependencies": {
"@smartimpact-it/shopify-disable-features": "^0.1.0"
}
}Example type usage in theme-disabled-features.mts:
import type { ThemeSchema } from "./available-schema-fields";
import type {
FeatureSetup,
FeatureGroups,
AlwaysEnabledFeatures,
} from "@smartimpact-it/shopify-disable-features";
export const featureGroups = {} as const satisfies FeatureGroups<ThemeSchema>;
export type FeatureGroupNames = keyof typeof featureGroups;
export const featureSetup: FeatureSetup<ThemeSchema, FeatureGroupNames> = {};
export const alwaysEnabledFeatures: AlwaysEnabledFeatures<ThemeSchema> = {};Build process
This package is published from generated dist/ output.
- source files stay committed in the repo
dist/is generated bynpm run builddist/is gitignored and should not be committed- the published package includes
dist/becausepackage.json -> filespoints to it
That means:
- local repo checkout: run
npm run buildif you want to exercise the built package locally - publish workflow: runs
npm run buildbeforenpm publish - consuming repos: install the package tarball from npm, which already contains
dist/
npm run verify checks that the built export surface can be imported successfully.
Publishing
Release flow:
npm version patch
git push --follow-tagsPushing a vX.Y.Z tag triggers .github/workflows/publish-package.yml, which:
- installs dependencies
- builds
dist/ - verifies the tag matches
package.jsonversion - creates a GitHub release
- publishes to the public npm registry
The workflow uses:
GITHUB_TOKENfor the GitHub releaseNPM_TOKENfor npm publishing
NPM_TOKEN should be an npm automation token with publish access to the @smartimpact-it organization.
Exports
Main exports:
@smartimpact-it/shopify-disable-features@smartimpact-it/shopify-disable-features/config@smartimpact-it/shopify-disable-features/mutations@smartimpact-it/shopify-disable-features/state@smartimpact-it/shopify-disable-features/analyzer@smartimpact-it/shopify-disable-features/feature-disabler@smartimpact-it/shopify-disable-features/schema@smartimpact-it/shopify-disable-features/webpack/schema-definitions-plugin@smartimpact-it/shopify-disable-features/webpack/extension-data-plugin
CLI binaries
Published bins:
shopify-disable-featuresshopify-lint-disabled-featuresshopify-disable-unused-featuresshopify-optimize-disabled-featuresshopify-generate-schema-definitionsshopify-generate-extension-datashopify-generate-theme-features-inventory
