Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Begin process to replace Loom with Turbo #707

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/forty-kings-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
rollup.config.js
rollup.config.cjs
.eslintrc.cjs
node_modules/
dist/
packages/shopify-api/rest/admin
5 changes: 3 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ module.exports = {
es2021: true,
},
extends: ['plugin:@shopify/typescript', 'plugin:@shopify/prettier'],
ignorePatterns: ['build/', 'tmp/', 'dist/', 'coverage/'],
ignorePatterns: ['build/', 'tmp/', 'dist/', 'coverage/', 'node_modules/'],
rules: {
'no-console': 0,
'@typescript-eslint/naming-convention': 0,
},
overrides: [
{
files: [
'packages/*/loom.config.ts',
'**/setup-jest.ts',
'**/rollup.config.js',
'**/rollup.config.*.js',
'packages/shopify-app-express/src/__tests__/test-helper.ts',
],
rules: {
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ database.sqlite
packages/**/build
packages/**/*.tgz
tmp/
.loom
.vscode/
bundle/
.turbo
.rollup.cache
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ coverage

packages/shopify-app-remix/docs/**/*.json
packages/shopify-app-remix/**/*.example.tsx?
packages/shopify-api/rest/admin
1 change: 1 addition & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ See the sections below for specific details related to the steps outlined above.
git checkout changeset-release/main
```

1. If releasing the `shopify-api` package, update the version string in the `packages/shopify-api/lib/version.ts` file to match the version in the `packages/shopify-api/package.json` file.
1. If releasing the Express package, update the version string in the `packages/shopify-app-express/src/version.ts` file to match the version in the `packages/shopify-app-express/package.json` file.
1. If releasing the Remix package, update the version string in the `packages/shopify-app-remix/src/version.ts` file to match the version in the `packages/shopify-app-remix/package.json` file.

Expand Down
31 changes: 20 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,27 @@
"license": "UNLICENSED",
"private": true,
"scripts": {
"build": "loom build",
"test": "loom test",
"lint": "loom lint",
"release": "loom build && changeset publish",
"clean": "rimraf ./packages/*/build .loom"
"build": "turbo build",
"lint": "turbo lint",
"test": "turbo run test --parallel",
"test:ci": "turbo run test:ci --parallel",
"release": "turbo build && changeset publish",
"dev": "turbo dev --no-cache --continue",
"clean": "turbo clean",
"changeset": "changeset",
"version-packages": "changeset version"
},
"devDependencies": {
"@changesets/cli": "^2.27.1",
"@jest/types": "^29.6.3",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-commonjs": "^24.0.1",
"@rollup/plugin-eslint": "^9.0.3",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-replace": "^5.0.2",
"@rollup/plugin-terser": "^0.4.0",
"@rollup/plugin-typescript": "^11.1.6",
"@shopify/eslint-plugin": "^44.0.0",
"@shopify/loom": "^1.0.2",
"@shopify/loom-cli": "^1.1.0",
"@shopify/loom-plugin-build-library": "^1.0.3",
"@shopify/loom-plugin-eslint": "^2.0.1",
"@shopify/loom-plugin-jest": "^1.0.2",
"@shopify/loom-plugin-prettier": "^2.0.1",
"@shopify/prettier-config": "^1.1.2",
"@shopify/typescript-configs": "^5.1.0",
"@types/jest": "^29.5.12",
Expand All @@ -31,8 +36,12 @@
"jest-runner-eslint": "^2.1.2",
"prettier": "^3.2.5",
"rimraf": "^5.0.5",
"rollup": "^4.12.0",
"rollup-plugin-dts": "^6.1.0",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"tslib": "^2.6.2",
"turbo": "^1.12.4",
"typescript": "5.3.3"
},
"dependencies": {},
Expand Down
27 changes: 0 additions & 27 deletions packages/shopify-app-session-storage-test-utils/loom.config.ts

This file was deleted.

40 changes: 35 additions & 5 deletions packages/shopify-app-session-storage-test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,35 @@
"author": "Shopify Inc.",
"license": "MIT",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"module": "./dist/index.mjs",
"types": "./dist/ts/index.d.ts",
"exports": {
".": {
"module": {
"types": "./dist/ts/index.d.ts",
"default": "./dist/index.mjs"
},
"import": {
"types": "./dist/ts/index.d.ts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/ts/index.d.ts",
"default": "./dist/index.js"
},
"default": "./dist/index.mjs"
}
},
"scripts": {
"clean": "yarn tsc --build --clean"
"lint": "eslint . --ext .js,.ts",
"build": "yarn run rollup",
"test": "jest",
"test:ci": "yarn test",
"rollup": "rollup -c --bundleConfigAsCjs",
"clean": "rimraf .rollup.cache dist",
"changeset": "changeset",
"version": "changeset version",
"release": "yarn build && changeset publish"
},
"private": true,
"publishConfig": {
Expand All @@ -39,10 +65,14 @@
"@shopify/shopify-app-session-storage": "^2.1.2"
},
"devDependencies": {},
"jest": {
"preset": "ts-jest"
},
"files": [
"build/*",
"!node_modules",
"dist/*",
"dist/node_modules/*",
"!bundle/*",
"!tsconfig.tsbuildinfo",
"!node_modules"
"!tsconfig.tsbuildinfo"
]
}
66 changes: 66 additions & 0 deletions packages/shopify-app-session-storage-test-utils/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import dts from 'rollup-plugin-dts';
import typescript from '@rollup/plugin-typescript';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import replace from '@rollup/plugin-replace';

import * as pkg from './package.json';

export const mainSrcInput = 'src/index.ts';

export function getPlugins() {
return [
replace({
preventAssignment: true,
}),
resolve(),
commonjs(),
typescript({
tsconfig: './tsconfig.json',
noEmit: true,
emitDeclarationOnly: true,
outDir: './dist/ts',
}),
];
}

const packageName = pkg.name.substring(1);
export const bannerConfig = {
banner: `/*! ${packageName}@${pkg.version} -- Copyright (c) 2023-present, Shopify Inc. -- license (MIT): https://github.com/Shopify/shopify-app-js/blob/main/LICENSE.md */`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
banner: `/*! ${packageName}@${pkg.version} -- Copyright (c) 2023-present, Shopify Inc. -- license (MIT): https://github.com/Shopify/shopify-app-js/blob/main/LICENSE.md */`,
banner: `/*! ${packageName}@${pkg.version} -- Copyright (c) 2024-present, Shopify Inc. -- license (MIT): https://github.com/Shopify/shopify-app-js/blob/main/LICENSE.md */`,

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we might want to keep it as it was - technically this is still the same package as before, so it still applies from 2023 onward.

};

const config = [
{
input: mainSrcInput,
plugins: getPlugins(),
external: Object.keys(pkg.dependencies),
output: [
{
dir: './dist',
format: 'es',
sourcemap: true,
entryFileNames: '[name].mjs',
},
],
},
{
input: mainSrcInput,
plugins: getPlugins(),
external: Object.keys(pkg.dependencies),
output: [
{
dir: './dist',
format: 'cjs',
sourcemap: true,
exports: 'named',
},
],
},
{
input: './dist/ts/index.d.ts',
output: [{file: 'dist/index.d.ts', format: 'es'}],
plugins: [dts.default()],
},
];

export default config;
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": ".",
"outDir": "./build/ts",
"outDir": "./dist/ts",
"rootDir": "src"
},
"include": ["src/**/*.ts"],
Expand Down
45 changes: 0 additions & 45 deletions packages/shopify-app-session-storage/loom.config.ts

This file was deleted.

45 changes: 39 additions & 6 deletions packages/shopify-app-session-storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,37 @@
"homepage": "https://github.com/Shopify/shopify-app-js/tree/main/packages/shopify-app-session-storage",
"author": "Shopify Inc.",
"license": "MIT",
"main": "./build/cjs/index.js",
"types": "./build/ts/index.d.ts",
"scripts": {},
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/ts/index.d.ts",
"exports": {
".": {
"module": {
"types": "./dist/ts/index.d.ts",
"default": "./dist/index.mjs"
},
"import": {
"types": "./dist/ts/index.d.ts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/ts/index.d.ts",
"default": "./dist/index.js"
},
"default": "./dist/index.mjs"
}
},
"scripts": {
"lint": "eslint . --ext .js,.ts",
"build": "yarn run rollup",
"test": "jest",
"test:ci": "yarn test",
"rollup": "rollup -c --bundleConfigAsCjs",
"clean": "rimraf .rollup.cache dist",
"changeset": "changeset",
"version": "changeset version",
"release": "yarn build && changeset publish"
},
"publishConfig": {
"access": "public",
"@shopify:registry": "https://registry.npmjs.org"
Expand All @@ -35,10 +63,15 @@
"@shopify/shopify-api": "^9.5.1"
},
"devDependencies": {},
"jest": {
"passWithNoTests": true,
"preset": "ts-jest"
},
"files": [
"build/*",
"!node_modules",
"dist/*",
"dist/node_modules/*",
"!bundle/*",
"!tsconfig.tsbuildinfo",
"!node_modules"
"!tsconfig.tsbuildinfo"
]
}
Loading
Loading