Skip to content

Commit 0ce09d3

Browse files
Initial commit using loom
1 parent 30530a1 commit 0ce09d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+9195
-755
lines changed

.eslintrc.js

+15-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = {
44
es2021: true,
55
},
66
extends: ['plugin:@shopify/typescript', 'plugin:@shopify/prettier'],
7-
ignorePatterns: ['dist/'],
7+
ignorePatterns: ['build/', 'tmp/'],
88
rules: {
99
'import/no-named-as-default': 0,
1010
'no-mixed-operators': 0,
@@ -13,4 +13,18 @@ module.exports = {
1313
'import/no-cycle': 0,
1414
'@typescript-eslint/naming-convention': 0,
1515
},
16+
overrides: [
17+
{
18+
files: ['packages/*/loom.config.ts', 'tests/setup/setup-jest.ts'],
19+
rules: {
20+
'import/no-extraneous-dependencies': 0,
21+
},
22+
},
23+
{
24+
files: ['**/.eslintrc.js'],
25+
rules: {
26+
'no-undef': 'off',
27+
},
28+
},
29+
],
1630
};

.github/workflows/ci.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
with:
1414
node-version: ${{ matrix.version }}
1515
- name: Install
16-
run: bin/ci_install_deps
16+
run: yarn install
1717
- name: Run tests
18-
run: bin/ci_test
19-
# - name: Run linting
20-
# run: bin/ci_lint
18+
run: yarn test
19+
- name: Run linting
20+
run: yarn lint

.gitignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
node_modules
22
.DS_STORE
33
yarn-error.log
4-
dist
4+
dist/
5+
build/
56
coverage/
6-
yarn-error.log
77
tsdocs/
88
tsconfig.tsbuildinfo
99
packages/**/*.d.ts
@@ -12,3 +12,4 @@ packages/**/*.js
1212
packages/**/*.js.map
1313
packages/**/*.tgz
1414
tmp/
15+
.loom

.prettierrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"@shopify/prettier-config"

bin/ci_clean

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/usr/bin/env bash
22

3-
for package in packages/*/
3+
# for package in packages/*/
4+
for package in packages/shopify-app-session-storage \
5+
packages/shopify-app-session-storage-test-utils \
6+
packages/shopify-app-session-storage-memory
47
do
58
echo "Cleaning ${package}"
69
(cd ${package} && yarn clean)

bin/ci_lint

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/usr/bin/env bash
22

3-
for package in packages/*/
3+
# for package in packages/*/
4+
for package in packages/shopify-app-session-storage \
5+
packages/shopify-app-session-storage-test-utils \
6+
packages/shopify-app-session-storage-memory
47
do
58
echo "Testing ${package}"
69
(cd ${package} && yarn lint)

loom.config.ts

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import {createWorkspace, createWorkspacePlugin} from '@shopify/loom';
2+
import {buildLibraryWorkspace} from '@shopify/loom-plugin-build-library';
3+
import {eslint} from '@shopify/loom-plugin-eslint';
4+
import {prettier} from '@shopify/loom-plugin-prettier';
5+
6+
import type {} from '@shopify/loom-plugin-jest';
7+
8+
export default createWorkspace((workspace) => {
9+
workspace.use(
10+
buildLibraryWorkspace(),
11+
eslint(),
12+
prettier({files: '**/*.{json,md}'}),
13+
jestWorkspaceConfigPlugin(),
14+
);
15+
});
16+
17+
function jestWorkspaceConfigPlugin() {
18+
return createWorkspacePlugin(
19+
'shopify-app-js--workplace-setup',
20+
({tasks: {test}}) => {
21+
test.hook(({hooks}) => {
22+
hooks.configure.hook((configure) => {
23+
configure.jestSetupFilesAfterEnv?.hook((files) => [
24+
...files,
25+
'../../tests/setup/setup-jest.ts',
26+
]);
27+
// Increase the test timeout to 20 seconds
28+
configure.jestConfig?.hook((config) => ({
29+
...config,
30+
testTimeout: 20000,
31+
}));
32+
});
33+
});
34+
},
35+
);
36+
}

nx.json

-73
This file was deleted.

package.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "shopify-app-js--root",
3+
"version": "1.0.0",
4+
"license": "UNLICENSED",
5+
"private": true,
6+
"scripts": {
7+
"build": "loom build",
8+
"test": "loom test",
9+
"lint": "loom lint",
10+
"clean": "bin/ci_clean"
11+
},
12+
"devDependencies": {
13+
"@shopify/eslint-plugin": "^42.0.1",
14+
"@shopify/loom": "^1.0.2",
15+
"@shopify/loom-cli": "^1.0.2",
16+
"@shopify/loom-plugin-build-library": "^1.0.3",
17+
"@shopify/loom-plugin-eslint": "^2.0.1",
18+
"@shopify/loom-plugin-jest": "^1.0.2",
19+
"@shopify/loom-plugin-prettier": "^2.0.1",
20+
"@shopify/prettier-config": "^1.1.2",
21+
"@shopify/typescript-configs": "^5.1.0",
22+
"eslint": "^8.28.0",
23+
"typescript": "^4.9.3"
24+
},
25+
"dependencies": {},
26+
"workspaces": [
27+
"packages/*"
28+
]
29+
}

package.json.ignore

-42
This file was deleted.

packages/shopify-app-express/jest.config.ts

-14
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import {createPackage, createProjectPlugin} from '@shopify/loom';
2+
import {buildLibrary} from '@shopify/loom-plugin-build-library';
3+
4+
export default createPackage((pkg) => {
5+
pkg.entry({root: './src/index.ts'});
6+
pkg.use(
7+
buildLibrary({
8+
// Required. A browserslist string for specifying your target output.
9+
// Use browser targets (e.g. `'defaults'`) if your package targets the browser,
10+
// node targets (e.g. `'node 12.22'`) if your package targets node
11+
// or both (e.g.`'defaults, node 12.22'`) if your package targets both
12+
targets: 'node 14',
13+
// Optional. Defaults to false. Defines if commonjs outputs should be generated.
14+
commonjs: true,
15+
// Optional. Defaults to false. Defines if esmodules outputs should be generated.
16+
esmodules: false,
17+
// Optional. Defaults to false. Defines if esnext outputs should be generated.
18+
esnext: false,
19+
// Optional. Defaults to true. Defines if entrypoints should be written at
20+
// the root of the repository. You can disable this if you have a single
21+
// entrypoint or if your package uses the `exports` key in package.json
22+
rootEntrypoints: false,
23+
// Optional. Defaults to 'node'. Defines if the jest environment should be 'node' or 'jsdom'.
24+
jestTestEnvironment: 'node',
25+
}),
26+
);
27+
});

packages/shopify-app-express/package.json

+6-18
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,9 @@
1212
"homepage": "https://github.com/Shopify/shopify-app-express/tree/main/packages/shopify-app-express",
1313
"author": "Shopify Inc.",
1414
"license": "MIT",
15-
"main": "./dist/index.js",
16-
"types": "./dist/index.d.ts",
17-
"prettier": "@shopify/prettier-config",
18-
"scripts": {
19-
"test:all": "jest",
20-
"test": "jest --selectProjects package",
21-
"test:dev": "jest --selectProjects package lint",
22-
"lint": "jest --selectProjects lint",
23-
"clean": "yarn tsc --build --clean",
24-
"prebuild": "yarn tsc --build --clean",
25-
"build": "tsc",
26-
"prepublishOnly": "yarn run build",
27-
"preversion": "yarn run test",
28-
"postversion": "git push origin main --follow-tags && echo \"Log in to shipit to deploy version $npm_package_version\""
29-
},
15+
"main": "./build/cjs/index.js",
16+
"types": "./build/ts/index.d.ts",
17+
"scripts": {},
3018
"publishConfig": {
3119
"access": "public"
3220
},
@@ -43,8 +31,8 @@
4331
],
4432
"dependencies": {
4533
"@shopify/shopify-api": "^6.0.0-rc9",
46-
"@shopify/shopify-app-session-storage": "../shopify-app-session-storage/shopify-shopify-app-session-storage-1.0.0-rc1.tgz",
47-
"@shopify/shopify-app-session-storage-memory": "../shopify-app-session-storage-memory/shopify-shopify-app-session-storage-memory-1.0.0-rc1.tgz",
34+
"@shopify/shopify-app-session-storage": "^1.0.0-rc1",
35+
"@shopify/shopify-app-session-storage-memory": "^1.0.0-rc1",
4836
"cookie-parser": "^1.4.6",
4937
"express": "^4.18.1",
5038
"tslib": "^2.4.0"
@@ -77,7 +65,7 @@
7765
"typescript": "^4.7.4"
7866
},
7967
"files": [
80-
"dist/*",
68+
"build/*",
8169
"!bundle/*",
8270
"!tsconfig.tsbuildinfo",
8371
"!node_modules"

0 commit comments

Comments
 (0)